Introduction
ERPNext provides a structured and integrated sales workflow that connects customer transactions, inventory operations, and financial accounting into a unified system. The sales lifecycle begins with a quotation where pricing and product details are proposed to the customer. Once the quotation is accepted, the process moves through several operational stages including sales order confirmation, delivery planning, goods dispatch, invoice generation, and payment settlement.
From a technical perspective, this workflow is built on the Frappe Framework’s DocType architecture, where each document is stored as a structured database record with relational links to other documents. When a document is created or submitted, ERPNext automatically triggers internal business logic that validates the transaction, updates stock quantities, and records accounting entries where necessary.
Understanding this architecture is essential for ERPNext developers, system administrators, and implementation consultants. By understanding how documents interact internally, organizations can customize workflows, automate sales processes, and maintain complete traceability of transactions.
Part A – Sales Workflow Architecture
1. Overview of the ERPNext Sales Lifecycle
The ERPNext sales lifecycle represents the complete sequence of business activities that occur when a company sells products or services to customers. The process starts with generating a quotation that communicates pricing and product details to a potential customer. Once the customer accepts the quotation, the system converts it into a sales order that confirms the purchase request. The sales order then guides warehouse operations to prepare and dispatch the products through delivery notes. Finally, the transaction is completed when a sales invoice is issued and the customer’s payment is recorded.
This lifecycle ensures that every stage of the sales process is documented and connected with other modules such as inventory and accounting. Each document references the previous stage, which enables businesses to trace the entire transaction history from the initial customer request to final payment.
Customer Inquiry ↓ Quotation ↓ Sales Order ↓ Delivery Note ↓ Sales Invoice ↓ Payment Entry
- Documents are linked using reference fields
- Each stage maintains traceability
- Inventory updates occur during delivery
- Accounting entries occur during invoicing
2. Core Sales DocTypes Used in ERPNext
ERPNext relies on a set of core DocTypes to manage the entire sales workflow. These DocTypes interact with each other through link fields and child tables, allowing ERPNext to maintain relationships between documents.
| Document | Purpose |
|---|---|
| Quotation | Price proposal to customer |
| Sales Order | Confirmation of customer purchase |
| Delivery Note | Records shipment of goods |
| Sales Invoice | Records financial transaction |
| Payment Entry | Records customer payment |
Quotation
│
└── Sales Order
│
└── Delivery Note
│
└── Sales Invoice
│
└── Payment Entry
3. Technical Structure of the Quotation Document
The Quotation document is the starting point of the ERPNext sales process and is designed to capture product pricing proposals for customers. The document stores customer information, pricing details, and tax calculations that define the offer being presented.
Create Quotation ↓ Add Customer ↓ Add Items ↓ Apply Pricing Rules ↓ Apply Taxes ↓ Submit Quotation
| Field | Description |
|---|---|
| customer | Linked customer record |
| transaction_date | Quotation creation date |
| valid_till | Expiry date |
| currency | Pricing currency |
| items | Product child table |
def validate(self):
for item in self.items:
if item.qty <= 0:
frappe.throw("Item quantity must be greater than zero")
4. Customer Master Data Integration
Customer master data determines how pricing rules, taxes, and payment terms are applied in sales transactions. When a customer is selected in a quotation or sales order, ERPNext automatically retrieves relevant information from the Customer DocType.
| Field | Purpose |
|---|---|
| customer_name | Customer identification |
| customer_group | Customer classification |
| territory | Sales region |
| credit_limit | Maximum receivable allowed |
5. Item Master Configuration and Product Data Management
The Item DocType acts as the central repository for product-related information. It stores attributes such as item code, unit of measure, valuation method, and default warehouse.
| Field | Description |
|---|---|
| item_code | Unique product ID |
| item_name | Product name |
| item_group | Product category |
| stock_uom | Unit of measurement |
| valuation_method | Inventory valuation method |
Item Master ↓ Quotation ↓ Sales Order ↓ Delivery Note ↓ Sales Invoice
6. Pricing Rules, Price Lists, and Tax Setup in Quotations
ERPNext provides flexible pricing configurations through price lists and pricing rules. These rules automatically apply discounts or price adjustments based on defined conditions.
| Component | Purpose |
|---|---|
| Price List | Base product pricing |
| Pricing Rule | Conditional discounts |
| Tax Template | Automatic tax calculation |
if customer_group == "Wholesale":
discount_percentage = 10
7. Quotation Approval Workflow
ERPNext allows organizations to define approval workflows that control how quotations are reviewed and approved before submission.
Draft ↓ Pending Approval ↓ Approved ↓ Submitted
8. Document Mapping from Quotation to Sales Order
Document mapping automatically transfers data from quotation documents into sales orders once the customer confirms the purchase.
sales_order = frappe.get_doc({
"doctype": "Sales Order",
"customer": quotation.customer
})
9. Sales Order Creation and Customer Order Confirmation
Sales orders represent confirmed customer purchases and serve as the operational instruction for order fulfillment.
Draft ↓ Submitted ↓ To Deliver ↓ To Bill ↓ Completed
10. Delivery Scheduling and Order Fulfillment Planning
Delivery scheduling allows businesses to plan shipments based on warehouse availability and production timelines.
Sales Order ↓ Warehouse Allocation ↓ Delivery Planning ↓ Create Delivery Note
Part B – Inventory and Financial Integration
11. Warehouse Allocation and Stock Reservation Mechanism
Warehouse allocation is an important operational step that occurs after a sales order is confirmed. At this stage, ERPNext determines the warehouse from which the ordered products will be supplied. The system checks the available stock quantity in the selected warehouse and ensures that sufficient inventory exists to fulfill the order.
From a technical perspective, ERPNext maintains warehouse data through the Warehouse DocType, which stores information about physical storage locations and inventory levels. When items are added to a sales order, the system references stock records from the Stock Ledger to determine the available quantity.
Sales Order Created ↓ Check Warehouse Stock ↓ Reserve Available Quantity ↓ Assign Warehouse for Delivery
| Field | Description |
|---|---|
| warehouse_name | Storage location |
| parent_warehouse | Warehouse hierarchy |
| company | Associated company |
| disabled | Warehouse status |
- Warehouse selection affects delivery processing
- Stock availability comes from Stock Ledger Entries
- Multiple warehouses can serve one order
12. Delivery Note Creation and Goods Dispatch Workflow
The Delivery Note document records the physical shipment of goods from the warehouse to the customer. Once warehouse staff prepare the items for dispatch, a delivery note is generated from the sales order.
When a delivery note is submitted, ERPNext automatically deducts the delivered quantity from warehouse stock. The system also creates stock ledger entries representing the movement of inventory.
Sales Order ↓ Pick Items from Warehouse ↓ Create Delivery Note ↓ Submit Delivery Note ↓ Stock Deducted
| Field | Description |
|---|---|
| customer | Customer receiving goods |
| posting_date | Dispatch date |
| set_warehouse | Warehouse used |
| items | Delivered items |
- Stock quantities are reduced
- Stock ledger entries are created
- Order fulfillment status updates automatically
13. Stock Ledger Entries and Inventory Movement Tracking
ERPNext tracks all inventory movements through the Stock Ledger. Every time stock is added, transferred, or removed, the system creates a Stock Ledger Entry. These entries maintain a historical record of inventory changes.
| Field | Description |
|---|---|
| item_code | Product identifier |
| warehouse | Warehouse location |
| actual_qty | Quantity change |
| valuation_rate | Cost per unit |
| voucher_type | Document reference |
Purchase Receipt ↓ Stock Ledger Entry (+) ↓ Delivery Note ↓ Stock Ledger Entry (-)
14. Batch and Serial Number Management in Deliveries
ERPNext supports batch and serial number tracking for products requiring traceability. Batch tracking is typically used for items produced in groups, while serial numbers identify individual units.
| Batch No | Item | Quantity |
|---|---|---|
| BATCH-001 | Medicine A | 100 |
| BATCH-002 | Medicine A | 80 |
| Serial No | Item | Status |
|---|---|---|
| SN001 | Laptop | Delivered |
| SN002 | Laptop | Delivered |
Item Produced ↓ Batch Created ↓ Stored in Warehouse ↓ Delivery Note ↓ Batch / Serial Recorded
15. Sales Invoice Generation and Document Linking
The Sales Invoice records revenue generated from a completed sale. ERPNext allows invoices to be created directly from sales orders or delivery notes depending on workflow configuration.
Delivery Note ↓ Create Sales Invoice ↓ Calculate Taxes ↓ Submit Invoice
| Field | Description |
|---|---|
| customer | Invoice recipient |
| posting_date | Invoice date |
| due_date | Payment due date |
| items | Products billed |
16. Accounting Integration and General Ledger Entry Creation
ERPNext integrates sales transactions with the accounting module through automatic general ledger entries. When a sales invoice is submitted, the system records revenue and accounts receivable.
| Account | Debit | Credit |
|---|---|---|
| Accounts Receivable | 1000 | |
| Sales Revenue | 900 | |
| Tax Payable | 100 |
Sales Invoice Submitted ↓ Generate GL Entries ↓ Update Financial Reports
17. Tax Calculation Engine in ERPNext Sales Transactions
ERPNext includes a flexible tax calculation engine that applies tax templates to sales documents. These templates calculate tax amounts automatically based on item totals.
| Tax Type | Rate |
|---|---|
| GST | 18% |
| Service Tax | 5% |
Item Total ↓ Apply Tax Template ↓ Calculate Tax Amount ↓ Add to Invoice Total
18. Payment Entry Workflow and Receivable Management
Payment Entry documents record customer payments against invoices. When payments are submitted, ERPNext automatically updates receivable balances and creates accounting entries.
Sales Invoice ↓ Customer Payment ↓ Create Payment Entry ↓ Update Receivable Balance
| Field | Description |
|---|---|
| party | Customer making payment |
| paid_amount | Amount received |
| mode_of_payment | Payment method |
| reference_no | Transaction reference |
19. Handling Partial Deliveries and Partial Billing
ERPNext supports partial delivery and billing scenarios where orders are fulfilled in multiple shipments or invoices. The system tracks delivered and billed quantities to ensure accuracy.
| Item | Ordered | Delivered |
|---|---|---|
| Product A | 100 | 60 |
| Product A | 100 | 40 |
Sales Order ↓ Delivery Note 1 ↓ Delivery Note 2 ↓ Final Invoice
20. End-to-End Document Traceability from Quotation to Payment
ERPNext maintains full traceability between sales documents. Each document links to previous and subsequent records, enabling organizations to track the complete lifecycle of a transaction.
Quotation ↓ Sales Order ↓ Delivery Note ↓ Sales Invoice ↓ Payment Entry
- Full visibility of transaction lifecycle
- Accurate reporting and analytics
- Simplified auditing
- Improved operational transparency
Conclusion
The quotation-to-invoice workflow in ERPNext demonstrates how sales operations, inventory management, and financial accounting work together within a unified ERP system. Each stage of the workflow—quotation, sales order, delivery note, sales invoice, and payment entry—plays a specific role while maintaining strong connections with other documents.
From a technical standpoint, ERPNext uses the Frappe Framework’s DocType architecture and automated business logic to ensure that inventory movements and financial transactions remain synchronized. Features such as document mapping, stock ledger tracking, tax templates, and accounting integration provide a reliable foundation for managing complex sales operations.
By understanding this workflow, developers, ERP administrators, and implementation consultants can design efficient processes, automate repetitive tasks, and build scalable ERPNext implementations that support long-term business growth.
