-
Notifications
You must be signed in to change notification settings - Fork 135
Finance Cash Book Overview
The cash book is the hospital's chronological audit trail of all cash movements. Every transaction processed through the cashier system — bill payments, shift handovers, fund transfers, deposits, income entries, and expense entries — creates a cash book entry. Finance officers and auditors use the cash book to verify that every financial event is accounted for and to trace any transaction back to its originating bill or payment record.
Cashier (main menu) -> Cash Book tab -> Cash Book Entries
This opens cashier/cash_book_entry.xhtml.
The cash book is built on two related data structures.
A CashBook record represents a running ledger associated with a specific combination of institution, site, and department. It holds the current running balance for each payment method. When a transaction occurs, the relevant CashBook balance is updated, and a CashBookEntry is written to preserve the before and after state.
Each CashBookEntry records one transaction event. It stores:
| Field | Description |
|---|---|
| Created At | Timestamp when the entry was written |
| Cashbook Date | Business date the entry belongs to (may differ from Created At for overnight shifts) |
| Institution | The legal entity (hospital or company) under which this entry falls |
| Site | The physical location derived from the originating department |
| Department | The cashier department where the transaction occurred |
| Payment Method | The tender type: Cash, Card, Cheque, Slip, IOU, Voucher, Credit, Ewallet, Agent, OnCall, OnlineSettlement, PatientDeposit, PatientPoints, StaffWelfare, or MultiplePaymentMethods |
| Entry Value | The monetary amount of this transaction |
| From Site / From Department | The source location (for inter-location transfers) |
| To Site / To Department | The destination location (for inter-location transfers) |
| Balance Before | Running balance at the site/department/institution level before this entry |
| Balance After | Running balance at the site/department/institution level after this entry |
| Bill | Reference to the originating bill, if applicable |
| Payment | Reference to the originating payment record, if applicable |
| Web User | The logged-in user whose action triggered the entry |
| Creater | The system user who created the entry record |
CashBookEntryData is an in-memory aggregation class used during report generation. It holds per-payment-method subtotals (cashValue, cardValue, chequeValue, voucherValue, ewalletValue, slipValue, iouValue, agentValue, creditValue, and others) together with the source and destination department, allowing summaries to be constructed without re-querying the database for each payment method.
Entries are written in the following situations:
- Shift handover — one entry per payment method when a cashier hands over to another user or to a supervisor
- Bank or safe deposit — when funds are deposited out of the drawer, a separate entry records the outflow (added in PR #20757; prior to this release, deposits did not automatically create an entry)
- Fund transfer — when cash or other instruments move between departments or sites
Direct billing payments do not typically create cash book entries at the moment of billing. The configuration flag doNotWriteCashBookEntriesAtBillingForAnyPaymentMethod controls this behaviour and is enabled by default. Entries are instead consolidated at handover time.
- Go to Cashier in the main navigation menu.
- Select the Cash Book tab.
- Click Cash Book Entries.
- Set the From date and To date using the date-time pickers.
- Select the Report Type:
- Institution -- shows entries aggregated at institution level
- Site -- shows entries at site level with per-payment-method balance columns
- Department -- shows entries at department level
- Optionally filter by Institution, Site, and/or Department using the drop-down menus.
- Click Process to load entries.
- The results table appears below the filter panel.
| Filter | Purpose |
|---|---|
| From | Start of the date-time range (inclusive) |
| To | End of the date-time range (inclusive) |
| Report Type | Determines which balance columns are displayed (Institution / Site / Department) |
| Institution | Restrict to entries belonging to one institution; leave blank for all |
| Site | Restrict to entries for one site; leave blank for all |
| Department | Restrict to entries for one department; leave blank for all |
The columns shown depend on the selected Report Type. Columns visible for all types:
| Column | Description |
|---|---|
| Entry AT | Exact timestamp the entry was created |
| Summary Date | Business date assigned to this entry |
| Institution | Institution name |
| Site | Site name |
| Department | Department name |
When Report Type is Site, additional balance-tracking columns are shown:
| Column | Description |
|---|---|
| Balance Before | Total site balance before this transaction |
| Value | Entry amount |
| Balance After | Total site balance after this transaction |
| Cash Before / Cash / Cash After | Cash-specific balance before, transaction amount, and balance after |
| Card Before / Card / Card After | Card-specific balance tracking |
| Slip Before / Slip / Slip After | Slip payment balance tracking |
| Button | Action |
|---|---|
| Process | Runs searchController.genarateCashBookEntries(), querying CashBookEntry records matching the chosen filters and date range |
| Item | Value |
|---|---|
| Page | cashier/cash_book_entry.xhtml |
| Navigation method | searchController.navigateToListCashBookEntry() |
| Primary controller | com.divudi.bean.cashTransaction.CashBookEntryController |
| Supporting controller | com.divudi.bean.common.SearchController |
| Key query method | CashBookEntryController.genarateCashBookEntries(fromDate, toDate, site, institution, department) |
| Entity (ledger) | com.divudi.core.entity.cashTransaction.CashBook |
| Entity (transaction) | com.divudi.core.entity.cashTransaction.CashBookEntry |
| Aggregation class | com.divudi.core.data.CashBookEntryData |
| Facade | com.divudi.core.facade.CashBookEntryFacade |
| Config key |
doNotWriteCashBookEntriesAtBillingForAnyPaymentMethod (boolean, application scope) -- controls whether entries are created at payment time or deferred to handover |