Sales Module Manual

Full Documentation for Sales Management, Invoicing, and POS Operations.

Module Overview

The Sales Module is the core of the revenue cycle, facilitating the transformation of inventory into revenue. It supports standard invoicing, Point of Sale (POS) operations, and detailed financial tracking including VAT, discounts, and customer ledger management.

Primary Goal: To manage sales transactions accurately, update stock levels in real-time, and ensure correct financial documentation through automatic ledger updates.

Step-by-Step Workflow

1

Sales Index & Search

Access the 'Sales' menu to view all invoices. Filter by date, branch, cost center, or customer ledger to audit past transactions.

2

Create Standard Invoice

Click 'Add New'. Select the Date, Branch, and Customer Ledger. Add items from the product price list. Specify quantities, rates, and any applicable discounts or tax (VAT).

3

Stock & Accounts Validation

Upon saving, the system validates available quantity. It then deducts stock from product_price_lists and generates Double Entry accounting vouchers in accounts (Debit Customer/Cash, Credit Sales).

4

Receipt & Challan Printing

Generate professional Invoices, Delivery Challans, or Mushak 6.3 documents immediately after saving or from the index list actions.

5

SMS Notifications

If configured, the system automatically sends SMS notifications to customers with invoice details and balance updates upon successful transaction commit.

Point of Sale (POS) System

The system includes a dedicated POS interface for rapid retail operations featuring:

  • Barcode Integration: Rapidly add items by scanning unique or model barcodes.
  • Multi-Account Payment: Support for partial payments via Cash, Bank, or Mobile Banking.
  • Fast Search: Category-wise item filtering and live text search.
  • Hold/Resume: Capability to put active carts on hold to process other customers.

Configuration Settings

Form behavior is dictated by SalesFormSetting, allowing administrators to customize fields and default accounts.

Setting Description
_default_sales Default Sales Account for credit entries.
_default_inventory Inventory ledger to track COGS (Cost of Goods Sold).
_default_vat_account Ledger where VAT collected from customers is tracked.
_cash_customer Defines which ledger represents random walk-in customers requring full payment.

Database Schema

Core tables managing the sales lifecycle:

Table Name Primary Columns Purpose
sales id, _date, _ledger_id, _total Main invoice header record.
sales_details _no, _item_id, _qty, _sales_rate Line items for each invoice; links to stock price lists.
sales_accounts _no, _ledger_id, _dr_amount Stores payment splits for POS or credit sales.
sales_barcodes _no_id, _barcode, _item_id Tracks specific serial numbers sold for warranty/tracking.
item_inventories _transection_ref, _qty, _cost_value Inventory ledger impact record.

Model Relationships

Eloquent models in app/Models/:

  • Sales:
    • _master_details(): HasMany SalesDetail (Line items).
    • s_account(): HasMany SalesAccount (Payment details).
    • _ledger(): BelongsTo AccountLedger (Customer).
    • _sales_man(): BelongsTo AccountLedger.
  • SalesDetail:
    • _items(): Fetches product info from Inventory.
    • _warrant(): Links to Warranty terms.

View File Mapping

Blade templates located in resources/views/backend/:

Category Blade View Usage
Accounting sales.index / create / edit Standard back-office sales management.
Retail pos.index Fast-paced POS touchscreen interface.
Reports sales.net_sales_after_return Profitability view after adjusting for returns.
Prints sales.print / challan Physical document templates.

Controller Function Details

Logical breakdown of SalesController.php:

Method Action Technical Logic
index Listing Fetches sales with advanced organization and branch-wise permissions.
posSalesSave POS Save Handles rapid barcodes, inventory deduction, and multi-ledger payment processing in a single transaction.
store Standard Save Full business logic: Stock check, COGS calculation, Ledger postings, and SMS triggering.
update Modify Critical Logic: Reverses old stock impacts before applying new details to ensure inventory consistency.
moneyReceipt Financial Generates a printable money receipt for payments associated with a specific invoice.
mushakSixThree Tax/VAT Generates the official VAT 6.3 report required for local tax compliance.
checkAvailableQty Inventory AJAX utility to verify item stock availability before allowing a line-item to be added.
categoryWiseItem AJAX Utility Returns JSON data of stock-available items for POS category navigation.
destroy Restriction Returns a denial message to prevent historical data loss; manual voiding is preferred.