HJSys

Run distributor operations with stock, invoices, and profits in one place.

HJSys is a distributor management system for procurement, sales, finance, and owner oversight. It centralizes purchase orders, invoicing, payments, stock updates, overdue tracking, and gross profit and commission calculations so the team can work from one source of truth.

Business Goals

  • Reduce manual admin work for purchase, sales, and finance processing by at least 60% within 3 months of launch.
  • Cut stock reconciliation errors to under 1% of monthly transactions within 90 days.
  • Improve invoice collection visibility so overdue invoices older than 7 days are identified automatically for 100% of active customers.
  • Generate monthly sales, overdue, and commission reports in under 2 minutes per report for finance and owners.
  • Increase invoice-to-payment tracking completeness to 98% or higher within the first quarter.

User Goals

  • Let procurement staff create and receive purchase orders quickly without re-entering product data.
  • Let finance staff issue invoices, record partial payments, and see overdue accounts automatically.
  • Let sales reps view their own paid-commission estimates without accessing sensitive financial data beyond their scope.
  • Let owners see real-time gross profit and stock position across the business.
  • Ensure product price history stays accurate even after master prices change.

Non-Goals

  • Do not build multi-warehouse stock allocation in the MVP.
  • Do not build WhatsApp reminders or message automation in the MVP.
  • Do not support returns, credit notes, or giro clearing workflows in the MVP.
  • Do not build customer self-service portals or e-commerce checkout in the MVP.

Procurement Admin Rina, 32 - Rina manages supplier orders and product stock for daily replenishment. She needs a fast way to create purchase orders, receive goods, and keep inventory accurate without spreadsheet work.

Procurement Admin Rina, 32

  • As a procurement admin, I want to create purchase orders from existing products, so that I can send orders to suppliers quickly.
  • As a procurement admin, I want stock to increase automatically when a purchase order is marked received, so that inventory stays accurate.
  • As a procurement admin, I want to see supplier history and item pricing, so that I can compare buying patterns before reordering.

Finance Admin Dedi, 38 - Dedi handles invoicing, customer payments, and overdue accounts. He needs accurate totals, partial payment tracking, and reliable overdue flags to keep cash flow visible.

Finance Admin Dedi, 38

  • As a finance admin, I want to create invoices with item price snapshots, so that historical invoices remain unchanged when product prices are updated later.
  • As a finance admin, I want to record multiple payments against one invoice, so that partial settlements are tracked correctly.
  • As a finance admin, I want overdue invoices to be flagged automatically, so that I can prioritize collection follow-up.

Owner Arman, 49 - Arman needs a clear view of profit, commissions, and operational health without digging into transaction details. He cares about decision-ready reports and control over all data.

Owner Arman, 49

  • As an owner, I want to see gross profit per invoice and in aggregate, so that I can judge business performance.
  • As an owner, I want sales commission to be calculated only on fully paid invoices, so that payouts are fair and consistent.
  • As an owner, I want role-based access control, so that sensitive finance data is only visible to authorized users.

Master Data Management · High priority

  • Provide structured maintenance of suppliers, clients, sales reps, and products so all transactions use consistent reference data.
  • Support unique codes for suppliers, clients, sales reps, and products.
  • Store client credit limit, tax address, tax number, and default payment term.
  • Allow product pricing and unit management with stock quantity tracking.
  • Prevent deletion of master records that are already referenced by transactions.
  • Support search and filtering by code, name, and phone.

Procurement Purchase Orders · High priority

  • Enable purchase order creation, lifecycle tracking, and automatic stock addition on receipt.
  • Support purchase order statuses draft, sent, received, and cancelled.
  • Calculate purchase totals from line items and tax mode.
  • On received, add quantities to product stock exactly once.
  • Block receiving a cancelled purchase order.
  • Retain historical purchase prices on order items.

Sales Invoicing and Stock Deduction · High priority

  • Enable invoice creation with customer and sales rep assignment, item price snapshotting, and stock deduction on invoicing.
  • Support invoice statuses draft, invoiced, and cancelled.
  • Capture buy price snapshot and sell price snapshot at the moment items are added.
  • On invoiced, deduct product stock exactly once per invoice.
  • On cancellation of an invoiced invoice, restore stock quantities automatically.
  • Validate due date, customer assignment, and item availability before invoicing.

