本文整理汇总了Java中org.kuali.rice.core.api.util.type.KualiDecimal.add方法的典型用法代码示例。如果您正苦于以下问题:Java KualiDecimal.add方法的具体用法?Java KualiDecimal.add怎么用?Java KualiDecimal.add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.api.util.type.KualiDecimal
的用法示例。
在下文中一共展示了KualiDecimal.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getYearBalance
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* @see org.kuali.kfs.gl.businessobject.Balance#getYearBalance()
*/
@Override
public KualiDecimal getYearBalance() {
KualiDecimal yearbalance = KualiDecimal.ZERO;
yearbalance = yearbalance.add(this.getMonth1Amount());
yearbalance = yearbalance.add(this.getMonth2Amount());
yearbalance = yearbalance.add(this.getMonth3Amount());
yearbalance = yearbalance.add(this.getMonth4Amount());
yearbalance = yearbalance.add(this.getMonth5Amount());
yearbalance = yearbalance.add(this.getMonth6Amount());
yearbalance = yearbalance.add(this.getMonth7Amount());
yearbalance = yearbalance.add(this.getMonth8Amount());
yearbalance = yearbalance.add(this.getMonth9Amount());
yearbalance = yearbalance.add(this.getMonth10Amount());
yearbalance = yearbalance.add(this.getMonth11Amount());
yearbalance = yearbalance.add(this.getMonth12Amount());
yearbalance = yearbalance.add(this.getMonth13Amount());
return yearbalance;
}
示例2: calculateTotalCreditsForCustomers
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* This method calculates the total credits for the customers.
*
* @param cgMapByCustomer
* @param knownCustomers
*/
protected void calculateTotalCreditsForCustomers(Map<String, List<ContractsGrantsInvoiceDocument>> cgMapByCustomer, Map<String, ContractsAndGrantsAgingReport> knownCustomers) {
Set<String> customerIds = cgMapByCustomer.keySet();
KualiDecimal credits = KualiDecimal.ZERO;
for (String customer : customerIds) {
ContractsAndGrantsAgingReport agingReportDetail = pickContractsGrantsAgingReportDetail(knownCustomers, customer);
List<ContractsGrantsInvoiceDocument> cgDocs = cgMapByCustomer.get(customer);
if (!CollectionUtils.isEmpty(cgDocs)) {
credits = KualiDecimal.ZERO;
for (ContractsGrantsInvoiceDocument cgDoc : cgDocs) {
Collection<CustomerCreditMemoDocument> creditDocs = customerCreditMemoDocumentService.getCustomerCreditMemoDocumentByInvoiceDocument(cgDoc.getDocumentNumber());
if (ObjectUtils.isNotNull(creditDocs) && !creditDocs.isEmpty()) {
for (CustomerCreditMemoDocument cm : creditDocs) {
for (CustomerCreditMemoDetail cmDetail : cm.getCreditMemoDetails()) {
if (ObjectUtils.isNotNull(cmDetail.getCreditMemoItemTotalAmount())) {
credits = credits.add(cmDetail.getCreditMemoItemTotalAmount());
}
}
}
}
}
}
agingReportDetail.setTotalCredits(credits);
totalCredits = totalCredits.add(credits);
}
}
示例3: getTotalAmount
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
@Override
public KualiDecimal getTotalAmount() {
KualiDecimal totalAmount = getExtendedPrice();
if (ObjectUtils.isNull(totalAmount)) {
totalAmount = KualiDecimal.ZERO;
}
KualiDecimal taxAmount = getItemTaxAmount();
if (ObjectUtils.isNull(taxAmount)) {
taxAmount = KualiDecimal.ZERO;
}
totalAmount = totalAmount.add(taxAmount);
return totalAmount;
}
示例4: isTransactionBalanceValid
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* This method validates the balance of the transaction given. A procurement card transaction is in balance if
* the total amount of the transaction equals the total of the target accounting lines corresponding to the transaction.
*
* @param pcTransaction The transaction detail used to retrieve the procurement card transaction and target accounting
* lines used to check for in balance.
* @return True if the amounts are equal and the transaction is in balance, false otherwise.
*/
protected boolean isTransactionBalanceValid(ProcurementCardTransactionDetail pcTransactionDetail) {
boolean inBalance = true;
KualiDecimal transAmount = pcTransactionDetail.getTransactionTotalAmount();
List<ProcurementCardTargetAccountingLine> targetAcctingLines = pcTransactionDetail.getTargetAccountingLines();
KualiDecimal targetLineTotal = KualiDecimal.ZERO;
for (TargetAccountingLine targetLine : targetAcctingLines) {
targetLineTotal = targetLineTotal.add(targetLine.getAmount());
}
// perform absolute value check because current system has situations where amounts may be opposite in sign
// This will no longer be necessary following completion of KULFDBCK-1290
inBalance = transAmount.abs().equals(targetLineTotal.abs());
if (!inBalance) {
GlobalVariables.getMessageMap().putError(ACCOUNTING_LINE_ERRORS, ERROR_DOCUMENT_PC_TRANSACTION_TOTAL_ACCTING_LINE_TOTAL_NOT_EQUAL, new String[] { transAmount.toString(), targetLineTotal.toString() });
}
return inBalance;
}
示例5: getTotalDollarAmountWithExclusionsSubsetItems
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* This method...
* @param excludedTypes
* @param includeBelowTheLine
* @param itemsForTotal
* @return
*/
protected KualiDecimal getTotalDollarAmountWithExclusionsSubsetItems(String[] excludedTypes, boolean includeBelowTheLine, List<PurApItem> itemsForTotal) {
if (excludedTypes == null) {
excludedTypes = new String[] {};
}
KualiDecimal total = new KualiDecimal(BigDecimal.ZERO);
for (PurApItem item : itemsForTotal) {
item.refreshReferenceObject(PurapPropertyConstants.ITEM_TYPE);
ItemType it = item.getItemType();
if ((includeBelowTheLine || it.isLineItemIndicator()) && !ArrayUtils.contains(excludedTypes, it.getItemTypeCode())) {
KualiDecimal totalAmount = item.getTotalAmount();
KualiDecimal itemTotal = (totalAmount != null) ? totalAmount : KualiDecimal.ZERO;
total = total.add(itemTotal);
}
}
return total;
}
示例6: updateDetailAmounts
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Sets null amount fields to 0
*
* @param paymentDetail <code>PaymentDetail</code> to update
*/
protected void updateDetailAmounts(PaymentDetail paymentDetail) {
KualiDecimal zero = KualiDecimal.ZERO;
if (paymentDetail.getInvTotDiscountAmount() == null) {
paymentDetail.setInvTotDiscountAmount(zero);
}
if (paymentDetail.getInvTotShipAmount() == null) {
paymentDetail.setInvTotShipAmount(zero);
}
if (paymentDetail.getInvTotOtherDebitAmount() == null) {
paymentDetail.setInvTotOtherDebitAmount(zero);
}
if (paymentDetail.getInvTotOtherCreditAmount() == null) {
paymentDetail.setInvTotOtherCreditAmount(zero);
}
// update the total payment amount with the amount from the accounts if null
if (paymentDetail.getNetPaymentAmount() == null) {
paymentDetail.setNetPaymentAmount(paymentDetail.getAccountTotal());
}
if (paymentDetail.getOrigInvoiceAmount() == null) {
KualiDecimal amt = paymentDetail.getNetPaymentAmount();
amt = amt.add(paymentDetail.getInvTotDiscountAmount());
amt = amt.subtract(paymentDetail.getInvTotShipAmount());
amt = amt.subtract(paymentDetail.getInvTotOtherDebitAmount());
amt = amt.add(paymentDetail.getInvTotOtherCreditAmount());
paymentDetail.setOrigInvoiceAmount(amt);
}
}
示例7: getTargetCurrentBudgetExpenseTotal
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Returns the total current budget expense amount from the target lines.
*
* @return KualiDecimal
*/
public KualiDecimal getTargetCurrentBudgetExpenseTotal() {
KualiDecimal total = KualiDecimal.ZERO;
AccountingDocumentRuleHelperService accountingDocumentRuleUtil = SpringContext.getBean(AccountingDocumentRuleHelperService.class);
for (Iterator iter = targetAccountingLines.iterator(); iter.hasNext();) {
BudgetAdjustmentAccountingLine line = (BudgetAdjustmentAccountingLine) iter.next();
if (accountingDocumentRuleUtil.isExpense(line)) {
total = total.add(line.getCurrentBudgetAdjustmentAmount());
}
}
return total;
}
示例8: getInvoiceItemTaxAmountTotal
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* This method returns the total of all tax amounts for all customer invoice detail lines
*
* @return
*/
public KualiDecimal getInvoiceItemTaxAmountTotal() {
KualiDecimal invoiceItemTaxAmountTotal = new KualiDecimal(0);
for (Iterator i = getSourceAccountingLines().iterator(); i.hasNext();) {
invoiceItemTaxAmountTotal = invoiceItemTaxAmountTotal.add(((CustomerInvoiceDetail) i.next()).getInvoiceItemTaxAmount());
}
return invoiceItemTaxAmountTotal;
}
示例9: getFullDiscountTaxablePrice
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public KualiDecimal getFullDiscountTaxablePrice(KualiDecimal extendedPrice, PurchasingAccountsPayableDocument purapDocument) {
KualiDecimal taxablePrice = KualiDecimal.ZERO;
KualiDecimal taxableLineItemPrice = KualiDecimal.ZERO;
KualiDecimal totalLineItemPrice = KualiDecimal.ZERO;
boolean useTaxIndicator = purapDocument.isUseTaxIndicator();
String deliveryState = getDeliveryState(purapDocument);
// iterate over items and calculate tax if taxable
for (PurApItem item : purapDocument.getItems()) {
if (item.getItemType().isLineItemIndicator()) {
//only when extended price exists
if (ObjectUtils.isNotNull(item.getExtendedPrice())) {
if (isTaxable(useTaxIndicator, deliveryState, item)) {
taxableLineItemPrice = taxableLineItemPrice.add(item.getExtendedPrice());
totalLineItemPrice = totalLineItemPrice.add(item.getExtendedPrice());
} else {
totalLineItemPrice = totalLineItemPrice.add(item.getExtendedPrice());
}
}
}
}
//check nonzero so no divide by zero errors, and make sure extended price is not null
if (totalLineItemPrice.isNonZero() && ObjectUtils.isNotNull(extendedPrice)) {
taxablePrice = taxableLineItemPrice.divide(totalLineItemPrice).multiply(extendedPrice);
}
return taxablePrice;
}
示例10: calculateTotalExpenditureAmount
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
protected KualiDecimal calculateTotalExpenditureAmount(ContractsGrantsInvoiceDocument document, List<ContractsGrantsLetterOfCreditReviewDetail> locReviewDetails) {
Map<String, KualiDecimal> totalBilledByAccountNumberMap = new HashMap<String, KualiDecimal>();
for (InvoiceDetailAccountObjectCode invoiceDetailAccountObjectCode : document.getInvoiceDetailAccountObjectCodes()) {
String key = invoiceDetailAccountObjectCode.getChartOfAccountsCode()+"-"+invoiceDetailAccountObjectCode.getAccountNumber();
KualiDecimal totalBilled = cleanAmount(totalBilledByAccountNumberMap.get(key));
totalBilled = totalBilled.add(invoiceDetailAccountObjectCode.getTotalBilled());
totalBilledByAccountNumberMap.put(key, totalBilled);
}
KualiDecimal totalExpendituredAmount = KualiDecimal.ZERO;
for (InvoiceAccountDetail invAcctD : document.getAccountDetails()) {
KualiDecimal currentExpenditureAmount = KualiDecimal.ZERO;
if (!ObjectUtils.isNull(totalBilledByAccountNumberMap.get(invAcctD.getChartOfAccountsCode()+"-"+invAcctD.getAccountNumber()))) {
invAcctD.setTotalPreviouslyBilled(totalBilledByAccountNumberMap.get(invAcctD.getChartOfAccountsCode()+"-"+invAcctD.getAccountNumber()));
} else {
invAcctD.setTotalPreviouslyBilled(KualiDecimal.ZERO);
}
currentExpenditureAmount = invAcctD.getCumulativeExpenditures().subtract(invAcctD.getTotalPreviouslyBilled());
invAcctD.setInvoiceAmount(currentExpenditureAmount);
// overwriting account detail expenditure amount if locReview Indicator is true - and award belongs to LOC Billing
if (!ObjectUtils.isNull(document.getInvoiceGeneralDetail())) {
ContractsAndGrantsBillingAward award = document.getInvoiceGeneralDetail().getAward();
if (ObjectUtils.isNotNull(award) && StringUtils.equalsIgnoreCase(award.getBillingFrequencyCode(), ArConstants.LOC_BILLING_SCHEDULE_CODE) && !CollectionUtils.isEmpty(locReviewDetails)) {
for (ContractsAndGrantsBillingAwardAccount awardAccount : award.getActiveAwardAccounts()) {
final ContractsGrantsLetterOfCreditReviewDetail locReviewDetail = retrieveMatchingLetterOfCreditReviewDetail(awardAccount, locReviewDetails);
if (!ObjectUtils.isNull(locReviewDetail) && StringUtils.equals(awardAccount.getChartOfAccountsCode(), invAcctD.getChartOfAccountsCode()) && StringUtils.equals(awardAccount.getAccountNumber(), invAcctD.getAccountNumber())) {
currentExpenditureAmount = locReviewDetail.getAmountToDraw();
invAcctD.setInvoiceAmount(currentExpenditureAmount);
}
}
}
}
totalExpendituredAmount = totalExpendituredAmount.add(currentExpenditureAmount);
}
totalExpendituredAmount = totalExpendituredAmount.add(document.getInvoiceGeneralDetail().getTotalPreviouslyBilled());
return totalExpendituredAmount;
}
示例11: calculateTotalPaymentsToDateByAward
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* @see org.kuali.kfs.module.ar.document.service.ContractsGrantsInvoiceDocumentService#calculateTotalPaymentsToDateByAward(org.kuali.kfs.integration.cg.ContractsAndGrantsBillingAward)
*/
@Override
public KualiDecimal calculateTotalPaymentsToDateByAward(ContractsAndGrantsBillingAward award) {
KualiDecimal totalPayments = KualiDecimal.ZERO;
Map<String, Object> criteria = new HashMap<String, Object>();
criteria.put(ArPropertyConstants.ContractsGrantsInvoiceDocumentFields.PROPOSAL_NUMBER, award.getProposalNumber());
Collection<ContractsGrantsInvoiceDocument> cgInvoiceDocs = businessObjectService.findMatching(ContractsGrantsInvoiceDocument.class, criteria);
for (ContractsGrantsInvoiceDocument cgInvoiceDoc : cgInvoiceDocs) {
totalPayments = totalPayments.add(getCustomerInvoiceDocumentService().calculateAppliedPaymentAmount(cgInvoiceDoc));
}
return totalPayments;
}
示例12: getDailyTotalForDocument
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public KualiDecimal getDailyTotalForDocument(TravelDocument travelDoc) {
KualiDecimal total = KualiDecimal.ZERO;
if (!personal) {
total = total.add(getMileageTotalForDocument(travelDoc));
total = total.add(getLodging());
total = total.add(getMealsAndIncidentals());
}
return total;
}
示例13: validateTotalAmount
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Verifies account amounts = item total. If does not equal then validation fails.
*
* @param item
* @param writeErrorMessage true if error message to be added to global error variables, else false
* @return true if account amounts sum = item total
*/
public boolean validateTotalAmount(PurApItem item, boolean writeErrorMessage) {
boolean valid = true;
if (item.getSourceAccountingLines().size() == 0) {
return valid;
}
if (item.getItemQuantity() == null || item.getItemUnitPrice() == null || item.getTotalAmount().compareTo(KualiDecimal.ZERO) == 0) {
//extended cost is not available yet so do not run validations....
return valid;
}
// validate that the amount total
KualiDecimal totalAmount = KualiDecimal.ZERO;
KualiDecimal desiredAmount = (item.getTotalAmount() == null) ? new KualiDecimal(0) : item.getTotalAmount();
for (PurApAccountingLine account : item.getSourceAccountingLines()) {
if (account.getAmount() != null) {
totalAmount = totalAmount.add(account.getAmount());
} else {
totalAmount = totalAmount.add(KualiDecimal.ZERO);
}
}
if (desiredAmount.compareTo(totalAmount) != 0) {
if (writeErrorMessage) {
GlobalVariables.getMessageMap().putError(PurapConstants.ITEM_TAB_ERROR_PROPERTY, PurapKeyConstants.ERROR_ITEM_ACCOUNTING_TOTAL_AMOUNT, item.getItemIdentifierString(), desiredAmount.toString());
}
valid = false;
}
return valid;
}
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:41,代码来源:PurchasingAccountsPayablesItemPreCalculateValidations.java
示例14: getPaymentTotalAmount
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public KualiDecimal getPaymentTotalAmount() {
KualiDecimal total = new KualiDecimal(0);
for (ResearchParticipantPaymentDetail detail : paymentDetails) {
total = total.add(detail.getAmount());
}
return total;
}
示例15: getSourceTotal
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Total for a Cash Receipt according to the spec should be the sum of the amounts on accounting lines belonging to object codes
* having the 'income' object type, less the sum of the amounts on accounting lines belonging to object codes having the
* 'expense' object type.
*
* @see org.kuali.kfs.sys.document.AccountingDocument#getSourceTotal()
*/
@Override
public KualiDecimal getSourceTotal() {
KualiDecimal total = KualiDecimal.ZERO;
AccountingLineBase al = null;
if (ObjectUtils.isNull(getSourceAccountingLines()) || getSourceAccountingLines().isEmpty()) {
refreshReferenceObject(KFSPropertyConstants.SOURCE_ACCOUNTING_LINES);
}
Iterator iter = getSourceAccountingLines().iterator();
while (iter.hasNext()) {
al = (AccountingLineBase) iter.next();
try {
KualiDecimal amount = al.getAmount().abs();
if (amount != null && amount.isNonZero()) {
if (isDebit(al)) {
total = total.subtract(amount);
}
else { // in this context, if it's not a debit, it's a credit
total = total.add(amount);
}
}
}
catch (Exception e) {
// Possibly caused by accounting lines w/ bad data
LOG.error("Error occured trying to compute Cash receipt total, returning 0", e);
return KualiDecimal.ZERO;
}
}
return total;
}