本文整理汇总了Java中org.kuali.rice.core.api.util.type.KualiDecimal.equals方法的典型用法代码示例。如果您正苦于以下问题:Java KualiDecimal.equals方法的具体用法?Java KualiDecimal.equals怎么用?Java KualiDecimal.equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.api.util.type.KualiDecimal
的用法示例。
在下文中一共展示了KualiDecimal.equals方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEffortCertificationDetailWithMaxPayrollAmount
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* find the detail lines that have max payroll amount
*
* @return the detail lines that have max payroll amount
*/
public List<EffortCertificationDetail> getEffortCertificationDetailWithMaxPayrollAmount() {
List<EffortCertificationDetail> detailLines = new ArrayList<EffortCertificationDetail>();
KualiDecimal maxAmount = null;
for (EffortCertificationDetail line : this.getEffortCertificationDetailLines()) {
KualiDecimal currentAmount = line.getEffortCertificationPayrollAmount();
if (maxAmount == null) {
maxAmount = currentAmount;
detailLines.add(line);
continue;
}
if (maxAmount.isLessThan(currentAmount)) {
detailLines.removeAll(detailLines);
maxAmount = currentAmount;
detailLines.add(line);
}
else if (maxAmount.equals(currentAmount)) {
detailLines.add(line);
}
}
return detailLines;
}
示例2: doRouteLevelChange
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* This is the default implementation which, if parameter KFS-SYS / Document / UPDATE_TOTAL_AMOUNT_IN_POST_PROCESSING_IND is on, updates the document
* and resaves if needed
* @see org.kuali.rice.kns.document.DocumentBase#doRouteLevelChange(org.kuali.rice.kew.dto.DocumentRouteLevelChangeDTO)
*/
@Override
public void doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) {
// grab the new app doc status
getFinancialSystemDocumentHeader().setApplicationDocumentStatus(getFinancialSystemDocumentHeader().getWorkflowDocument().getApplicationDocumentStatus());
if (this instanceof AmountTotaling
&& getDocumentHeader() != null
&& getParameterService() != null
&& getBusinessObjectService() != null
&& getParameterService().parameterExists(KfsParameterConstants.FINANCIAL_SYSTEM_DOCUMENT.class, UPDATE_TOTAL_AMOUNT_IN_POST_PROCESSING_PARAMETER_NAME)
&& getParameterService().getParameterValueAsBoolean(KfsParameterConstants.FINANCIAL_SYSTEM_DOCUMENT.class, UPDATE_TOTAL_AMOUNT_IN_POST_PROCESSING_PARAMETER_NAME)) {
final KualiDecimal currentTotal = ((AmountTotaling)this).getTotalDollarAmount();
if (!currentTotal.equals(getFinancialSystemDocumentHeader().getFinancialDocumentTotalAmount())) {
getFinancialSystemDocumentHeader().setFinancialDocumentTotalAmount(currentTotal);
}
}
if (this instanceof AmountTotaling || !StringUtils.isBlank(getFinancialSystemDocumentHeader().getApplicationDocumentStatus())) {
getBusinessObjectService().save(getFinancialSystemDocumentHeader());
}
super.doRouteLevelChange(levelChangeEvent);
}
示例3: reconcileGroups
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Identify and separate the matching and mismatching account line groups
*
* @param glKeySet GL Account Line groups
*/
protected void reconcileGroups(Collection<GlAccountLineGroup> glKeySet) {
for (GlAccountLineGroup glAccountLineGroup : glKeySet) {
PurApAccountLineGroup purapAccountLineGroup = this.purapAcctGroupMap.get(glAccountLineGroup);
KualiDecimal glAmt = this.glEntryGroupMap.get(glAccountLineGroup).getAmount();
if (purapAccountLineGroup == null || !glAmt.equals(purapAccountLineGroup.getAmount())) {
if (LOG.isDebugEnabled()) {
LOG.debug("GL account line " + glAccountLineGroup.toString() + " did not find a matching purchasing account line group");
}
misMatchedGroups.add(glAccountLineGroup);
}
else {
if (LOG.isDebugEnabled()) {
LOG.debug("GL account line " + glAccountLineGroup.toString() + " found a matching Purchasing account line group ");
}
glAccountLineGroup.setMatchedPurApAcctLines(purapAccountLineGroup.getSourceEntries());
matchedGroups.add(glAccountLineGroup);
misMatchedGroups.remove(glAccountLineGroup);
}
}
}
示例4: checkForTotalCopiesGreaterThanQuantityAtSubmit
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public boolean checkForTotalCopiesGreaterThanQuantityAtSubmit(List<OleCopies> copyList, KualiDecimal noOfCopiesOrdered) {
boolean isValid = true;
int copies = 0;
if (copyList.size() > 0) {
for (int itemCopies = 0; itemCopies < copyList.size(); itemCopies++) {
copies = copies + copyList.get(itemCopies).getItemCopies().intValue();
}
if (noOfCopiesOrdered != null && !noOfCopiesOrdered.equals(new KualiDecimal(copies))) {
GlobalVariables.getMessageMap().putError(PurapConstants.ITEM_TAB_ERROR_PROPERTY,
OLEConstants.TOTAL_OF_ITEM_COPIES_ITEMCOPIES_GREATERTHAN_ITEMCOPIESORDERED, new String[]{});
isValid = false;
}
} else {
GlobalVariables.getMessageMap().putError(PurapConstants.ITEM_TAB_ERROR_PROPERTY,
OLEConstants.TOTAL_OF_ITEM_COPIES_ITEMCOPIES_GREATERTHAN_ITEMCOPIESORDERED, new String[]{});
isValid = false;
}
return isValid;
}
示例5: doRouteLevelChange
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* This is the default implementation which, if parameter KFS-SYS / Document / UPDATE_TOTAL_AMOUNT_IN_POST_PROCESSING_IND is on, updates the document
* and resaves if needed
* @see org.kuali.rice.kns.document.DocumentBase#doRouteLevelChange(org.kuali.rice.kew.dto.DocumentRouteLevelChangeDTO)
*/
@Override
public void doRouteLevelChange(DocumentRouteLevelChange levelChangeEvent) {
if (this instanceof AmountTotaling
&& getDocumentHeader() != null
&& getParameterService() != null
&& getBusinessObjectService() != null
&& getParameterService().parameterExists(OleParameterConstants.FINANCIAL_SYSTEM_DOCUMENT.class, UPDATE_TOTAL_AMOUNT_IN_POST_PROCESSING_PARAMETER_NAME)
&& getParameterService().getParameterValueAsBoolean(OleParameterConstants.FINANCIAL_SYSTEM_DOCUMENT.class, UPDATE_TOTAL_AMOUNT_IN_POST_PROCESSING_PARAMETER_NAME)) {
final KualiDecimal currentTotal = ((AmountTotaling)this).getTotalDollarAmount();
if (!currentTotal.equals(getFinancialSystemDocumentHeader().getFinancialDocumentTotalAmount())) {
getFinancialSystemDocumentHeader().setFinancialDocumentTotalAmount(currentTotal);
getBusinessObjectService().save(getFinancialSystemDocumentHeader());
}
}
super.doRouteLevelChange(levelChangeEvent);
}
示例6: validate
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* @see org.kuali.kfs.sys.document.validation.Validation#validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)
*/
@Override
public boolean validate(AttributedDocumentEvent event) {
final TravelAuthorizationDocument documentForValidation = (TravelAuthorizationDocument)event.getDocument();
boolean success = true;
if (!ObjectUtils.isNull(documentForValidation.getTravelAdvance()) && documentForValidation.getTravelAdvance().isAtLeastPartiallyFilledIn()) {
// find the total for the accounting lines
final KualiDecimal accountingLineTotal = calculateAdvanceAccountingLineTotal(documentForValidation);
if (!accountingLineTotal.equals(documentForValidation.getTravelAdvance().getTravelAdvanceRequested())) {
GlobalVariables.getMessageMap().putError(TemPropertyConstants.ADVANCE_ACCOUNTING_LINES+"[0]."+KFSPropertyConstants.AMOUNT, TemKeyConstants.ERROR_TA_ADVANCE_ACCOUNTING_LINES_ADVANCE_AMOUNT_REQUESTED_NOT_EQUAL, documentForValidation.getTravelAdvance().getTravelAdvanceRequested().toString(), accountingLineTotal.toString());
success = false;
}
}
return success;
}
示例7: containsIdentical
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
protected boolean containsIdentical(CustomerInvoiceDetail customerInvoiceDetail, KualiDecimal amountApplied, List<InvoicePaidApplied> invoicePaidApplieds ) {
boolean identicalFlag = false;
String custRefInvoiceDocNumber = customerInvoiceDetail.getDocumentNumber();
Integer custInvoiceSequenceNumber = customerInvoiceDetail.getInvoiceItemNumber();
for (InvoicePaidApplied invoicePaidApplied : invoicePaidApplieds) {
String payAppDocNumber = invoicePaidApplied.getDocumentNumber();
String refInvoiceDocNumber = invoicePaidApplied.getFinancialDocumentReferenceInvoiceNumber();
Integer invoiceSequenceNumber = invoicePaidApplied.getInvoiceItemNumber();
KualiDecimal appliedAmount = invoicePaidApplied.getInvoiceItemAppliedAmount();
Integer paidAppliedItemNumber = invoicePaidApplied.getPaidAppliedItemNumber();
if (custRefInvoiceDocNumber.equals(refInvoiceDocNumber) && custInvoiceSequenceNumber.equals(invoiceSequenceNumber) && amountApplied.equals(appliedAmount)) {
identicalFlag = true;
break;
}
}
return identicalFlag;
}
示例8: validate
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Returns true if credit/debit entries are in balance
* @see org.kuali.kfs.sys.document.validation.Validation#validate(org.kuali.kfs.sys.document.validation.event.AttributedDocumentEvent)
*/
public boolean validate(AttributedDocumentEvent event) {
KualiDecimal creditAmount = getAuxiliaryVoucherDocumentForValidation().getCreditTotal();
KualiDecimal debitAmount = getAuxiliaryVoucherDocumentForValidation().getDebitTotal();
boolean balanced = debitAmount.equals(creditAmount);
if (!balanced) {
String errorParams[] = { creditAmount.toString(), debitAmount.toString() };
GlobalVariables.getMessageMap().putError(ACCOUNTING_LINE_ERRORS, ERROR_DOCUMENT_BALANCE_CONSIDERING_CREDIT_AND_DEBIT_AMOUNTS, errorParams);
}
return balanced;
}
示例9: validateAssetTotalCostMatchesPaymentTotalCost
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Give an error if this asset can't be separated due to mismatching amount on asset and AssetPayment records
*
* @param assetGlobal
* @return validation success of failure
*/
public static boolean validateAssetTotalCostMatchesPaymentTotalCost(AssetGlobal assetGlobal) {
PaymentSummaryService paymentSummaryService = SpringContext.getBean(PaymentSummaryService.class);
assetGlobal.refreshReferenceObject(CamsPropertyConstants.AssetGlobal.SEPARATE_SOURCE_CAPITAL_ASSET);
KualiDecimal assetTotalCost = ObjectUtils.isNull(assetGlobal.getSeparateSourceCapitalAsset().getTotalCostAmount()) ? new KualiDecimal(0) : assetGlobal.getSeparateSourceCapitalAsset().getTotalCostAmount();
KualiDecimal paymentTotalCost = paymentSummaryService.calculatePaymentTotalCost(assetGlobal.getSeparateSourceCapitalAsset());
if (!paymentTotalCost.equals(assetTotalCost)) {
GlobalVariables.getMessageMap().putErrorWithoutFullErrorPath(MAINTAINABLE_ERROR_PREFIX + CamsPropertyConstants.AssetGlobal.SEPARATE_SOURCE_CAPITAL_ASSET_NUMBER, CamsKeyConstants.AssetGlobal.ERROR_SEPARATE_ASSET_TOTAL_COST_NOT_MATCH_PAYMENT_TOTAL_COST);
return false;
}
return true;
}
示例10: closePurchaseOrder
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
protected void closePurchaseOrder() {
//Added for jira OLE-3529 Starts
Integer poIdentifier = purchaseOrderDocument.getPurapDocumentIdentifier();
String docNumber = purchaseOrderDocument.getDocumentNumber();
Map purchaseOrderMap = new HashMap();
purchaseOrderMap.put("documentNumber", docNumber);
purchaseOrderMap.put("itemTypeCode", OLEConstants.ITEM);
KualiDecimal itemQuantity = new KualiDecimal(0);
KualiDecimal itemOrderQuantity = new KualiDecimal(0);
List<OlePurchaseOrderItem> olePurchaseOrderItemList = (List<OlePurchaseOrderItem>) getBusinessObjectService().findMatching(OlePurchaseOrderItem.class, purchaseOrderMap);
for (OlePurchaseOrderItem olePurchaseOrderItem : olePurchaseOrderItemList) {
itemQuantity = itemQuantity.add(olePurchaseOrderItem.getItemQuantity());
}
Map lineItemReceivingMap = new HashMap();
lineItemReceivingMap.put("purchaseOrderIdentifier", poIdentifier);
List<OleLineItemReceivingDocument> oleLineItemReceivingDocumentList = (List<OleLineItemReceivingDocument>) getBusinessObjectService().findMatching(OleLineItemReceivingDocument.class, lineItemReceivingMap);
for (OleLineItemReceivingDocument oleLineItemReceivingDocument : oleLineItemReceivingDocumentList) {
String docId = oleLineItemReceivingDocument.getDocumentNumber();
Map docIdMap = new HashMap();
docIdMap.put("documentNumber", docId);
List<OleLineItemReceivingItem> oleLineItemReceivingItemList = (List<OleLineItemReceivingItem>) getBusinessObjectService().findMatching(OleLineItemReceivingItem.class, docIdMap);
for (OleLineItemReceivingItem oleLineItemReceivingItem : oleLineItemReceivingItemList) {
itemOrderQuantity = itemOrderQuantity.add(oleLineItemReceivingItem.getItemOrderedQuantity());
}
if (itemQuantity.equals(itemOrderQuantity)) {
try {
this.setDocumentHeader(purchaseOrderDocument.getDocumentHeader());
updateAndSaveAppDocStatus(PurapConstants.PurchaseOrderStatuses.APPDOC_CLOSED);
} catch (WorkflowException e) {
logAndThrowRuntimeException("Error while Closing the PO from Payment Request "
+ getDocumentNumber(), e);
}
}
}
//End
}
示例11: validate
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Returns true if credit/debit entries are in balance
* @see org.kuali.ole.sys.document.validation.Validation#validate(org.kuali.ole.sys.document.validation.event.AttributedDocumentEvent)
*/
public boolean validate(AttributedDocumentEvent event) {
KualiDecimal creditAmount = getAuxiliaryVoucherDocumentForValidation().getCreditTotal();
KualiDecimal debitAmount = getAuxiliaryVoucherDocumentForValidation().getDebitTotal();
boolean balanced = debitAmount.equals(creditAmount);
if (!balanced) {
String errorParams[] = { creditAmount.toString(), debitAmount.toString() };
GlobalVariables.getMessageMap().putError(ACCOUNTING_LINE_ERRORS, ERROR_DOCUMENT_BALANCE_CONSIDERING_CREDIT_AND_DEBIT_AMOUNTS, errorParams);
}
return balanced;
}
示例12: capitalAccountingLineAmountDistributed
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
*
* @param kadfb
* @param capitalAssetsInformation
* @return true if accounting line amount equals to capital asset amount, else false.
*/
protected boolean capitalAccountingLineAmountDistributed(CapitalAccountingLines capitalAccountingLine, List<CapitalAssetInformation> capitalAssetsInformation) {
KualiDecimal amountDistributed = KualiDecimal.ZERO;
for (CapitalAssetInformation capitalAsset : capitalAssetsInformation) {
amountDistributed = amountDistributed.add(getAccountingLineAmount(capitalAsset, capitalAccountingLine));
}
KualiDecimal capitalAccountingLineAmount = capitalAccountingLine.getAmount();
return amountDistributed.equals(capitalAccountingLineAmount);
}
示例13: validateAssetTotalAmount
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* check if amount is above threshold for capital assets for normal user. minTotalPaymentByAsset and maxTotalPaymentByAsset are
* used to check against threshold. Due to the decimal rounding, the asset total amount could have 1 cent difference with each
* other. We need to pick up the right value for different threshold check.
*
* @param document
* @return
*/
protected boolean validateAssetTotalAmount(MaintenanceDocument document) {
boolean success = true;
AssetGlobal assetGlobal = (AssetGlobal) document.getNewMaintainableObject().getBusinessObject();
KualiDecimal minTotalPaymentByAsset = getAssetGlobalService().totalPaymentByAsset(assetGlobal, false);
KualiDecimal maxTotalPaymentByAsset = getAssetGlobalService().totalPaymentByAsset(assetGlobal, true);
if (minTotalPaymentByAsset.isGreaterThan(maxTotalPaymentByAsset)) {
// swap min and max
KualiDecimal totalPayment = minTotalPaymentByAsset;
minTotalPaymentByAsset = maxTotalPaymentByAsset;
maxTotalPaymentByAsset = totalPayment;
}
// Disallow FO change asset total amount during routing. Asset total amount is derived from asset payments total and the
// quantity of assets
if (getAssetService().isDocumentEnrouting(document) && (!minTotalPaymentByAsset.equals(assetGlobal.getMinAssetTotalAmount()) || !maxTotalPaymentByAsset.equals(assetGlobal.getMaxAssetTotalAmount()))) {
putFieldError(CamsPropertyConstants.AssetGlobal.ASSET_PAYMENT_DETAILS, CamsKeyConstants.AssetGlobal.ERROR_CHANGE_ASSET_TOTAL_AMOUNT_DISALLOW, !minTotalPaymentByAsset.equals(assetGlobal.getMinAssetTotalAmount()) ? new String[] { (String) new CurrencyFormatter().format(assetGlobal.getMinAssetTotalAmount()), (String) new CurrencyFormatter().format(minTotalPaymentByAsset) } : new String[] { (String) new CurrencyFormatter().format(assetGlobal.getMaxAssetTotalAmount()), (String) new CurrencyFormatter().format(maxTotalPaymentByAsset) });
success = false;
}
// run threshold checking before routing
if (!getAssetService().isDocumentEnrouting(document)) {
String capitalizationThresholdAmount = getCapitalizationThresholdAmount();
if (isCapitalStatus(assetGlobal)) {
// check if amount is above threshold for capital asset.
if (!validateCapitalAssetAmountAboveThreshhold(document, minTotalPaymentByAsset, capitalizationThresholdAmount)) {
putFieldError(CamsPropertyConstants.AssetGlobal.INVENTORY_STATUS_CODE, CamsKeyConstants.AssetGlobal.ERROR_CAPITAL_ASSET_PAYMENT_AMOUNT_MIN, capitalizationThresholdAmount);
success = false;
}
}
else {
// check if amount is less than threshold for non-capital assets for all users
success &= validateNonCapitalAssetAmountBelowThreshold(maxTotalPaymentByAsset, capitalizationThresholdAmount);
}
}
return success;
}
示例14: takeAPennyLeaveAPennyCGBStyle
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* If the total of current expenditures within the list of InvoiceDetailAccountObjectCode business objects does not meet the amount to target,
* steal or give a penny from one of those business objects so that it does
* @param invoiceDetailAccountObjectCodes a List of InvoiceDetailAccountObjectCode business objects
* @param amountToTarget the amount which the sum of those objects should equal
*/
protected void takeAPennyLeaveAPennyCGBStyle(List<InvoiceDetailAccountObjectCode> invoiceDetailAccountObjectCodes, KualiDecimal amountToTarget) {
if (!CollectionUtils.isEmpty(invoiceDetailAccountObjectCodes)) {
final KualiDecimal currentExpenditureTotal = sumInvoiceDetailAccountObjectCodes(invoiceDetailAccountObjectCodes).getCurrentExpenditures();
if (!currentExpenditureTotal.equals(amountToTarget)) {
final KualiDecimal difference = currentExpenditureTotal.subtract(amountToTarget);
InvoiceDetailAccountObjectCode invoiceDetailAccountObjectCode = findFirstPositiveCurrentExpenditureInvoiceDetailAccountObjectCode(invoiceDetailAccountObjectCodes);
if (invoiceDetailAccountObjectCode != null) {
invoiceDetailAccountObjectCode.setCurrentExpenditures(invoiceDetailAccountObjectCode.getCurrentExpenditures().subtract(difference));
}
}
}
}
示例15: capitalAccountingLineAmountDistributed
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
*
* Checks to see if all the capital assets' distributed amount is the same as
* the capital accounting lines (there is only one lines, of course).
* @param kadfb
* @param capitalAssetsInformation
* @return true if accounting line amount equals to capital asset amount, else false.
*/
protected boolean capitalAccountingLineAmountDistributed(CapitalAccountingLines capitalAccountingLine, List<CapitalAssetInformation> capitalAssetsInformation) {
KualiDecimal amountDistributed = KualiDecimal.ZERO;
for (CapitalAssetInformation capitalAsset : capitalAssetsInformation) {
amountDistributed = amountDistributed.add(getAccountingLineAmount(capitalAsset, capitalAccountingLine));
}
KualiDecimal capitalAccountingLineAmount = capitalAccountingLine.getAmount();
return amountDistributed.equals(capitalAccountingLineAmount);
}