Payments, Overdue, and Receivables · High priority

  • Track partial and full payments per invoice and automatically flag overdue balances.
  • Allow multiple payment records per invoice with date, amount, method, and reference number.
  • Recalculate paid amount after every payment insert, update, or delete.
  • Set payment status to unpaid, partially_paid, paid, or overdue according to rules.
  • Run a daily scheduled job after midnight to mark overdue invoices.
  • Provide overdue reporting by customer, aging bucket, and date range.

Profit, Commission, and Reporting · Medium priority

  • Calculate gross profit and sales commission accurately from transactional data and provide exportable reports.
  • Compute gross profit at line and invoice level using snapshot prices and discounts.
  • Exclude cancelled invoices from revenue, profit, and commission calculations.
  • Calculate commission only for paid invoices using the sales rep rate.
  • Export sales recap, overdue list, and commission detail to Excel.
  • Generate printable PDFs for delivery notes, invoices, and purchase orders.

First-Time Setup and Daily Use

  • Create the company profile, user accounts, and role assignments in under 15 minutes.
  • Add master data for suppliers, clients, sales reps, and products with CSV import support.
  • Set default tax behavior, payment terms, and numbering rules.
  • Create the first purchase order and receive stock to verify inventory flow.
  • Create the first invoice and record a payment to confirm finance flow.
  • Reach first useful output, such as a printable invoice or stock report, within 30 minutes of setup.

1. Manage master data

  • Users create and maintain suppliers, clients, products, and sales reps from structured forms and searchable tables.
  • Require unique codes and basic validation for required fields.
  • Use inline search and filters to find records fast.
  • Prevent accidental deletion when records are already linked to transactions.

2. Create a purchase order

  • Procurement users select a supplier, add items, apply tax mode, and save a draft or send it onward.
  • Auto-calculate line subtotals and order totals.
  • Allow editing in draft only, then lock content after send or receive.
  • Handle invalid quantities, missing prices, and unavailable products with form errors.

3. Receive goods and update stock

  • When a purchase order is marked received, the system updates inventory automatically and records the final receipt state.
  • Increase stock only once per order receipt event.
  • Prevent double counting if the status change is repeated.
  • Show stock movement history for audit review.

4. Create invoice and issue it

  • Finance users create invoices for clients and sales reps, with item-level price snapshots and payment terms.
  • Store snapshot prices from current product data at the time of entry.
  • Calculate subtotal, tax, discounts, total, and gross profit immediately.
  • Deduct stock when invoice status becomes invoiced and prevent invoicing beyond available stock unless explicitly allowed by configuration.

5. Record payments and monitor receivables

  • Users add one or more payments against an invoice and the system updates the payment status automatically.
  • Recalculate paid amount and status after each payment change.
  • Mark overdue invoices through the daily scheduled job.
  • Show aging and collection status on invoice and customer views.

Power User and Edge-Case Support

  • Bulk CSV import for master products and clients with validation preview.
  • PDF generation for invoices, purchase orders, and delivery notes.
  • Excel exports for sales recap, overdue aging, and commission statements.
  • Audit trail for stock-impacting status changes.
  • Role-based screens for owner, procurement, finance, and sales rep.
  • Readonly commission dashboard for sales reps with payment-qualified earnings only.

Fast, Clear, Audit-Friendly UI

  • Use dense data tables with quick filters, sticky totals, and obvious status badges.
  • Keep critical actions such as receive order, invoice, cancel, and record payment behind confirmation dialogs.
  • Display stock impacts and profit totals in plain language alongside numeric values.
  • Support keyboard-friendly forms, high-contrast statuses, and readable invoice print layouts.
  • Optimize tables and reports for sub-2 second loads on typical VPS hardware.

Rina used to receive supplier deliveries in a spreadsheet, then manually update stock counts later in the day. That meant stock was often wrong during the busiest hours, and the sales team sometimes promised items that were already sold out.

With HJSys, she creates a purchase order, receives it in the system, and stock updates instantly. The sales and finance teams now see the same inventory data, so the owner gets cleaner reporting and fewer costly mistakes.

On the finance side, Dedi issues invoices with saved price snapshots, records partial payments, and lets the system mark overdue accounts automatically. Arman can open the dashboard and immediately see gross profit, commission liability, and outstanding receivables without asking for a manual recap.

