本文整理汇总了Java中org.kuali.rice.core.api.util.type.KualiDecimal.bigDecimalValue方法的典型用法代码示例。如果您正苦于以下问题:Java KualiDecimal.bigDecimalValue方法的具体用法?Java KualiDecimal.bigDecimalValue怎么用?Java KualiDecimal.bigDecimalValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.api.util.type.KualiDecimal
的用法示例。
在下文中一共展示了KualiDecimal.bigDecimalValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newPBGLBusinessObject
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
protected PendingBudgetConstructionGeneralLedger newPBGLBusinessObject(Integer RequestYear, Object[] sqlResult) {
PendingBudgetConstructionGeneralLedger PBGLObj = new PendingBudgetConstructionGeneralLedger();
/*
* the document number will be set later if we have to store this in a new document
* a new row in an existing document will take it's document number from the existing document
* otherwise (existing document, existing row), the only field in this that will be different from
* the existing row is the beginning balance amount
*/
PBGLObj.setUniversityFiscalYear(RequestYear);
PBGLObj.setChartOfAccountsCode((String) sqlResult[sqlChartOfAccountsCode]);
PBGLObj.setAccountNumber((String) sqlResult[sqlAccountNumber]);
PBGLObj.setSubAccountNumber((String) sqlResult[sqlSubAccountNumber]);
PBGLObj.setFinancialObjectCode((String) sqlResult[sqlObjectCode]);
PBGLObj.setFinancialSubObjectCode((String) sqlResult[sqlSubObjectCode]);
PBGLObj.setFinancialBalanceTypeCode((String) sqlResult[sqlBalanceTypeCode]);
PBGLObj.setFinancialObjectTypeCode((String) sqlResult[sqlObjectTypeCode]);
KualiDecimal BaseAmount = (KualiDecimal) sqlResult[sqlBeginningBalanceLineAmount];
BaseAmount = BaseAmount.add((KualiDecimal) sqlResult[sqlAccountLineAnnualBalanceAmount]);
KualiInteger DollarBaseAmount = new KualiInteger(BaseAmount.bigDecimalValue());
PBGLObj.setFinancialBeginningBalanceLineAmount(DollarBaseAmount);
PBGLObj.setAccountLineAnnualBalanceAmount(KualiInteger.ZERO);
// ObjectID is set in the BusinessObjectBase on insert and update
// but, we must set the version number
PBGLObj.setVersionNumber(DEFAULT_VERSION_NUMBER);
return PBGLObj;
}
示例2: convertToDatabaseColumn
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*
* This implementation will convert from a {@link KualiDecimal} to a {@link BigDecimal}.
*/
@Override
public BigDecimal convertToDatabaseColumn(KualiDecimal objectValue) {
if (objectValue == null) {
return null;
}
return objectValue.bigDecimalValue();
}
示例3: generateTransactionsBySymbol
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Wrapper function to allow for internal iterations on ICR account distribution collection if determined to use ICR from account
*
* @param et
* @param icrRateDetail
* @param generatedTransactionAmount
* @param runDate
* @param group
* @param icrGenerationMetadata
*/
private void generateTransactionsBySymbol(ExpenditureTransaction et, IndirectCostRecoveryRateDetail icrRateDetail, KualiDecimal generatedTransactionAmount, Date runDate, PrintStream group, IndirectCostRecoveryGenerationMetadata icrGenerationMetadata) {
KualiDecimal icrTransactionAmount;
KualiDecimal unappliedTransactionAmount = new KualiDecimal(generatedTransactionAmount.bigDecimalValue());
//if symbol is denoted to use ICR from account
if (GeneralLedgerConstants.PosterService.SYMBOL_USE_ICR_FROM_ACCOUNT.equals(icrRateDetail.getAccountNumber())) {
int icrCount = icrGenerationMetadata.getAccountLists().size();
for (IndirectCostRecoveryAccountDistributionMetadata meta : icrGenerationMetadata.getAccountLists()){
//set a new icr meta data for transaction processing
IndirectCostRecoveryGenerationMetadata icrMeta = new IndirectCostRecoveryGenerationMetadata(icrGenerationMetadata.getIndirectCostRecoveryTypeCode(),
icrGenerationMetadata.getFinancialIcrSeriesIdentifier());
icrMeta.setIndirectCostRcvyFinCoaCode(meta.getIndirectCostRecoveryFinCoaCode());
icrMeta.setIndirectCostRecoveryAcctNbr(meta.getIndirectCostRecoveryAccountNumber());
//change the transaction amount base on ICR percentage
if (icrCount-- == 1) {
// Deplete the rest of un-applied transaction amount
icrTransactionAmount = unappliedTransactionAmount;
}
else {
// Normal transaction amount is calculated by icr account line percentage
icrTransactionAmount = getPercentage(generatedTransactionAmount, meta.getAccountLinePercent());
unappliedTransactionAmount = unappliedTransactionAmount.subtract(icrTransactionAmount);
}
//perform the actual transaction generation
generateTransactions(et, icrRateDetail, icrTransactionAmount, runDate, group, icrMeta);
}
}else{
//non-ICR; process as usual
generateTransactions(et, icrRateDetail, generatedTransactionAmount, runDate, group, icrGenerationMetadata);
}
}
示例4: setInvoiceItemUnitPrice
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* @param invoiceItemUnitPrice
*/
@Override
public void setInvoiceItemUnitPrice(KualiDecimal invoiceItemUnitPrice) {
if (ObjectUtils.isNotNull(invoiceItemUnitPrice)) {
this.invoiceItemUnitPrice = invoiceItemUnitPrice.bigDecimalValue();
}
else {
this.invoiceItemUnitPrice = BigDecimal.ZERO;
}
}
示例5: Detail
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public Detail(final String name, final KualiDecimal amount, final String date) {
this.name = name;
if (amount != null) {
this.amount = amount.bigDecimalValue();
}
this.date = date;
}
示例6: Detail
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public Detail(final String name, final String expenseType, final KualiDecimal amount, final Date date) {
this.name = name;
if (amount != null) {
this.amount = amount.bigDecimalValue();
}
else {
this.amount = KualiDecimal.ZERO.bigDecimalValue();
}
if (date != null) {
final String expenseDate = new SimpleDateFormat("MM/dd").format(date);
this.date = expenseDate;
}
this.expenseType = expenseType;
}
示例7: Detail
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public Detail(final String name, final KualiDecimal amount, final String date) {
this.name = name;
if (amount != null) {
this.amount = amount.bigDecimalValue();
}
else {
this.amount = KualiDecimal.ZERO.bigDecimalValue();
}
this.date = date;
}
示例8: getTotalAccountLineAmount
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* @return the amount on the document that needs to be matched by accounting lines - which means we need to remove the hung expenses amount
*/
@Override
public KualiDecimal getTotalAccountLineAmount() {
KualiDecimal approvedAmount = getApprovedAmount();
// remove hung expenses amount
KualiDecimal totalAccountingLineAmount = new KualiDecimal(approvedAmount.bigDecimalValue());
for (HistoricalTravelExpense expense : getHistoricalTravelExpenses()) {
totalAccountingLineAmount = totalAccountingLineAmount.subtract(expense.getConvertedAmount());
}
return totalAccountingLineAmount;
}
示例9: generateTransactionsBySymbol
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Wrapper function to allow for internal iterations on ICR account distribution collection if determined to use ICR from account
*
* @param et
* @param icrRateDetail
* @param generatedTransactionAmount
* @param runDate
* @param group
* @param icrGenerationMetadata
*/
private void generateTransactionsBySymbol(ExpenditureTransaction et, IndirectCostRecoveryRateDetail icrRateDetail, KualiDecimal generatedTransactionAmount, Date runDate, PrintStream group, IndirectCostRecoveryGenerationMetadata icrGenerationMetadata) {
KualiDecimal icrTransactionAmount;
KualiDecimal unappliedTransactionAmount = new KualiDecimal(generatedTransactionAmount.bigDecimalValue());
//if symbol is denoted to use ICR from account
if (GeneralLedgerConstants.PosterService.SYMBOL_USE_ICR_FROM_ACCOUNT.equals(icrRateDetail.getAccountNumber())) {
int icrCount = icrGenerationMetadata.getAccountLists().size();
for (IndirectCostRecoveryAccountDistributionMetadata meta : icrGenerationMetadata.getAccountLists()){
//set a new icr meta data for transaction processing
IndirectCostRecoveryGenerationMetadata icrMeta = new IndirectCostRecoveryGenerationMetadata(icrGenerationMetadata.getIndirectCostRecoveryTypeCode(),
icrGenerationMetadata.getFinancialIcrSeriesIdentifier());
icrMeta.setIndirectCostRcvyFinCoaCode(meta.getIndirectCostRecoveryFinCoaCode());
icrMeta.setIndirectCostRecoveryAcctNbr(meta.getIndirectCostRecoveryAccountNumber());
//change the transaction amount base on ICR percentage
if (icrCount-- == 1) {
// Deplete the rest of un-applied transaction amount
icrTransactionAmount = unappliedTransactionAmount;
}
else {
// Normal transaction amount is calculated by icr account line percentage
icrTransactionAmount = getPercentage(generatedTransactionAmount, meta.getAccountLinePercent());
unappliedTransactionAmount = unappliedTransactionAmount.subtract(icrTransactionAmount);
}
//perform the actual transaction generation
generateTransactions(et, icrRateDetail, icrTransactionAmount, runDate, group, icrMeta);
}
}else{
//non-ICR; process as usual
generateTransactions(et, icrRateDetail, generatedTransactionAmount, runDate, group, icrGenerationMetadata);
}
}
示例10: isDepreciationOk
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Determines whether or not a calculated depreciation amount has the same value as the on the fixture file
*
* @param depreciatedAssets
* @param resultsMustGet
* @return
*/
public boolean isDepreciationOk(Collection<AssetPayment> depreciatedAssets, Collection<AssetPayment> resultsMustGet) {
boolean result = true;
try {
Iterator<AssetPayment> resultsMustGetIterator = resultsMustGet.iterator();
Iterator<AssetPayment> depreciatedAssetsIterator = depreciatedAssets.iterator();
while (depreciatedAssetsIterator.hasNext()) {
AssetPayment depreciatedAsset = depreciatedAssetsIterator.next();
AssetPayment resultMustGet = resultsMustGetIterator.next();
for (int period = 1; period < 13; period++) {
String getterMethodName = "getPeriod" + period + "Depreciation1Amount";
Method method = AssetPayment.class.getMethod(getterMethodName);
KualiDecimal amountCalculated = new KualiDecimal(method.invoke(depreciatedAsset).toString());
KualiDecimal amountInFile = new KualiDecimal(method.invoke(resultMustGet).toString());
String stringFromFile = period + "-" + depreciatedAsset.getCapitalAssetNumber() + "-" + depreciatedAsset.getPaymentSequenceNumber() + "-" + amountInFile.bigDecimalValue();
if (!mockDepreciationBatchDao.getAssetPaymentsStr().contains(stringFromFile)) {
result &= false;
break;
}
}
if (!result)
break;
}
}
catch (Exception re) {
LOG.info(re.getMessage());
}
return result;
}
示例11: updateReasonStatisticsReportsWithAThreshold
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* @see org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionReasonStatisticsReportDao#reportReasonStatisticsWithAThreshold(java.lang.String,
* java.lang.Integer, boolean, org.kuali.rice.core.api.util.type.KualiDecimal)
*/
@Override
public void updateReasonStatisticsReportsWithAThreshold(String principalName, Integer previousFiscalYear, boolean reportIncreasesAtOrAboveTheThreshold, KualiDecimal thresholdPercent) {
// get a unique session ID
String idForSession = java.util.UUID.randomUUID().toString();
cleanReportsReasonStatisticsTable(principalName);
// build the list of constant strings to insert into the SQL
ArrayList<String> stringsToInsert = new ArrayList<String>(1);
stringsToInsert.add(BCConstants.VACANT_EMPLID);
// for a report by threshold, we want everyone--exclude only vacant lines
getSimpleJdbcTemplate().update(reportReasonStatisticsWithThreshold.get(0).getSQL(stringsToInsert), idForSession, principalName);
// get all the salary and appointment information for those people
adjustLastYearSalaryForAppointmentChanges(principalName, idForSession, previousFiscalYear);
// mark the rows to be excluded when we are screening with a threshold percent
// (KualiDecimal is not recognized as a type by java.sql--we have to convert it to its superclass BigDecimal)
BigDecimal thresholdValue = thresholdPercent.bigDecimalValue();
if (reportIncreasesAtOrAboveTheThreshold) {
// exclude everyone with increases less than the threshold
getSimpleJdbcTemplate().update(reportReasonStatisticsWithThreshold.get(1).getSQL(), idForSession, thresholdValue);
}
else {
// exclude everyone with increases over the threshold
getSimpleJdbcTemplate().update(reportReasonStatisticsWithThreshold.get(2).getSQL(), idForSession, thresholdValue);
}
fetchIndividualDetailForContinuingPeople(principalName, idForSession);
sumTheDetailRowsToProduceTheReportData(principalName, idForSession);
cleanWorkTablesFromThisSession(idForSession);
}
示例12: setBaseBudgetAdjustmentAmount
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public void setBaseBudgetAdjustmentAmount(KualiDecimal baseBudgetAdjustmentAmount) {
if (baseBudgetAdjustmentAmount != null) {
this.baseBudgetAdjustmentAmount = new KualiInteger(baseBudgetAdjustmentAmount.bigDecimalValue());
}
}
示例13: updateSalaryAndReasonSummaryReportsWithThreshold
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* @see org.kuali.kfs.module.bc.document.dataaccess.BudgetConstructionSalarySummaryReportDao#salarySummaryReports(java.lang.String,
* java.lang.Integer, boolean, org.kuali.rice.core.api.util.type.KualiDecimal)
*/
@Override
public void updateSalaryAndReasonSummaryReportsWithThreshold(String principalName, Integer previousFiscalYear, boolean reportGreaterThanOrEqualToThreshold, KualiDecimal threshold) {
// get the session ID
String idForSession = UUID.randomUUID().toString();
// clean out anything left from a previous report requested by this user
clearUserPreviouSalarySummaryReports(principalName);
// default duration code is inserted into a couple of the SQL queries--get it now
ArrayList<String> durationCodeDefault = new ArrayList<String>(2);
durationCodeDefault.add(BCConstants.VACANT_EMPLID);
durationCodeDefault.add(BCConstants.AppointmentFundingDurationCodes.NONE.durationCode);
// fetch the base and request salary parameters for people who are marked as not going on leave
getSimpleJdbcTemplate().update(updateReportsSalarySummaryThreshold.get(0).getSQL(durationCodeDefault), idForSession, principalName);
// fetch the base and request salary parameters for people who are marked as going on leave
getSimpleJdbcTemplate().update(updateReportsSalarySummaryThreshold.get(1).getSQL(durationCodeDefault), idForSession, principalName);
// take request percent time, months appointment, and position months from the row with the largest request salary
getSimpleJdbcTemplate().update(updateReportsSalarySummaryThreshold.get(2).getSQL(), idForSession, idForSession);
// take base percent time, months appointment, and position months from the row with the largest base salary
getSimpleJdbcTemplate().update(updateReportsSalarySummaryThreshold.get(3).getSQL(), idForSession, idForSession, previousFiscalYear);
// combine the base and request months/percent time/position months into a single table
getSimpleJdbcTemplate().update(updateReportsSalarySummaryThreshold.get(4).getSQL(), idForSession, idForSession);
// adjust the base salary so that it reflects the same appointment parameters as the request salary (increase it if the
// person will work 12 months this year, but worked only 10 last year, for example)
getSimpleJdbcTemplate().update(updateReportsSalarySummaryThreshold.get(5).getSQL(), idForSession);
// adjust the base salary for changes in the position months versus last year
getSimpleJdbcTemplate().update(updateReportsSalarySummaryThreshold.get(6).getSQL(), idForSession);
// the salaries taken will either be above or below the threshold
// April 09, 2008: Jdbc (at least Oracle's implementation) chokes on a KualiDecimal, with a message that says
// "illegal column type"
// a simple cast to Number has the same result
// using the code below works
BigDecimal thresholdValue = threshold.bigDecimalValue();
if (reportGreaterThanOrEqualToThreshold) {
getSimpleJdbcTemplate().update(salarySummaryAboveThreshold.get(0).getSQL(), idForSession, idForSession, thresholdValue);
}
else {
getSimpleJdbcTemplate().update(salarySummaryBelowThreshold.get(0).getSQL(), idForSession, idForSession, thresholdValue);
}
// populate the holding table with the rows to be reported
// (only request is reported--the base was manipulated above to identify people above and below the threshold)
// name records for the rows to be reported
getSimpleJdbcTemplate().update(updateReportsSalarySummaryCommon.get(0).getSQL(), principalName, principalName, idForSession);
// salary data for the rows to be reported
getSimpleJdbcTemplate().update(updateReportsSalarySummaryCommon.get(1).getSQL(), principalName, principalName, idForSession);
// clear out the threshold work tables for this session
clearThresholdWorkTables(idForSession);
// clear out the common work table for this session
clearCommonWorkTable(idForSession);
}