org.kuali.kfs.fp.service.impl
Class CashDrawerServiceImpl

java.lang.Object
  extended by org.kuali.kfs.fp.service.impl.CashDrawerServiceImpl
All Implemented Interfaces:
CashDrawerService

@Transactional
public class CashDrawerServiceImpl
extends Object
implements CashDrawerService

This is the default implementation of the CashDrawerService interface.


Constructor Summary
CashDrawerServiceImpl()
           
 
Method Summary
protected  Map buildPrimaryKeyMap(String campusCode)
          This method creates a primary key map by adding the associated campus code to a new map instance and returning this map new instance.
 void closeCashDrawer(CashDrawer drawer)
          Sets the status of the drawer provided to closed and saves the new state.
 void closeCashDrawer(String campusCode)
          Retrieves the CashDrawer associated with the campus code provided and sets the state of the drawer to closed.
 org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
          Gets the businessObjectService attribute value.
 CashDrawer getByCampusCode(String campusCode)
          This method retrieves a cash drawer instance using the campus code provided as a search parameter.
 org.kuali.rice.kns.util.KualiDecimal getCoinTotal(CashDrawer drawer)
          This method calculates the total of all the coins in the cash drawer.
 org.kuali.rice.kns.util.KualiDecimal getCurrencyTotal(CashDrawer drawer)
          This method calculates the total of all the currency in the cash drawer.
 void lockCashDrawer(CashDrawer drawer, String documentId)
          Sets the state of the cash drawer provided to locked and persists this new state.
 void lockCashDrawer(String campusCode, String documentId)
          Retrieves a cash drawer using the campus code provided, updates the state to locked, then persists this state change.
 CashDrawer openCashDrawer(CashDrawer drawer, String documentId)
          Sets the status of the cash drawer provided to open, persists this new state and returns the drawer.
 CashDrawer openCashDrawer(String campusCode, String documentId)
          Retrieves an instance of a cash drawer based on the parameters provided and sets the status of the drawer to open, persists the state change and then returns an instance of the drawer in it's new state.
protected  void save(CashDrawer cashDrawer)
          Persists the given CashDrawer instance.
 void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
          Sets the businessObjectService attribute value.
 void unlockCashDrawer(CashDrawer drawer, String documentId)
          Sets the state of the cash drawer provided to open and persists this new state.
 void unlockCashDrawer(String campusCode, String documentId)
          Retrieves a cash drawer using the campus code provided, updates the state to open, then persists this state change.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CashDrawerServiceImpl

public CashDrawerServiceImpl()
Method Detail

closeCashDrawer

public void closeCashDrawer(String campusCode)
Retrieves the CashDrawer associated with the campus code provided and sets the state of the drawer to closed.

Specified by:
closeCashDrawer in interface CashDrawerService
Parameters:
campusCode - The code of the campus associated with the cash drawer being retrieved.
See Also:
CashDrawerService.closeCashDrawer(java.lang.String)

closeCashDrawer

public void closeCashDrawer(CashDrawer drawer)
Sets the status of the drawer provided to closed and saves the new state.

Specified by:
closeCashDrawer in interface CashDrawerService
Parameters:
drawer - The instance of the cash drawer to be closed.
See Also:
CashDrawerService.closeCashDrawer(org.kuali.kfs.fp.businessobject.CashDrawer)

openCashDrawer

public CashDrawer openCashDrawer(String campusCode,
                                 String documentId)
Retrieves an instance of a cash drawer based on the parameters provided and sets the status of the drawer to open, persists the state change and then returns an instance of the drawer in it's new state.

Specified by:
openCashDrawer in interface CashDrawerService
Parameters:
campusCode - The campus code associated with the cash drawer we wish to retrieve and open.
documentId - The id of the reference document linked to the drawer.
Returns:
A new instance of the cash drawer in open status.
See Also:
CashDrawerService.openCashDrawer(java.lang.String, java.lang.String)

openCashDrawer

public CashDrawer openCashDrawer(CashDrawer drawer,
                                 String documentId)
Sets the status of the cash drawer provided to open, persists this new state and returns the drawer.

Specified by:
openCashDrawer in interface CashDrawerService
Parameters:
drawer - An instance of the drawer being opened.
documentId - The id of the reference document linked to the drawer.
Returns:
An instance of the cash drawer with a status of open.
See Also:
CashDrawerService.openCashDrawer(org.kuali.kfs.fp.businessobject.CashDrawer, java.lang.String)

lockCashDrawer

public void lockCashDrawer(String campusCode,
                           String documentId)
