10. Payments — Recording What Customers Pay
When a customer hands you cash, scans your UPI QR, or transfers to your bank — you record it here. The bill auto-updates and (if WhatsApp is enabled) the customer gets a receipt with the new balance.
Before you start
- 09-billing.md — at least one bill exists to receive payment against
- Optional: 11-whatsapp.md — for auto WhatsApp receipts
Where payments live
Three places, all wired to the same record:
| Where | Use |
|---|---|
| Billing screen → Pay button on a bill row | Quick collect right from the list |
| Bill drawer → Record Payment | When you opened the bill to review first |
| Customer profile → Khata | View all payments for one customer across months |
There's no separate "Payments" main menu — payments live where the bills do.
Recording a payment
- Open the bill (or tap Pay on the row).
- Quick Collect opens with the balance amount pre-filled.
- Adjust if the customer is paying less:
- Amount — ₹ the customer is handing over
- Method — Cash · UPI · Bank Transfer · Cheque · Online
- Reference number — UPI ref, cheque number (optional)
- Date — defaults to today
- Notes — anything you want to remember
- Tap Save.
What happens next:
- Bill
amount_paidincreases. balance_duerecomputes.- Status flips: Generated → Partial (or → Paid if balance hits 0).
- A WhatsApp payment receipt is auto-sent if the customer has WhatsApp opt-in.
Payment methods
| Method | When to use |
|---|---|
| Cash | Most common — physical notes |
| UPI | PhonePe, GooglePay, Paytm, BHIM. Capture the UPI ref ID for traceability |
| Bank Transfer | NEFT / IMPS / RTGS. Record the bank ref |
| Cheque | Write the cheque number in reference |
| Online | Generic catch-all (online portals, payment links) |
Quick collect from the billing list
The fastest path:
- Open Billing screen.
- Find the customer (filter by Overdue / Partial works well).
- On their row, tap Pay · ₹X (the amount is the standalone bill due).
- Inline cash field appears — type the amount, tap ✓.
- Done. Status updates, receipt fires.
No drawer, no extra screens. ~3 seconds per customer when you're walking around collecting cash.
Partial payments
A customer hands you ₹500 of a ₹2,000 bill?
- Tap Pay.
- Type
500. - Save.
Bill becomes:
amount_paid = 500balance_due = 1500status = partial
You can record more payments later — one bill can have many payment rows.
Overpayment — going to advance balance
What if the customer hands you ₹2,500 for a ₹2,000 bill?
The system caps payment input at the bill's standalone due to prevent accidental overpay. So you can only enter up to ₹2,000 against this specific bill.
For the extra ₹500:
- Record it as a separate general payment without a bill_id (no bill_id = goes straight to
customers.advance_balance) - Or apply it to another unpaid bill of theirs
Auto-overpay handling: if you cancel/edit a delivery on an already-paid bill and the bill amount drops below what was paid, the excess automatically moves to the customer's
advance_balance. The bill clamps to clean, and the credit is parked for next month.
Viewing payments per customer
Open any customer → View Khata or the Khata tab. You'll see:
- Every bill (month-wise)
- Payments under each bill — date, method, amount, reference
- Running totals: this month, year-to-date, lifetime
- Advance balance (if any credit is parked)
This is the customer's full financial relationship with you, on one screen.
Deleting a payment
If you recorded the wrong amount or wrong customer:
- Open the bill drawer.
- Find the payment in the Payments section.
- Tap the delete icon.
- Confirm.
The bill recomputes:
amount_paiddecreasesbalance_dueincreases- Status flips back if needed
This is a real delete — the row goes from the database. Use it sparingly; for legitimate refunds, prefer recording a new payment with a negative note instead.
WhatsApp payment receipt
(Auto-fires when Payment received owner toggle is on. See 11-whatsapp.md.)
The customer receives a payment_received message with:
- Business name + customer name
- Billing month + period range
- Amount paid
- Payment method line (e.g. "UPI · Ref 123456 · paid on 30 Apr 2026")
- This month's bill · Previous pending · Remaining balance
- Multi-line summary: products bought + deliveries completed + counter purchases
This is the closest thing customers get to a "till receipt" for their dairy account.
Bulk reminder for overdue payments
When you want to nudge everyone who's behind on payment:
- Billing screen → Send All Reminders (amber button, top-right).
- Modal lists all unpaid bills (across months) with WhatsApp opt-in customers.
- Filter by month / minimum due if you want.
- Select rows.
- Tap Send N Reminders.
- Each customer gets a
payment_overdue_remindertemplate with:- Bill number
- Days overdue
- Pending amount
- "View Bill" button (deep link to their bill PDF)
Useful at month-end or when a few customers are 10+ days late.
Tips
- Record payments the moment they happen. Walking around collecting and recording later = you'll forget who paid.
- Always capture the UPI ref for digital payments. Saves time when reconciling with bank statements.
- Use Quick Collect when on the move; Bill drawer when you want to review first.
- Check Advance Balance regularly. Customers who overpay often forget they have credit.
Common mistakes
| Mistake | Fix |
|---|---|
| Entered ₹5000 instead of ₹500 | Open the bill, find the payment row, delete, re-enter correctly. |
| Wrong customer | Open the wrong customer's bill, delete the payment. Then go to the right customer and re-record. |
| Customer paid for THIS month but you applied to LAST month's bill | Delete the payment from the wrong bill, record on the correct bill. |
| Customer says "I paid via UPI yesterday" but you have no record | Check your UPI app for the ref. Record with that ref + yesterday's date. |
What's next?
- 11-whatsapp.md — auto-receipts and overdue reminders
- 13-reports.md — collection rate, who pays on time
- 16-faq.md — answers to "where do payments go?", "what if customer overpays?", etc.
Related upstream
- 09-billing.md — bills you record payments against
- 05-customers.md — who pays you