Sales fulfillment lifecycle
Sales fulfillment turns a customer request into a controlled commercial flow. A quotation can become a Sales Order. The order can reserve stock, drive delivery, create a bill, and collect payment. Delivery Notes, returns, credit notes, stock records, and accounting records remain linked so that sales, inventory, and finance show the same progress. For the wider domain, see Sales and commerce and Point of sale and subscriptions.
Lifecycle model
The lifecycle uses linked business documents rather than one fixed path. Each later document carries references to the earlier document and updates delivered, billed, returned, installed, or paid progress.
This diagram shows the main paths from a customer offer to fulfillment and collection.
flowchart LR
Q[Quotation] -->|accepted| SO[Sales Order]
SO -->|reserve or plan stock| F[Fulfillment work]
F -->|ship goods| DN[Delivery Note]
SO -->|bill ordered goods| SI[Sales Invoice]
DN -->|bill delivered goods| SI
SO -->|request advance| PR[Payment Request]
PR -->|customer payment| PE[Payment Entry]
SI -->|collect receivable| PE
DN -->|return goods| DR[Return Delivery Note]
SI -->|reverse charge| CR[Credit Note]
DR --> CR
DN --> L[Stock and accounting records]
SI --> L
PE --> L
The common path is quotation to Sales Order to Delivery Note to Sales Invoice. The system also supports advance payment against an order, direct billing from an order, and invoices that update stock when no Delivery Note is used. These paths meet at shared order progress and accounting records.
References: erpnext/…/mapper.py• L54-59 erpnext/…/mapper.py• L221-410 erpnext/…/mapper.py• L421-665 erpnext/…/mapper.py• L76-221
Commercial commitment
Quotation
The Quotation is a time-bound offer for a customer or an earlier sales party such as a lead or prospect. It records the proposed items, prices, taxes, terms, delivery context, and payment schedule before the customer commits. Submission updates the related sales opportunity or lead to the quotation stage.
An accepted Quotation becomes a Sales Order through a linked conversion. The conversion carries only the remaining quantity. It excludes unused alternative items and prevents a target document with a different customer, company, or currency from absorbing the offer. Unless settings allow it, an expired Quotation cannot create an order. A Quotation reports Partially Ordered until its valid items are fully ordered.
Quotation versions preserve the history of an offer. Only one version is active at a time. A version with ordered quantity cannot be revised. A lost version cannot be revised or used for billing, and a quotation with an order cannot be set as lost. When the active version is canceled, the latest remaining version can become active again.
The quotation status also separates an open offer from an offer that was lost, ordered, canceled, or expired. This status drives the actions available to create an order, create an invoice, mark the offer lost, or create a new version.
References: erpnext/…/quotation.py• L166-225 erpnext/…/quotation.py• L275-331 erpnext/…/quotation.py• L365-405 erpnext/…/quotation.py• L417-487 erpnext/…/quotation.py• L499-533 erpnext/…/mapper.py• L15-178 erpnext/…/mapper.py• L181-239 erpnext/…/test_quotation.py• L668-682 erpnext/…/test_quotation.py• L684-767
Sales Order
The Sales Order is the customer commitment that controls fulfillment. It fixes the customer, company, ordered items, expected dates, warehouse choices, prices, taxes, terms, and any advance payment plan. It can also mark items for supplier delivery or skip the Delivery Note step.
Service items can skip the Delivery Note when the selling setting allows it. Stock components in a product bundle still require delivery. If the setting changes, the order recalculates the item flag and delivery progress so that old values do not leave the order in a false completed state.
After submission, the order can create the work needed to fulfill its remaining commitment. This can include material requests, pick lists, work orders, production plans, supplier Purchase Orders, projects, maintenance records, or a subcontracting inward order. The right branch depends on the item, delivery mode, remaining quantity, order status, and user permission. The system does not require one fixed next document.
Stock reservation protects the remaining quantity for the order. Reservation is separate from delivery: it protects supply but does not reduce physical stock until a stock-affecting document is submitted. Reservation can start at order submission or later from the order. Closing or canceling the order releases the remaining reservation. A submitted order row cannot close while its stock remains reserved.
The order can hold a delivery schedule. A schedule divides an item quantity across dated deliveries. Delivery-note creation can then select the required dates and remaining quantities. The server checks the schedule against the actual order row and keeps the schedule within the ordered quantity. Changes to an item quantity or unit also rescale or remove its schedule rows.
Subcontracted orders use a separate fulfillment branch. Each service row must identify a valid finished good and its production basis. The order can create a subcontracting inward order, and item changes become restricted after that inward order is submitted. Closing the Sales Order also closes its submitted inward orders.
Submitted orders remain editable only within their remaining commitment. An item cannot be reduced below its delivered quantity. Closing an item writes off its pending quantity and removes it from later delivery, billing, or production mapping. Cancellation is blocked for closed orders or orders with draft downstream invoices, and cancellation removes schedules and reservations.
References: erpnext/…/sales_order.py• L221-305 erpnext/…/sales_order.py• L399-435 erpnext/…/sales_order.py• L506-624 erpnext/…/sales_order.py• L675-689 erpnext/…/mapper.py• L61-160 erpnext/…/mapper.py• L221-410 erpnext/…/mapper.py• L723-899 erpnext/…/mapper.py• L985-1043 erpnext/…/mapper.py• L1052-1141 erpnext/…/delivery_schedule.py• L23-149 erpnext/…/reservation.py• L19-191 erpnext/…/subcontracting.py• L16-69 erpnext/…/sales_order.js• L87-137 erpnext/…/sales_order.js• L970-1221 erpnext/…/sales_order.js• L1874-1908 erpnext/…/test_sales_order.py• L116-243 erpnext/…/test_sales_order.py• L1034-1147
Fulfillment progress
Order status
Sales Order status combines delivery progress, billing progress, and advance-payment progress. The separate fields show why an order is still open. An order can need shipment, billing, an advance payment, or more than one of these at the same time.
| Order condition | Meaning |
|---|---|
To Deliver and Bill | The submitted order still needs delivery and billing. |
To Bill | Delivery is complete or skipped, but billing is incomplete. |
To Deliver | Billing is complete, but delivery is incomplete and required. |
To Pay | The order has an advance payment request. |
Completed | Delivery is complete or not required and billing is complete. |
On Hold, Closed, or Cancelled | Fulfillment is paused or ended by an explicit order state. |
The delivery_status, billing_status, percentage fields, picking percentage, supplier receipt progress, and advance-payment status provide the detail behind the main status. Partial delivery and partial billing remain visible. Supplier-delivered quantities use linked purchase progress. Picking remains separate from delivery. Closed item rows are excluded from later open-quantity work and trigger a progress recalculation.
References: erpnext/…/status.py• L21-186 erpnext/…/status_updater.py• L43-68 erpnext/…/sales_order.py• L399-426 erpnext/…/sales_order.py• L675-689 erpnext/…/sales_order.json• L1271-1349 erpnext/…/sales_order.json• L1645-1654
Fulfillment work
The order exposes work that can satisfy its remaining commitment. Each work record consumes only the quantity still needed, so repeated actions do not create duplicate supply or production work.
| Fulfillment need | Related record |
|---|---|
| External supply | Material Request or supplier Purchase Order |
| Internal production | Work Order or Production Plan |
| Warehouse preparation | Pick List |
| Customer shipment | Delivery Note |
| Customer service or project work | Maintenance Visit, Maintenance Schedule, or Project |
| Customer-provided subcontracting | Subcontracting Inward Order |
Pick-list mapping preserves manually selected locations. Automatic location assignment is used only when manual picking is not selected. For product bundles, the pick list calculates the remaining quantity for each component from that component's picked quantity and its share of parent delivery progress. Component pick quantities use the component stock unit, so a bundle sold in another unit does not change the warehouse quantity. Reservation and pick data carry the component source and serial or batch context into later delivery work.
References: erpnext/…/mapper.py• L127-159 erpnext/…/mapper.py• L723-899 erpnext/…/mapper.py• L985-1043 erpnext/…/mapper.py• L1052-1141 erpnext/…/sales_order.js• L102-134 erpnext/…/sales_order.js• L1073-1105 erpnext/…/reservation.py• L78-163 erpnext/…/test_sales_order.py• L88-114 erpnext/…/test_sales_order.py• L369-453
Delivery Note
The Delivery Note records the physical handover of goods to the customer. It can be made from a Sales Order, a Pick List, or a Sales Invoice. Its item links preserve the source order and item row. Submission updates delivered quantities, billing progress, reservations, stock, and related accounting effects.
The note can cover part of an order. Later notes use the remaining quantity and can select rows by delivery date. Product bundles create packed component rows. A packing slip must account for the full packed quantity before the Delivery Note is submitted. A submitted note can lead to a shipment, delivery trip, installation record, return, or Sales Invoice. A return can also lead to a credit note when the return still has billed value.
When an order has reserved stock, the Delivery Note must use the reserved warehouse. Submission updates linked progress and reservation quantities before it updates the stock ledger. For packed products, the required serial and batch bundles are prepared before reservation updates. This order keeps promised stock, physical stock, and trace data aligned.
Delivery billing tracks both amount and quantity. A Sales Invoice made from an order is assigned to Delivery Notes in date order. Returned quantity reduces the capacity available to later billing. Billing through the Sales Order also accounts for the net quantity of each Delivery Note. When order billing exceeds net delivered quantity, that excess is shared across the related deliveries from the earliest one onward rather than counted against every delivery. If the billed amount is below the delivery amount because the rate changed, fully invoiced quantity can still mark the delivery as fully billed. Mapping the same Delivery Note into an invoice again does not duplicate its existing draft rows.
Return settlement depends on the billing path. A full return of a Delivery Note that was never billed has no remaining amount for a credit note. A delivery made from an invoice or billed through its Sales Order still needs a credit note for the returned billed quantity. This keeps stock returns and financial reversals aligned.
Return status updates are attached when a return is submitted, even though the return flag is set during document creation. This lets the return update the original Delivery Note and Sales Order returned quantities at once. An internal return also keeps the original target warehouse. A submitted Delivery Note can be closed and reopened only through its status flow. Cancellation reverses its linked order, pick, stock, and accounting progress.
References: erpnext/…/delivery_note.py• L161-253 erpnext/…/delivery_note.py• L292-320 erpnext/…/delivery_note.py• L336-361 erpnext/…/delivery_note.py• L542-600 erpnext/…/delivery_note.js• L137-374 erpnext/…/delivery_note.js• L392-418 erpnext/…/delivery_note_list.js• L14-70 erpnext/…/mapper.py• L28-44 erpnext/…/mapper.py• L47-74 erpnext/…/mapper.py• L76-222 erpnext/…/mapper.py• L225-259 erpnext/…/billing_status.py• L214-377 erpnext/…/billing_status.py• L480-582 erpnext/…/test_delivery_note.py• L1233-1394 erpnext/…/test_delivery_note.py• L1438-1578
Installation Note
The Installation Note records installation or setup after delivery. It consumes the delivered quantity that remains after returns and earlier installation. Its rows must point to submitted Delivery Note rows for the same item and customer context.
Installation cannot be dated before delivery. Serialized items must use serials from the source delivery, and a returned quantity is no longer installable. Submission updates installation progress on the Delivery Note. Cancellation reverses that progress.
References: erpnext/…/installation_note.py• L49-91 erpnext/…/installation_note.py• L94-115 erpnext/…/installation_note.py• L144-190 erpnext/…/mapper.py• L263-300
Direct stock billing
A Sales Invoice can replace the Delivery Note for a stock sale when Update Stock is enabled. In that path, invoice submission updates stock and delivery progress as well as billing and accounting. If an invoice refers to a Pick List, stock update is required so picked quantity and delivered quantity do not diverge.
References: erpnext/…/sales_invoice.py• L336-340 erpnext/…/sales_invoice.py• L426-476 erpnext/…/sales_invoice.py• L599-638
Work queues
List views turn lifecycle states into work queues. These queues help users find offers that need attention, orders that need delivery or billing, and delivery notes that need billing or represent returns.
| Record | Useful queue states |
|---|---|
| Quotation | Draft, Open, expiring soon, Lost |
| Sales Order | Draft, On Hold, To Deliver, To Bill |
| Delivery Note | Draft, To Bill, Returns |
The list indicators give return states precedence over normal billing and completion states. This prevents a returned shipment from appearing as an ordinary open shipment. Selected submitted Delivery Notes can also become a Delivery Trip in the company taken from the selected notes, rather than from incomplete list-row data.
References: erpnext/…/quotation_list.js• L1-53 erpnext/…/quotation_open.json• L1-21 erpnext/…/quotation_expiring_in_7_days.json• L1-21 erpnext/…/sales_order_to_deliver.json• L1-21 erpnext/…/sales_order_to_bill.json• L1-21 erpnext/…/delivery_note_list.js• L1-70 erpnext/…/delivery_note_returns.json• L1-21
Billing and collection
Customer exposure
Customer exposure combines open accounting balances with unbilled sales commitments and eligible delivered goods. Credit limits and overdue thresholds can stop new fulfillment when the customer owes too much. The customer overview presents sales, receivables, credit position, pipeline, and recent transactions within the viewer's company and accounting permissions.
The overview supports fiscal-year, rolling-year, quarter, and prior-fiscal-year views. It separates account data from sales data when the user lacks account access. Credit usage is hidden when a restricted user cannot see the whole company exposure. This prevents a partial view from being presented as the customer's full available credit.
References: erpnext/…/customer.py• L628-758 erpnext/…/customer.py• L834-984 erpnext/…/customer_overview.py• L14-106 erpnext/…/customer_overview.py• L126-245 erpnext/…/customer_overview.py• L314-404 erpnext/…/test_customer_overview.py• L38-107 erpnext/…/test_customer_overview.py• L120-188
Sales Invoice
The Sales Invoice creates or changes the customer receivable. It can be created from a Sales Order or Delivery Note. Its item links decide whether billing consumes ordered quantity directly or bills delivered quantity. Submission posts accounting entries and updates linked order and Delivery Note billing measures.
When an invoice is made from an order, pending quantity accounts for delivered quantity, billed quantity, returns, and later re-delivery. This prevents a return from making more quantity billable than the order allows. The invoice status describes the receivable rather than shipment: Unpaid, Partly Paid, Overdue, and Paid depend on outstanding amount and due dates. A submitted return changes the original invoice view to Credit Note Issued, while the return invoice has status Return.
The order exposes billing actions only while an item has both quantity headroom and amount headroom. Returned delivery quantity can reopen billable quantity when the credit note updates order billing, while a neutral credit note does not. A fully billed order is not offered again only because an over-billing allowance exists. Delivery-note billing also tracks amount and quantity, so a lower invoice rate does not leave fully invoiced quantity open. Invoice mapping also applies the caller's permissions to target addresses and items unless an explicit permission bypass is requested. Billable-order searches retain item-level filters so the work queue only offers orders with matching billable rows.
References: erpnext/…/mapper.py• L413-665 erpnext/…/sales_order.py• L1017-1162 erpnext/…/test_sales_order.py• L503-786 erpnext/…/mapper.py• L28-44 erpnext/…/mapper.py• L76-222 erpnext/…/billing_status.py• L214-377 erpnext/…/billing_status.py• L480-582 erpnext/…/status.py• L15-68
Payment Request
The Payment Request is a customer-facing request tied to a Sales Order or Sales Invoice. It states the amount to collect and can provide a payment URL or payment channel. It supports an order advance as well as collection of an invoice balance. A failed gateway action does not make the invoice paid.
References: erpnext/…/payment_request.py• L23-30 erpnext/…/payment_request.py• L132-191 erpnext/…/payment_request.py• L225-267 erpnext/…/payment_request.py• L269-313 erpnext/…/payment_request.py• L424-444
Payment Entry
The Payment Entry records money received from the customer and allocates it to one or more reference documents. It can settle a Sales Invoice, an order advance, or a Payment Request. Submission posts the receipt, updates payment schedules and outstanding amounts, and refreshes payment status. Partial allocation is valid because the helper uses the current outstanding balance.
References: erpnext/…/payment_entry.py• L121-150 erpnext/…/payment_entry.py• L173-212 erpnext/…/payment_entry.py• L2611-2778
Returns and reversal
Delivery return
A Delivery Note return represents goods moving back from the customer. It links to the original note through return_against and uses negative quantities. Submission updates returned quantities on the original Delivery Note and Sales Order, reverses the stock effect, and can create a credit note when Issue Credit Note is selected.
Return validation checks the customer, source link, posting time, item, serial or batch data, and quantity still available to return. This keeps physical stock and delivered progress aligned when the customer returns only part of a shipment. Internal returns also restore goods to the target warehouse used by the original internal delivery.
References: erpnext/…/mapper.py• L437-441 erpnext/…/sales_and_purchase_return.py• L22-85 erpnext/…/sales_and_purchase_return.py• L88-250 erpnext/…/delivery_note.py• L217-253 erpnext/…/delivery_note.py• L336-361 erpnext/…/test_delivery_note.py• L161-262 erpnext/…/test_delivery_note.py• L510-649
Sales return invoice
A Sales Invoice return is the financial reversal of an invoice. It links to the original invoice through return_against and uses negative billing values. It can update stock when the original invoice affected stock. A credit note made from a returned Delivery Note can also reverse the billed amount on the linked Sales Order.
Returns change both source progress and the customer balance. A stock return restores inventory through stock records. A credit note reverses billed value and reduces or offsets the receivable. A credit note that is not configured to update source billing does not reopen later billing capacity.
References: erpnext/…/mapper.py• L81-85 erpnext/…/sales_and_purchase_return.py• L54-85 erpnext/…/sales_invoice.py• L426-465 erpnext/…/sales_order.py• L1017-1065 erpnext/…/mapper.py• L195-200 erpnext/…/test_sales_order.py• L680-857
Cross-system records
Stock records
Stock reservation protects quantities promised to a submitted Sales Order. Delivery Notes and stock-updating Sales Invoices turn that promise into physical stock movement. The order's delivered quantity is updated before stock ledger work so the remaining reservation is correct.
Product bundles reserve component stock rather than only the displayed bundle. A Pick List can supply the reservation details for packed components. Manual pick locations remain unchanged during order mapping. Serial and batch context follows the item through reservation, delivery, and return. Delivery submission creates the packed-row tracking records before reservation work uses them.
References: erpnext/…/reservation.py• L19-191 erpnext/…/mapper.py• L190-219 erpnext/…/mapper.py• L353-408 erpnext/…/mapper.py• L1052-1141 erpnext/…/delivery_note.py• L542-577 erpnext/…/delivery_note_item.json• L543-570 erpnext/…/delivery_note_item.json• L896-940
Accounting records
Sales Invoices post the customer receivable, income, taxes, and related adjustments. Delivery Notes can create stock-related accounting entries when perpetual inventory is in use. Payment Entries post receipts and reduce allocated outstanding balances. Cancellation reverses linked ledger effects instead of deleting business history.
References: erpnext/…/sales_invoice.py• L448-485 erpnext/…/delivery_note.py• L483-486 erpnext/…/delivery_note.py• L571-577 erpnext/…/payment_entry.py• L203-212 erpnext/…/payment_entry.py• L298-320
Linked-document integrity
The lifecycle depends on item-level links such as Quotation Item, Sales Order Item, Delivery Note Item, and Sales Invoice Item. Validation compares the customer, company, project, currency, item, unit, and conversion data across those links. This prevents a later document from silently changing the meaning of an earlier commitment.
Delivery Note rows also retain links to their Sales Order row, Sales Invoice row, Delivery Note source row, and Pick List row. The row stores quantities in both the selling unit and stock unit, along with returned, packed, installed, and billed progress. These links let later documents consume only the remaining part of the original commitment.
References: erpnext/…/sales_order.py• L506-520 erpnext/…/delivery_note.py• L364-445 erpnext/…/delivery_note_item.json• L264-273 erpnext/…/delivery_note_item.json• L645-717 erpnext/…/delivery_note_item.json• L764-787 erpnext/…/sales_invoice.py• L294-318
Change checklist
When these files or sections are changed, remember to consider these:
- Changes to Sales Order item quantity, unit, or date must keep delivery schedules and the quantities mapped into Delivery Notes aligned.
- Changes to service-item delivery skipping must keep stock-bearing product bundles on the delivery path and must clear stale skip flags when the setting changes.
- Changes to stock reservation or Pick List mapping must preserve warehouses, source vouchers, manual locations, component-level remaining quantities, stock-unit quantities, and serial or batch context.
- Changes to Delivery Note submit order must keep packed serial and batch records available before reservation and stock work.
- Changes to return status updater setup must keep returned quantities synchronized on the original Delivery Note, Sales Order, and related billing records.
- Changes to subcontracted order rules must preserve finished-good validation, inward-order eligibility, item edit limits, and linked status updates.
- Changes to order status or item-close behavior must remain consistent with delivery, billing, picking, supplier receipt, advance payment, and reservation progress.
- Changes to billing mapping must preserve quantity net of returns and re-deliveries, amount headroom, idempotent draft mapping, and FIFO allocation across Delivery Notes.
- Changes to Delivery Note packing or installation eligibility must preserve packed quantity, returned quantity, serial or batch identity, and installation progress.
- Changes to return rules must preserve both stock quantities and billed quantities on the source Delivery Note, Sales Order, and Sales Invoice.
- Changes to return billing settlement must distinguish unbilled full returns from deliveries billed by an invoice or Sales Order, and must share Sales Order overbilling across sibling deliveries in order.
- Changes to stock-affecting invoice behavior must preserve the distinction between a normal invoice and an invoice with
Update Stockenabled. - Changes to cancellation order must reverse status updates with stock and accounting ledger updates.
- Changes to work-queue states or list indicators must keep user actions aligned with return, delivery, billing, and completion state.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A later document has a parent reference without its matching item-row reference. | The document cannot prove which ordered or delivered quantity it consumes. | Reference validation requires both parent and child links. |
| A service item keeps a stale skip-delivery flag after the selling setting is disabled. | The order can report delivery as complete when the item still needs fulfillment. | Sales Order validation recalculates the flag and delivery progress from the current setting. |
| A return uses the wrong customer, an earlier posting time, or more than the remaining quantity. | The return can reverse more stock or value than was issued. | Return validation checks party, time, source linkage, serial or batch data, and maximum returnable quantity. |
| A Delivery Note uses a warehouse outside the Sales Order reservation. | Fulfillment can consume stock that was not reserved for that order. | Delivery validation checks the reserved warehouse for each linked item. |
| Packed component tracking is created after reservation work starts. | Reservation can miss the component stock or its serial and batch context. | Submission creates packed-row bundles before it updates reservations and stock. |
| A bundle Pick List uses the parent row's remaining quantity for every component or keeps the bundle unit conversion. | Uneven component picks or a non-stock bundle unit can overstate or understate warehouse work. | Pick mapping uses each component's remaining quantity and sets its stock-unit conversion. |
| An order is billed and delivered through different paths without the correct stock-update behavior. | Order and Delivery Note progress becomes inconsistent. | Status updates distinguish direct order billing, Delivery Note billing, and stock-updating invoices. |
| A Sales Order invoice is distributed without accounting for returned delivery quantity or sibling delivery order. | Billing can be assigned to returned quantity or the same excess can settle multiple returns. | Delivery billing uses net delivered quantity and date-ordered allocation across related Delivery Notes. |
| A full return of an unbilled Delivery Note is treated as a billed return. | The system can create an unnecessary credit note. | Return settlement marks the return complete when no billable quantity remains. |
| A delivery made from an invoice or billed through its Sales Order is treated as an unbilled return. | The customer balance can remain overstated after goods return. | The return remains creditable when the source delivery was already billed. |
| The same Delivery Note is mapped into an in-progress invoice more than once. | The draft invoice can contain duplicate delivery rows. | Mapping counts rows already present in the target draft before adding pending quantity. |
| Invoice mapping bypasses permissions for a target address or item supplied by the caller. | A user can read or use a document value that is outside their access. | Mapping keeps permission checks active unless the caller explicitly requests a bypass. |
| A return is submitted without its return-specific status updater. | Returned quantity can remain stale on the original Delivery Note or Sales Order. | Return submission attaches the updater after the return flag is set. |
| A Payment Entry uses an old or excessive outstanding balance. | The receivable can become negative or exceed the requested amount. | Payment validation refreshes references and checks current outstanding values. |
| A credit check uses only ledger balances or a partial company view. | New fulfillment can pass a limit check or show false available credit. | Exposure includes eligible orders and deliveries, and the overview hides whole-company usage from restricted users. |
| A delivery schedule names a row that is not in the Sales Order or exceeds its quantity. | The planned shipment can detach from the order or overstate the commitment. | Server-side schedule creation uses the order row and checks total quantity. |
| A submitted order row is reduced below delivered quantity or closed while stock remains reserved. | Delivery history or reserved stock can become detached from the order. | Item updates enforce the delivered-quantity floor and require unreservation before closure. |
| A subcontracted order lacks a valid finished good or production basis. | The inward fulfillment path cannot represent what the customer ordered. | Submission validates the finished good, quantity, and active production basis. |
| An installation is dated before delivery or includes returned or foreign serials. | Installation progress can exceed the goods still held by the customer. | Installation validates the source Delivery Note, date, quantity, and serial identity. |
| A packing slip leaves quantity unpacked when the Delivery Note is submitted. | Shipment records and packed component quantities can disagree. | Packing validation requires packed quantity to equal delivery quantity. |
| A returned Delivery Note keeps a normal billing indicator. | Users can treat a stock return as an open shipment or bill it through the wrong path. | Return indicators take precedence over billing and completion states. |
Key files
| File | Why to read it |
|---|---|
| erpnext/…/quotation.py | Defines quotation states, revisions, active versions, expiry, and sales-pipeline updates. |
| erpnext/…/mapper.py | Shows how accepted quotation quantities become Sales Order or Sales Invoice quantities. |
| erpnext/…/sales_order.py | Defines order validation, status changes, cancellation, reservations, and linked progress. |
| erpnext/…/mapper.py | Shows how an order becomes fulfillment, delivery, invoice, production, purchasing, or subcontracting work. |
| erpnext/…/status.py | Explains separate delivery, billing, picking, supplier-receipt, and advance-payment measures. |
| erpnext/…/reservation.py | Explains how an order protects stock for later fulfillment. |
| erpnext/…/delivery_schedule.py | Defines dated delivery quantities and their link to Sales Order rows. |
| erpnext/…/subcontracting.py | Defines the subcontracted-order branch and its status relationship. |
| erpnext/…/sales_order.js | Shows which fulfillment, billing, payment, reservation, item-close, and status actions are available for an order. |
| erpnext/…/test_sales_order.py | Shows the contracts for service delivery skipping, over-delivery, returns, billing, reservation release, and mapping permissions. |
| erpnext/…/delivery_note.py | Defines shipment, return, stock, accounting, installation, and source-order effects. |
| erpnext/…/mapper.py | Shows Delivery Note billing, installation, shipment, delivery-trip, internal-transfer, and return relationships. |
| erpnext/…/delivery_note.js | Shows the user actions that connect delivery notes to orders, picks, invoices, returns, shipments, trips, and installation. |
| erpnext/…/delivery_note_list.js | Defines Delivery Note work indicators and list actions for trips, invoices, and packing slips. |
| erpnext/…/billing_status.py | Explains Delivery Note billing progress, return settlement, FIFO allocation, and automatic credit-note creation. |
| erpnext/…/test_delivery_note.py | Shows the contracts for billing progress, returns, stock effects, draft mapping, and list-related delivery behavior. |
| erpnext/…/delivery_note_item.json | Defines the row-level links and quantities that preserve delivery, stock, return, packing, and billing context. |
| erpnext/…/sales_invoice.py | Defines receivable creation, stock-updating invoices, returns, and cancellation effects. |
| erpnext/…/payment_request.py | Defines customer payment requests and gateway initiation. |
| erpnext/…/payment_entry.py | Defines receipt allocation, outstanding updates, ledger posting, and cancellation. |
| erpnext/…/sales_and_purchase_return.py | Defines shared validation for return links, quantities, dates, and rates. |