Retrieves a cash drawer using the campus code provided, updates the state to locked, then persists this state change.

Specified by:
lockCashDrawer in interface CashDrawerService
Parameters:
campusCode - The campus code associated with the cash drawer.
documentId - The reference document id to be set to the cash drawer.
See Also:
CashDrawerService.lockCashDrawer(java.lang.String,java.lang.String)

lockCashDrawer

public void lockCashDrawer(CashDrawer drawer,
                           String documentId)
Sets the state of the cash drawer provided to locked and persists this new state.

Specified by:
lockCashDrawer in interface CashDrawerService
Parameters:
drawer - The cash drawer to be locked.
documentId - The reference document id to be set to the cash drawer.
See Also:
CashDrawerService.lockCashDrawer(org.kuali.kfs.fp.businessobject.CashDrawer, java.lang.String)

unlockCashDrawer

public void unlockCashDrawer(String campusCode,
                             String documentId)
Retrieves a cash drawer using the campus code provided, updates the state to open, then persists this state change.

Specified by:
unlockCashDrawer in interface CashDrawerService
Parameters:
campusCode - The campus code associated with the cash drawer.
documentId - The reference document id to be set to the cash drawer.
See Also:
CashDrawerService.unlockCashDrawer(java.lang.String,java.lang.String)

unlockCashDrawer

public void unlockCashDrawer(CashDrawer drawer,
                             String documentId)
Sets the state of the cash drawer provided to open and persists this new state.

Specified by:
unlockCashDrawer in interface CashDrawerService
Parameters:
drawer - The cash drawer to be unlocked.
documentId - The reference document id to be set to the cash drawer.
See Also:
CashDrawerService.unlockCashDrawer(org.kuali.kfs.fp.businessobject.CashDrawer, java.lang.String)

getByCampusCode

public CashDrawer getByCampusCode(String campusCode)
This method retrieves a cash drawer instance using the campus code provided as a search parameter. If no drawer can be found for the campus provided and the autocreate flag is set to true, then a new instance of a cash drawer will be generated and returned. If the autocreate flag is false, then a null value will be returned. NOTE: The new instance created if autocreate is set to true is an unpersisted instance.

Specified by:
getByCampusCode in interface CashDrawerService
Parameters:
campusCode - The campus code used to retrieve the cash drawer.
Returns:
An instance of a cash drawer matching the value provided.
See Also:
org.kuali.kfs.fp.service.CashDrawerService#findByCampusCode(java.lang.String)

save

protected void save(CashDrawer cashDrawer)
Persists the given CashDrawer instance.

Parameters:
cashDrawer - The cash drawer to be persisted.

buildPrimaryKeyMap

protected Map buildPrimaryKeyMap(String campusCode)
This method creates a primary key map by adding the associated campus code to a new map instance and returning this map new instance.

Parameters:
campusCode - The campus code to be added to the map.
Returns:
Map suitable for use with primaryKey-related OJB methods

getCoinTotal

public org.kuali.rice.kns.util.KualiDecimal getCoinTotal(CashDrawer drawer)
This method calculates the total of all the coins in the cash drawer. This is accomplished by totaling the values from each of the *CentAmount() methods (ie. getFinancialDocumentHundredCentAmount()) from the drawer and returning the resulting value.

Specified by:
getCoinTotal in interface CashDrawerService
Parameters:
drawer - The drawer being totaled.
Returns:
The sum of all the coin amounts in the drawer.
See Also:
CashDrawerService.getCoinTotal(org.kuali.kfs.fp.businessobject.CashDrawer)

getCurrencyTotal

public org.kuali.rice.kns.util.KualiDecimal getCurrencyTotal(CashDrawer drawer)
This method calculates the total of all the currency in the cash drawer. This is accomplished by totaling the values from each of the *DollarAmount() methods (ie. getFinancialDocumentHundredDollarAmount()) from the drawer and returning the resulting value.

Specified by:
getCurrencyTotal in interface CashDrawerService
Parameters:
drawer - The drawer being totaled.
Returns:
The sum of all the currency amounts in the drawer.
See Also:
CashDrawerService.getCurrencyTotal(org.kuali.kfs.fp.businessobject.CashDrawer)

getBusinessObjectService

public org.kuali.rice.kns.service.BusinessObjectService getBusinessObjectService()
Gets the businessObjectService attribute value.

Returns:
The current value of businessObjectService.

setBusinessObjectService

public void setBusinessObjectService(org.kuali.rice.kns.service.BusinessObjectService businessObjectService)
Sets the businessObjectService attribute value.

Parameters:
businessObjectService - The businessObjectService to set.


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