HEERA Distributor Control System

SYSTEM AUDIT / PRODUCTION HARDENING

Make HEERA reliable enough for daily distributor operations without rebuilding the system.

This audit focuses on fixing critical failures, improving consistency, and reducing operator friction across order to invoice to delivery to collection to ledger.

SYSTEM SCOPE

What already exists

The system is already functional. The work is to audit, fix, simplify, and harden the existing workflows for real distributor usage.

Owner Login Staff Login Retailers Orders Invoices PDF Sharing Assignments Delivery Collections Ledger Activity Logs

CRITICAL FIXES

High-priority issues to resolve before pilot

01 Collection Flow

Pass complete invoice context into the staff delivery screen.

The staff collection flow cannot be trusted if the screen only receives invoiceId. It must always receive invoiceId, retailerId, retailerName, and amountDue.

  • Ensure collection submission uses full invoice payload.
  • Support both CASH and UPI.
  • Prevent partial navigation state from breaking collection entry.
02 Daily Summary

Show only today's operational numbers.

Daily summary should use proper timestamp filtering for the current day, not all-time aggregates.

  • Today's collections only
  • Today's invoices only
  • Today's pending credit only
03 Ledger Correctness

Remove placeholder arithmetic and rely only on real transactions.

Ledger state must be immutable and transaction-driven. Placeholder logic such as returns = quantity * 100 creates false balances and destroys trust.

  • Use real debit / credit entries only
  • Maintain immutable ledger event history
  • No frontend-computed fake adjustments
04 State Consistency

Track fulfillment and payment states on invoices, not orders.

Orders should stop at order creation and invoice generation. Delivery and payment lifecycle belongs to invoices.

UNASSIGNED ASSIGNED DELIVERED PARTIAL PAID
05 Simplify Unused Complexity

Keep optional systems optional.

Inventory, CSV import, and logistics partner management should not slow the core operator path if they are not required for daily distributor usage.

  • Keep inventory optional
  • Hide or de-emphasize unused logistics flows
  • Keep CSV import available but not central

FLOW SIMPLIFICATION

Reduce operator effort in the paths used every day

Order

Order creation

Default to the shortest valid path. Keep simple order entry available first, with itemized entry as an optional branch.

Invoice

Invoice generation

Use fewer decisions, better defaults, and a direct path from order to invoice to reduce waiting and re-entry.

Collection

Collection entry

Make payment mode, amount due, and retailer context available immediately so staff can finish in a single pass.

DATA SAFETY

Protect balances and prevent duplicate money movement

Cloud Functions own balance updates

Balance mutation logic must run server-side so mobile clients cannot corrupt ledger or invoice balances.

No direct frontend ledger mutation

The frontend can initiate actions, but it should not compute or overwrite ledger state directly.

Duplicate collection protection

Every collection submission should be idempotent or collision-checked to avoid duplicate entries during retries and bad network conditions.

PILOT READINESS

Final goal

A distributor should be able to use HEERA daily for order -> invoice -> delivery -> collection -> ledger without confusion or failure.

WAITLIST

Join the distributor pilot waitlist

Leave your details if you want early access to HEERA pilot usage, rollout updates, and launch communication.

Owner and distributor use cases only
Pilot onboarding happens manually
WhatsApp is the fastest activation path

We review pilot access manually. Your details are used only for HEERA pilot communication.