User-Centric Metrics

  • 90% of purchase orders are created in under 5 minutes.
  • At least 95% of invoices are issued without manual recalculation corrections.
  • Stock discrepancies stay below 1% of monthly item movements.
  • 100% of invoice payments are attached to an invoice record.
  • Overdue invoices are flagged within 24 hours of passing due date.
  • Sales reps can view commission estimates with less than 1 minute of navigation time.

Business Metrics

  • Reduce month-end closing effort by 50% within 3 months.
  • Increase on-time collection visibility for 100% of active receivables.
  • Cut manual report preparation time by 70% within the first quarter.
  • Achieve 80% weekly active usage among operational users after rollout.
  • Maintain 99% transaction traceability for profit and commission audit requests.

Technical Metrics

  • 99.5% monthly uptime on a single VPS deployment.
  • 95th percentile page response time under 2 seconds for transactional screens.
  • Zero silent stock mutations without an audit record.
  • Scheduled overdue job completes within 5 minutes for up to 10,000 invoices.

Tracking Plan

  • Track user_login by role and tenant/company context.
  • Track purchase_order_created, purchase_order_received, and purchase_order_cancelled.
  • Track sales_invoice_created, sales_invoice_invoiced, and sales_invoice_cancelled.
  • Track payment_recorded with amount and method.
  • Track overdue_job_completed with count of invoices updated.
  • Track export_generated for PDF and Excel outputs.
  • Track commission_report_viewed by sales rep and owner roles.

Technical Needs

  • Use Laravel 11 with FilamentPHP for the admin interface.
  • Implement MySQL 8 with transactional integrity and foreign keys.
  • Use queued jobs and scheduler for overdue checks and document generation.
  • Implement role-based authorization using Laravel policies and middleware.
  • Build idempotent stock mutation services for receive and invoice status changes.
  • Use Laravel events or observers to keep payment and profit totals synchronized.
  • Containerize deployment for Ubuntu 22.04 via Docker or Coolify with Nginx reverse proxy.

Integration Points

  • Laravel DomPDF for invoice, delivery note, and purchase order PDFs.
  • Maatwebsite Excel for report exports.
  • SMTP or transactional email service such as Mailgun for optional notification support.
  • Optional object storage such as S3-compatible storage for generated documents.
  • Authentication via Laravel Breeze or Filament auth with standard session login.

Data Storage & Privacy

  • Store only business-relevant personal data such as names, phone numbers, addresses, and tax numbers.
  • Restrict finance data to authorized roles through server-side authorization checks.
  • Keep audit logs for stock changes, invoice status changes, and payment edits.
  • Support data export and deletion workflows where legally required for personal records.
  • Apply least-privilege access and encrypted secrets management for production credentials.

Scalability & Performance

  • Use database indexes on invoice number, PO number, due date, payment status, and foreign keys.
  • Paginate all master and transaction lists to avoid loading large tables at once.
  • Cache reference data such as products and sales reps for read-heavy views.
  • Use background jobs for PDF generation and overdue scanning when data volume grows.

Potential Challenges

  • Double-counted stock changes when statuses are toggled repeatedly; mitigate with idempotent state transition guards and audit fields.
  • Historical price drift if snapshots are not captured at item entry; mitigate by storing immutable snapshot fields on invoice items.
  • Incorrect overdue status due to timezone or scheduler issues; mitigate with standardized application timezone and monitored cron execution.
  • Commission disputes from changing invoice totals after payment; mitigate by calculating commission from immutable paid invoices and preserving calculation history.
  • Role leakage exposing sensitive financial data; mitigate with strict policies, scoped queries, and role-specific Filament resources.

Team & resourcing - Small team - 2 backend engineers, 1 UI/UX designer, part-time QA, part-time PM

Phase 1: Core MVP · Weeks 1-4

  • Authentication and role-based access control
  • Master data CRUD for suppliers, clients, sales reps, and products
  • Purchase order module with receive-to-stock logic
  • Sales invoice module with stock deduction and price snapshots
  • Basic payment recording and overdue flagging
  • Initial dashboard and printable invoice PDF

Phase 2: Finance and Reporting · Weeks 5-7

  • Gross profit calculation on invoice and line item level
  • Commission calculation for paid invoices only
  • Excel exports for sales recap, overdue list, and commissions
  • Enhanced invoice and receivables views
  • Daily scheduled overdue job with logs

Phase 3: Operational Hardening · Weeks 8-9

  • Audit trail for stock-impacting actions
  • Improved validation and edge-case handling for cancellations
  • Performance tuning for list pages and reports
  • Document templates for purchase order and delivery note
  • Role-specific UI refinements for procurement, finance, sales, and owner

Phase 4: Launch Readiness · Weeks 10-12

  • Production deployment on single VPS
  • Backup and restore procedures
  • Monitoring and error reporting setup
  • User acceptance fixes and training materials
  • Go-live checklist and data migration support

Paste this into Cursor, Bolt, Lovable, or v0 to start building.

Build a distributor management web app called HJSys using Laravel 11, FilamentPHP v5, and MySQL 8. Create a production-ready admin system for procurement, finance, sales, and owner roles.

Core modules:
1. Authentication and role-based authorization for super-admin, procurement, finance_sales, and salesman.
2. Master data CRUD for suppliers, clients, sales reps, and products.
3. Purchase orders with statuses draft, sent, received, cancelled. When a PO is marked received, increase product stock exactly once.
4. Sales invoices with statuses draft, invoiced, cancelled and payment statuses unpaid, partially_paid, paid, overdue. When invoiced, deduct stock exactly once. If an invoiced invoice is cancelled, restore stock exactly once.
5. Invoice items must store immutable buy_price_snapshot and sell_price_snapshot from products at entry time. Never recalculate historical invoices when product prices change.
6. Payments module that supports multiple payments per invoice and recalculates paid_amount and payment_status automatically.
7. Gross profit calculation per line and invoice, plus commission calculation only for fully paid invoices using sales rep commission_rate.
8. Daily scheduler job that marks unpaid or partially_paid invoices overdue when due_date has passed.
9. PDF generation for invoice, delivery note, and purchase order using DomPDF. Excel exports for sales recap, overdue aging, and commission reports using maatwebsite/excel.
10. Audit-friendly transaction history and role-specific dashboards.

Primary screens:
Dashboard, Suppliers, Clients, Sales Reps, Products, Purchase Orders, Sales Invoices, Payments, Reports, Users and Roles.

Data model:
users, suppliers, clients, sales_reps, products, purchase_orders, purchase_order_items, sales_invoices, sales_invoice_items, payments.
Use proper foreign keys, timestamps, soft deletes where appropriate, and indexed columns for invoice_number, po_number, due_date, payment_status, and foreign keys.

Implementation requirements:
Use Laravel policies and middleware for access control. Use database transactions for all stock-impacting status changes. Make stock mutation idempotent. Add server-side validation for unique codes, required references, quantity > 0, and non-negative amounts. Use queued jobs for PDF generation and the overdue scheduler. Build responsive Filament resources with searchable tables, filters, status badges, and print/export actions. Include seeders for demo data and a clean, maintainable service layer for inventory and financial calculations.

Default deployment target: Dockerized Laravel app on a single Ubuntu 22.04 VPS behind Nginx, with MySQL 8 and scheduled cron execution.

Business Idea

