org.kuali.kfs.module.ld.util
Class DebitCreditUtil

java.lang.Object
  extended by org.kuali.kfs.module.ld.util.DebitCreditUtil

public class DebitCreditUtil
extends Object

This class provides a set of utilities that handle the debit credit logic.


Constructor Summary
DebitCreditUtil()
           
 
Method Summary
static String getDebitCreditCode(org.kuali.rice.kns.util.KualiDecimal amount, boolean isReversed)
          Determine the Debit Credit code based on the given amount.
static String getDebitCreditCode(org.kuali.rice.kns.util.KualiDecimal amount, String currentDebitCreditCode, boolean isReversed)
          Determine the Debit Credit code based on the given amount.
static String getDebitCreditCodeForExpenseDocument(ExpenseTransferAccountingLine accountingLine)
          Determines the Debit Credit code for the expense accountine line (Salary Expense and Benefit Expense documents).
static org.kuali.rice.kns.util.KualiDecimal getNumericAmount(org.kuali.rice.kns.util.KualiDecimal amount, String currentDebitCreditCode)
          Determine the actual amount based on Debit Credit code.
static String getReverseDebitCreditCode(String currentDebitCreditCode)
          get the reversed debit credit code of the given code
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DebitCreditUtil

public DebitCreditUtil()
Method Detail

getDebitCreditCode

public static String getDebitCreditCode(org.kuali.rice.kns.util.KualiDecimal amount,
                                        boolean isReversed)
Determine the Debit Credit code based on the given amount. Normally (isReverse flag is set as false), the debit code returns if the amount is positive while the credit code returns if the amount is negative. When isReverse flag is set as true, the credit returns for positive amount and the debit code for negative amount.

Parameters:
amount - the given amount, which can be either negative or positive number.
isReversed - a flag that indicates if normal accounting practice is used. False for normal accoutning practice; true for reverse.
Returns:
the Debit Credit code based on the given transaction amount and the value of isReversed

getDebitCreditCode

public static String getDebitCreditCode(org.kuali.rice.kns.util.KualiDecimal amount,
                                        String currentDebitCreditCode,
                                        boolean isReversed)
Determine the Debit Credit code based on the given amount. Normally (isReverse flag is set as false), the debit code returns if the amount is positive while the credit code returns if the amount is negative. When isReverse flag is set as true, the credit returns for positive amount and the debit code for negative amount.

Parameters:
amount - the given amount, which can be either negative or positive number.
currentDebitCreditCode - the current debit credit code
isReversed - a flag that indicates if normal accounting practice is used. False for normal accoutning practice; true for reverse.
Returns:
the Debit Credit code based on the given transaction amount and the value of isReversed

getDebitCreditCodeForExpenseDocument

public static String getDebitCreditCodeForExpenseDocument(ExpenseTransferAccountingLine accountingLine)
Determines the Debit Credit code for the expense accountine line (Salary Expense and Benefit Expense documents).

Parameters:
accountingLine - - line to determine code for
Returns:
String representing the debit/credit code for the line

getReverseDebitCreditCode

public static String getReverseDebitCreditCode(String currentDebitCreditCode)
get the reversed debit credit code of the given code

Parameters:
currentDebitCreditCode - the current debit credit code
Returns:
the reversed debit credit code of the given code

getNumericAmount

public static org.kuali.rice.kns.util.KualiDecimal getNumericAmount(org.kuali.rice.kns.util.KualiDecimal amount,
                                                                    String currentDebitCreditCode)
Determine the actual amount based on Debit Credit code. If the code is credit code, then change the sign of the given amount; otherwise, do nothing

Parameters:
amount - the given amount, which can be either negative or positive number.
currentDebitCreditCode - the current debit credit code
Returns:
the actual numeric amount of the given amount


Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.