# Wallet Surfacing Audit — final gaps

Scope: every money-moving dialog and detail screen in the app, checked against
the two wallet conventions the modules already follow:

1. **Picker at the movement** — a dialog that moves money offers the wallet to move through
   (`Wallet::defaultCash()` fallback), e.g. loan payments, contractor collect/pay.
2. **Name on every row** — every feed/detail screen that lists money rows resolves the
   landed wallet's *name* (ledger leg → named stamp), e.g. the earnings payment feeds
   (`$payment->wallet = $p->walletTransaction?->wallet?->name`).

Movers inventoried (30 `WalletService` credit/debit call sites across 16 controllers +
`BookingEngine`): loans (personal + property), income/expense/vendor payments, POS,
pharmacy POS + purchases, property POS, customer dues/payments, contractor
collections/payouts, fleet billing, parking, rent collection, delivery cash handover,
company funds, and the booking engine's ledger mirror.

## Covered (no gap)

| Module | Picker | Row-party wallet name |
| --- | --- | --- |
| Personal loans (earnings) | ✓ dialog | ✓ feed + rows |
| Property loans | ✓ pay dialog | ✓ detail chips + receipt PDFs ("Received into wallet") |
| Income payments | (income-level) | ✓ feed (leg → income wallet fallback) |
| Expense payments + pending approvals | (vendor pay leg) | ✓ feed + panel chip (leg → vendor pay-out wallet) |
| Contractor collect/pay dialogs | ✓ wallet picker | (rows below) |
| POS due collect, pharmacy collect, property POS collect, customer payment form, property milestone split pay | ✓ wallet picker | (rows below) |
| Delivery cash handover | — (designed handover) | ✓ list rows + printed slip prints wallet name |
| Company funds | ✓ movements carry wallet | ✓ payments/withdrawals feed loads `wallet:id,name` |

## Final gaps

### A. Movement happens, but rows/receipts never say which wallet

1. **POS retail sales** — payment rows store `wallet_id`/`wallet_transaction_id`, but
   `PosController::show` loads `payments` without resolving names and the printed
   receipt lists tender lines with method only (`PosController::receipt` ⇒
   `'  Cash: 12.00'`). No wallet on the slip or in the sale detail/history rows.
2. **Pharmacy sales + supplier payments** — `PharmacyPosController::showSale` and the
   `PhPurchase::with('payments')` feed return raw rows; the thermal/pdf receipts never
   print the wallet. Collect dialogs have pickers; the money's destination is invisible
   afterwards.
3. **Fleet invoices** — detail loads `payments:id,fleet_invoice_id,amount,is_refund`
   (wallet columns stripped) and the invoice PDF prints methods only
   (`Paid: 1,000.00 (cash)`).
4. **Parking invoices** — `ParkingInvoice::with('payments')` and
   `PdfService::parkingReceipt` carry no wallet name, though `parking_payments` moved
   the cash through a real wallet leg.
5. **Property POS sales** — `transactions` feed = raw Payment rows (no leg resolution);
   the property sale receipt PDF prints tenders without the wallet.
6. **Customer dues collections** — `customer_payments` moved cash to a chosen wallet,
   but the CRM timeline / customer-ledger rows don't resolve the wallet name (the type
   already carries `wallet_id`; only the statement PDF is wallet-aware).
7. **Contractor collections/payouts** — `showPayable`/detail load `payouts.user` and
   `collections.user` but not `wallet:id,name`; the payable detail and any history rows
   can't show where the cash went.
8. **Booking payments** — `BookingEngine` mirrors every payment to the *default* wallet
   by design ("accounting mirror, not the booking source of truth"), and booking
   payment rows/receipts never show it. At minimum the booking payment feed should
   print/name the mirror wallet so the ledger entry is traceable from the screen.

### B. Wallet picker missing where the backend already accepts `wallet_id`

9. **Vendor payments page** (`/vendor-payments`) — `VendorPaymentController` validates
   `wallet_id` and debits it on approval (default-cash fallback), but the dedicated
   vendor payments dialog posts with no wallet choice, so every vendor pay-out silently
   rides default cash (or the vendor's internal UI elsewhere).
10. **Rent collection page** (`/rent/rent-collection`) — `RentCollectionController`
    accepts `wallet_id` on collection (contractor-collection pattern), but the page has
    zero wallet mentions: no picker in the collect dialog and no wallet on invoice
    payments rows. The collected rent's landing spot is decided server-side only.

### C. Money movement with no wallet accounting at all

11. **Salary payouts** (`markSalaryPaid`) — paid payslips never debit a wallet; salary
    cost is invisible to cash balances.
12. **Employee advances** — advance/paid flows move no wallet leg.
13. **Investor module** — investments, investment withdrawals and profit distributions
    bring cash in and out with no wallet leg (company-fund wallet columns exist but
    these controllers never touch `WalletService`).
14. **Inventory-for-cash sales** (`InventorySaleController`) — sells stock for cash
    without crediting a wallet, so proceeds bypass the shared ledger.
15. **Master payments admin feed** (`/payments` master list) — the cross-module
    payments screen lists raw Payment rows with `payable` only; given the rows already
    carry wallet legs it should resolve + show the wallet name like the earnings feeds.

## Suggested order

1. B-9/B-10 (pickers) and A-1/A-2 (POS + pharmacy names) — one-line feed stamps mirroring
   the earnings pattern, biggest user visibility.
2. A-3..A-7 feeds (same pattern), then C-item modules need a design decision first
   (which wallet disbursements debit — accounts/wages vs. investor custody) before any
   surfacing work matters.
