← BACK TO SYSTEMS
Flagship case study · sole software engineer

VaatcoBMS

Built after studying the factory and warehouse on site for a pharmaceutical and aquaculture manufacturer—a 5-module full-stack ERP used by all 30 employees through role-based portals, cutting multi-step manual workflows by an estimated 50–60%.

SYSTEM SCOPE

5 modules (Sales & territory, HR & payroll, Manufacturing Inventory & BOM, Returns & traceability, Accounting) · .NET 8 · PostgreSQL · Role-based portals & employee leaderboard

Open the live system

50–60% less manual work

Cut manual accounting, handwritten production & stock logs

30 active employees

Employee ESS portals, GPS attendance & leaderboard

2–3 days → On demand

Income statement, balance sheet & gross profit statement

1 transaction boundary

GL sync, reversals & accurate COGS

CORE ARCHITECTURAL LIFECYCLE

End-to-End Sales, Warehouse Dispatch & Billing Workflow

I designed and built a four-stage sales delivery workflow connecting booking with credit check, carton packing, FEFO (first-expiry-first-out) delivery challan dispatch with transport logistics (Truck, Courier, Hand Delivery), and invoice approval with GL posting. Managers and officers book orders, log hand-collected cash, and maintain sales and collection entries directly—cutting manual accounting through automated double-entry GL posting while eliminating phantom stock and mismatched dealer dues with one canonical customer-due formula.

STAGE 01Field Sales

Field Booking

  • Managers & officers book orders, log hand-collected payments & maintain sales/collection entries
  • Credit limit & outstanding due checks
  • Strict read-only role policy post-booking
0 physical stock deducted at booking
STAGE 02Warehouse

Carton Packing

  • Allocate PM shipping cartons per order
  • Visual stock readiness & staging indicators
  • Packing costs hidden from field users
0 GL impact until dispatch/billing
STAGE 03Dispatch

Delivery Challan Dispatch

  • FEFO (first-expiry-first-out) batch allocation lock
  • Assign transport logistics: Truck, Courier, Hand Delivery
  • Cleanly deducts FG & PM stock at shipment
  • Authorized 4-party delivery challan
Prevents phantom inventory drift
STAGE 04Finance / Admin

Invoice Approval

  • Double-entry GL booking (AR / Rev / COGS)
  • Routes PM carton costs to packaging expense accounts
  • Syncs CustomerDue via single canonical calc
Immutable ledger lock & mirror reversals
SYSTEM ARCHITECTURE · PHYSICAL TO FINANCIAL DATA FLOWSingle PostgreSQL Transaction Boundary
NODE 01

Factory & BOM

Dispensing scale variance check & BOM consumption

UnitCost = Value / Stock
NODE 02

Inventory Control

GL 1300 RM · GL 1400 PM · FG batch expiry tracking

Zero-tolerance Pcs
NODE 03

4-Stage Dispatch

Booking → Packing → FEFO Challan (Truck/Courier/Hand)

No phantom stock
NODE 04

JournalPostingService

Single GL choke point · AR/AP sub-ledger sync

SUM(Dr) == SUM(Cr)
NODE 05

On-Demand Reports

Income Statement, Balance Sheet & Gross Profit

0.00 Sub-Ledger Var
PRODUCTION INTERFACE TOUR · 7 LIVE MODULES

Inside VaatcoBMS — Real Screens from Production

Actual interfaces built for daily operations across Sales, Warehouse Dispatch, Manufacturing Cost Analytics, Batch Expiry, Dual-Gate Leaderboards, and Reconciled General Ledger reporting.

VaatcoBMS › Sales & Delivery Orders
VaatcoBMS Sales and Delivery Orders screen showing 59 dispatched challans, FEFO stock deduction, pipeline filters, and lifecycle stage indicators
SCREEN 01·

Sales & Delivery Orders — 4-Stage Lifecycle

Tracks commercial bookings through packing, FEFO (first-expiry-first-out) challan dispatch with assigned transport logistics, and financial invoicing with live lifecycle indicators.

FEFO Stock Deduction5-Dot Stage TrackerOne-Click Invoice Conversion
PILLAR 01 / SALES & COLLECTIONS

Eliminating conflicting dealer balances and resolving the bulk collection puzzle

Business pain point

A dealer pays one amount against several invoices. If each screen allocates that money differently, the business cannot reliably answer what is still owed—or who owns the account after a territory change.

How I engineered the solution

  • Managers and officers book orders and enter hand-collected payments into the system; deterministic FIFO payment replay absorbs OpeningDue first, honors pinned invoices, settles oldest-first, and carries excess as an advance.
  • One CustomerDueCalculator is reused across dashboards, ledgers, and PDF statements.
  • Effective-dated ZSM > RSM > ASM > TSM > TO geography governs access. Mid-period transfers change live access immediately while preserving period targets with the previous manager through month-end; managers may hold dual roles.
  • An audited cash commission engine uses configurable age windows, with statutory VAT withholding and a transactional double-claim lock.

Defensible business impact

A single explainable balance is available across views, bulk payments follow one repeatable allocation rule, and manager transfers preserve both immediate access boundaries and month-end performance ownership.

FAILURE-CLASS ENGINEERING

Two deep engineering debugging stories

When a system behaves unexpectedly, classify the failure before changing the data.

DEBUG STORY / 01PostgreSQL concurrency

The second save that silently failed

Consecutive Unit of Work saves raised false concurrency exceptions when a generated token was not synchronized back to the ORM.

  1. 01Inspected the save sequence and generated-token lifecycle.
  2. 02Added a BEFORE INSERT OR UPDATE trigger named trg_set_rowversion on token tables.
  3. 03Used store-generated ORM synchronization so the next save uses the database-issued token.
Verification invariant

A committed row version must match the version used by the following Unit of Work save.

DEBUG STORY / 02Failure-class thinking

The journal existed, the record did not

An accounting credit note appeared in the GL but was missing from its UI screen—a read-path classification problem, not a reason to post it again.

  1. 01Built a read-only classification script and mapped journal source modules.
  2. 02Moved tab filtering server-side and added a reconciliation banner.
  3. 03Wrote a guarded header-reconstruction script that never double-posts an existing journal.
Verification invariant

Repair the missing source record without duplicating a journal that already exists.

The system's business invariants are the center of the engineering story.

Discuss a systems challenge