本文整理汇总了Java中org.kuali.rice.core.api.util.type.KualiDecimal.toString方法的典型用法代码示例。如果您正苦于以下问题:Java KualiDecimal.toString方法的具体用法?Java KualiDecimal.toString怎么用?Java KualiDecimal.toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kuali.rice.core.api.util.type.KualiDecimal
的用法示例。
在下文中一共展示了KualiDecimal.toString方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getInvoicedForeignGrandTotal
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public String getInvoicedForeignGrandTotal() {
KualiDecimal total = getInvoicedForeignTotalWithAllItems(true, this.getItems());
/* if (this.isItemSign()) {
if (total.isLessThan(KualiDecimal.ZERO)) {
total = total;
}
} */
for (OleInvoiceItem item : (List<OleInvoiceItem>)this.getItems()) {
if (!item.getItemType().getItemTypeCode().equalsIgnoreCase(PurapConstants.ItemTypeCodes.ITEM_TYPE_ITEM_CODE)
&& item.getAdditionalForeignUnitCost() != null) {
total = total.add(new KualiDecimal(item.getAdditionalForeignUnitCost()));
}
else if (!item.getItemType().getItemTypeCode().equalsIgnoreCase(PurapConstants.ItemTypeCodes.ITEM_TYPE_ITEM_CODE)
&& item.getItemForeignUnitCost() != null) {
total = total.add(item.getItemForeignUnitCost());
}
}
return total != null ? total.toString() : "0";
}
示例2: 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();
}
示例3: 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";
}
示例4: getInvoicedForeignItemTotal
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public String getInvoicedForeignItemTotal() {
KualiDecimal foreignItemTotal = getInvoicedForeignTotalWithAllItems(false, this.getItems());
/* if (this.isItemSign()) {
if (foreignItemTotal.isLessThan(KualiDecimal.ZERO)) {
foreignItemTotal = foreignItemTotal;
}
} */
return foreignItemTotal != null ? foreignItemTotal.toString() : "0";
}
示例5: getInvoicedGrandTotal
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
public String getInvoicedGrandTotal() {
KualiDecimal total = getInvoicedTotalWithAllItems(true, this.getItems());
/* if (this.isItemSign()) {
if (total.isLessThan(KualiDecimal.ZERO)) {
total = total;
}
} */
return total != null ? total.toString() : "0";
}
示例6: validate
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Returns true if the explicit, non-DI credit and debit GLPEs derived from the document's accountingLines 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) {
// generate GLPEs specifically here so that we can compare debits to credits
if (!getGeneralLedgerPendingEntryService().generateGeneralLedgerPendingEntries(getAccountingDocumentForValidation())) {
throw new ValidationException("general ledger GLPE generation failed");
}
// now loop through all of the GLPEs and calculate buckets for debits and credits
KualiDecimal creditAmount = KualiDecimal.ZERO;
KualiDecimal debitAmount = KualiDecimal.ZERO;
for (GeneralLedgerPendingEntry glpe : getAccountingDocumentForValidation().getGeneralLedgerPendingEntries()) {
// make sure we are looking at only the explicit entries that aren't DI types
if (!glpe.isTransactionEntryOffsetIndicator() && !glpe.getFinancialDocumentTypeCode().equals(OLEConstants.FinancialDocumentTypeCodes.DISTRIBUTION_OF_INCOME_AND_EXPENSE)) {
if (GL_CREDIT_CODE.equals(glpe.getTransactionDebitCreditCode())) {
creditAmount = creditAmount.add(glpe.getTransactionLedgerEntryAmount());
}
else { // DEBIT
debitAmount = debitAmount.add(glpe.getTransactionLedgerEntryAmount());
}
}
}
boolean balanced = debitAmount.equals(creditAmount);
if (!balanced) {
String errorParams[] = { creditAmount.toString(), debitAmount.toString() };
GlobalVariables.getMessageMap().putError(ACCOUNTING_LINE_ERRORS, ERROR_DOCUMENT_BALANCE, errorParams);
}
return balanced;
}
开发者ID:VU-libtech,项目名称:OLE-INST,代码行数:34,代码来源:AuxiliaryVoucherGeneralLedgerPendingEntriesBalanceValdiation.java
示例7: 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;
}
示例8: processDebitAndCreditForSourceLine
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* This method checks the debit and credit attributes passed in, figures out which one has a value, and sets the source
* accounting line's amount and debit/credit attribute appropriately. It assumes that if it finds something in the debit field,
* it's a debit entry, otherwise it's a credit entry. If a user enters a value into both fields, it will assume the debit value,
* then when the br eval framework applies the "add" rule, it will bomb out. If first checks to make sure that there isn't a
* value in both the credit and debit columns.
*
* @param sourceLine
* @param debitAmount
* @param creditAmount
* @param index if -1, then its a new line, if not -1 then it's an existing line
* @return boolean True if the processing was successful, false otherwise.
*/
protected boolean processDebitAndCreditForSourceLine(SourceAccountingLine sourceLine, KualiDecimal debitAmount, KualiDecimal creditAmount, int index) {
// check to make sure that the
if (!validateCreditAndDebitAmounts(debitAmount, creditAmount, index)) {
return false;
}
// check to see which amount field has a value - credit or debit field?
// and set the values of the appropriate fields
if (debitAmount != null && debitAmount.isNonZero()) { // a value entered into the debit field? if so it's a debit
// create a new instance w/out reference
KualiDecimal tmpDebitAmount = new KualiDecimal(debitAmount.toString());
sourceLine.setDebitCreditCode(OLEConstants.GL_DEBIT_CODE);
sourceLine.setAmount(tmpDebitAmount);
}
else if (creditAmount != null && creditAmount.isNonZero()) { // assume credit, if both are set the br eval framework will
// catch it
KualiDecimal tmpCreditAmount = new KualiDecimal(creditAmount.toString());
sourceLine.setDebitCreditCode(OLEConstants.GL_CREDIT_CODE);
sourceLine.setAmount(tmpCreditAmount);
}
else { // default to DEBIT, note the br eval framework will still pick it up
sourceLine.setDebitCreditCode(OLEConstants.GL_DEBIT_CODE);
sourceLine.setAmount(KualiDecimal.ZERO);
}
return true;
}
示例9: convertToString
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Converts the value into a string, with the appropriate formatting
*
* @param fieldActualValue actual field value
* @param fieldType field type (i.e. "String", "Integer", "Date")
* @return String object value as a string
*/
public static String convertToString(Object fieldActualValue, String fieldType) {
if (fieldActualValue == null) {
return "";
}
if ("String".equals(fieldType)) {
return (String) fieldActualValue;
}
else if ("Integer".equals(fieldType)) {
Integer i = (Integer) fieldActualValue;
return i.toString();
}
else if ("KualiDecimal".equals(fieldType)) {
KualiDecimal kd = (KualiDecimal) fieldActualValue;
return kd.toString();
}
else if ("BigDecimal".equals(fieldType)) {
BigDecimal bd = (BigDecimal) fieldActualValue;
return bd.toString();
}
else if ("Date".equals(fieldType)) {
Date d = (Date) fieldActualValue;
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
return df.format(d);
}
return "";
}
示例10: validate
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* Returns true if the explicit, non-DI credit and debit GLPEs derived from the document's accountingLines 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) {
// generate GLPEs specifically here so that we can compare debits to credits
if (!getGeneralLedgerPendingEntryService().generateGeneralLedgerPendingEntries(getAccountingDocumentForValidation())) {
throw new ValidationException("general ledger GLPE generation failed");
}
// now loop through all of the GLPEs and calculate buckets for debits and credits
KualiDecimal creditAmount = KualiDecimal.ZERO;
KualiDecimal debitAmount = KualiDecimal.ZERO;
for (GeneralLedgerPendingEntry glpe : getAccountingDocumentForValidation().getGeneralLedgerPendingEntries()) {
// make sure we are looking at only the explicit entries that aren't DI types
if (!glpe.isTransactionEntryOffsetIndicator() && !glpe.getFinancialDocumentTypeCode().equals(KFSConstants.FinancialDocumentTypeCodes.DISTRIBUTION_OF_INCOME_AND_EXPENSE)) {
if (GL_CREDIT_CODE.equals(glpe.getTransactionDebitCreditCode())) {
creditAmount = creditAmount.add(glpe.getTransactionLedgerEntryAmount());
}
else { // DEBIT
debitAmount = debitAmount.add(glpe.getTransactionLedgerEntryAmount());
}
}
}
boolean balanced = debitAmount.equals(creditAmount);
if (!balanced) {
String errorParams[] = { creditAmount.toString(), debitAmount.toString() };
GlobalVariables.getMessageMap().putError(ACCOUNTING_LINE_ERRORS, ERROR_DOCUMENT_BALANCE, errorParams);
}
return balanced;
}
示例11: 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;
}
示例12: processDebitAndCreditForSourceLine
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
/**
* This method checks the debit and credit attributes passed in, figures out which one has a value, and sets the source
* accounting line's amount and debit/credit attribute appropriately. It assumes that if it finds something in the debit field,
* it's a debit entry, otherwise it's a credit entry. If a user enters a value into both fields, it will assume the debit value,
* then when the br eval framework applies the "add" rule, it will bomb out. If first checks to make sure that there isn't a
* value in both the credit and debit columns.
*
* @param sourceLine
* @param debitAmount
* @param creditAmount
* @param index if -1, then its a new line, if not -1 then it's an existing line
* @return boolean True if the processing was successful, false otherwise.
*/
protected boolean processDebitAndCreditForSourceLine(SourceAccountingLine sourceLine, KualiDecimal debitAmount, KualiDecimal creditAmount, int index) {
// check to make sure that the
if (!validateCreditAndDebitAmounts(debitAmount, creditAmount, index)) {
return false;
}
// check to see which amount field has a value - credit or debit field?
// and set the values of the appropriate fields
if (debitAmount != null && debitAmount.isNonZero()) { // a value entered into the debit field? if so it's a debit
// create a new instance w/out reference
KualiDecimal tmpDebitAmount = new KualiDecimal(debitAmount.toString());
sourceLine.setDebitCreditCode(KFSConstants.GL_DEBIT_CODE);
sourceLine.setAmount(tmpDebitAmount);
}
else if (creditAmount != null && creditAmount.isNonZero()) { // assume credit, if both are set the br eval framework will
// catch it
KualiDecimal tmpCreditAmount = new KualiDecimal(creditAmount.toString());
sourceLine.setDebitCreditCode(KFSConstants.GL_CREDIT_CODE);
sourceLine.setAmount(tmpCreditAmount);
}
else { // default to DEBIT, note the br eval framework will still pick it up
sourceLine.setDebitCreditCode(KFSConstants.GL_DEBIT_CODE);
sourceLine.setAmount(KualiDecimal.ZERO);
}
return true;
}
示例13: marshal
import org.kuali.rice.core.api.util.type.KualiDecimal; //导入方法依赖的package包/类
@Override
public String marshal(KualiDecimal decimal) throws Exception {
return decimal == null ? null : decimal.toString();
}