Automation
3 document types, 1 shared numbering function
NamelesTek
Loading experience
Internal Systems
Real financial infrastructure for an NGO — donation receipts, expense vouchers, and sales invoices — with collision-safe numbering and one-tap WhatsApp delivery, fast enough for non-technical staff.

The Challenge
An NGO needed real financial infrastructure — donation receipts, expense vouchers, and sales invoices — that met basic accounting hygiene (sequential, collision-free numbering; proper audit trails) while remaining fast enough for non-technical staff to issue on the spot and deliver through the channel donors actually use.
The Solution
A single collision-safe numbering pattern reused across all three document types: filter existing records to those matching today's date prefix (DR-YYYYMMDD-, SR-YYYYMMDD-, or a voucher-type prefix like RV-/MV-/SV-), take the highest existing sequence number for that prefix, increment by one, and zero-pad. The same logic, written once, guarantees no duplicate numbers regardless of which staff member is issuing documents concurrently.
The Engineering
Next.js with a server-side WhatsApp integration (/api/whatsapp/send-document) that wraps the Meta Graph API's two-step flow: upload the generated PDF to /{phone_number_id}/media, then send it as a document message referencing the returned media ID — turning what would otherwise be "download a PDF, open WhatsApp, manually attach it" into one server call. PDFs are generated entirely client-side via jsPDF, so no server-side rendering pipeline is required for document creation.
Collision-safe document numbering
New document request
receipt / voucher / invoice
Filter by today's date prefix
Find highest existing sequence
Increment + zero-pad
DR- / RV- / MV- / SV- / SR- number
PDF → WhatsApp delivery
jsPDF
generated client-side
/api/whatsapp/send-document
Meta Graph API
upload to /{phone_number_id}/media
Sent as document message
referencing returned media ID
Built For
The System
One voucher schema flexibly represents two different accounting shapes through a single conditional: finalAmount = voucherType === 'reimbursement' ? itemsTotal : singleAmount. Maintenance and salary vouchers use a flat amount field; reimbursement vouchers compute their total from a dynamic array of line items — both validated and numbered through the same code path rather than two parallel systems. Expense data aggregates into a payee × month pivot (tracking maintenance, reimbursement, and salary totals separately per payee per month) computed client-side via useMemo.

Admin financial dashboard

Expense voucher creation

Sales invoice creation

Monthly expense report

Balance report

Document delivery via WhatsApp
The Outcome
Receipt, voucher, and invoice numbering is automated and collision-safe across three document types using one shared sequencing function, removing manual numbering and the renumbering errors that come with it. Document delivery is automated end-to-end from PDF generation to WhatsApp send, eliminating the manual "generate, download, attach, send" sequence. A single voucher schema serves three distinct expense categories without branching into separate forms or tables per type.
Automation
3 document types, 1 shared numbering function
Automation
PDF generation → WhatsApp send, end-to-end
Architecture
1 voucher schema serves 3 expense categories
Technologies
Some systems and client engagements are subject to confidentiality agreements. Screenshots shown here have been selected or generalized to avoid exposing private client information.
Let's scope the architecture and plan the build.