# PRODUCT REQUIREMENT DOCUMENT (PRD) ## 1. PROJECT OVERVIEW - **System Name:** HJSys (Harapan Jaya Management System) - **Target Tech Stack:** Laravel 11.x, FilamentPHP v5, MySQL 8.0 - **Target Infrastructure:** Single VPS Ubuntu 22.04 LTS (Dockerized / Coolify / Native Nginx) - **Objective:** Mengotomatiskan seluruh siklus administrasi distributor—mulai dari procurement (PO Masuk), penjualan (PO Keluar/Invoice), manajemen stok otomatis, pelacakan piutang overdue, hingga kalkulasi presisi untuk keuntungan kotor (*gross profit*) dan komisi sales. --- ## 2. USER ROLES & ACCESS CONTROL | Role ID | Role Name | Tanggung Jawab & Hak Akses | | :--- | :--- | :--- | | `super-admin` | Super Admin / Owner | Akses penuh ke seluruh data, laporan keuangan, komisi sales, margin keuntungan, dan manajemen pengguna. | | `procurement` | Admin Procurement | Mengelola Master Supplier, Master Produk, dan Transaksi PO Masuk (Purchase Order ke Supplier). | | `finance_sales` | Admin Finance & Sales | Mengelola Master Client, PO Keluar, Invoice Penjualan, Pencatatan Pembayaran, dan Pelacakan Overdue. | | `salesman` | Salesman | Access Read-only / Draf input untuk PO Keluar dan melihat estimasi komisi pribadi. | --- ## 3. FASE 1: FITUR WAJIB (MVP - MUST HAVE) ### 3.1. Master Data Management - **Master Supplier:** `code`, `name`, `phone`, `address`, `top_days` (Term of Payment default). - **Master Client:** `code`, `name`, `owner_name`, `phone`, `delivery_address`, `tax_address`, `tax_number`, `credit_limit`, `top_days`. - **Master Salesman:** `code`, `name`, `phone`, `commission_rate` (Persentase default, misal `2.00`%). - **Master Produk:** - `sku`, `name`, `unit` (Dus/Pack/Pcs), `buy_price`, `sell_price`, `stock`. ### 3.2. Procurement / PO Masuk (Purchase Order) - **Status Lifecycle:** `draft` -> `sent` -> `received` -> `cancelled`. - **Field Utama:** `po_number`, `supplier_id`, `order_date`, `tax_type` (`non_ppn`, `include_ppn`, `exclude_ppn`), `tax_amount`, `total_amount`, `notes`. - **Item Transaksi:** `product_id`, `qty`, `buy_price`, `subtotal`. - **Automated Stock Rule:** Saat status PO Masuk berubah menjadi `received`, stok barang di `products.stock` **otomatis bertambah**. ### 3.3. Penjualan & Invoicing (Sales Order & Invoicing) - **Pemisahan Status Transaksi & Pembayaran:** - **Status Invoice:** `draft` -> `invoiced` -> `cancelled`. - **Status Payment:** `unpaid` -> `partially_paid` -> `paid` -> `overdue`. - **Field Utama:** `invoice_number`, `client_id`, `sales_rep_id`, `invoice_date`, `due_date`, `invoice_status`, `payment_status`, `tax_type`, `subtotal_amount`, `tax_amount`, `discount_amount`, `total_amount`, `paid_amount`, `gross_profit_total`. - **Item Transaksi:** `product_id`, `qty`, `buy_price_snapshot`, `sell_price_snapshot`, `discount_item`, `subtotal`, `gross_profit`. - **CRITICAL BUSINESS RULES:** 1. **Price Snapshotting:** Saat item dimasukkan ke invoice, system **WAJIB** menyimpan `buy_price_snapshot` dan `sell_price_snapshot` dari tabel `products`. Perubahan harga master produk di masa depan tidak boleh mengubah data histori invoice lama. 2. **Automated Stock Rule:** - Saat `invoice_status` diubah menjadi `invoiced`, stok barang di `products.stock` **otomatis berkurang**. - Jika invoice berstatus `invoiced` diubah menjadi `cancelled`, stok barang wajib **dikembalikan (rollback)** secara otomatis. ### 3.4. Keuangan, Piutang & Overdue Tracking - **Pencatatan Pembayaran:** Menampung riwayat cicilan/pembayaran per invoice (`sales_invoice_id`, `payment_date`, `amount`, `payment_method` [transfer/cash/giro], `reference_number`). - **Update Status Tagihan:** - Jika `paid_amount` = 0 -> Status `unpaid`. - Jika `paid_amount` < `total_amount` -> Status `partially_paid`. - Jika `paid_amount` >= `total_amount` -> Status `paid`. - **Automated Overdue Check:** Scheduled task (Cron Job) berjalan harian (pukul 00:01). Mengidentifikasi invoice berstatus `invoiced` dengan `payment_status` `unpaid` / `partially_paid` yang mana `now() > due_date`, kemudian memperbarui `payment_status` menjadi `overdue`. ### 3.5. Kalkulasi Keuntungan & Komisi Sales - **Rumus Keuntungan Kotor (Gross Profit):** $$\text{Gross Profit Item} = (\text{sell\_price\_snapshot} - \text{buy\_price\_snapshot}) \times \text{qty} - \text{discount\_item}$$ $$\text{Gross Profit Invoice} = \sum(\text{Gross Profit Item}) - \text{discount\_amount\_invoice}$$ - **Rumus Komisi Sales:** Calculated **HANYA** dari invoice berstatus `invoiced` dengan `payment_status` = `paid` (lunas). $$\text{Nilai Komisi} = \text{Total Nominal Invoice Lunas} \times \left( \frac{\text{sales\_rep.commission\_rate}}{100} \right)$$ ### 3.6. Export & Document Generation - **PDF Generation (`barryvdh/laravel-dompdf`):** - Cetak Surat Jalan menggunakan `delivery_address`. - Cetak Invoice Tagihan menggunakan `tax_address` dan menampilkan `tax_number`. - Cetak Purchase Order. - **Excel Export (`maatwebsite/excel`):** Export Rekap Penjualan, Laporan Overdue, dan Rincian Komisi Sales. --- ## 4. FASE 2: ROADMAP PENGEMBANGAN MASA DEPAN 1. **WhatsApp API Gateway:** Send PDF Invoice & Auto Reminder H-3 / H+1 Overdue. 2. **Multi-Warehouse Support:** Pelacakan stok di beberapa gudang terpisah dan fitur Transfer Stok. 3. **Modul Retur & Credit Note:** Penanganan barang rusak/retur toko yang memotong sisa tagihan piutang. 4. **Enforcement Limit Kredit:** Penguncian otomatis pembuatan invoice baru jika piutang toko melebihi `credit_limit`. 5. **Salesman Mobile Portal (PWA):** Tampilan khusus *smartphone* untuk input order langsung dari lokasi toko. 6. **Pencatatan Giro Mundur:** Pengelolaan pencairan giro dengan tanggal kliring resmi. --- ## 5. DATABASE SCHEMA (DBML) ```dbml Table users { id bigint [pk, increment] name varchar email varchar [unique] password varchar role enum('super-admin', 'procurement', 'finance_sales', 'salesman') created_at timestamp updated_at timestamp } Table suppliers { id bigint [pk, increment] code varchar [unique] name varchar phone varchar address text top_days int [default: 0] created_at timestamp updated_at timestamp } Table clients { id bigint [pk, increment] code varchar [unique] name varchar owner_name varchar phone varchar delivery_address text tax_address text [null] tax_number varchar [null] credit_limit decimal [default: 0] top_days int [default: 30] created_at timestamp updated_at timestamp } Table sales_reps { id bigint [pk, increment] user_id bigint [null, ref: > users.id] code varchar [unique] name varchar phone varchar commission_rate decimal [default: 2.00] created_at timestamp updated_at timestamp } Table products { id bigint [pk, increment] sku varchar [unique] name varchar unit varchar [default: 'Pcs'] buy_price decimal [default: 0] sell_price decimal [default: 0] stock int [default: 0] created_at timestamp updated_at timestamp } Table purchase_orders { id bigint [pk, increment] po_number varchar [unique] supplier_id bigint [ref: > suppliers.id] order_date date status enum('draft', 'sent', 'received', 'cancelled') [default: 'draft'] tax_type enum('non_ppn', 'include_ppn', 'exclude_ppn') [default: 'non_ppn'] tax_amount decimal [default: 0] total_amount decimal [default: 0] notes text [null] created_at timestamp updated_at timestamp } Table purchase_order_items { id bigint [pk, increment] purchase_order_id bigint [ref: > purchase_orders.id] product_id bigint [ref: > products.id] qty int buy_price decimal subtotal decimal } Table sales_invoices { id bigint [pk, increment] invoice_number varchar [unique] client_id bigint [ref: > clients.id] sales_rep_id bigint [ref: > sales_reps.id] invoice_date date due_date date invoice_status enum('draft', 'invoiced', 'cancelled') [default: 'draft'] payment_status enum('unpaid', 'partially_paid', 'paid', 'overdue') [default: 'unpaid'] tax_type enum('non_ppn', 'include_ppn', 'exclude_ppn') [default: 'non_ppn'] subtotal_amount decimal [default: 0] tax_amount decimal [default: 0] discount_amount decimal [default: 0] total_amount decimal [default: 0] paid_amount decimal [default: 0] gross_profit_total decimal [default: 0] notes text [null] created_at timestamp updated_at timestamp } Table sales_invoice_items { id bigint [pk, increment] sales_invoice_id bigint [ref: > sales_invoices.id] product_id bigint [ref: > products.id] qty int buy_price_snapshot decimal sell_price_snapshot decimal discount_item decimal [default: 0] subtotal decimal gross_profit decimal } Table payments { id bigint [pk, increment] sales_invoice_id bigint [ref: > sales_invoices.id] payment_date date amount decimal payment_method enum('transfer', 'cash', 'giro') reference_number varchar [null] notes text [null] created_at timestamp updated_at timestamp }

Make My PRD

Design by The Resonance | Powered by GPC – The AI Transformation Company

    PRD: # PRODUCT REQUIREMENT DOCUMENT (PRD) ## 1