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


Java KualiDecimal.isLessThan方法代码示例

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


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

示例1: checkDelegateFromAmtGreaterThanEqualZero

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * This method checks to see if the from amount is greater than zero
 * 
 * @param fromAmount
 * @param lineNum
 * @return false if from amount less than zero
 */
protected boolean checkDelegateFromAmtGreaterThanEqualZero(KualiDecimal fromAmount, int lineNum, boolean add) {
    boolean success = true;
    if (ObjectUtils.isNotNull(fromAmount)) {
        if (fromAmount.isLessThan(ZERO)) {
            String errorPath = OLEConstants.EMPTY_STRING;
            if (add) {
                errorPath = OLEConstants.MAINTENANCE_ADD_PREFIX + DELEGATE_GLOBALS_PREFIX + "." + "approvalFromThisAmount";
                putFieldError(errorPath, OLEKeyConstants.ERROR_DOCUMENT_ACCTDELEGATEMAINT_FROM_AMOUNT_NONNEGATIVE);
            }
            else {
                errorPath = DELEGATE_GLOBALS_PREFIX + "[" + lineNum + "]." + "approvalFromThisAmount";
                putFieldError(errorPath, OLEKeyConstants.ERROR_DOCUMENT_ACCTDELEGATEMAINT_FROM_AMOUNT_NONNEGATIVE);
            }
            success &= false;
        }
    }
    return success;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:26,代码来源:DelegateGlobalRule.java

示例2: isTravelExpenseExceedReceiptRequirementThreshold

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.tem.service.TravelExpenseService#isTravelExpenseExceedReceiptRequirementThreshold(org.kuali.kfs.module.tem.businessobject.OtherExpense)
 */
@Override
public boolean isTravelExpenseExceedReceiptRequirementThreshold(OtherExpense expense) {
    boolean isExceed = false;

    final ExpenseTypeObjectCode expenseTypeCode = expense.getExpenseTypeObjectCode();

    if (expenseTypeCode.isReceiptRequired()) {
      //check for the threshold amount
        if (expenseTypeCode.getReceiptRequirementThreshold() != null){
            KualiDecimal threshold = expenseTypeCode.getReceiptRequirementThreshold();
            isExceed = threshold.isLessThan(expense.getExpenseAmount());
        }else{
            isExceed = true;
        }
    }
    return isExceed;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:21,代码来源:TravelExpenseServiceImpl.java

示例3: checkDelegateFromAmtGreaterThanEqualZero

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * This method checks to see if the from amount is greater than zero
 *
 * @param fromAmount
 * @param lineNum
 * @return false if from amount less than zero
 */
protected boolean checkDelegateFromAmtGreaterThanEqualZero(KualiDecimal fromAmount, int lineNum, boolean add) {
    boolean success = true;
    if (ObjectUtils.isNotNull(fromAmount)) {
        if (fromAmount.isLessThan(ZERO)) {
            String errorPath = KFSConstants.EMPTY_STRING;
            if (add) {
                errorPath = KFSConstants.MAINTENANCE_ADD_PREFIX + DELEGATE_GLOBALS_PREFIX + "." + "approvalFromThisAmount";
                putFieldError(errorPath, KFSKeyConstants.ERROR_DOCUMENT_ACCTDELEGATEMAINT_FROM_AMOUNT_NONNEGATIVE);
            }
            else {
                errorPath = DELEGATE_GLOBALS_PREFIX + "[" + lineNum + "]." + "approvalFromThisAmount";
                putFieldError(errorPath, KFSKeyConstants.ERROR_DOCUMENT_ACCTDELEGATEMAINT_FROM_AMOUNT_NONNEGATIVE);
            }
            success &= false;
        }
    }
    return success;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:26,代码来源:DelegateGlobalRule.java

示例4: 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;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:31,代码来源:EffortCertificationDocument.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: validateCapitalAssetAmountAboveThreshhold

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * Validate Capital Asset Amount above the threshold or below the amount for authorized user only.
 *
 * @param document
 * @param assetAmount
 * @param capitalizationThresholdAmount
 * @return
 */
protected boolean validateCapitalAssetAmountAboveThreshhold(MaintenanceDocument document, KualiDecimal assetAmount, String capitalizationThresholdAmount) {
    boolean success = true;
    FinancialSystemMaintenanceDocumentAuthorizerBase documentAuthorizer = (FinancialSystemMaintenanceDocumentAuthorizerBase) SpringContext.getBean(DocumentDictionaryService.class).getDocumentAuthorizer(document);
    boolean isOverrideAuthorized = documentAuthorizer.isAuthorized(document, CamsConstants.CAM_MODULE_CODE, CamsConstants.PermissionNames.OVERRIDE_CAPITALIZATION_LIMIT_AMOUNT, GlobalVariables.getUserSession().getPerson().getPrincipalId());

    if (assetAmount.isLessThan(new KualiDecimal(capitalizationThresholdAmount)) && !isOverrideAuthorized) {
        success = false;
    }
    return success;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:19,代码来源:AssetGlobalRule.java

示例7: convertNegativeSign

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public String convertNegativeSign (KualiDecimal convertTo){
    if (convertTo.isLessThan(KualiDecimal.ZERO)) {
        String converted = convertTo.toString().replace("-", "");
        return "(" + converted + ")";
    }
    return convertTo.toString();
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:8,代码来源:OleFundLookupAction.java

示例8: checkForTotalCopiesGreaterThanQuantity

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public boolean checkForTotalCopiesGreaterThanQuantity(List<OleCopies> copyList, KualiDecimal noOfCopies, 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 (noOfCopies != null && noOfCopiesOrdered != null && noOfCopiesOrdered.isLessThan(noOfCopies.add(new KualiDecimal(copies)))) {
            GlobalVariables.getMessageMap().putError(PurapConstants.ITEM_TAB_ERROR_PROPERTY,
                    OLEConstants.TOTAL_OF_ITEM_COPIES_ITEMCOPIES_GREATERTHAN_ITEMCOPIESORDERED, new String[]{});
            isValid = false;
        }
    }
    return isValid;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:16,代码来源:OleCopyHelperServiceImpl.java

示例9: getInvoicedItemTotal

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public String getInvoicedItemTotal() {
    KualiDecimal total = getInvoicedTotalWithAllItems(false, this.getItems());
    if (this.isItemSign()) {
        if (total.isLessThan(KualiDecimal.ZERO)) {
            total = total;
        }
    }
    return total != null ? total.toString() : "0";
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:10,代码来源:OleInvoiceDocument.java

示例10: totalAmountMatchForCapitalAccountingLinesAndCapitalAssets

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * compares the total amount from capital accounting lines to the
 * capital assets totals amount.
 *
 * @param capitalAccountingLines
 * @param capitalAssets
 * @return true if two amounts are equal else return false
 */
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(KFSConstants.EDIT_ACCOUNTING_LINES_FOR_CAPITALIZATION_ERRORS, KFSKeyConstants.ERROR_DOCUMENT_ACCOUNTING_LINES_NOT_ALL_TOTALS_DISTRIBUTED_TO_CAPITAL_ASSETS);
        return false;
    }

    if (capitalAccountingLinesTotals.isLessThan(capitalAAssetTotals)) {
        //not all the accounting lines amounts have been distributed to capital assets
        GlobalVariables.getMessageMap().putError(KFSConstants.EDIT_ACCOUNTING_LINES_FOR_CAPITALIZATION_ERRORS, KFSKeyConstants.ERROR_DOCUMENT_ACCOUNTING_LINES_MORE_TOTALS_DISTRIBUTED_TO_CAPITAL_ASSETS);
        return false;
    }

    return totalAmountMatched;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:37,代码来源:CapitalAssetBuilderModuleServiceImpl.java

示例11: validate

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
@Override
public boolean validate(AttributedDocumentEvent event) {
    TravelAuthorizationDocument doc = (TravelAuthorizationDocument)event.getDocument();
    List<PerDiemExpense> estimates = doc.getPerDiemExpenses();
    boolean valid = true;
    
    for(int i = 0; i < estimates.size(); i++) {
        PerDiemExpense estimate = estimates.get(i);
        if(estimate.getLodging() != null) {
            KualiDecimal lodging = estimate.getLodging();
            if(lodging.isLessThan(KualiDecimal.ZERO)) {
                GlobalVariables.getMessageMap().putError("document.perDiemExpenses[" + i + "].lodging", KFSKeyConstants.ERROR_NEGATIVE_AMOUNT, "Lodging");
                valid = false;
            }
        }
        
        if(estimate.getMiles() != null) {
            Integer miles = estimate.getMiles();
            if(miles.intValue() < 0) {
                GlobalVariables.getMessageMap().putError("document.perDiemExpenses[" + i + "].miles", KFSKeyConstants.ERROR_NEGATIVE_AMOUNT, "Miles");
                valid = false;
            }
        }
    }
            
    if(doc.getPerDiemAdjustment() != null) {
        KualiDecimal perDiemAdjustment = doc.getPerDiemAdjustment();
        if(perDiemAdjustment.isLessThan(KualiDecimal.ZERO)) {
            GlobalVariables.getMessageMap().putError("document.perDiemAdjustment", KFSKeyConstants.ERROR_NEGATIVE_AMOUNT, "Manual Per Diem Adjustment");
            valid = false;
        }
    }
    
    return valid;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:36,代码来源:TravelAuthEstimateDetailNonNegativeValidation.java

示例12: processPercentPayment

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
 * @see org.kuali.kfs.module.cab.document.service.PurApLineService#processPercentPayment(org.kuali.kfs.module.cab.businessobject.PurchasingAccountsPayableItemAsset)
 */
@Override
public void processPercentPayment(PurchasingAccountsPayableItemAsset itemAsset, List<PurchasingAccountsPayableActionHistory> actionsTakenHistory) {
    KualiDecimal oldQty = itemAsset.getAccountsPayableItemQuantity();
    KualiDecimal newQty = new KualiDecimal(1);
    // update quantity, total cost and unit cost.
    if (oldQty.isLessThan(newQty)) {
        itemAsset.setAccountsPayableItemQuantity(newQty);
        setLineItemCost(itemAsset);
        // add to action history
        addPercentPaymentHistory(actionsTakenHistory, itemAsset, oldQty);
        // update status code
        updateItemStatusAsUserModified(itemAsset);
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:18,代码来源:PurApLineServiceImpl.java

示例13: getAccountingLineAmountToFillIn

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
@Override
protected KualiDecimal getAccountingLineAmountToFillIn(TravelFormBase travelFormBase) {
    TravelAuthorizationForm travelAuthForm = (TravelAuthorizationForm) travelFormBase;
    KualiDecimal amount = new KualiDecimal(0);

    KualiDecimal encTotal = travelAuthForm.getTravelAuthorizationDocument().getEncumbranceTotal();
    KualiDecimal expenseTotal = travelAuthForm.getTravelAuthorizationDocument().getExpenseLimit();

    List<SourceAccountingLine> accountingLines = travelAuthForm.getTravelAuthorizationDocument().getSourceAccountingLines();

    KualiDecimal accountingTotal = new KualiDecimal(0);
    for (SourceAccountingLine accountingLine : accountingLines) {
        accountingTotal = accountingTotal.add(accountingLine.getAmount());
    }

    if (ObjectUtils.isNull(expenseTotal)) {
        amount = encTotal.subtract(accountingTotal);
    }
    else if (expenseTotal.isLessThan(encTotal)) {
        amount = expenseTotal.subtract(accountingTotal);
    }
    else {
        amount = encTotal.subtract(accountingTotal);
    }

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

示例14: update

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
@Override
public void update(Observable arg0, Object arg1) {
    if (!(arg1 instanceof Object[])) {
        return;
    }
    final Object[] args = (Object[]) arg1;
    LOG.debug(args[WRAPPER_ARG_IDX]);
    if (!(args[WRAPPER_ARG_IDX] instanceof TravelMvcWrapperBean)) {
        return;
    }
    final TravelMvcWrapperBean wrapper = (TravelMvcWrapperBean) args[WRAPPER_ARG_IDX];

    final TravelDocument document = wrapper.getTravelDocument();
    final Integer deleteIndex = (Integer) args[SELECTED_LINE_ARG_IDX];
    final Integer deleteDetailIndex = (Integer) args[SELECTED_DETAIL_LINE_ARG_IDX];

    ImportedExpense line = document.getImportedExpenses().get(deleteIndex.intValue());
    document.removeExpenseDetail(line, deleteDetailIndex);

    List<ImportedExpense> importedExpenses = wrapper.getNewImportedExpenseLines();

    KualiDecimal detailTotal = line.getTotalDetailExpenseAmount();

    if (detailTotal.isLessThan(line.getExpenseAmount())){
        KualiDecimal remainderExpense = line.getExpenseAmount().subtract(detailTotal);
        KualiDecimal remainderConverted = line.getConvertedAmount().subtract(new KualiDecimal(detailTotal.bigDecimalValue().multiply(line.getCurrencyRate())));

        wrapper.getNewImportedExpenseLines().get(deleteIndex).setExpenseAmount(remainderExpense);
        wrapper.getNewImportedExpenseLines().get(deleteIndex).setConvertedAmount(remainderConverted);
    }

    wrapper.setDistribution(getAccountingDistributionService().buildDistributionFrom(document));

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

示例15: update

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
@Override
public void update(Observable arg0, Object arg1) {
    if (!(arg1 instanceof Object[])) {
        return;
    }
    final Object[] args = (Object[]) arg1;
    LOG.debug(args[WRAPPER_ARG_IDX]);
    if (!(args[WRAPPER_ARG_IDX] instanceof TravelMvcWrapperBean)) {
        return;
    }
    final TravelMvcWrapperBean wrapper = (TravelMvcWrapperBean) args[WRAPPER_ARG_IDX];

    final TravelDocument document = wrapper.getTravelDocument();
    final Integer deleteIndex = (Integer) args[SELECTED_LINE_ARG_IDX];
    final Integer deleteDetailIndex = (Integer) args[SELECTED_DETAIL_LINE_ARG_IDX];

    ActualExpense line = document.getActualExpenses().get(deleteIndex.intValue());
    document.removeExpenseDetail(line, deleteDetailIndex);

    List<ActualExpense> actualExpenses = wrapper.getNewActualExpenseLines();

    KualiDecimal detailTotal = line.getTotalDetailExpenseAmount();

    if (detailTotal.isLessThan(line.getExpenseAmount())){
        KualiDecimal remainderExpense = line.getExpenseAmount().subtract(detailTotal);
        KualiDecimal remainderConverted = line.getConvertedAmount().subtract(new KualiDecimal(detailTotal.bigDecimalValue().multiply(line.getCurrencyRate())));

        wrapper.getNewActualExpenseLines().get(deleteIndex).setExpenseAmount(remainderExpense);
        wrapper.getNewActualExpenseLines().get(deleteIndex).setConvertedAmount(remainderConverted);
    }

    ExpenseUtils.calculateMileage(document, document.getActualExpenses());
    for (String disabledProperty : document.getDisabledProperties().keySet()) {
        getTravelDocumentService().restorePerDiemProperty(document, disabledProperty);
    }
    wrapper.setDistribution(getAccountingDistributionService().buildDistributionFrom(document));
    document.getDisabledProperties().clear();

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


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