📊 System Overview
A comprehensive multi-tier inventory and sales tracking system designed for Factory, Dealer, and Shop users to manage goods flow, payments, and profit calculations efficiently.
Workflow Diagram
Factory → Dealer → Shop → Customer
↓ ↓ ↓ ↓
Payments Payments Payments Payments
↓ ↓ ↓ ↓
Dashboard Dashboard Dashboard Dashboard
👥 User Roles & Responsibilities
🏭 Factory User
- Send goods to dealers
- Set factory prices
- Receive payments
- Track dealer dues
- Monitor total sales
🚚 Dealer User
- Receive factory goods
- Set dealer prices
- Supply shops
- Manage payments
- Calculate profits
🏪 Shop User
- Receive dealer goods
- Sell to customers
- Manage credit sales
- Track collections
- Customer management
📈 Process Flow & Data Management
Factory Operations
| Action | Data Tracked | Dashboard Metrics |
|---|---|---|
| Send Goods to Dealer | Dealer name, products, quantities, factory price, invoice amount | Total sent goods value, payment received, dues |
| Receive Payment | Invoice reference, amount, date, payment method | Payment history, dealer status |
Dealer Operations
| Action | Data Tracked | Dashboard Metrics |
|---|---|---|
| Receive Factory Goods | Stock update, factory pricing | Current stock levels |
| Send to Shops | Shop details, dealer prices, quantities | Goods sent value, shop dues |
| Payment Management | Factory payments, shop collections | Profit calculation, cash flow |
Shop Operations
| Action | Data Tracked | Dashboard Metrics |
|---|---|---|
| Customer Sales | Customer info, products, prices, credit terms | Sales volume, credit exposure |
| Payment Collection | Customer payments, credit settlement | Collection efficiency, outstanding |
| Stock Management | Inventory levels, dealer supplies | Stock turnover, reorder points |
💾 Database Structure
Core database tables required for the system:
// Users Table
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100),
type ENUM('factory', 'dealer', 'shop'),
contact_info TEXT,
created_at TIMESTAMP
);
// Products Table
CREATE TABLE products (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(100),
description TEXT,
factory_price DECIMAL(10,2)
);
// Factory-Dealer Transactions
CREATE TABLE factory_dealer_transactions (
id INT PRIMARY KEY AUTO_INCREMENT,
from_factory_id INT,
to_dealer_id INT,
product_id INT,
quantity INT,
factory_price DECIMAL(10,2),
total_amount DECIMAL(10,2),
date DATE,
status ENUM('sent', 'received')
);
Additional tables: payments, dealer_shop_transactions, customer_sales, customer_payments
🚀 Implementation Steps
- Database design and setup
- User authentication system
- Role-based dashboard development
- Transaction management modules
- Payment tracking system
- Reporting and analytics
- Testing and deployment