Case Study: Haoliaoya (Hao Liao Ya) — Food Wholesale & Inventory ERP System
Project Code: haoliaoya
Category: Enterprise Resource Planning (ERP) / Wholesale Distribution
Status: Active (Port 8020)
Industry: Food Manufacturing & Wholesale Distribution
1. Project Name
Haoliaoya ERP — A full-featured enterprise resource planning system for a food wholesale and distribution business in Taiwan, covering product management, procurement, sales orders, inventory control, costing, and customer/supplier relationship management.
2. Core Technology Stack
| Layer | Technology |
|---|---|
| Backend Framework | Django 4.2+, Python 3 |
| Database | PostgreSQL (dedicated: haoliaoya) |
| Admin UI | django-baton (Material Icons), django-autocomplete-light |
| Data Export/Import | pandas, openpyxl (Excel bidirectional) |
| Rich Content | CKEditor |
| Frontend | Django Templates (RWD) |
| Hosting | GCP / Docker |
Custom Apps Built (14 total):
cores · products (product catalogue, variants, units) · procurements (purchase orders, supplier invoicing) · customers · orders (sales order lifecycle) · contents (CMS for product descriptions) · stocks (inventory tracking, safety stock alerts) · costs (COGS calculation, margin reporting) · carts (order draft management) · ivic (inventory in/out control) · inbound_ops (goods receipt, quality inspection) · dashboards · front · admin_helpers
3. The Challenge (The Problem)
Small-to-medium food wholesalers in Taiwan typically operate on a patchwork of spreadsheets, paper delivery notes, and phone-based orders — a workflow that creates four compounding problems:
- Inventory accuracy collapse: Without real-time stock movements, overselling is routine. Physical counts diverge from records within days, forcing expensive emergency procurement and damaging customer relationships.
- Cost opacity: In food wholesale, raw material costs fluctuate frequently. Without a systematic COGS tracking layer, operators cannot tell whether individual product lines are profitable, making pricing decisions intuitive rather than data-driven.
- Order-to-delivery friction: Manual order entry and paper-based pick lists create transcription errors and make partial-shipment tracking impossible. When a customer calls about a missing item, there is no system of record to consult.
- Procurement without signals: Without a safety stock alert system, reordering is reactive — buyers place orders only when shelves are visibly empty, creating cycle stock volatility and frequent stockouts.
4. The Solution (The Implementation)
Feature 1: Multi-Tier Product & Unit Management
The products app supports a hierarchical product structure with variant management (SKU-level) and a multi-unit system — a food product can be purchased by the carton (30 bags), sold by the bag, and costed per kilogram, with automated conversion between all three units. This eliminates the manual conversion arithmetic that is a persistent source of invoice errors in food wholesale.
Feature 2: End-to-End Order Lifecycle with Inventory Lock
The orders and ivic apps work in concert: when a sales order is confirmed, the ordered quantity is immediately locked in the inventory ledger, preventing the same stock from being sold twice. As goods are picked and shipped via inbound_ops, stock levels update in real time. The system tracks partial fulfillments, backorders, and multi-shipment orders at the line-item level.
Feature 3: Cost Layer & Margin Reporting
The costs app maintains a current and historical COGS per SKU, updated when goods are received at a new purchase price. The dashboards app surfaces real-time margin reports by product, customer, and sales period — giving management the visibility to identify unprofitable SKUs and negotiate better purchase prices with suppliers.
Feature 4: Safety Stock Alerts & Procurement Signals
The stocks app allows operators to define a minimum safety stock level per SKU. When inventory falls below threshold (either from sales or warehouse movements), the system generates a procurement alert. The procurements app then supports the full purchase order workflow from supplier selection through goods receipt and invoice matching.
Feature 5: Comprehensive Development Infrastructure
The system includes a mature development methodology: dev_progress tables for sprint tracking, documentation with full worklog history (most recent: 2026-03-27), and docs/requirements specification library — reflecting a production-quality engineering practice rather than a prototype.
5. Business Impact (The Result)
- Inventory accuracy: Real-time inventory locking on order confirmation eliminates the double-sell scenario. Safety stock alerts convert reactive procurement into proactive replenishment.
- Cost visibility: Management can now answer "which SKUs are profitable?" from a dashboard rather than constructing the answer from spreadsheet fragments.
- Order accuracy: Multi-unit automated conversion removes transcription errors between purchase, storage, and sale units — a critical reliability improvement in a product category where a "1 kg vs 1 bag" error has real financial consequences.
- Labour efficiency: The entire order-to-invoice workflow is handled in the system. Manual re-entry of orders from phone/paper into separate billing and stock systems — a common source of wasted hours in SME wholesale — is eliminated.
- [Needs Manual Input]: Number of active SKUs, monthly order volume, specific stock accuracy improvements, procurement cycle time reduction.
6. AI / Innovation Factor
- Django-Native ERP Architecture: The system demonstrates that a full-featured ERP (14 interconnected apps) can be delivered on the Django framework at a fraction of the licensing cost of SAP Business One or Oracle NetSuite — a cost architecture particularly relevant for Australian SMEs where software licensing expenses can represent a disproportionate share of operating costs.
- Shared Core Mixin Library: The
coresapp provides reusable model base classes (UserUpdateModel,ActiveModel,CodeNO) that enforce audit logging, soft deletion, and automatic document numbering across all 14 apps consistently — a design pattern that dramatically reduces the maintenance burden as the system scales. - Excel Bidirectionality: The pandas/openpyxl integration enables bulk product and inventory data import from Excel (for migration from legacy systems) and export to Excel (for external reporting) without manual data re-entry — meeting the practical reality that accountants and logistics teams in Taiwanese SMEs rely on Excel for downstream processing.
- [Needs Manual Input]: Any planned AI integration for demand forecasting or supplier price benchmarking.
Document generated: 2026-05-03 | Maintained by Tom Lai / You Er Ta Mu She Ji
