• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java KualiDecimal类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



KualiDecimal类属于org.kuali.rice.core.api.util.type包,在下文中一共展示了KualiDecimal类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAsText

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * This overridden method converts
 * <code>org.kuali.rice.core.api.util.type.KualiPercent</code> objects to the
 * display string.
 *
 * @see java.beans.PropertyEditorSupport#getAsText()
 */
@Override
public String getAsText() {
    Object value = this.getValue();
    // Previously returned N/A
    if (value == null)
        return "";

    String stringValue = "";

    try {
        if (value instanceof KualiDecimal) {

            value = ((KualiDecimal) this.getValue()).bigDecimalValue();
        }
        BigDecimal bigDecValue = (BigDecimal) value;
        bigDecValue = bigDecValue.setScale(PERCENTAGE_SCALE, BigDecimal.ROUND_HALF_UP);
        stringValue = NumberFormat.getInstance().format(bigDecValue.doubleValue());
    } catch (IllegalArgumentException iae) {
        throw new FormatException("formatting", RiceKeyConstants.ERROR_PERCENTAGE, this.getValue().toString(), iae);
    }

    return stringValue +"%";
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:31,代码来源:CustomPercentageEditor.java


示例2: getAsText

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * This overridden method converts
 * <code>org.kuali.rice.core.api.util.type.KualiPercent</code> objects to the
 * display string.
 *
 * @see java.beans.PropertyEditorSupport#getAsText()
 */
@Override
public String getAsText() {
    Object value = this.getValue();
    // Previously returned N/A
    if (value == null)
        return "";

    String stringValue = "";
    try {
        if (value instanceof KualiDecimal) {
            value = ((KualiDecimal) this.getValue()).bigDecimalValue();
        }
        BigDecimal bigDecValue = (BigDecimal) value;
        bigDecValue = bigDecValue.setScale(PERCENTAGE_SCALE, BigDecimal.ROUND_HALF_UP);
        stringValue = NumberFormat.getInstance().format(bigDecValue.doubleValue());
    } catch (IllegalArgumentException iae) {
        throw new FormatException("formatting", RiceKeyConstants.ERROR_PERCENTAGE, this.getValue().toString(), iae);
    }

    return stringValue;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:UifPercentageEditor.java


示例3: columnTypeCompare

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * Compare the string values based on the given sortType, which must match one of the constants
 * in {@link org.kuali.rice.krad.uif.UifConstants.TableToolsValues}.
 * 
 * @param val1 The first string value for comparison
 * @param val2 The second string value for comparison
 * @param sortType the sort type
 * @return 0 if the two elements are considered equal, a positive integer if the element at
 *         index1 is considered greater, else a negative integer
 */
private int columnTypeCompare(String val1, String val2, String sortType) {
    final int result;

    if (isOneNull(val1, val2)) {
        result = compareOneIsNull(val1, val2);
    } else if (UifConstants.TableToolsValues.STRING.equals(sortType)) {
        result = val1.compareTo(val2);
    } else if (UifConstants.TableToolsValues.NUMERIC.equals(sortType)) {
        result = NumericValueComparator.getInstance().compare(val1, val2);
    } else if (UifConstants.TableToolsValues.PERCENT.equals(sortType)) {
        result = NumericValueComparator.getInstance().compare(val1, val2);
    } else if (UifConstants.TableToolsValues.DATE.equals(sortType)) {
        result = TemporalValueComparator.getInstance().compare(val1, val2);
    } else if (UifConstants.TableToolsValues.CURRENCY.equals(sortType)) {
        // strip off non-numeric symbols, convert to KualiDecimals, and compare
        KualiDecimal decimal1 = new KualiDecimal(val1.replaceAll("[^0-9.]", ""));
        KualiDecimal decimal2 = new KualiDecimal(val2.replaceAll("[^0-9.]", ""));

        result = decimal1.compareTo(decimal2);
    } else {
        throw new RuntimeException("unknown sort type: " + sortType);
    }

    return result;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:36,代码来源:MultiColumnComparator.java


示例4: getSortType

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
private String getSortType(Class<?> dataTypeClass) {
    String sortType = UifConstants.TableToolsValues.STRING;
    if (ClassUtils.isAssignable(dataTypeClass, KualiPercent.class)) {
        sortType = UifConstants.TableToolsValues.PERCENT;
    } else if (ClassUtils.isAssignable(dataTypeClass, KualiInteger.class) || ClassUtils.isAssignable(dataTypeClass,
            KualiDecimal.class)) {
        sortType = UifConstants.TableToolsValues.CURRENCY;
    } else if (ClassUtils.isAssignable(dataTypeClass, Timestamp.class)) {
        sortType = "date";
    } else if (ClassUtils.isAssignable(dataTypeClass, java.sql.Date.class) || ClassUtils.isAssignable(dataTypeClass,
            java.util.Date.class)) {
        sortType = UifConstants.TableToolsValues.DATE;
    } else if (ClassUtils.isAssignable(dataTypeClass, Number.class)) {
        sortType = UifConstants.TableToolsValues.NUMERIC;
    }
    return sortType;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:18,代码来源:RichTable.java


示例5: javaToSql

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * Convert percentages to decimals for proper storage.
 * 
 * @see FieldConversion#javaToSql(Object)
 */
public Object javaToSql(Object source) {

    // Convert to BigDecimal using existing conversion.
    source = super.javaToSql(source);

    // Check for null, and verify object type.
    // Do conversion if our type is correct (BigDecimal).
    if (source != null && source instanceof BigDecimal) {
        BigDecimal converted = (BigDecimal) source;
        return converted.divide(oneHundred, 4, KualiDecimal.ROUND_BEHAVIOR);
    }
    else {
        return null;
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:21,代码来源:OjbDecimalPercentageFieldConversion.java


示例6: mapBuilderFromContext

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
EntityEmployment.Builder mapBuilderFromContext(DirContextOperations context) {
    final String departmentCode = context.getStringAttribute(getConstants().getDepartmentLdapProperty());
    
    if (departmentCode == null) {
        return null;
    }

    final EntityEmployment.Builder employee = EntityEmployment.Builder.create();
    employee.setId(context.getStringAttribute(getConstants().getEmployeeIdProperty()));
    employee.setEmployeeStatus(
            CodedAttribute.Builder.create(context.getStringAttribute(getConstants().getEmployeeStatusProperty())));
    //employee.setEmployeeTypeCode(context.getStringAttribute(getConstants().getEmployeeTypeProperty()));
    employee.setEmployeeType(CodedAttribute.Builder.create("P"));
    employee.setBaseSalaryAmount(KualiDecimal.ZERO);
    
    employee.setActive(true);
    return employee;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:19,代码来源:EntityEmploymentMapper.java


示例7: populateEmploymentInfo

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
protected void populateEmploymentInfo( EntityDefault entity ) {
	if(entity!=null){
		EntityEmployment employmentInformation = entity.getEmployment();
		if ( employmentInformation != null ) {
			employeeStatusCode = unNullify( employmentInformation.getEmployeeStatus() != null ? employmentInformation.getEmployeeStatus().getCode() : null);
			employeeTypeCode = unNullify( employmentInformation.getEmployeeType() != null ? employmentInformation.getEmployeeType().getCode() : null);
			primaryDepartmentCode = unNullify( employmentInformation.getPrimaryDepartmentCode() );
			employeeId = unNullify( employmentInformation.getEmployeeId() );
			if ( employmentInformation.getBaseSalaryAmount() != null ) {
				baseSalaryAmount = employmentInformation.getBaseSalaryAmount();
			} else {
				baseSalaryAmount = KualiDecimal.ZERO;
			}
		} else {
			employeeStatusCode = "";
			employeeTypeCode = "";
			primaryDepartmentCode = "";
			employeeId = "";
			baseSalaryAmount = KualiDecimal.ZERO;
		}
	}
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:23,代码来源:PersonImpl.java


示例8: doProcessingAfterPost

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
@Override
protected void doProcessingAfterPost(KualiForm actionForm, HttpServletRequest request) {
	super.doProcessingAfterPost(actionForm, request);
	BookOrderForm form = (BookOrderForm) actionForm;
       BookOrderDocument document = form.getBookOrderDocument();
       for (BookOrder entry : document.getBookOrders()) {
       	if(entry.getBookId() != null){
       	Book book = KNSServiceLocator.getBusinessObjectService().findBySinglePrimaryKey(Book.class, entry.getBookId());
       	entry.setUnitPrice(book.getPrice());
		Double totalPrice = 0.0d;
		if (book.getPrice() != null && entry.getQuantity() != null) {
			totalPrice = book.getPrice().doubleValue() * entry.getQuantity().intValue();
			if (entry.getDiscount() != null && entry.getDiscount().doubleValue() > 0) {
				totalPrice = totalPrice	- (totalPrice * entry.getDiscount().doubleValue() / 100);
			}
		}
		entry.setTotalPrice(new KualiDecimal(totalPrice));
       	entry.setBook(book);
       	}
       }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:22,代码来源:BookOrderAction.java


示例9: format

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * Returns a string representation of its argument, formatted as a percentage value.
 *
 * @return a formatted String
 */
@Override
public Object format(Object value) {
    if (value == null) {
        return "N/A";
    }

    String stringValue = "";
    try {
    	if (value instanceof KualiDecimal) {
    		value = ((KualiDecimal)value).bigDecimalValue();
    	}
        BigDecimal bigDecValue = (BigDecimal) value;
        bigDecValue = bigDecValue.setScale(PERCENTAGE_SCALE, BigDecimal.ROUND_HALF_UP);
        stringValue = NumberFormat.getInstance().format(bigDecValue.doubleValue());
    }
    catch (IllegalArgumentException iae) {
    	// begin Kuali Foundation modification
        throw new FormatException("formatting", RiceKeyConstants.ERROR_PERCENTAGE, value.toString(), iae);
    	// end Kuali Foundation modification
    }

    return stringValue + " percent";
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:29,代码来源:PercentageFormatter.java


示例10: testParseQuantityReqItem

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * Tests whether parseItem returns successfully with valid quantity-driven Requisition item line as input.
 */
public void testParseQuantityReqItem() {
    String itemLine = "3,BX,123,,paper,6";
    try {
        PurApItem item = parser.parseItem(itemLine, itemClass, documentNumber);
        assertEquals(item.getItemQuantity().compareTo(new KualiDecimal(3)), 0);
        assertEquals(item.getItemUnitOfMeasureCode(), "BX");
        assertEquals(item.getItemCatalogNumber(), "123");            
        assertEquals(item.getItemDescription(), "paper");
        assertEquals(item.getItemUnitPrice().compareTo(new BigDecimal(6)), 0);
        assertEquals(item.getItemTypeCode(), PurapConstants.ItemTypeCodes.ITEM_TYPE_ITEM_CODE);
        assertTrue(item instanceof RequisitionItem);
        assertFalse(((RequisitionItem)item).isItemRestrictedIndicator());
    }
    catch(ItemParserException e) {
        fail("Caught ItemParserException with valid quantity-driven requisition item.");
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:21,代码来源:ItemParserTest.java


示例11: adjustPaymentAmounts

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * @see org.kuali.kfs.module.cam.document.service.AssetPaymentService#adjustPaymentAmounts(org.kuali.kfs.module.cam.businessobject.AssetPayment,
 *      boolean, boolean)
 */
public void adjustPaymentAmounts(AssetPayment assetPayment, boolean reverseAmount, boolean nullPeriodDepreciation) throws IllegalAccessException, InvocationTargetException {
    LOG.debug("Starting - adjustAmounts() ");
    PropertyDescriptor[] propertyDescriptors = PropertyUtils.getPropertyDescriptors(AssetPayment.class);
    for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
        Method readMethod = propertyDescriptor.getReadMethod();
        if (readMethod != null && propertyDescriptor.getPropertyType() != null && KualiDecimal.class.isAssignableFrom(propertyDescriptor.getPropertyType())) {
            KualiDecimal amount = (KualiDecimal) readMethod.invoke(assetPayment);
            Method writeMethod = propertyDescriptor.getWriteMethod();
            if (writeMethod != null && amount != null) {
                // Reset periodic depreciation expenses
                if (nullPeriodDepreciation && Pattern.matches(CamsConstants.SET_PERIOD_DEPRECIATION_AMOUNT_REGEX, writeMethod.getName().toLowerCase())) {
                    Object[] nullVal = new Object[] { null };
                    writeMethod.invoke(assetPayment, nullVal);
                }
                else if (reverseAmount) {
                    // reverse the amounts
                    writeMethod.invoke(assetPayment, (amount.negated()));
                }
            }

        }
    }
    LOG.debug("Finished - adjustAmounts()");
}
 
开发者ID:kuali,项目名称:kfs,代码行数:29,代码来源:AssetPaymentServiceImpl.java


示例12: getCashSummary

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * @see org.kuali.module.gl.service.GeneralLedgerPendingEntryService#getCashSummary(java.util.Collection, java.lang.String,
 *      java.lang.String, boolean)
 */
@Override
public KualiDecimal getCashSummary(List universityFiscalYears, String chartOfAccountsCode, String accountNumber, boolean isDebit) {
    LOG.debug("getCashSummary() started");

    Chart c = chartService.getByPrimaryId(chartOfAccountsCode);

    // Note, we are getting the options from the first fiscal year in the list. We are assuming that the
    // balance type code for actual is the same in all the years in the list.
    SystemOptions options = optionsService.getOptions((Integer) universityFiscalYears.get(0));

    // FIXME! - cache this list - will not change during the lifetime of the server
    Collection objectCodes = new ArrayList();
    objectCodes.add(c.getFinancialCashObjectCode());

    // FIXME! - cache this list - balance type code will not change during the lifetime of the server
    Collection balanceTypeCodes = new ArrayList();
    balanceTypeCodes.add(options.getActualFinancialBalanceTypeCd());

    return generalLedgerPendingEntryDao.getTransactionSummary(universityFiscalYears, chartOfAccountsCode, accountNumber, objectCodes, balanceTypeCodes, isDebit);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:25,代码来源:GeneralLedgerPendingEntryServiceImpl.java


示例13: createNewModifyCapitalAsset

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * helper method to add accounting details for this new modify capital asset record
 *
 * @param capitalAccountingLines
 * @param currentCapitalAssetInformation
 * @param documentNumber
 * @param actionType
 * @param nextCapitalAssetLineNumnber
 * @param capitalAssetNumber
 */
protected void createNewModifyCapitalAsset(List<CapitalAccountingLines> capitalAccountingLines, List<CapitalAssetInformation> currentCapitalAssetInformation, String documentNumber, String actionType, Integer nextCapitalAssetLineNumber, long capitalAssetNumber) {
    CapitalAssetInformation capitalAsset = new CapitalAssetInformation();
    capitalAsset.setCapitalAssetNumber(capitalAssetNumber);
    capitalAsset.setCapitalAssetLineAmount(KualiDecimal.ZERO);
    capitalAsset.setDocumentNumber(documentNumber);
    capitalAsset.setCapitalAssetLineNumber(nextCapitalAssetLineNumber);
    capitalAsset.setCapitalAssetActionIndicator(actionType);
    capitalAsset.setCapitalAssetProcessedIndicator(false);

    //now setup the account line information associated with this capital asset
    for (CapitalAccountingLines capitalAccountingLine : capitalAccountingLines) {
        capitalAsset.setDistributionAmountCode(capitalAccountingLine.getDistributionAmountCode());
        createCapitalAssetAccountingLinesDetails(capitalAccountingLine, capitalAsset);
    }

    currentCapitalAssetInformation.add(capitalAsset);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:28,代码来源:CapitalAssetInformationActionBase.java


示例14: populateReportDetails

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * This method populates CustomerOpenItemReportDetails for CustomerCreditMemoDocuments and WriteOffDocuments <=> all documents
 * but CustomerInvoiceDocument and PaymentApplicationDocument (Customer History Report).
 *
 * @param finSysDocHeaderIds <=> documentNumbers of FinancialSystemDocumentHeaders
 * @param results <=> CustomerOpenItemReportDetails to display in the report
 * @param details <=> <key = documentNumber, value = customerOpenItemReportDetail>
 */
public void populateReportDetails(List<String> finSysDocHeaderIds, List results, Hashtable details) {
    Collection<FinancialSystemDocumentHeader> financialSystemDocHeaders = new ArrayList<FinancialSystemDocumentHeader>();
    for (String documentNumber : finSysDocHeaderIds) {
        FinancialSystemDocumentHeader header = businessObjectService.findBySinglePrimaryKey(FinancialSystemDocumentHeader.class, documentNumber);
        if ( header != null ) {
            financialSystemDocHeaders.add( header );
        }
    }

    for ( FinancialSystemDocumentHeader fsDocumentHeader : financialSystemDocHeaders ) {
        CustomerOpenItemReportDetail detail = (CustomerOpenItemReportDetail) details.get(fsDocumentHeader.getDocumentNumber());

        // populate Document Description
        detail.setDocumentDescription(StringUtils.trimToEmpty(fsDocumentHeader.getDocumentDescription()));

        // populate Document Payment Amount
        detail.setDocumentPaymentAmount(fsDocumentHeader.getFinancialDocumentTotalAmount().negated());

        // Unpaid/Unapplied Amount
        detail.setUnpaidUnappliedAmount(KualiDecimal.ZERO);

        results.add(detail);
    }
}
 
开发者ID:kuali,项目名称:kfs,代码行数:33,代码来源:CustomerOpenItemReportServiceImpl.java


示例15: findNominalActivityBalancesForFiscalYear

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * Finds all of the balances for the fiscal year that should be processed by nominal activity closing
 *
 * @param year the university fiscal year of balances to find
 * @return an Iterator of Balances to process
 * @see org.kuali.kfs.gl.dataaccess.BalanceDao#findNominalActivityBalancesForFiscalYear(Integer, List, SystemOptions)
 */
@Override
public Iterator<Balance> findNominalActivityBalancesForFiscalYear(Integer year, Collection<String> nominalActivityObjectTypeCodes, SystemOptions currentYearOptions) {
    LOG.debug("findNominalActivityBalancesForFiscalYear() started");

    Criteria c = new Criteria();
    c.addEqualTo(KFSPropertyConstants.UNIVERSITY_FISCAL_YEAR, year);
    c.addEqualTo(KFSPropertyConstants.BALANCE_TYPE_CODE, currentYearOptions.getActualFinancialBalanceTypeCd());
    c.addIn(KFSPropertyConstants.OBJECT_TYPE_CODE, nominalActivityObjectTypeCodes);
    c.addNotEqualTo("accountLineAnnualBalanceAmount", KualiDecimal.ZERO);

    QueryByCriteria query = QueryFactory.newQuery(Balance.class, c);
    query.addOrderByAscending(KFSPropertyConstants.CHART_OF_ACCOUNTS_CODE);
    query.addOrderByAscending(KFSPropertyConstants.ACCOUNT_NUMBER);
    query.addOrderByAscending(KFSPropertyConstants.SUB_ACCOUNT_NUMBER);
    query.addOrderByAscending(KFSPropertyConstants.OBJECT_CODE);
    query.addOrderByAscending(KFSPropertyConstants.SUB_OBJECT_CODE);
    query.addOrderByAscending(KFSPropertyConstants.BALANCE_TYPE_CODE);
    query.addOrderByAscending(KFSPropertyConstants.OBJECT_TYPE_CODE);

    return getPersistenceBrokerTemplate().getIteratorByQuery(query);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:29,代码来源:BalanceDaoOjb.java


示例16: testCreateAssetPaymentDocument_FPData

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
public void testCreateAssetPaymentDocument_FPData() throws Exception {
    CapitalAssetInformation assetInformation = new CapitalAssetInformation();
    assetInformation.getCapitalAssetAccountsGroupDetails().add(createNewCapitalAssetAcountsGroupDetails());
    assetInformation.setDocumentNumber("1001");
    assetInformation.setCapitalAssetNumber(1594L);
    assetInformation.setCapitalAssetLineAmount(new KualiDecimal(5200.50));
    assetInformation.setCapitalAssetLineNumber(1);
    assetInformation.setCapitalAssetActionIndicator("C");
    businessObjectService.save(assetInformation);

    AssetPaymentDocument document = (AssetPaymentDocument) glLineService.createAssetPaymentDocument(primary, 1);
    assertNotNull(document);

    // assert here
    List<AssetPaymentDetail> assetPaymentDetails = document.getSourceAccountingLines();
    assertEquals(1, assetPaymentDetails.size());

    assertAssetPaymentDetail(document, assetPaymentDetails.get(0), "1031400", new KualiDecimal(5200.50), Integer.valueOf(1));
}
 
开发者ID:kuali,项目名称:kfs,代码行数:20,代码来源:GlLineServiceTest.java


示例17: createEntry

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
private PurApAccountingLineBase createEntry(Integer i, String chartCode, String acctNum, String subAcctNum, String objCd, String subObjCd, String fiscalPrd, String docNum, String refDocNum, KualiDecimal amount, Class<? extends PurApAccountingLineBase> clazz) {
    PurApAccountingLineBase entry = null;
    try {
        entry = (PurApAccountingLineBase) clazz.newInstance();
    }
    catch (Exception e) {
        fail(e.toString());
    }
    entry.setPostingYear(i);
    entry.setChartOfAccountsCode(chartCode);
    entry.setAccountNumber(acctNum);
    entry.setSubAccountNumber(subAcctNum);
    entry.setFinancialObjectCode(objCd);
    entry.setFinancialSubObjectCode(subObjCd);
    entry.setPostingPeriodCode(fiscalPrd);
    entry.setDocumentNumber(docNum);
    entry.setAmount(amount);
    return entry;
}
 
开发者ID:kuali,项目名称:kfs,代码行数:20,代码来源:AccountLineGroupTest.java


示例18: performSanityChecks

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
/**
 * Performs basic checking to ensure that values are set up so that reconciliation can proceed
 * 
 * @param columns the columns generated by the {@link org.kuali.ole.gl.batch.service.ReconciliationParserService}
 * @param javaAttributeNames the java attribute names corresponding to each field in columns. (see
 *        {@link #resolveJavaAttributeNames(List)})
 * @param columnSums a list of KualiDecimals used to store column sums as reconciliation iterates through the origin entries
 * @param errorMessages a list to which error messages will be appended.
 * @return true if there are no problems, false otherwise
 */
protected boolean performSanityChecks(List<ColumnReconciliation> columns, List<JavaAttributeAugmentedColumnReconciliation> javaAttributeNames, KualiDecimal[] columnSums, List<Message> errorMessages) {
    boolean success = true;

    if (javaAttributeNames.size() != columnSums.length || javaAttributeNames.size() != columns.size()) {
        // sanity check
        errorMessages.add(new Message("Reconciliation error: Sizes of lists do not match", Message.TYPE_FATAL));
        success = false;
    }
    for (int i = 0; i < columns.size(); i++) {
        if (columns.get(i).getTokenizedFieldNames().length != javaAttributeNames.get(i).size()) {
            errorMessages.add(new Message("Reconciliation error: Error tokenizing column elements.  The number of database fields and java fields do not match.", Message.TYPE_FATAL));
            success = false;
        }
        for (int fieldIdx = 0; fieldIdx < javaAttributeNames.get(i).size(); i++) {
            if (StringUtils.isBlank(javaAttributeNames.get(i).getJavaAttributeName(fieldIdx))) {
                errorMessages.add(new Message("Reconciliation error: javaAttributeName is blank for DB column: " + columns.get(i).getTokenizedFieldNames()[fieldIdx], Message.TYPE_FATAL));
                success = false;
            }
        }
    }
    return success;
}
 
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:33,代码来源:ReconciliationServiceImpl.java


示例19: getBudgetAdjustmentIncreaseForObject

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
public KualiDecimal getBudgetAdjustmentIncreaseForObject(String chartCode, String accountNo,
                                                         String objectCode) {
    Map searchMap = new HashMap();
    searchMap.put("chartOfAccountsCode", chartCode);
    searchMap.put("accountNumber", accountNo);
    searchMap.put("financialObjectCode", objectCode);
    searchMap.put("financialDocumentTypeCode", OLEConstants.DOC_TYP_CD);
    searchMap.put("financialBalanceTypeCode", OLEConstants.BAL_TYP_CD);
    searchMap.put("financialDocumentApprovedCode", OLEConstants.FDOC_APPR_CD);
    List<GeneralLedgerPendingEntry> generalLedgerPendingEntryList = (List<GeneralLedgerPendingEntry>) SpringContext.getBean(
            BusinessObjectService.class).findMatching(GeneralLedgerPendingEntry.class, searchMap);
    KualiDecimal budgetIncrease = KualiDecimal.ZERO;
    if (generalLedgerPendingEntryList.size() > 0) {
        for (GeneralLedgerPendingEntry entry : generalLedgerPendingEntryList) {
            if (entry.getTransactionLedgerEntryAmount().isGreaterThan(KualiDecimal.ZERO)) {
                budgetIncrease = budgetIncrease.add(entry.getTransactionLedgerEntryAmount());
            }
        }
    }

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


示例20: addNewBCSF

import org.kuali.rice.core.api.util.type.KualiDecimal; //导入依赖的package包/类
public void addNewBCSF(BudgetConstructionCalculatedSalaryFoundationTracker bCSF, KualiDecimal amountFromCSFToSet) {
    // lop off the pennies--go down to the nearest whole dollar 
    KualiInteger wholeDollarsCSFAmount = new KualiInteger(amountFromCSFToSet, RoundingMode.FLOOR);
    // store the whole dollar amount in the budget construction CSF object
    bCSF.setCsfAmount(wholeDollarsCSFAmount);
    // find the pennies that were shaved off
    KualiDecimal penniesFromCSFAmount = amountFromCSFToSet;
    // BigDecimal values are immutable.  So, we have to reset the pointer  after the subtract
    penniesFromCSFAmount = penniesFromCSFAmount.subtract(wholeDollarsCSFAmount.kualiDecimalValue());
    //  just round negative amounts and return.
    //  this is only a safety measure.  negative salaries are illegal in budget construction. 
    if (wholeDollarsCSFAmount.isNegative()) {
        return;
    }
    // save the difference. (KualiDecimal values are immutable, so we need to redirect the diffAmount pointer to a new one.)
    diffAmount = diffAmount.add(penniesFromCSFAmount);
    // store the budget construction CSF row with the truncated amount for possible adjustment later
    candidateBCSFRows.add(bCSF);
}
 
开发者ID:kuali,项目名称:kfs,代码行数:20,代码来源:GenesisDaoOjb.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java JobEntryTableExists类代码示例发布时间:2022-05-22
下一篇:
Java Files类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap