09. Billing & Khata — Monthly Bills
The Billing screen replaces the back of your paper register where you used to write "Ramesh — March — ₹4,200". MilkGo computes the monthly bill from delivery and counter-sale records and keeps it up to date as you mark deliveries through the month.
Before you start
- 06-subscriptions.md — at least one subscription so deliveries exist
- 07-deliveries.md — and/or 08-counter.md — so there's something to bill
You don't generate bills manually. They build up as deliveries / sales accumulate.
Where to find it
Bottom navigation → Billing (receipt icon).
There's also a per-customer view: open any customer → View Khata button. That shows only that customer's bills across months.
Bill lifecycle
Draft → Generated → Sent → Paid / Partial / Overdue
| Status | What it means |
|---|---|
| Draft | Bill is being built up as deliveries are marked. Editable. |
| Generated | Month is over (or you tapped Generate). Bill total is locked in. |
| Sent | You sent the bill via WhatsApp. Customer has the PDF. |
| Partial | Customer paid some, balance still due. |
| Paid | Fully paid, balance = 0. |
| Overdue | Past due date with balance > 0. |
Auto-reopen behaviour: if you add a new delivery to a Paid month later, the bill flips back to Partial automatically. Money already collected stays.
How a bill is built
For each customer, each month, MilkGo aggregates:
| Component | Source |
|---|---|
| Delivery items | Marked deliveries (subscription-based) for that month |
| Counter sale items | Walk-in sales linked to that month |
| Adjustments | Manual additions / discounts you add |
| Previous balance | Carryover from earlier unpaid months (informational; doesn't double-count) |
Final amount = Total items + Adjustments
Balance due = Final amount − Amount paid
Reading the Billing screen
Each card shows:
- Bill number (e.g.
BILL-202604-001) and period (1 Apr – 30 Apr) - Customer name + code
- Status badge (color-coded)
- Bill amount · Paid · Due in a single line
- Quick action buttons — Pay, Remind (if enabled)
Filter & search
Top of screen:
- Status tabs — All / Generated / Partial / Paid / Overdue
- Search box — by customer name, customer code, or bill number
Useful for sweeping through "who's overdue" at month-end.
Opening a bill — the Bill drawer
Tap any bill row → drawer slides in with:
| Section | What's there |
|---|---|
| Header | Customer + month + status |
| Delivery items | Each product, total qty, rate, amount |
| Counter items | Same, for walk-in sales |
| Adjustments | Manual ₹+/− entries you've added |
| Previous balance | Carryover info |
| Totals | Bill amount, paid, balance due |
| Payments | Each payment recorded against this bill |
| Actions | Send via WhatsApp · Record Payment · Adjustment · PDF |
Manual adjustments
Sometimes you want to add a discount or extra charge:
- Open the bill.
- Tap + Add Adjustment.
- Pick:
- Type — Discount (₹−) or Extra (₹+)
- Description — e.g. "Diwali discount" or "Late delivery refund"
- Amount — in ₹
- Save.
Adjustments are listed separately on the bill PDF so customers see what changed.
Send the bill via WhatsApp
(Only visible if your plan has WhatsApp + the Monthly bill owner toggle is on. See 11-whatsapp.md.)
Two ways:
Single bill
- Open the bill drawer.
- Tap Send Bill via WhatsApp.
- The customer receives:
- A WhatsApp message with the bill_summary template (month, products, total, paid, pending)
- A PDF attachment with full delivery details
- Bill status flips from
Generated→Sentafter a successful send.
Bulk send — "Send All Due"
- On the Billing screen, tap Send All Due (top-right, green button).
- A modal opens listing all unpaid bills for the chosen month.
- Select / deselect specific customers (default = all selected).
- Tap Send N Bills.
- Watch the progress bar — each bill is sent one by one with a 350 ms gap (rate-limit safe).
- End screen shows totals: Sent / Failed / Cancelled.
Bulk failures (e.g. customer's WhatsApp number is blocked) appear in the failed list with the reason. You can Retry Failed in one tap.
Bill PDF
The PDF auto-generated from the bill is in the owner's preferred language (Gujarati / Hindi / English). It contains:
- Header with your business name + phone
- Customer block with name + address
- Bill number + month + due date
- All delivery items grouped by product (qty, rate, amount)
- All counter sale items
- Subtotal · Adjustments · Final amount · Paid · Balance due
- Footer with your contact for queries
To download manually: open the bill → Download PDF.
Recording a payment
Tap Pay (or open the bill → Record Payment). See the full flow in 10-payments.md.
Tips
- Don't worry about "generating" bills. They build as you mark deliveries. Open them at month-end for a final review.
- Add adjustments before sending. Once the customer has the PDF, changes look messy. Adjust → review → send.
- Use the bulk send on the 1st of the next month. Most owners send all due bills the same day they generate.
- Filter by Overdue regularly. End of week, sweep the overdue list and tap Remind on each.
Common mistakes
| Mistake | Fix |
|---|---|
| Bill amount looks wrong | Open the bill — check delivery items vs your records. Edit any wrong delivery on the Deliveries screen and the bill auto-recomputes. |
| Sent the bill but customer says "didn't get it" | Check Settings → WhatsApp Notifications → usage. If quota was full, message wasn't actually sent. Resend after next month resets. |
| Customer paid more than the bill | Excess goes to advance balance automatically — see 10-payments.md. |
| Two customers got the same bill number | Bill numbers are owner-scoped, so duplicates can't happen for one owner. If you see BILL-202604-001 twice on Customer A and B — that's actually two different rows; check the customer column. |
What's next?
Once bills are flowing, focus on collection:
- 10-payments.md — record what customers pay
- 11-whatsapp.md — auto-send + reminders
- 13-reports.md — collection rate, top customers
Related upstream
- 06-subscriptions.md — deliveries → bill items
- 07-deliveries.md — what gets billed
- 08-counter.md — counter sales also land on the bill