NCC ERP — New Crystal Copier

One system for sales, rentals, stock, service and money across fifteen branches.

Category
Enterprise ERP
Stack
PHP · MySQL · Custom MVC · Android
Status
Live operational system
Documentation
Complete case study

Screens withheld — this system runs on live client records. The structure above and the figures below are published instead.

01

Overview

NCC ERP is the operating system of New Crystal Copier, a copier and printer dealership that sells, rents and services machines across fifteen branches. Every machine has a life inside the business: quotation, sale or rental contract, installation, meter readings, service calls, spare parts, and eventually replacement. The ERP holds that life in one place, with the paperwork, ledger entries and stock movements attached to it.

02

Business context

A dealership like this runs three commercial models at once: outright sale, rental contracts billed against meter readings, and maintenance contracts with scheduled service. Each produces a different document, a different revenue timing, and a different follow-up task.

Underneath all of it sits inventory: machines, consumables, spares, serialised units, and stock that physically moves between branches and warehouses. A sale, a rental installation, a service visit and a return all change stock, and each change has to be traceable to a document and a person.

So the system has to behave like an accounting system and an operations system at the same time. That pressure shaped every structural decision in it.

03

Problem statement

  • Rental income has to be billed per contract cycle from meter readings, with slab rates, minimums, and mid-cycle changes.
  • The same machine appears as sold stock, rental asset, service subject and replacement candidate. Those views must not drift apart.
  • Stock moves between branches over days, so quantities have to stay reconcilable without anyone hand-editing a balance.
  • Service work arrives as a complaint, is assigned to an engineer, consumes parts, and has to show up in both service history and stock.
  • Management reporting spans sales, rent, service and finance at once, per branch and in total.
04

Solution overview

A single server-rendered PHP application over MySQL, organised around the documents the business already uses: quotation, invoice, rental contract, job card, voucher, transfer. Each module owns its documents and posts the consequences — stock movement, ledger entry, service record — through shared services.

Access is scoped by branch. A user holds permissions per branch, so the same person can manage one location and read another. Reports resolve against the branches the viewer is allowed to see.

Everything that leaves the building is printable: invoices on pre-printed stationery, job cards for engineers, statements for customers, and report packs for the owner.

05

Core modules & workflows

Sales & billing

  • Quotation and customer order capture
  • Sales invoices with serialised items
  • Sale returns and adjustments
  • Customer ledger and outstanding
  • Billing series and barcode labels

Rental & contracts

  • Rental contracts and contract types
  • Meter reading capture
  • Monthly rental billing
  • Renewal, machine swap and closure

Inventory & warehouses

  • Product master, categories, brands, UOM conversion
  • Branch and warehouse stock
  • Inter-branch requests, deliveries and receipts
  • Stock transfers, adjustments and verifications
  • Serialised machine register and customer devices

Purchasing & suppliers

  • Purchase entry and line items
  • Purchase returns
  • Supplier ledger and dues

Field service

  • Complaint logging
  • Job cards and work logs
  • Engineer assignment and incentives
  • Quality checks
  • Spare recovery and returns

Finance

  • Cash and bank receipts and payments
  • Cheque clearance
  • Branch settlements
  • Cash handovers

People

  • Employee records and team leaders
  • Attendance and leave balances
  • Payroll runs, payslips and salary structures
  • Engineer issues and returns

Administration & reporting

  • Users, roles and per-branch permissions
  • Audit log and edit history
  • Report definitions
  • Branch dashboard
06

System architecture

Client

Server-rendered PHP pages in the browser, with a companion Android app for field and branch use.

Application

Custom MVC structure: controllers per module, service layer for billing, stock and ledger rules, shared helpers for permissions and printing.

Data

MySQL. 231 tables in the audited mirror. Quantity changes are written as stock transactions and money as ledger rows, never as overwritten totals.

Output

Invoice, quotation, job card and report templates rendered server-side for A4 and dot-matrix printers.

Table counts, module inventory and figures on this page were read from a local mirror of the production schema during an audit — not from a live production query.

07

Technology stack

PHPMySQLCustom MVCAndroid

Server-rendered PHP over MySQL with a custom MVC structure, plus an Android client used in the field. It runs on a single LAMP host, chosen because the business needed to own and afford its own deployment.

08

Engineering decisions

01

Stock movement is a ledger, not a counter

Quantities are written as transactions — in, out, transfer, adjustment — and balances are derived. It costs query time and removes the class of bug where two screens disagree about what is in a branch.

02

Never repair history by editing it

When a reported figure is wrong, the fix goes into the report query or a compensating transaction. Stock and serial tables are treated as append-only, backed by audit tables and triggers.

03

Branch scope is a first-class permission

Every user is bound to branches and holds permissions per branch. Authorisation is checked on the server for every list, document and report — not just hidden in the menu.

04

Billing rules live in one place

Rental cycles, slab rates, minimums and prorated periods are computed in a single service layer, so the invoice screen, the monthly run and the report agree by construction rather than by coincidence.

05

Design for the printer

A large share of daily use is paper: invoices on stationery, job cards for engineers, statements for customers. Print templates are treated as product features, not exports.

09

My contribution

Architecture & data model

Mine. Entity design, module boundaries, permission model, and the billing and stock rules the system is built on.

Module implementation

AI-assisted. A large share of module code was produced with AI assistance against written specifications, then reviewed, corrected and exercised against live-shaped data.

Critical logic

Written and reviewed directly: rental billing, ledger posting, stock reconciliation and the heavier report queries.

Delivery, migration & support

Mine. Deployment, moving prior records into the system, training the staff who use it, and ongoing fixes.

10

Challenges

01

Reconciling stock across fifteen branches

Transfers take days, units sit in transit, and requests and receipts happen in different branches. Reconciliation needed an explicit model of counted versus expected stock, which became the verification and freeze features.

02

Rental billing edge cases

Mid-cycle rate changes, meter resets, machines swapped under an existing contract, part-month billing. Each case is a rule in the billing service, not an exception handler bolted onto a screen.

03

Reporting on a large transaction history

Reports run against six figures of stock rows. Several were rewritten to aggregate in SQL over indexed date and branch keys instead of pulling rows into PHP and summing them there.

04

Earning trust in the numbers

The hard part of an operations system is not features, it is whether the owner believes the report. Audit tables, edit history and reconciliation screens exist for that reason alone.

11

Verified results

23 modules
15 branches
4,374 customers
120,621 stock transactions audited mirror
118 employees
3,550 products
  • 23 modules in production use, serving 15 branches, 118 employees and 4,374 customers.
  • 3,550 products with 120,621 recorded stock transactions in the audited mirror.
  • A single shared database replaced per-branch registers and separate spreadsheets for sales, rent and stock.
12

Status & limitations

Live operational system Running the day-to-day operations of a multi-branch dealership.
  • Single-server LAMP deployment. No cluster, no managed failover, no container orchestration.
  • No automated test suite. Correctness is checked through scripted audits and reconciliation of reports against real records.
  • The interface is functional-first: dense, fast for trained staff, and not a showcase of interaction design.
  • Not multi-tenant. One installation serves one business.
  • The schema still carries audit and migration snapshot tables from past reconciliations.

Contact

Let’s build something useful.

Have a business workflow to improve, a product idea to develop, or a software role to discuss? Get in touch.

BaseIndia · IST · UTC+05:30