org.kuali.kfs.sys.document.service
Interface DebitDeterminerService

All Known Implementing Classes:
DebitDeterminerServiceImpl

public interface DebitDeterminerService

A collection of methods that help accounting docs determine whether an accounting line represents a debit or not


Method Summary
 void disallowErrorCorrectionDocumentCheck(GeneralLedgerPendingEntrySource poster)
          throws an IllegalStateException if the document is an error correction.
 String getDebitCalculationIllegalStateExceptionMessage()
          Gets the isDebitCalculationIllegalStateExceptionMessage attribute.
 String getErrorCorrectionIllegalStateExceptionMessage()
          Gets the isErrorCorrectionIllegalStateExceptionMessage attribute.
 String getInvalidLineTypeIllegalArgumentExceptionMessage()
          Gets the isInvalidLineTypeIllegalArgumentExceptionMessage attribute.
 boolean isAsset(GeneralLedgerPendingEntrySourceDetail postable)
          Determines whether an accounting line is an asset line.
 boolean isAssetTypeCode(String objectTypeCode)
          Determines whether the objectTypeCode is an asset.
 boolean isDebitCode(String debitCreditCode)
           
 boolean isDebitConsideringNothingPositiveOnly(GeneralLedgerPendingEntrySource poster, GeneralLedgerPendingEntrySourceDetail postable)
           object type is not included in determining if a line is debit or credit.
 boolean isDebitConsideringSection(AccountingDocument accountingDocument, AccountingLine accountingLine)
           accounting line section (source/target) type is included in determining if a line is debit or credit.
 boolean isDebitConsideringSectionAndTypePositiveOnly(AccountingDocument accountingDocument, AccountingLine accountingLine)
           accounting line section (source/target) and object type is included in determining if a line is debit or credit.
 boolean isDebitConsideringType(GeneralLedgerPendingEntrySource poster, GeneralLedgerPendingEntrySourceDetail postable)
           object type is included in determining if a line is debit or credit.
 boolean isErrorCorrection(GeneralLedgerPendingEntrySource poster)
          Convience method for determine if a document is an error correction document.
 boolean isExpense(GeneralLedgerPendingEntrySourceDetail postable)
          Check object code type to determine whether the accounting line is expense.
 boolean isExpenseOrAsset(GeneralLedgerPendingEntrySourceDetail postable)
          Determines whether an accounting line is an expense or asset.
 boolean isIncome(GeneralLedgerPendingEntrySourceDetail postable)
          Determines whether an accounting line is an income line or not.
 boolean isIncomeOrLiability(GeneralLedgerPendingEntrySourceDetail postable)
          Determines whether an accounting line is an income or liability line.
 boolean isLiability(GeneralLedgerPendingEntrySourceDetail postable)
          Determines whether an accounting line is a liability line.
 boolean isLiabilityTypeCode(String objectTypeCode)
          Determines whether the objectTypeCode is a liability.
 boolean isRevenue(GeneralLedgerPendingEntrySourceDetail postable)
          Check object code type to determine whether the accounting line is revenue.
 

Method Detail

isDebitCode

boolean isDebitCode(String debitCreditCode)
Parameters:
debitCreditCode -
Returns:
true if debitCreditCode equals the the debit constant

isDebitConsideringType

boolean isDebitConsideringType(GeneralLedgerPendingEntrySource poster,
                               GeneralLedgerPendingEntrySourceDetail postable)
  1. object type is included in determining if a line is debit or credit.
the following are credits (return false)
  1. (isIncome || isLiability) && (lineAmount > 0)
  2. (isExpense || isAsset) && (lineAmount < 0)
the following are debits (return true)
  1. (isIncome || isLiability) && (lineAmount < 0)
  2. (isExpense || isAsset) && (lineAmount > 0)
the following are invalid ( throws an IllegalStateException)
  1. document isErrorCorrection
  2. lineAmount == 0
  3. ! (isIncome || isLiability || isExpense || isAsset)

Parameters:
rule -
accountingDocument -
accountingLine -
Returns:
boolean

isDebitConsideringNothingPositiveOnly

boolean isDebitConsideringNothingPositiveOnly(GeneralLedgerPendingEntrySource poster,
                                              GeneralLedgerPendingEntrySourceDetail postable)
  1. object type is not included in determining if a line is debit or credit.
  2. accounting line section (source/target) is not included in determining if a line is debit or credit.
the following are credits (return false)
  1. none
the following are debits (return true)
  1. (isIncome || isLiability || isExpense || isAsset) && (lineAmount > 0)
the following are invalid ( throws an IllegalStateException)
  1. lineAmount <= 0
  2. ! (isIncome || isLiability || isExpense || isAsset)

Parameters:
rule -
accountingDocument -
accountingLine -
Returns:
boolean

isDebitConsideringSection

boolean isDebitConsideringSection(AccountingDocument accountingDocument,
                                  AccountingLine accountingLine)
  1. accounting line section (source/target) type is included in determining if a line is debit or credit.
  2. zero line amounts are never allowed
the following are credits (return false)
  1. isSourceLine && (isIncome || isExpense || isAsset || isLiability) && (lineAmount > 0)
  2. isTargetLine && (isIncome || isExpense || isAsset || isLiability) && (lineAmount < 0)
