org.kuali.kfs.fp.document.validation.impl
Class CashManagementDocumentRule

java.lang.Object
  extended by org.kuali.rice.kns.rules.DocumentRuleBase
      extended by org.kuali.kfs.sys.document.validation.impl.LedgerPostingDocumentRuleBase
          extended by org.kuali.kfs.sys.document.validation.impl.GeneralLedgerPostingDocumentRuleBase
              extended by org.kuali.kfs.fp.document.validation.impl.CashManagementDocumentRule
All Implemented Interfaces:
CashManagingRule, org.kuali.rice.kns.rule.AddAdHocRoutePersonRule, org.kuali.rice.kns.rule.AddAdHocRouteWorkgroupRule, org.kuali.rice.kns.rule.AddNoteRule, org.kuali.rice.kns.rule.ApproveDocumentRule, org.kuali.rice.kns.rule.BusinessRule, org.kuali.rice.kns.rule.RouteDocumentRule, org.kuali.rice.kns.rule.SaveDocumentRule, org.kuali.rice.kns.rule.SendAdHocRequestsRule

public class CashManagementDocumentRule
extends GeneralLedgerPostingDocumentRuleBase
implements CashManagingRule

Business rule(s) applicable to Cash Management Document.


Constructor Summary
CashManagementDocumentRule()
           
 
Method Summary
protected  org.kuali.rice.kns.util.KualiDecimal calculateTotalCashDrawerReserves(CashDrawer cashDrawer, CashieringTransaction trans)
          This method calculates the total cash drawer reserves amount
 boolean checkAllPaidBackItemsInProcess(CashieringTransaction trans)
          This method returns true if all open items in process amounts do not exceed the total for each specific item's amount total
 boolean checkEnoughCashForMoneyOut(CashDrawer cashDrawer, CashieringTransaction trans)
          This method returns true if none of the coin (1 cent, 5 cents, etc) and cash increments (1 dollar, 2 dollars, 5 dollars etc.
 boolean checkItemInProcessIsNotPayingOffItemInProcess(CashieringTransaction trans)
          This method returns true if a new item in process is populated and none of the open item in process' amounts are greater than zero.
 boolean checkMoneyInMoneyOutBalance(CashieringTransaction trans)
          Returns true if money-in and money-out are in balance with each other
 boolean checkMoneyInNoNegatives(CashieringTransaction trans)
          Returns true if none of the entered money-in amounts (cash and coin) are not negative in a cashiering transaction
 boolean checkMoneyOutNoNegatives(CashieringTransaction trans)
          Returns true if none of the entered money-out amounts (cash and coin) are not negative in a cashiering transaction
 boolean checkNewItemInProcessDoesNotExceedCashDrawer(CashDrawer cashDrawer, CashieringTransaction trans)
          This method returns true if the new item in process does not exceed the current amount in the cash drawer reserves
 boolean checkNewItemInProcessInPast(CashieringTransaction trans)
          This method returns true if the current date is after all new items in process' open dates
 boolean checkPaidBackItemInProcessDoesNotExceedTotal(CashieringItemInProcess itemInProc, int cashieringItemNumber)
          This method returns true if the current payment amount for the cashiering item in process does not exceed the actual item amount for the item in process
 boolean checkTransactionCheckTotalDoesNotExceedCashDrawer(CashDrawer cashDrawer, CashieringTransaction trans)
          This method returns true if check total from transaction does not exceed the current amount in the cash drawer reserves
protected  int convertDateToDayYear(Date d)
          This method returns the current day of year as an int for a specific date.
protected  boolean performDataDictionaryValidation(Deposit deposit)
          Performs complete, recursive dataDictionary-driven validation of the given Deposit.
 boolean processCashieringTransactionApplication(CashDrawer cashDrawer, CashieringTransaction cashieringTransaction)
          Processes the checks to validate that the application of the given cashiering transaction will be valid
protected  boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.Document document)
          Overrides to validate that all cash receipts are deposited when routing cash management document.
protected  boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.Document document)
          Overrides to validate that the person saving the document is the initiator, validates that the cash drawer is open for initial creation, validates that the cash drawer for the specific verification unit is closed for subsequent saves, and validates that the associate cash receipts are still verified.
protected  boolean validateDeposit(Deposit deposit, boolean documentIsInitiated)
          If documentIsInitiated, performs complete dataDictionary-driven validation of the given Deposit.
protected  boolean validateDeposits(CashManagementDocument cmd)
          Validates all Deposits associated with the given CashManagementDocument
protected  boolean verifyAllVerifiedCashReceiptsDeposited(CashManagementDocument cmDoc)
          Verifies that all verified cash receipts have been deposited
protected  void verifyCashDrawerForVerificationUnitIsOpenForPostInitiationSaves(CashManagementDocument cmd)
          This method checks to make sure that the cash drawer is closed for the associated verification unit, for post initiation saves for CashManagementDocuments which don't have Final
