当前位置: 首页>>代码示例>>Java>>正文


Java KualiDecimal.isGreaterThan方法代码示例

本文整理汇总了Java中org.kuali.rice.core.api.util.type.KualiDecimal.isGreaterThan方法的典型用法代码示例。如果您正苦于以下问题:Java KualiDecimal.isGreaterThan方法的具体用法?Java KualiDecimal.isGreaterThan怎么用?Java KualiDecimal.isGreaterThan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.core.api.util.type.KualiDecimal的用法示例。


在下文中一共展示了KualiDecimal.isGreaterThan方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: continueIfSubcontractorTotalGreaterThanAwardTotal

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * Checks if the {@link Subcontractor} total amount is greater than the award total. If so asks the user if they want to
 * continue validation. if no is selected further validation is aborted and the user is returned to the award document.
 * 
 * @return true if the user selects yes, false otherwise
 */
protected boolean continueIfSubcontractorTotalGreaterThanAwardTotal() {
    boolean proceed = true;

    KualiDecimal awardTotal = newAward.getAwardTotalAmount();
    KualiDecimal subcontractorTotal = newAward.getAwardSubcontractorsTotalAmount();
    if ((ObjectUtils.isNotNull(awardTotal) && subcontractorTotal.isGreaterThan(awardTotal)) || (ObjectUtils.isNull(awardTotal) && subcontractorTotal.isPositive())) {

        String subcontracorLabel = dataDictionaryService.getCollectionLabel(Award.class, OLEPropertyConstants.AWARD_SUBCONTRACTORS);
        String awardLabel = dataDictionaryService.getAttributeErrorLabel(Award.class, OLEPropertyConstants.AWARD_TOTAL_AMOUNT);

        proceed = askOrAnalyzeYesNoQuestion("subcontractorTotalGreaterThanAwardTotal", buildConfirmationQuestion(OLEKeyConstants.WARNING_AWARD_SUBCONTRACTOR_TOTAL_GREATER_THAN_AWARD_TOTAL, subcontracorLabel, awardLabel));
    }

    return proceed;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:22,代码来源:AwardPreRules.java

示例2: getGeneralLedgerPendingEntrySourceDetails

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.sys.document.GeneralLedgerPendingEntrySource#getGeneralLedgerPostables()
 */
@Override
public List<GeneralLedgerPendingEntrySourceDetail> getGeneralLedgerPendingEntrySourceDetails() {
    List<GeneralLedgerPendingEntrySourceDetail> generalLedgerPendingEntrySourceDetails = new ArrayList<GeneralLedgerPendingEntrySourceDetail>();
    if (creditMemoDetails != null) {
        Iterator iter = creditMemoDetails.iterator();
        CustomerCreditMemoDetail customerCreditMemoDetail;
        KualiDecimal amount;
        while (iter.hasNext()) {
            customerCreditMemoDetail = (CustomerCreditMemoDetail)iter.next();
            amount = customerCreditMemoDetail.getCreditMemoItemTotalAmount();

            // get only non empty credit memo details to generate GLPEs
            if (ObjectUtils.isNotNull(amount) && amount.isGreaterThan(KualiDecimal.ZERO)) {
                generalLedgerPendingEntrySourceDetails.add(customerCreditMemoDetail);
            }
        }
    }
    return generalLedgerPendingEntrySourceDetails;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:23,代码来源:CustomerCreditMemoDocument.java

示例3: isValidExpenses

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 *
 * @return
 */
@Transient
public boolean isValidExpenses(){
    if(this.actualExpenses == null){
        return true;
    }

    int counter = 0;
    for(ActualExpense actualExpense: this.actualExpenses){
        if (actualExpense.getExpenseDetails().size() > 0){
            KualiDecimal detailAmount = actualExpense.getTotalDetailExpenseAmount();
            GlobalVariables.getMessageMap().addToErrorPath(KRADPropertyConstants.DOCUMENT);
            GlobalVariables.getMessageMap().addToErrorPath(TemPropertyConstants.ACTUAL_EXPENSES + "[" + counter + "]");
            if(detailAmount.isGreaterThan(actualExpense.getExpenseAmount()) && !TemConstants.ExpenseTypes.MILEAGE.equals(actualExpense.getExpenseTypeCode())){
                GlobalVariables.getMessageMap().putError(TemPropertyConstants.EXPENSE_AMOUNT, TemKeyConstants.ERROR_ACTUAL_EXPENSE_DETAIL_AMOUNT_EXCEED, detailAmount.toString(), actualExpense.getExpenseAmount().toString());
                return false;
            }
            GlobalVariables.getMessageMap().clearErrorPath();
        }
        counter++;
    }

    return true;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:28,代码来源:TravelDocumentBase.java

示例4: requiresAccountingReviewRouting

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 *
 * @return
 */
private boolean requiresAccountingReviewRouting() {
    // start with getting the TA encumbrance amount
    String percent = getParameterService().getParameterValueAsString(TravelReimbursementDocument.class, TravelReimbursementParameters.REIMBURSEMENT_PERCENT_OVER_ENCUMBRANCE_AMOUNT);

    KualiDecimal taTotal = getTravelDocumentService().getTotalAuthorizedEncumbrance(this);
    if (taTotal.isLessEqual(KualiDecimal.ZERO)) {
        return false;
    }

    KualiDecimal trTotal = getTravelDocumentService().getTotalCumulativeReimbursements(this);
    if (trTotal.isLessEqual(KualiDecimal.ZERO)) {
        return false;
    }

    if (trTotal.isGreaterThan(taTotal)) {
        KualiDecimal subAmount = trTotal.subtract(taTotal);
        KualiDecimal percentOver = (subAmount.divide(taTotal)).multiply(new KualiDecimal(100));
        return (percentOver.isGreaterThan(new KualiDecimal(percent)));
    }
    return false;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:26,代码来源:TravelReimbursementDocument.java

示例5: validateDelgationAmountsWithinRoleMemberBoundaries

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
protected boolean validateDelgationAmountsWithinRoleMemberBoundaries( OrgReviewRole orr ) {
    boolean valid = true;
    if(StringUtils.isNotEmpty(orr.getRoleMemberId())){
        RoleMember roleMember = getOrgReviewRoleService().getRoleMemberFromKimRoleService(orr.getRoleMemberId());
        List<OleKimDocumentAttributeData> attributes = orr.getAttributeSetAsQualifierList(roleMember.getAttributes());
        if(roleMember!=null && attributes!=null){
            for(OleKimDocumentAttributeData attribute: attributes){
                if(OleKimAttributes.FROM_AMOUNT.equals(attribute.getKimAttribute().getAttributeName())){
                    KualiDecimal roleMemberFromAmount = new KualiDecimal(attribute.getAttrVal());
                    if(orr.getFromAmount()!=null){
                        KualiDecimal inputFromAmount = orr.getFromAmount();
                        if((roleMemberFromAmount!=null && inputFromAmount==null) || (inputFromAmount!=null && inputFromAmount.isLessThan(roleMemberFromAmount))){
                            putFieldError(OleKimAttributes.FROM_AMOUNT, OLEKeyConstants.FROM_AMOUNT_OUT_OF_RANGE);
                            valid = false;
                        }
                    }
                }
                if(OleKimAttributes.TO_AMOUNT.equals(attribute.getKimAttribute().getAttributeName())){
                    KualiDecimal roleMemberToAmount = new KualiDecimal(attribute.getAttrVal());
                    if(orr.getToAmount()!=null){
                        KualiDecimal inputToAmount = orr.getToAmount();
                        if((roleMemberToAmount!=null && inputToAmount==null) || (inputToAmount!=null && inputToAmount.isGreaterThan(roleMemberToAmount))){
                            putFieldError(OleKimAttributes.TO_AMOUNT, OLEKeyConstants.TO_AMOUNT_OUT_OF_RANGE);
                            valid = false;
                        }
                    }
                }
            }
        }
    }
    return valid;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:33,代码来源:OrgReviewRoleRule.java

示例6: isValidCopiesAndPartsForEInstance

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
private boolean isValidCopiesAndPartsForEInstance(KualiDecimal noOfCopiesOrdered, KualiInteger noOfPartsOrdered, String linkToOrderOption) {
    boolean valid = true;
    if (StringUtils.isNotBlank(linkToOrderOption) && (linkToOrderOption.equals(OLEConstants.NB_ELECTRONIC) || linkToOrderOption.equals(OLEConstants.EB_ELECTRONIC)) && noOfCopiesOrdered != null && noOfPartsOrdered != null && (noOfCopiesOrdered.isGreaterThan(new KualiDecimal(1))
            || noOfPartsOrdered.isGreaterThan(new KualiInteger(1)))) {
        GlobalVariables.getMessageMap().putError(PurapConstants.ITEM_TAB_ERROR_PROPERTY,
                OLEConstants.ITEM_COPIESANDPARTS_SHOULDNOT_BE_GREATERTHAN_ONE_EINSTANCE, new String[]{});
        valid = false;
    }
    return valid;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:11,代码来源:OlePurchasingAddItemValidation.java

示例7: validateCreateAssetAction

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * Validate selected line item for asset global creation.
 * 
 * @param selectedLine
 */
protected void validateCreateAssetAction(PurchasingAccountsPayableItemAsset selectedLine) {
    KualiDecimal integerOne = new KualiDecimal(1);
    KualiDecimal quantity = selectedLine.getAccountsPayableItemQuantity();
    // check if item quantity is a fractional value greater than 1.
    if (quantity.isGreaterThan(integerOne) && quantity.mod(integerOne).isNonZero()) {
        GlobalVariables.getMessageMap().putError(CabPropertyConstants.PurApLineForm.PURAP_DOCS, CabKeyConstants.ERROR_FRACTIONAL_QUANTITY);
    }
    // if quantity is between (0,1) , set it to 1.
    else if (quantity.isGreaterThan(KualiDecimal.ZERO) && quantity.isLessThan(integerOne)) {
        selectedLine.setAccountsPayableItemQuantity(integerOne);
    }

}
 
开发者ID:kuali,项目名称:kfs,代码行数:19,代码来源:PurApLineAction.java

示例8: checkForItemCopiesGreaterThanQuantity

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public boolean checkForItemCopiesGreaterThanQuantity(KualiDecimal noOfCopies, KualiDecimal noOfCopiesOrdered) {
    boolean isValid = true;
    if (noOfCopies != null && noOfCopiesOrdered != null && noOfCopies.isGreaterThan(noOfCopiesOrdered)) {
        GlobalVariables.getMessageMap().putError(PurapConstants.ITEM_TAB_ERROR_PROPERTY,
                OLEConstants.ITEM_COPIES_ITEMCOPIES_GREATERTHAN_ITEMCOPIESORDERED, new String[]{});
        isValid = false;
    }
    return isValid;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:10,代码来源:OleCopyHelperServiceImpl.java

示例9: getReimbursableTotal

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.tem.document.TravelDocument#getReimbursableTotal()
 */
@Override
public KualiDecimal getReimbursableTotal() {
    KualiDecimal eligible = getEligibleAmount();
    final KualiDecimal expenseLimit = getExpenseLimit();

    if (expenseLimit != null && expenseLimit.doubleValue() > 0) {
        return eligible.isGreaterThan(expenseLimit) ? expenseLimit : eligible;
    }

    return eligible;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:15,代码来源:TEMReimbursementDocument.java

示例10: combineEntry

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * This method will combine multiple GL entries for the same account line group, so that m:n association is prevented in the
 * database. This could be a rare case that we need to address. First GL is used as the final target and rest of the GL entries
 * are adjusted.
 * 
 * @param entry
 */
public void combineEntry(Entry newEntry) {
    this.sourceEntries.add(newEntry);
    KualiDecimal newAmt = newEntry.getTransactionLedgerEntryAmount();
    String newDebitCreditCode = newEntry.getTransactionDebitCreditCode();

    KualiDecimal targetAmount = this.targetEntry.getTransactionLedgerEntryAmount();
    String targetDebitCreditCode = this.targetEntry.getTransactionDebitCreditCode();

    // if debit/credit code is same then just add the amount
    if (targetDebitCreditCode.equals(newDebitCreditCode)) {
        targetAmount = targetAmount.add(newAmt);
    }
    else {
        // if debit/credit code is not the same and new amount is greater, toggle the debit/credit code
        if (newAmt.isGreaterThan(targetAmount)) {
            targetDebitCreditCode = newDebitCreditCode;
            targetAmount = newAmt.subtract(targetAmount);
        }
        else {
            // if debit/credit code is not the same and current amount is greater or equal
            targetAmount = targetAmount.subtract(newAmt);
        }
    }
    this.targetEntry.setTransactionDebitCreditCode(targetDebitCreditCode);
    this.targetEntry.setTransactionLedgerEntryAmount(targetAmount);
    // re-compute the absolute value of amount
    if (KFSConstants.GL_CREDIT_CODE.equals(targetDebitCreditCode)) {
        setAmount(targetAmount.negated());
    }
    else {
        setAmount(targetAmount);
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:41,代码来源:GlAccountLineGroup.java

示例11: totalAmountMatchForCapitalAccountingLinesAndCapitalAssets

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
protected boolean totalAmountMatchForCapitalAccountingLinesAndCapitalAssets(List<CapitalAccountingLines> capitalAccountingLines, List<CapitalAssetInformation> capitalAssets) {
    boolean totalAmountMatched = true;
    
    KualiDecimal capitalAccountingLinesTotals = KualiDecimal.ZERO;
    KualiDecimal capitalAAssetTotals = KualiDecimal.ZERO;
    
    for (CapitalAccountingLines capitalAccountingLine : capitalAccountingLines) {
        capitalAccountingLinesTotals = capitalAccountingLinesTotals.add(capitalAccountingLine.getAmount());
    }

    for (CapitalAssetInformation capitalAsset : capitalAssets) {
        capitalAAssetTotals = capitalAAssetTotals.add(capitalAsset.getCapitalAssetLineAmount());
    }
    
    if (capitalAccountingLinesTotals.isGreaterThan(capitalAAssetTotals)) {
        //not all the accounting lines amounts have been distributed to capital assets
        GlobalVariables.getMessageMap().putError(OLEConstants.EDIT_ACCOUNTING_LINES_FOR_CAPITALIZATION_ERRORS, OLEKeyConstants.ERROR_DOCUMENT_ACCOUNTING_LINES_NOT_ALL_TOTALS_DISTRIBUTED_TO_CAPITAL_ASSETS);
        return false;
    }
    
    if (capitalAccountingLinesTotals.isLessEqual(capitalAAssetTotals)) {
        //not all the accounting lines amounts have been distributed to capital assets
        GlobalVariables.getMessageMap().putError(OLEConstants.EDIT_ACCOUNTING_LINES_FOR_CAPITALIZATION_ERRORS, OLEKeyConstants.ERROR_DOCUMENT_ACCOUNTING_LINE_FOR_CAPITALIZATION_HAS_NO_CAPITAL_ASSET);
        return false;
    }
    
    return totalAmountMatched;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:29,代码来源:CapitalAccountingLinesValidations.java

示例12: setAssetTotalAmountFromPersistence

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
private void setAssetTotalAmountFromPersistence(AssetGlobal assetGlobal) {
    KualiDecimal minAssetTotalAmount = getAssetGlobalService().totalPaymentByAsset(assetGlobal, false);
    KualiDecimal maxAssetTotalAmount = getAssetGlobalService().totalPaymentByAsset(assetGlobal, true);
    if (minAssetTotalAmount.isGreaterThan(maxAssetTotalAmount)) {
        // swap min and max
        KualiDecimal totalPayment = minAssetTotalAmount;
        minAssetTotalAmount = maxAssetTotalAmount;
        maxAssetTotalAmount = totalPayment;
    }
    assetGlobal.setMinAssetTotalAmount(minAssetTotalAmount);
    assetGlobal.setMaxAssetTotalAmount(maxAssetTotalAmount);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:13,代码来源:AssetGlobalMaintainableImpl.java

示例13: getAccountingLineAmountToFillIn

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
protected KualiDecimal getAccountingLineAmountToFillIn(TravelFormBase travelReqForm) {
    KualiDecimal amount = KualiDecimal.ZERO;

    TravelDocument travelDocument = travelReqForm.getTravelDocument();
    KualiDecimal amountToBePaid = travelDocument.getTotalAccountLineAmount();

    final List<TemSourceAccountingLine> accountingLines = travelDocument.getSourceAccountingLines();

    KualiDecimal accountingTotal = KualiDecimal.ZERO;
    for (TemSourceAccountingLine accountingLine : accountingLines) {
        accountingTotal = accountingTotal.add(accountingLine.getAmount());
    }

    if (!ObjectUtils.isNull(amountToBePaid) && amountToBePaid.isGreaterEqual(accountingTotal)) {
        amount = amountToBePaid.subtract(accountingTotal);
    }

    if (travelDocument.getExpenseLimit() != null && travelDocument.getExpenseLimit().isPositive()) {
        if (accountingTotal.isGreaterEqual(travelDocument.getExpenseLimit())) {
            return KualiDecimal.ZERO; // the accounting line total is greater than or equal to the expense limit, there's no more expense limit to spend
        }
        if (amount.isGreaterThan(travelDocument.getExpenseLimit())) {
            return travelDocument.getExpenseLimit().subtract(accountingTotal); // the amount to be paid - accounting total is still greater than the expense limit; so the amount we can actually pay is the expense limit - the accounting total
        }
        // we're under the expense limit; let's just return amount
    }

    return amount;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:30,代码来源:TravelActionBase.java

示例14: requiresDivisionApprovalRouting

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.tem.document.TravelDocumentBase#requiresDivisionApprovalRouting()
 */
@Override
protected boolean requiresDivisionApprovalRouting() {
    boolean reqDivApproval = false;
    KualiDecimal trTotal = getTravelDocumentService().getTotalCumulativeReimbursements(this);
    KualiDecimal divApprovalMax = new KualiDecimal(getParameterService().getParameterValueAsString(TemParameterConstants.TEM_DOCUMENT.class, TravelParameters.CUMULATIVE_REIMBURSABLE_AMOUNT_WITHOUT_DIVISION_APPROVAL));
    return (trTotal.isGreaterThan(divApprovalMax)) && requiresAccountingReviewRouting();
}
 
开发者ID:kuali,项目名称:kfs,代码行数:11,代码来源:TravelReimbursementDocument.java

示例15: getReimbursableGrandTotal

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.tem.document.TEMReimbursementDocument#getReimbursableGrandTotal()
 */
@Override
public KualiDecimal getReimbursableGrandTotal() {
    KualiDecimal grandTotal = getReimbursableTotal();

    KualiDecimal advancesTotal = getAdvancesTotal();
    if (advancesTotal.isGreaterThan(grandTotal)) {
        return KualiDecimal.ZERO; // if advances are greater than what is being reimbursed, then the grand total is a big fat goose egg.  With two equally sized goose eggs after the decimal point.
    }
    final KualiDecimal reimbursableGrandTotal = grandTotal.subtract(getAdvancesTotal());
    final KualiDecimal reimbursableGrandTotalAfterExpenseLimit = applyExpenseLimit(reimbursableGrandTotal);
    return reimbursableGrandTotalAfterExpenseLimit;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:16,代码来源:TravelReimbursementDocument.java


注:本文中的org.kuali.rice.core.api.util.type.KualiDecimal.isGreaterThan方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。