◆ booting phatdev.net
<PhatLam/>
000%
← All projects
Full-stack · ERP · Accounting

ERP Tân Doanh

Internal software for inventory, sales, purchasing, warranty, finance and accounting: an append-only ledger that is reversed, never edited, department-scoped permissions, encrypted backups and weekly restore drills.

Internal pilot run

ERP Tân DoanhERP Tân Doanh
Role
Design, development, operations
Platform
Next.js 16, PostgreSQL 16, Docker
Scope
Inventory, sales, purchasing, warranty, finance, accounting
Access
Internal, single sign-on
126
business screens
120
database migrations
60+
tables, ledgers guarded by triggers
14
automated browser test suites

Highlights

Write once, reverse never edit

Stock, cash, obligation and COD ledgers have database triggers that block UPDATE and DELETE. A mistake is fixed with a reversing entry, so every number stays traceable.

A closed order lifecycle

Reservation, dispatch, handover, delivery, COD reconciliation and returns run on one engine; revenue is recognised at successful delivery, with average cost per item and warehouse.

Department-scoped permissions

Permissions are scoped across 6 departments and 4 levels instead of a flat list; delegation needs a reason, an expiry and an approver, and finance actions separate maker from checker.

A parallel general ledger

Journal entries, sales, stock, cash and COD reconciliation, period close and financial statements; running as a draft against the current accounting software before becoming the official ledger.

Encrypted backups, restore drills

Nightly backups plus transaction logs every 30 minutes, encrypted and pushed to a NAS and off-site storage; a restore drill runs weekly and alerts on failure.

Screenshots

Executive overview: revenue, gross profit, stock value and pending workExecutive overview: revenue, gross profit, stock value and pending work
Executive overview: revenue, gross profit, stock value and pending work
Sales orders: filter by status, channel and payment stateSales orders: filter by status, channel and payment state
Sales orders: filter by status, channel and payment state
Stock by warehouse: available quantity, cost and low-stock alertsStock by warehouse: available quantity, cost and low-stock alerts
Stock by warehouse: available quantity, cost and low-stock alerts
Cash funds: balance per fund and daily cash ledgerCash funds: balance per fund and daily cash ledger
Cash funds: balance per fund and daily cash ledger
Warranty tickets: coverage dates and processing stageWarranty tickets: coverage dates and processing stage
Warranty tickets: coverage dates and processing stage
Trial balance following Vietnamese TT200 accountingTrial balance following Vietnamese TT200 accounting
Trial balance following Vietnamese TT200 accounting

Click an image to enlarge, use the arrow keys to browse.

On this page
  1. The problem
  2. The solution
  3. Status
  4. License
  5. Third-party libraries and resources (0)

ERP Tân Doanh is an app for inventory, sales, purchasing, warranty, finance and accounting, built for the Tân Doanh and IGA retail businesses. It is an internal project, in a pilot run and not public.

The problem

Stock, orders, COD, warranty and ledger figures lived in different places, each calculated its own way. Getting gross margin or carrier receivables meant manual reconciliation, and one wrongly edited old document could skew the numbers with nobody knowing where.

The solution

One web app, one PostgreSQL database and one rule: a posted ledger entry is never edited, only reversed.

Inventory and serials

Receipts, issues, transfers and stock counts, scanning by handheld scanner, camera or keyboard. Average cost per item and per warehouse; a warehouse is locked while it is being counted.

Sales and COD

Quotes become orders, with stock reservation, dispatch, carrier handover, delivery, COD reconciliation and returns refunded at the discounted price.

Purchasing and warranty

Supplier orders, reorder suggestions and receiving against orders. RMA warranty cases link to existing warranty data and compute expiry from the label.

Finance and accounting

Cash accounts, receipts and payments, obligations, journal entries, reconciliation and financial statements. Accounting currently runs as a draft in parallel with the existing accounting software.

Permissions and data safety

Department-scoped permissions, encrypted backups, weekly restore drills, and business tests that run inside a transaction and roll back so no data is dirtied.

Status

In an internal pilot with data synced one way from the storefront and warranty systems. Every undecided business rule runs on a pre-selected option listed inside the app, so changing an option changes the reports in a controlled way.

License

Source code is not public, all rights reserved. The code of this project is not kept on the web server, so there is no license file to check against.

Developed for Tân Doanh.

The screenshots on this page were taken by me from the running version of the project.

See the License and credits page →

Third-party libraries and resources (0)

No list yet: the code of this project runs on another machine and I will add it once it has been scanned.

More projects