the following are debits (return true)
  1. isSourceLine && (isIncome || isExpense || isAsset || isLiability) && (lineAmount < 0)
  2. isTargetLine && (isIncome || isExpense || isAsset || isLiability) && (lineAmount > 0)
the following are invalid ( throws an IllegalStateException)
  1. lineAmount == 0
  2. ! (isIncome || isLiability || isExpense || isAsset)

Parameters:
rule -
accountingDocument -
accountingLine -
Returns:
boolean

isDebitConsideringSectionAndTypePositiveOnly

boolean isDebitConsideringSectionAndTypePositiveOnly(AccountingDocument accountingDocument,
                                                     AccountingLine accountingLine)
  1. accounting line section (source/target) and object type is included in determining if a line is debit or credit.
  2. negative line amounts are Only allowed during error correction
the following are credits (return false)
  1. isSourceLine && (isExpense || isAsset) && (lineAmount > 0)
  2. isTargetLine && (isIncome || isLiability) && (lineAmount > 0)
  3. isErrorCorrection && isSourceLine && (isIncome || isLiability) && (lineAmount < 0)
  4. isErrorCorrection && isTargetLine && (isExpense || isAsset) && (lineAmount < 0)
the following are debits (return true)
  1. isSourceLine && (isIncome || isLiability) && (lineAmount > 0)
  2. isTargetLine && (isExpense || isAsset) && (lineAmount > 0)
  3. isErrorCorrection && (isExpense || isAsset) && (lineAmount < 0)
  4. isErrorCorrection && (isIncome || isLiability) && (lineAmount < 0)
the following are invalid ( throws an IllegalStateException)
  1. !isErrorCorrection && !(lineAmount > 0)

Parameters:
rule -
accountingDocument -
accountingLine -
Returns:
boolean

disallowErrorCorrectionDocumentCheck

void disallowErrorCorrectionDocumentCheck(GeneralLedgerPendingEntrySource poster)
throws an IllegalStateException if the document is an error correction. otherwise does nothing

Parameters:
rule -
accountingDocument -

isErrorCorrection

boolean isErrorCorrection(GeneralLedgerPendingEntrySource poster)
Convience method for determine if a document is an error correction document.

Parameters:
accountingDocument -
Returns:
true if document is an error correct

isAsset

boolean isAsset(GeneralLedgerPendingEntrySourceDetail postable)
Determines whether an accounting line is an asset line.

Parameters:
accountingLine -
Returns:
boolean True if a line is an asset line.

isLiability

boolean isLiability(GeneralLedgerPendingEntrySourceDetail postable)
Determines whether an accounting line is a liability line.

Parameters:
accountingLine -
Returns:
boolean True if the line is a liability line.

isIncome

boolean isIncome(GeneralLedgerPendingEntrySourceDetail postable)
Determines whether an accounting line is an income line or not. This goes agains the configurable object type code list in the ApplicationParameter mechanism. This list can be configured externally.

Parameters:
accountingLine -
Returns:
boolean True if the line is an income line.

isExpense

boolean isExpense(GeneralLedgerPendingEntrySourceDetail postable)
Check object code type to determine whether the accounting line is expense.

Parameters:
accountingLine -
Returns:
boolean True if the line is an expense line.

isExpenseOrAsset

boolean isExpenseOrAsset(GeneralLedgerPendingEntrySourceDetail postable)
Determines whether an accounting line is an expense or asset.

Parameters:
line -
Returns:
boolean True if it's an expense or asset.

isIncomeOrLiability

boolean isIncomeOrLiability(GeneralLedgerPendingEntrySourceDetail postable)
Determines whether an accounting line is an income or liability line.

Parameters:
line -
Returns:
boolean True if the line is an income or liability line.

isRevenue

boolean isRevenue(GeneralLedgerPendingEntrySourceDetail postable)
Check object code type to determine whether the accounting line is revenue.

Parameters:
line -
Returns:
boolean True if the line is a revenue line.

isAssetTypeCode

boolean isAssetTypeCode(String objectTypeCode)
Determines whether the objectTypeCode is an asset.

Parameters:
objectTypeCode -
Returns:
Is she asset or something completely different?

isLiabilityTypeCode

boolean isLiabilityTypeCode(String objectTypeCode)
Determines whether the objectTypeCode is a liability.

Parameters:
objectTypeCode -
Returns:
Is she liability or something completely different?

getDebitCalculationIllegalStateExceptionMessage

String getDebitCalculationIllegalStateExceptionMessage()
Gets the isDebitCalculationIllegalStateExceptionMessage attribute.

Returns:
Returns the isDebitCalculationIllegalStateExceptionMessage.

getErrorCorrectionIllegalStateExceptionMessage

String getErrorCorrectionIllegalStateExceptionMessage()
Gets the isErrorCorrectionIllegalStateExceptionMessage attribute.

Returns:
Returns the isErrorCorrectionIllegalStateExceptionMessage.

getInvalidLineTypeIllegalArgumentExceptionMessage

String getInvalidLineTypeIllegalArgumentExceptionMessage()
Gets the isInvalidLineTypeIllegalArgumentExceptionMessage attribute.

Returns:
Returns the isInvalidLineTypeIllegalArgumentExceptionMessage.


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