You need the following tables for the Cash Drawer Management sample application:
▪ CDMCASHDRAWER
▪ CDMBIN
▪ CDMBATCH
▪ CDMTOTAL
▪ CDMCASHTRAY
▪ CDMDENOMINATION
All of these tables are in a database called BTF by default. You must create each table using the provided scripts.
The following diagram shows the relationship between the tables:
By default, any of the scripts that create the tables for the Bank Teller Sample first creates the database to contain the tables. The default name of the database is BTF. The scripts is specific to Windows operating system, and database management system, such as DB2 or Oracle.
To create all the tables required by the Cash Drawer Management sample application, follow these steps:
1 Make sure the database drivers JAR files are available in the classpath. If you use DB2, the database drivers JAR files are db2jcc.jar, db2jcc_license_cisuz.jar and db2jcc_license_cu.jar.
2 Locate the table script in <toolkit_root>/lib/dbtools/Windows/ directory. DB2 and Oracle are supported.
3 Start your database management system.
4 Execute the script file at a command prompt.
5 Verify that the scripts have generated the following tables in your DBMS.
Cash Drawer Management uses com.ibm.btt.bc.common.pool.ConnectionPool to manage the database connection. There are two types of connection pool configurations. One uses the datasource which is managed by web container, and the other uses the conventional DBDriver definition. To use the datasource, you should disable the connection pool first, and then provide the jndi datasource for it. To use the DBDriver, you should provide the dbDriverName, dbUrl, dbUserName, dbPassword for the connection pool. Following is a connection pool definition example that use the DBDriver:
1 Copy the following plug-ins from <toolkit_root>/plugins to the plugins directory of your Rational Application Developer, WebSphere Integration Developer, or eclipse:
▪ com.ibm.btt.bc.cm.common.0
▪ com.ibm.btt.bc.cm.rcp.0
▪ com.ibm.btt.core.0
▪ com.ibm.btt.csclient.http.0
▪ com.ibm.btt.rcp.activity.0
▪ com.ibm.btt.rcp.broker.0
▪ com.ibm.btt.rcp.navigator.0
▪ com.ibm.btt.rcp.perspective.0
▪ com.ibm.btt.rcp.service.manager.0
▪ com.ibm.btt.rcp.visualbean.runtime.0
▪ com.ibm.btt.rcp.visualbean.0
▪ com.ibm.btt.rcp.theme.0
▪ com.ibm.btt.rcp.workingarea.0
2 Import the sample RCP application project from Client, follow these steps:
▪ Click File > Import.
▪ In the pop-up dialog box, select Existing Projects into Workspace and click Next.
▪ Choose the project directory and select com.ibm.btt.rcp.sample to import.
3 Follow these to connect the client with the server:
▪ Select com.ibm.btt.rcp.sample in the Package Explorer.
▪ Expand src > btt.cm.client > client.xml, and open the file.
Double-click the Cash Drawer Management in the Navigator, the Cash Drawer Management view is displayed. Following is the screen capture of cash drawer management view:
The transaction is role based.
▪ If you are a teller, the management displays all the cash drawers assigned to you, and you can not perform any transactions listed on the right side.
▪ If you are a supervisor, the management displays all the cash drawers in the system. You can create, modify, delete, assign or unassign cash drawers. No extra information is needed to delete or unassign.
In the Cash Drawer Management view, click Create, and you can see the cash drawer creation view. Following is the screen capture:
Enter all the information about the new drawer and click OK. If the new drawer is created successfully, you can see the result on the Cash Drawer Management view.
In the Cash Drawer Management view, select a cash drawer and click Modify, and you can see the cash drawer modification view. Following is the screen capture:
Enter the new location for the drawer and click OK. If the drawer’s location is modified successfully, you can see it on the Cash Drawer Management view.
In the Cash Drawer Management view, select a cash drawer and click Assign, and you can see the cash drawer assignment view. Following is the screen capture:
Select the user to whom you want to assign the cash drawer and click OK. If the drawer is assigned successfully, you can see the result on the Cash Drawer Management view.
▪ If you are a supervisor, you can access all the drawers in the system
▪ If you are a teller, you can only access your own drawers.
Double-click the Query Cash Drawer Totals in the Navigator, and you can see the Drawers and the details.
Double-click the drawer in the Drawer table, the totals of the specific drawer are displayed in the Detail table, with its summary information in the lower right corner.
Following is the screen capture of cash drawer total query:
You can query the cash denomination detail by this transaction. It is also role based. If you are a supervisor, you can access all the drawers in the system; If you are a teller, you can only check your own drawers. Double-click Global Cash Position in the Navigator, the Global Cash Position view is displayed. Select the currency in the Currency drop-down list, and select the Drawer ID in the Drawer ID drop-down list, and then click Query, the detailed Denominational information is displayed in the Notes and Coins tables.
Following is the screen capture of global cash position view:
You can deposit cash into a cash drawer. Enter the cash count according to the denominational value. Double-click Deposit Cash in the navigator, and the Cash Deposit view opens. You can select a Drawer in the Drawer drop-down list, and click Summary. The total amount is displayed in the lower right corner. After you enter all the information about the deposit, click Deposit. Following is the screen capture of the deposit view:
Note This section is only a sample, not part of the product.
To add new transaction rules that will be used by a cash drawer for new transactions, add them to the XML file for that branch.
The following is an example of the transaction rules defined in the branch001.xml file:
<!-- A deposit transaction definition, which contains some totaling rules.--> <com.ibm.btt.bc.cm.rule.TransactionRule id="depositTxn" txnCode="DEPOSIT"> <list Injection="totalRules"> <ref refId="depositRule" /> <ref refId="cashInRule" /> </list> </com.ibm.btt.bc.cm.rule.TransactionRule> <!-- A totaling rule definition, which has the action type that would perform and the target total that would have an impact.--> <com.ibm.btt.bc.cm.rule.TotalingRule id="cashInRule" action="INCREMENT" targetTotal="CASH_IN"> </com.ibm.btt.bc.cm.rule.TotalingRule> <com.ibm.btt.bc.cm.rule.TotalingRule id="depositRule" action="INCREMENT" targetTotal="DEPOSIT"> </com.ibm.btt.bc.cm.rule.TotalingRule>
Double-click the Settle Cash Drawer in the Navigator, and the Settle Cash Drawer view opens. On the top of this view, the number of your unsettled drawers are shown. All your drawers are displayed in the drawer table, with UNSETTLED ones in the front row. Following is the screen capture of the settlement view:
Follow these steps to settle a cash drawer:
1 Select a cash drawer in the drawer table, and click Query. Notes and Coins in the drawer are displayed, with the Drawer Total displayed in the lower right corner.
2 Enter the count for each denominational value in the Count list and click Summary, the Counted Cash is displayed in the lower right corner.
3 Click Settle, the management can check if your count equals to drawer count. The line will be highlighted if count value is not the same. If it is correct, the drawer state is changed to SETTLED.
Creates a new cash drawer using the parameters passed by user.
1 Valid branch ID, drawer ID, drawer type, currency code, and number of reserve trays are provided. A location is optional (can be an empty string), but cannot be null.
2 A drawer with the specified drawer ID does not exist yet.
3 The drawer types and currency codes used by the branch are specified in the XML file
4 Create a new cash drawer.
Parameters
branchId
String
The branch ID
drawerId
String
The drawer ID
locationT
String
The drawer’s location
type
String
The drawer’s type (STD, VLT, etc.)
currencyCode
int
The number of reserve trays.
Return
void
Exception
CashDrawerManagementException
Trying to create a type of cash drawer that is not specified in the configuration file.
The drawer to be created has already been created.
2 Set the starting positions of each cash tray to the amount specified in cash tray current positions, and sets the drawer state to INITIALIZED for all drawers assigned to the user.
3 If resetsTotals = true, resetstotals for the drawers belonging to this user.
The configuration XML file contains descriptions for each drawer type and for each currency that is supported by the branch. Each branch has its own XML file for easy maintenance. The UDTT ElementFactory is used to read and process the tags in the XML file.
The following is a sample configuration XML file named brach001.xml: