# Till collections and advance reports

## Setup and permissions

Enable Till Collections for users who manage till collections. Grant the relevant
checkboxes under that module: View Own / View All Till Collections, Collect Cash,
Print Collection Acknowledgement and Reverse Collection. Creating a collection
does not automatically grant permission to reverse it. Existing regular roles
are not automatically granted new permissions.

Under Reports grant Till Collections Report and/or Advance Payments Report, with
Reports module access. Reports View enables the report directory. Export CSV and
Print remain separately controlled by the existing report permissions.

## Collecting cash

Shifts are optional. When using shifts, open the cashier's shift with the actual opening float. Cash receipts, including
customer advances and room payments linked to that shift, contribute to expected
drawer cash. Cash expenses and advance refunds reduce it.

Till Collections > Collect Cash opens a popup. Choose a branch, cashier,
cash payment method, recipient and destination account. An open shift is optional.
When selected, the cashier and branch come from that shift. All branch selections
are validated on the server. The recipient must be active and
assigned to that branch. Cash in Office is provided as an accounting destination;
existing active cash/petty-cash/bank accounts are also available.

With a shift, the amount cannot exceed expected drawer cash. Without a shift,
it cannot exceed the posted cash-account balance for the selected branch.
This is a branch/account balance, not an individually counted cashier drawer.
Collections receive a short TC
reference and a printable acknowledgement with signature spaces. The recipient
selection records a handover; it is not an electronic signature or approval.
The recorded-by user is always the actual logged-in user. Duplicate submissions
of the same request do not collect twice.

Retail/Wholesale and Restaurant have a Till Collections shortcut for authorised
users; it opens a separate tab so an in-progress cart stays intact.
Collections work without enabling Shift Management. If the selected cashier has
an open shift in that branch, select it to preserve shift reconciliation.
A collection does not close a shift.

## Accounting and reconciliation

Debit the destination account and credit the account mapped to the cash payment
method. The amount is a transfer, not revenue, an expense or a discount. Sales,
customer balances, VAT and stock are unchanged.

Expected cash = opening float + cash receipts - cash expenses/refunds - posted
till collections. Shift list, shift closing and the individual shift report use
the same calculation. Cashier closing/count differences therefore reflect cash
actually left in the drawer.

If cash first goes to Cash in Office, record a later bank deposit from Cash in
Office to the bank, not from the drawer again. Do not enter the same collection
again as a generic cash transfer.

Reversal requires a reason and physical return of cash to the drawer. It creates
an opposite journal entry and restores expected cash. Both journal entries stay
posted so ledger balances net correctly. History remains; there is no delete.
A collection on a closed shift cannot be reversed, because its cash is reconciled;
use a separately authorised accounting correction for a later real movement.

## Reports

Reports > Till Collections: branch, cashier, search, status, date/time and existing
shift-period presets. Date selection refers to the collection time. Posted and
reversed collections have separate totals; totals cover all filtered pages.
Statuses reflect their current state. For dated cash inflows/outflows including
later reversals, use Accounting > Cash Flow with the relevant account.

Reports > Advance Payments: filter by receipt date/time, branch, recipient,
payment method, customer or reference. Received is the original amount of the
selected advances. Applied/Refunded to Date and Available Now show their current
balances, including movements after their receipt period; they are not a report
of allocations/refunds occurring only within the selected dates.

Both reports use system pagination and offer authorised printing/CSV export.
CSV includes all filtered records and totals, not just the visible page. CSV
amounts use the stored/base currency; the on-screen amounts use system formatting.

## Client deployment

Back up the database, copy the updated code and run:

```text
php artisan migrate --force
php artisan route:clear
php artisan view:clear
```

Migration `2026_10_11_140000_create_till_collections` adds the collection table,
permissions and Cash in Office if missing. Preserve the document reference
sequence table from the earlier reference-numbering upgrade. Existing receipts,
stock and historical transactions are not changed.

Migration `2026_10_11_150000_make_till_collections_independent` allows collections
without shifts, adds the standalone Till Collections module and moves its
permission checkboxes there. Existing till-collection grants are retained.
Customers now show Available Advance (received less applied and refunded) and
Pending Balance (unpaid, non-voided sales), scoped to accessible/selected branches.
Advance credit is shown separately and is not silently deducted from pending bills.
