本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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";
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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));
}
示例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();
}