protected  void verifyCashReceipts(Deposit deposit, boolean documentIsInitiated)
          Verifies that all CashReceipts associated with the given document are of an appropriate status for the given CashManagementDocument state
protected  void verifyUserIsDocumentInitiator(CashManagementDocument cmd)
          This method checks to make sure that the current system user is the person that initiated this document in the first place.
 
Methods inherited from class org.kuali.rice.kns.rules.DocumentRuleBase
getDataDictionaryService, getDictionaryValidationService, getDocumentHelperService, getIdentityManagementService, getKualiConfigurationService, getMaxDictionaryValidationDepth, getPersonService, getWorkflowInfoService, isAddHocRoutePersonValid, isAddHocRouteWorkgroupValid, isAdHocRouteRecipientsValid, isDocumentAttributesValid, isDocumentOverviewValid, isNoteValid, processAddAdHocRoutePerson, processAddAdHocRouteWorkgroup, processAddNote, processApproveDocument, processCustomAddAdHocRoutePersonBusinessRules, processCustomAddAdHocRouteWorkgroupBusinessRules, processCustomAddNoteBusinessRules, processCustomApproveDocumentBusinessRules, processCustomSendAdHocRequests, processRouteDocument, processSaveDocument, processSendAdHocRequests, setMaxDictionaryValidationDepth, validateSensitiveDataValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CashManagementDocumentRule

public CashManagementDocumentRule()
Method Detail

processCustomSaveDocumentBusinessRules

protected boolean processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.Document document)
Overrides to validate that the person saving the document is the initiator, validates that the cash drawer is open for initial creation, validates that the cash drawer for the specific verification unit is closed for subsequent saves, and validates that the associate cash receipts are still verified.

Overrides:
processCustomSaveDocumentBusinessRules in class org.kuali.rice.kns.rules.DocumentRuleBase
Parameters:
document - submitted cash management document
Returns:
true if there are no issues processing rules associated with saving a cash management document
See Also:
org.kuali.rice.kns.rule.DocumentRuleBase#processCustomSaveDocumentBusinessRules(org.kuali.rice.kns.document.Document)

processCustomRouteDocumentBusinessRules

protected boolean processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.Document document)
Overrides to validate that all cash receipts are deposited when routing cash management document.

Overrides:
processCustomRouteDocumentBusinessRules in class org.kuali.rice.kns.rules.DocumentRuleBase
Parameters:
document - submitted cash management document
Returns:
true if there are no issues processing rules associated with routing a cash management document
See Also:
DocumentRuleBase.processCustomRouteDocumentBusinessRules(org.kuali.rice.kns.document.Document)

verifyUserIsDocumentInitiator

protected void verifyUserIsDocumentInitiator(CashManagementDocument cmd)
This method checks to make sure that the current system user is the person that initiated this document in the first place.

Parameters:
cmd - submitted cash management document

verifyCashDrawerForVerificationUnitIsOpenForPostInitiationSaves

protected void verifyCashDrawerForVerificationUnitIsOpenForPostInitiationSaves(CashManagementDocument cmd)
This method checks to make sure that the cash drawer is closed for the associated verification unit, for post initiation saves for CashManagementDocuments which don't have Final

Parameters:
cmd - submitted cash management document

validateDeposits

protected boolean validateDeposits(CashManagementDocument cmd)
Validates all Deposits associated with the given CashManagementDocument

Parameters:
cmd - submitted cash management document
Returns:
true if all deposits in a cash management are valid

validateDeposit

protected boolean validateDeposit(Deposit deposit,
                                  boolean documentIsInitiated)
If documentIsInitiated, performs complete dataDictionary-driven validation of the given Deposit. Unconditionally validates the CashReceipts associated with the given Deposit.

Parameters:
deposit - individual deposit from cash management document
documentIsInitiated - if document is initiated
Returns:
true if deposit is valid

verifyCashReceipts

protected void verifyCashReceipts(Deposit deposit,
                                  boolean documentIsInitiated)
Verifies that all CashReceipts associated with the given document are of an appropriate status for the given CashManagementDocument state

Parameters:
deposit - deposit from cash management document
documentIsInitiated - if document is initiated

verifyAllVerifiedCashReceiptsDeposited

protected boolean verifyAllVerifiedCashReceiptsDeposited(CashManagementDocument cmDoc)
Verifies that all verified cash receipts have been deposited

Parameters:
cmDoc - the cash management document that is about to be routed
Returns:
true if there are no outstanding verified cash receipts that are not part of a deposit, false if otherwise

performDataDictionaryValidation

protected boolean performDataDictionaryValidation(Deposit deposit)
Performs complete, recursive dataDictionary-driven validation of the given Deposit.

Parameters:
deposit - deposit from cash management document
Returns:
true if deposit is validated against data dictionary entry

processCashieringTransactionApplication

public boolean processCashieringTransactionApplication(CashDrawer cashDrawer,
                                                       CashieringTransaction cashieringTransaction)
