@Transactional public class CashManagementServiceImpl extends Object implements CashManagementService
Constructor and Description |
---|
CashManagementServiceImpl() |
Modifier and Type | Method and Description |
---|---|
void |
addDeposit(CashManagementDocument cashManagementDoc,
String depositTicketNumber,
Bank bank,
List selectedCashReceipts,
List selectedCashieringChecks,
boolean isFinalDeposit)
This method adds a new deposit to a the given CashManagementDocument.
|
boolean |
allowDocumentCancellation(CashManagementDocument cmDoc)
This method determines if a document can be cancelled, by reviewing a set of criteria:
- do any cash receipts exist in this document?
- do any cashiering checks exist in this document?
- do any cash details exist in this document?
If any of these questions comes back as true, then the document cannot be canceled.
|
boolean |
allVerifiedCashReceiptsAreDeposited(CashManagementDocument cmDoc)
This method verifies that all cash receipts for the document are deposited.
|
void |
applyCashieringTransaction(CashManagementDocument cmDoc)
This method applies the cashiering transaction to the given CashManagementDocument.
|
protected Deposit |
buildDeposit(CashManagementDocument cashManagementDoc,
String depositTypeCode,
String depositTicketNumber,
Bank bank,
List<CashReceiptDocument> selectedCashReceipts,
List selectedCashieringChecks)
This method builds a new deposit object from the parameters provided.
|
org.kuali.rice.core.api.util.type.KualiDecimal |
calculateDepositedCheckTotal(String documentNumber)
Total up the amounts of all checks so far deposited as part of the given cash management document.
|
org.kuali.rice.core.api.util.type.KualiDecimal |
calculateUndepositedCheckTotal(String documentNumber)
Calculates the total amount of all the undeposited checks for a cash management document.
|
void |
cancelCashManagementDocument(CashManagementDocument cmDoc)
This method cancels a cash management document, effectively nullifying all values and attributes associated with
the document.
|
void |
cancelDeposit(Deposit deposit)
This method cancels a given deposit.
|
protected void |
completeNewItemInProcess(CashieringTransaction trans)
This method completes the new item in process by setting the item remaining amount equal to the item amount.
|
CashManagementDocument |
createCashManagementDocument(String campusCode,
String docDescription,
String annotation)
This method creates a new cash management document and sets the provided values as attributes to the document.
|
void |
createNewCashDetails(CashManagementDocument cmDoc,
String cashieringStatus)
This method creates new cumulative currency and coin details for the document given.
|
protected boolean |
existCashDetails(CashManagementDocument cmDoc)
This method determines if any populated currency or coin details exist for the given document.
|
protected boolean |
existCashieringChecks(CashManagementDocument cmDoc)
This method determines if cashiering checks exist for the cash management document.
|
protected boolean |
existCashReceipts(CashManagementDocument cmDoc)
This method determines if any verified, interim, or final cash receipts currently exist.
|
void |
finalizeCashManagementDocument(CashManagementDocument cmDoc)
This method performs the necessary steps to finalize a cash management document.
|
protected void |
finalizeCashReceiptsForDeposit(Deposit deposit)
This method switches cash receipts to "final" status as opposed to "interim" status.
|
void |
finalizeLastInterimDeposit(CashManagementDocument cmDoc)
This method turns the last interim deposit into the final deposit and locks the cash drawer.
|
CoinDetail |
generateMasterCoinDetail(CashManagementDocument cmDoc)
This method generates a master coin detail for the cash management document given.
|
CurrencyDetail |
generateMasterCurrencyDetail(CashManagementDocument cmDoc)
This method generates a master currency detail for the cash management document given.
|
void |
generateMasterRecord(CashManagementDocument cmDoc,
CurrencyDetail masterCurrencyDetail,
CoinDetail masterCoinDetail)
This method pulls out the master currency and coin details and sets them to the cashManagementDocument
|
org.kuali.rice.krad.service.BusinessObjectService |
getBusinessObjectService()
Getter for retrieving an instance of the BusinessObjectService attribute.
|
Map<Class,Object> |
getCashDetailsForFinalDeposit(String documentNumber)
This method retrieves the cash details for the final deposit object.
|
CashDrawerService |
getCashDrawerService()
Getter for retrieving an instance of the CashDrawerService attribute.
|
CashManagementDao |
getCashManagementDao()
Gets the cashManagementDao attribute.
|
CashManagementDocument |
getCashManagementDocumentForCashReceiptId(String documentId)
If a CMD is found that is associated with the CR document, then that CMD is returned; otherwise null is returned.
|
org.kuali.rice.kns.service.DataDictionaryService |
getDataDictionaryService() |
org.kuali.rice.core.api.datetime.DateTimeService |
getDateTimeService()
Gets the dateTimeService attribute.
|
org.kuali.rice.krad.service.DocumentService |
getDocumentService()
Gets the documentService attribute.
|
List<CashieringItemInProcess> |
getOpenItemsInProcess(CashManagementDocument cmDoc)
This method retrieves a collection of open CashieringItemInProcess objects from the cash management document given
and returns that collection.
|
List<CashieringItemInProcess> |
getRecentlyClosedItemsInProcess(CashManagementDocument cmDoc)
This method retrieves a collection of recently closed CashieringItemInProcess objects from the cash management
document given and returns the collection.
|
protected Map<Integer,Check> |
getUndepositedChecksAsMap(CashManagementDocument cmDoc)
This method returns all undeposited checks as a map with the key of each value in the map equal to the sequence id
of the corresponding check.
|
void |
populateCashDetailsForDeposit(CashManagementDocument cmDoc)
Populates the currency and coin detail for final deposits by setting the deposited currency or coin amount equal to the
associated cashiering record currency or coin amount.
|
List<CashReceiptDocument> |
retrieveCashReceipts(Deposit deposit)
This method returns a collection of cash receipts associated with the deposit given.
|
protected void |
saveChecks(CashManagementDocument cmDoc)
This method retrieves all the checks for the given document and persists them.
|
protected void |
saveExisingItemsInProcess(CashManagementDocument cmDoc,
CashieringTransaction trans)
This method checks the cashiering transaction to see if any open items in process were at least partially paid back;
it then saves the changes.
|
protected void |
saveMoneyInCash(CashManagementDocument cmDoc,
CashieringTransaction trans)
This method retrieves the amount of cash in the "money in" portion of the transaction and saves it to the
cash management document.
|
protected void |
saveMoneyOutCash(CashManagementDocument cmDoc,
CashieringTransaction trans)
This method retrieves the amount of cash in the "money out" portion of the transaction and saves it to the
cash management document.
|
protected void |
saveNewItemInProcess(CashManagementDocument cmDoc,
CashieringTransaction trans)
This methods checks if data was actually entered for the new item in process; if so, it saves that item in process.
|
List<Check> |
selectCashieringChecksForDeposit(String documentNumber,
Integer depositLineNumber)
This method retrieves the collection of cashiering checks associated with a given deposit.
|
List<Check> |
selectDepositedCashieringChecks(String documentNumber)
This method retrieves a collection of all deposited checks associated with the given document.
|
Integer |
selectNextAvailableCheckLineNumber(String documentNumber)
This method retrieves the next available check line number from the document provided.
|
List<Check> |
selectUndepositedCashieringChecks(String documentNumber)
This method retrieves the collection of undeposited cashiering checks associated with the document given.
|
void |
setBusinessObjectService(org.kuali.rice.krad.service.BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value.
|
void |
setCashDrawerService(CashDrawerService cashDrawerService)
Sets the cashDrawerService attribute value.
|
void |
setCashManagementDao(CashManagementDao cashManagementDao)
Sets the cashManagementDao attribute value.
|
void |
setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
Sets the data dictionary service implementation
|
void |
setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
Sets the dateTimeService attribute value.
|
void |
setDocumentService(org.kuali.rice.krad.service.DocumentService documentService)
Sets the documentService attribute value.
|
protected void |
transferChecksToCashManagementDocument(CashManagementDocument cmDoc,
CashieringTransaction trans)
This method retrieves the checks from the transaction and adds them to the cash management document.
|
protected void |
updateCashDrawer(CashDrawer drawer,
CashieringTransaction trans)
This method puts money from the "money in" portion of the transaction into the cash drawer, and takes money from the
"money out" portion of the cash drawer out.
|
protected void |
validateDepositParams(CashManagementDocument cashManagementDoc,
Bank bank,
List<CashReceiptDocument> selectedCashReceipts)
Validates the given Deposit parameters, throwing various (runtime) exceptions if errors exist.
|
boolean |
verifyCashReceiptIsDeposited(CashManagementDocument cmDoc,
CashReceiptDocument crDoc)
Verifies if a given cash receipt is deposited as part of the given cash management document.
|
public CashManagementServiceImpl()
public CashManagementDocument getCashManagementDocumentForCashReceiptId(String documentId)
getCashManagementDocumentForCashReceiptId
in interface CashManagementService
documentId
- The id of the cash receipt document linked to the cash management document.CashManagementService.getCashManagementDocumentForCashReceiptId(java.lang.String)
public CashManagementDocument createCashManagementDocument(String campusCode, String docDescription, String annotation)
createCashManagementDocument
in interface CashManagementService
campusCode
- The campus code of the cash drawer.docDescription
- The document description to be set on the new cash management document.annotation
- CashManagementService.createCashManagementDocument(java.lang.String,
java.lang.String, java.lang.String)
public void createNewCashDetails(CashManagementDocument cmDoc, String cashieringStatus)
createNewCashDetails
in interface CashManagementService
cmDoc
- The cash management document the cumulative details will be associated with.cashieringSource
- The cashiering record source for the new details.public void addDeposit(CashManagementDocument cashManagementDoc, String depositTicketNumber, Bank bank, List selectedCashReceipts, List selectedCashieringChecks, boolean isFinalDeposit)
addDeposit
in interface CashManagementService
cashManagementDoc
- The document to have the deposit added to.depositTicketNumber
- The ticket number of the deposit being added.bankAccount
- The bank account on the deposit.selectedCashReceipts
- The collection of cash receipts associated with the new deposit.selectedCashieringChecks
- The collection of checks associated with the new deposit.isFinalDeposit
- A flag used to identify if a deposit is the final deposit to be added to a cash management document.org.kuali.ole.fp.document.service.CashManagementService#addInterimDeposit(org.kuali.ole.fp.document.CashManagementDocument,
java.lang.String, org.kuali.ole.fp.businessobject.BankAccount, java.util.List)
protected void validateDepositParams(CashManagementDocument cashManagementDoc, Bank bank, List<CashReceiptDocument> selectedCashReceipts)
cashManagementDoc
- The document the deposit will be added to.bank
- The bank account of the deposit being added.selectedCashReceipts
- The collection of cash receipts associated with the new deposit.protected Deposit buildDeposit(CashManagementDocument cashManagementDoc, String depositTypeCode, String depositTicketNumber, Bank bank, List<CashReceiptDocument> selectedCashReceipts, List selectedCashieringChecks)
cashManagementDoc
- The cash management document the deposit will be added to.depositTypeCode
- The type code associated with the deposit.depositTicketNumber
- The deposit ticket number to be set on the deposit object.bank
- The bank account of the deposit.selectedCashReceipts
- The cash receipts that make up the deposit.selectedCashieringChecks
- The cashiering checks that make up the deposit.protected Map<Integer,Check> getUndepositedChecksAsMap(CashManagementDocument cmDoc)
cmDoc
- The cash management doc to find undeposited checks for.public void cancelCashManagementDocument(CashManagementDocument cmDoc)
cancelCashManagementDocument
in interface CashManagementService
cmDoc
- The CashManagementDocument to be canceled.CashManagementService.cancelCashManagementDocument(org.kuali.ole.fp.document.CashManagementDocument)
public void cancelDeposit(Deposit deposit)
cancelDeposit
in interface CashManagementService
CashManagementService.cancelDeposit(org.kuali.ole.fp.businessobject.Deposit)
public void finalizeCashManagementDocument(CashManagementDocument cmDoc)
finalizeCashManagementDocument
in interface CashManagementService
cmDoc
- The CashManagementDocument to be finalized.CashManagementService.finalizeCashManagementDocument(org.kuali.ole.fp.document.CashManagementDocument)
public boolean allVerifiedCashReceiptsAreDeposited(CashManagementDocument cmDoc)
allVerifiedCashReceiptsAreDeposited
in interface CashManagementService
cmDoc
- The cash management document to verify.public List<CashReceiptDocument> retrieveCashReceipts(Deposit deposit)
retrieveCashReceipts
in interface CashManagementService
deposit
- The deposit to retrieve all the cash receipts for.CashManagementService.retrieveCashReceipts(org.kuali.ole.fp.businessobject.Deposit)
public boolean verifyCashReceiptIsDeposited(CashManagementDocument cmDoc, CashReceiptDocument crDoc)
verifyCashReceiptIsDeposited
in interface CashManagementService
cmDoc
- The cash management document to search through.crDoc
- The cash receipt to check the deposited status of.public void finalizeLastInterimDeposit(CashManagementDocument cmDoc)
finalizeLastInterimDeposit
in interface CashManagementService
cmDoc
- The cash management document to take deposits from for finalization.protected void finalizeCashReceiptsForDeposit(Deposit deposit)
deposit
- The deposit the cash receipts are associated with.public void applyCashieringTransaction(CashManagementDocument cmDoc)
applyCashieringTransaction
in interface CashManagementService
cmDoc
- The transaction to apply to the cash management document.org.kuali.ole.fp.document.service.CashManagementService#applyCashieringTransaction(org.kuali.ole.fp.document.CashManagementDocument, org.kuali.ole.fp.businessobject.CashieringTransaction)
,
org.kuali.ole.fp.document.validation.impl.CashieringTransactionRule#processCashieringTransactionApplicationRules(CashManagementDocument)
protected void updateCashDrawer(CashDrawer drawer, CashieringTransaction trans)
drawer
- The cash drawer to operate on.trans
- The transaction that is the operation.protected void completeNewItemInProcess(CashieringTransaction trans)
trans
- The transaction being performed.protected void saveChecks(CashManagementDocument cmDoc)
cmDoc
- The cash management document the checks will be saved against.protected void transferChecksToCashManagementDocument(CashManagementDocument cmDoc, CashieringTransaction trans)
cmDoc
- The document the checks will be transferred to.trans
- The transaction the checks are associated with.protected void saveNewItemInProcess(CashManagementDocument cmDoc, CashieringTransaction trans)
cmDoc
- The cash management doc that the new item in process will be associated with.trans
- The cashiering transaction that created the new item in process.protected void saveExisingItemsInProcess(CashManagementDocument cmDoc, CashieringTransaction trans)
cmDoc
- The cash management document that the items in process will be associated withtrans
- The cashiering transaction the items in process are associated with.protected void saveMoneyInCash(CashManagementDocument cmDoc, CashieringTransaction trans)
cmDoc
- The cash management document that the cash will be saved to.trans
- The cashiering transaction the cash is currently associated with.protected void saveMoneyOutCash(CashManagementDocument cmDoc, CashieringTransaction trans)
cmDoc
- The cash management document that the cash will be saved to.trans
- The cashiering transaction the cash is currently associated with.public List<CashieringItemInProcess> getOpenItemsInProcess(CashManagementDocument cmDoc)
getOpenItemsInProcess
in interface CashManagementService
cmDoc
- The document the open items in process will be retrieved from.CashManagementService.getOpenItemsInProcess(org.kuali.ole.fp.document.CashManagementDocument)
public List<CashieringItemInProcess> getRecentlyClosedItemsInProcess(CashManagementDocument cmDoc)
getRecentlyClosedItemsInProcess
in interface CashManagementService
cmDoc
- The cash management document the recently closed items will be retrieved from.CashManagementService.getRecentlyClosedItemsInProcess(org.kuali.ole.fp.document.CashManagementDocument)
public CoinDetail generateMasterCoinDetail(CashManagementDocument cmDoc)
generateMasterCoinDetail
in interface CashManagementService
cmDoc
- The document the master coin detail will be generated from.CashManagementService.generateMasterCoinDetail(org.kuali.ole.fp.document.CashManagementDocument)
public CurrencyDetail generateMasterCurrencyDetail(CashManagementDocument cmDoc)
generateMasterCurrencyDetail
in interface CashManagementService
cmDoc
- The document the master currency detail will be generated from.CashManagementService.generateMasterCurrencyDetail(org.kuali.ole.fp.document.CashManagementDocument)
public void populateCashDetailsForDeposit(CashManagementDocument cmDoc)
populateCashDetailsForDeposit
in interface CashManagementService
cmDoc
- The cash management document which has deposits to populate.public List<Check> selectCashieringChecksForDeposit(String documentNumber, Integer depositLineNumber)
selectCashieringChecksForDeposit
in interface CashManagementService
documentNumber
- The id of the document to search for the deposit within.depositLineNumber
- The line number of the deposit to be found.CashManagementService.selectCashieringChecksForDeposit(java.lang.String, java.lang.Integer)
public List<Check> selectUndepositedCashieringChecks(String documentNumber)
selectUndepositedCashieringChecks
in interface CashManagementService
documentNumber
- The id of the document to search for the undeposited checks within.CashManagementService.selectUndepositedCashieringChecks(java.lang.String)
public List<Check> selectDepositedCashieringChecks(String documentNumber)
selectDepositedCashieringChecks
in interface CashManagementService
documentNumber
- The document to retrieve the deposited checks from.CashManagementService.selectDepositedCashieringChecks(java.lang.String)
public org.kuali.rice.core.api.util.type.KualiDecimal calculateDepositedCheckTotal(String documentNumber)
calculateDepositedCheckTotal
in interface CashManagementService
documentNumber
- The id of a cash management document.public org.kuali.rice.core.api.util.type.KualiDecimal calculateUndepositedCheckTotal(String documentNumber)
calculateUndepositedCheckTotal
in interface CashManagementService
documentNumber
- The id of the cash management document to pull the undeposited checks from.CashManagementService.calculateUndepositedCheckTotal(java.lang.String)
public boolean allowDocumentCancellation(CashManagementDocument cmDoc)
allowDocumentCancellation
in interface CashManagementService
cmDoc
- The document that would be canceled.CashManagementService.allowDocumentCancellation(org.kuali.ole.fp.document.CashManagementDocument)
protected boolean existCashReceipts(CashManagementDocument cmDoc)
cmDoc
- The cash management document to find cash receipts associated with the campus of.protected boolean existCashDetails(CashManagementDocument cmDoc)
cmDoc
- A cash management document to find details.protected boolean existCashieringChecks(CashManagementDocument cmDoc)
cmDoc
- The cash management document to test.public Integer selectNextAvailableCheckLineNumber(String documentNumber)
selectNextAvailableCheckLineNumber
in interface CashManagementService
documentNumber
- The document to get the next check line number from.CashManagementService.selectNextAvailableCheckLineNumber(java.lang.String)
public Map<Class,Object> getCashDetailsForFinalDeposit(String documentNumber)
getCashDetailsForFinalDeposit
in interface CashManagementService
documentNumber
- The document the details will be generated from.CashManagementService.getCashDetailsForFinalDeposit(java.lang.String)
public void generateMasterRecord(CashManagementDocument cmDoc, CurrencyDetail masterCurrencyDetail, CoinDetail masterCoinDetail)
cmDoc
- masterCurrencyDetail
- masterCoinDetail
- public org.kuali.rice.krad.service.BusinessObjectService getBusinessObjectService()
public void setBusinessObjectService(org.kuali.rice.krad.service.BusinessObjectService businessObjectService)
businessObjectService
- The businessObjectService to set.public CashDrawerService getCashDrawerService()
public void setCashDrawerService(CashDrawerService cashDrawerService)
cashDrawerService
- The cashDrawerService to set.public org.kuali.rice.krad.service.DocumentService getDocumentService()
public void setDocumentService(org.kuali.rice.krad.service.DocumentService documentService)
documentService
- public org.kuali.rice.core.api.datetime.DateTimeService getDateTimeService()
public void setDateTimeService(org.kuali.rice.core.api.datetime.DateTimeService dateTimeService)
dateTimeService
- The dateTimeService to set.public CashManagementDao getCashManagementDao()
public void setCashManagementDao(CashManagementDao cashManagementDao)
cashManagementDao
- The cashManagementDao to set.public org.kuali.rice.kns.service.DataDictionaryService getDataDictionaryService()
public void setDataDictionaryService(org.kuali.rice.kns.service.DataDictionaryService dataDictionaryService)
dataDictionaryService
- the implementation of the data dictionary service to useCopyright © 2004–2015 The Kuali Foundation. All rights reserved.