Skip to content

An standard ER diagram for a point of sale system with stand accounting logic with all table details.

Notifications You must be signed in to change notification settings

najibullahjafari/POS-ER-Diagram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 

Repository files navigation

πŸ“Š POS-ER-Diagram

This repository contains a standard Entity-Relationship (ER) diagram for a Point of Sale (POS) system integrated with accounting logic. The diagram defines all major tables, their relationships, and the reasoning behind their design.

The goal is to provide a scalable and normalized database model that supports sales, inventory, and financial tracking for retail or service businesses. er πŸ“ Tables Overview

  1. Users

Stores system users (cashiers, managers, admins).

Required for authentication, permissions, and tracking who performs sales.

  1. Customers

Holds customer details (name, contact info, type).

Needed for tracking purchases, returns, and loyalty programs.

  1. Suppliers

Stores supplier/vendor details.

Supports purchase orders and inventory restocking.

  1. Products

Core table containing product details (name, code, price, category, unit, tax).

Central to both sales and inventory control.

  1. Categories

Groups products (e.g., beverages, electronics, clothing).

Helps reporting and filtering in POS interfaces.

  1. Sales (Invoices)

Header table for each sale/transaction.

Tracks invoice number, date, customer, user, total, payment method.

Connected to Sales_Items for line details.

  1. Sales_Items

Line items for each invoice.

Contains product ID, quantity, price, discount, and subtotal.

  1. Purchases (GRN / Purchase Invoices)

Header table for recording stock purchases.

Tracks supplier, invoice number, total cost, and user.

  1. Purchase_Items

Line details of purchase invoices.

Contains product, quantity, cost, and total.

  1. Inventory / Stock Movements

Tracks increases/decreases in product stock.

Generated automatically from sales, purchases, and adjustments.

Ensures accurate stock-on-hand and prevents overselling.

  1. Payments

Handles customer payments (cash, card, credit).

Connected to invoices to ensure proper accounting.

  1. Accounts / Ledger

Provides basic accounting logic.

Tracks transactions (sales revenue, expenses, receivables, payables).

Supports double-entry bookkeeping for financial reports.

  1. Returns (Sales_Returns & Purchase_Returns)

Optional but important for real-world POS.

Records product returns from customers or to suppliers.

πŸ”— Relationships

Users β†’ Sales / Purchases: Who performed the transaction.

Customers β†’ Sales: Which customer made the purchase.

Suppliers β†’ Purchases: Which supplier provided the stock.

Sales ↔ Sales_Items: One-to-many (invoice with multiple products).

Purchases ↔ Purchase_Items: One-to-many (purchase with multiple products).

Products ↔ Sales_Items / Purchase_Items: Track product-level movement.

Sales / Purchases β†’ Accounts: Each transaction posts to accounting entries.

Inventory ↔ Products: Updates stock per product.

🎯 Why This Structure?

Scalability – can handle single-store or multi-branch setups.

Accuracy – double-entry accounting ensures financial reliability.

Traceability – every sale, purchase, and return is linked to users, customers, and suppliers.

Inventory Control – stock movement tables keep stock levels consistent.

Compliance – supports auditing and financial reporting.

πŸ“Œ Use Case

This ER model can be used as a foundation for:

Retail POS applications

Restaurant ordering systems

Pharmacy management

Any sales-based system requiring accounting integration

✍️ Author: Najibullah Jafari

About

An standard ER diagram for a point of sale system with stand accounting logic with all table details.

Resources

Stars

Watchers

Forks

Packages

No packages published