Processes the checks to validate that the application of the given cashiering transaction will be valid

Specified by:
processCashieringTransactionApplication in interface CashManagingRule
Parameters:
cashDrawer - the cash drawer the transaction will be applied to
cashieringTransaction - the cashering transaction which may be applied
Returns:
true if the transaction would be valid, false otherwise
See Also:
org.kuali.kfs.fp.document.validation.CashManagingRule#processCashieringTransactionApplication(org.kuali.kfs.fp.businessobject.CashieringTransaction)

checkMoneyInNoNegatives

public boolean checkMoneyInNoNegatives(CashieringTransaction trans)
Returns true if none of the entered money-in amounts (cash and coin) are not negative in a cashiering transaction

Parameters:
trans - represents cashiering transaction from document
Returns:
true if none of the amounts are negative

checkMoneyOutNoNegatives

public boolean checkMoneyOutNoNegatives(CashieringTransaction trans)
Returns true if none of the entered money-out amounts (cash and coin) are not negative in a cashiering transaction

Parameters:
trans - represents cashiering transaction from document
Returns:
true if none of the amounts are negative

checkMoneyInMoneyOutBalance

public boolean checkMoneyInMoneyOutBalance(CashieringTransaction trans)
Returns true if money-in and money-out are in balance with each other

Parameters:
trans - represents cashiering transaction from cash management document
Returns:
true if money-in and money-out are balanced

checkEnoughCashForMoneyOut

public boolean checkEnoughCashForMoneyOut(CashDrawer cashDrawer,
                                          CashieringTransaction trans)
This method returns true if none of the coin (1 cent, 5 cents, etc) and cash increments (1 dollar, 2 dollars, 5 dollars etc. ) from ( money-in + cash drawer ) exceed the amount for that increment from the money-out.

Parameters:
cmDoc - represents cash management document
trans - represents cash transaction from cash management document
Returns:
true if none of the coin and cash increments from money-in + cash drawer excreed amount for increments in money-out

checkNewItemInProcessDoesNotExceedCashDrawer

public boolean checkNewItemInProcessDoesNotExceedCashDrawer(CashDrawer cashDrawer,
                                                            CashieringTransaction trans)
This method returns true if the new item in process does not exceed the current amount in the cash drawer reserves

Parameters:
cmDoc - submitted cash management document
trans - transaction from cash management document
Returns:
true if the new item in process does not exceed the current amount in the cash drawer reserves

checkTransactionCheckTotalDoesNotExceedCashDrawer

public boolean checkTransactionCheckTotalDoesNotExceedCashDrawer(CashDrawer cashDrawer,
                                                                 CashieringTransaction trans)
This method returns true if check total from transaction does not exceed the current amount in the cash drawer reserves

Parameters:
cmDoc - submitted cash management document
trans - transaction from cash management document
Returns:
true if check total from transaction does not exceed the current amount in the cash drawer reserves

checkPaidBackItemInProcessDoesNotExceedTotal

public boolean checkPaidBackItemInProcessDoesNotExceedTotal(CashieringItemInProcess itemInProc,
                                                            int cashieringItemNumber)
This method returns true if the current payment amount for the cashiering item in process does not exceed the actual item amount for the item in process

Parameters:
itemInProc - cashiering item in process
cashieringItemNumber - cashiering item number
Returns:
true if the current payment amount for the cashiering item in process does not exceed the actual item amount for the item in process

checkItemInProcessIsNotPayingOffItemInProcess

public boolean checkItemInProcessIsNotPayingOffItemInProcess(CashieringTransaction trans)
This method returns true if a new item in process is populated and none of the open item in process' amounts are greater than zero.

Parameters:
cmDoc - submitted cash management document
trans - transaction from cash management document
Returns:
true if a new item in process is populated and none of the open item in process' amounts are greater than zero.

checkAllPaidBackItemsInProcess

public boolean checkAllPaidBackItemsInProcess(CashieringTransaction trans)
This method returns true if all open items in process amounts do not exceed the total for each specific item's amount total

Parameters:
trans - transaction from cash management document
Returns:
true if all open items in process amounts do not exceed the total for each specific item's amount total

checkNewItemInProcessInPast

public boolean checkNewItemInProcessInPast(CashieringTransaction trans)
This method returns true if the current date is after all new items in process' open dates

Parameters:
trans - transaction from cash management document
Returns:
true if the current date is after all new items in process' open dates

calculateTotalCashDrawerReserves

protected org.kuali.rice.kns.util.KualiDecimal calculateTotalCashDrawerReserves(CashDrawer cashDrawer,
                                                                                CashieringTransaction trans)
This method calculates the total cash drawer reserves amount

Parameters:
cmDoc -
trans -
Returns:
KualiDecimal as total from cash drawer reserves

convertDateToDayYear

protected int convertDateToDayYear(Date d)
This method returns the current day of year as an int for a specific date.

Parameters:
d - date
Returns:
int as day of year


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