xMatix
Sign in Request demo
xMatix
PRODUCTS
SalesField Sales & SFACRMRewardsClaimsInventoryProcurementWarehouse ManagementField ServiceServiceSupportTelephony & MessagingFinance & AccountingPayrollExpense ManagementCommercePortalsAnalytics & ReportingData StudioMobile AppSee all products →
PLATFORM
Platform overviewApp BuilderAutomationIntegrationsSecurity & GovernanceChange ManagementDevelopers
SENSE AI
Sense AI overviewSense AssistSense ControlSense VisionAI StudioTrust & governanceIn Claude & ChatGPTUse cases
SOLUTIONS
Auto DMSConsumer Goods DMSSales Force Automation (SFA) FMCG & DistributionManufacturing & Dealer NetworksAutomotive & DealershipsPharma & HealthcareConsumer DurablesAgri-InputsBuilding MaterialsService NetworksWarehousing & 3PLFinancial AccountingERP SoftwareIndia GST ComplianceUAE VAT & e-InvoicingSaudi ZATCA & VATAll solutions →
RESOURCES
Knowledge CenterDeveloper & CLIBlogGuidesWhat is xMatix?Company facts
COMPANY
AboutCareersPartnersEventsContactAuthorsLegal
Sign in Request demo
Home/Docs/Sales/Sales order lines
HOW-TO · Last reviewed

Sales order lines

A sales order line is one item, or one charge, on a sales order: what is sold, how much of it, at what price, discount and tax, and how far that quantity has got through fulfilment, allocation, picking, delivery and invoicing. Every action on the order works line by line, drawing on the quantity each line still has pending. So the lines are where you see what is done and what is still to do. Lines are added after the order header is saved, and they feed the fulfilment documents, delivery orders and invoices the order produces.

Overview

A line has three parts:

  • What is sold. The Item (with its SKU and Item Lot Type), or a Description alone for a charge that is not an item, such as freight or labour.
  • Its price. Unit Price, the price list it came from, discounts, scheme benefits and taxes. These roll up into Base Amount, Amount and Gross Amount, and into the order's totals.
  • Its progress. A counter for every stage — released to fulfilment, allocated, picked, delivered, invoiced, cancelled and returned — and a pending quantity for what each stage still has to do.

Lines are opened from the order's Lines tab. They have no list of their own in any app.

When to use it

Add a line for every item or charge the customer is buying. Change a line while the order is being agreed: a different quantity, a price you have negotiated, a different tax group. Once processing has started, let the order's actions move the quantities. Cancel the part of a line that will not be supplied, and don't delete it.

How xMatix handles it

What happens when you save a line

When a new line is saved, xMatix:

  1. checks that the order's partner account and branch are valid, and that the item is active and has a valid SKU where it needs one;
  2. replaces the item with its successor if the item has an active Superseded alternate, and keeps the original in Original Item;
  3. copies the item's Invoice Group, Billing Type, Billing Frequency and Charge Type to the line where the line leaves them blank;
  4. prices the line from the price list in force, unless you typed a unit price yourself;
  5. picks the tax group from the tax rules and works out the taxes, then applies the matching discount-group rule;
  6. copies a header Discount percentage onto the line, adds the components of a package item as lines of their own, and finds the stock record for the item at the order's branch;
  7. evaluates the trade schemes that apply automatically, unless Skip Scheme is ticked on the line or on the order.

When an existing line changes, only the affected steps run again:

You changexMatix
Price List, Price List Rule or Price As On DateRe-prices the line
Item, SKU, Tax Group, Quantity or the amountWorks out the taxes again
Item, SKU, Tax Group, Unit Price, Quantity or Skip SchemeEvaluates the schemes again
Item, SKU, Item Lot Type or Storage LocationFinds the stock record again
Quantity of a package lineRescales its component lines
Item of a package lineReplaces its component lines

Saving a line does not reserve stock. The shipped inventory-ledger rule for order lines is switched off. Stock is reserved by allocation — see Allocating stock to orders.

How the amounts are worked out

  • Base Amount = (Quantity − Cancelled Quantity) × the unit price. When Unit Price 2 is above zero, it is used instead of Unit Price.
  • Net Discount adds up three discount pairs: the regular discount (Discount % or Discount Amount), the cash discount (Discount2 % or Cash Discount Amount) and the contract discount from the discount group (Contract Discount % or Contract Discount Amount). In each pair, an amount above zero wins over the percentage.
  • Net Scheme Discount is the scheme benefit: Scheme Discount Amount, or else Scheme Discount % of the base.
  • Amount = Base Amount − Net Scheme Discount − Net Discount, less the line's share of any discount lines on the order (Additional Discount Share).
  • Gross Amount = Amount + Tax Amount.

With Apply Post Tax Discount ticked, the discounts are worked out on the base plus tax and come off after tax: Amount is then the base, and Gross Amount is base + tax − discounts.

Because cancelled quantity comes off the base, cancelling part of a line also lowers its value and its tax.

The progress counters

Each counter is kept up to date by the documents raised against the line:

CounterFilled from
Fulfilment Order QuantityFulfilment document lines
Fulfilment Allocated QuantityAllocation lines
Picked Quantity, Picking Requested Quantity, Picking Cancel Quantity, Picking Return QuantityPicking lines
Delivery QuantityDelivery order lines
Invoice QuantityInvoice lines. Split into Allocated Invoiced Quantity (invoiced from allocated stock) and OTC Invoiced Quantity (invoiced over the counter)
Returned QuantityCredit note lines
Cancelled QuantityCancel Order on the order

The pending quantities are worked out from them — for example, Pending Invoice Quantity = Quantity − Cancelled Quantity − Invoice Quantity. The full set of formulas is on the sales order lifecycle. A returned quantity does not reopen any pending quantity.

Prerequisites

  • The order header is saved, with a valid partner account and branch.
  • Your security profile gives you access to Order Line — see Permissions.
  • The items are active. Price-list rules exist for them, or you will type the unit prices.

Procedure

Step 1 — Add lines from the order

Open the order from Sales → Orders and go to the Lines tab. Its toolbar offers four ways to add lines:

  • Quick Add opens a form with Item, SKU, Item Lot Type, Quantity, Unit Price, Tax Group and Description, and an Item 360 panel with stock, schemes and alternates for the chosen item. SKU lists only the item's SKUs, and Item Lot Type only the item's lot types.
  • Product Catalogue opens a browsable catalogue. Pick products into the cart and choose Add to document. When every product is added, the catalogue closes and the new lines appear. If some fail, it stays open with the cart so that you can try those products again.
  • Barcode Scanner adds lines as you scan. With the shipped setup, one label can carry the item, SKU and quantity separated by a vertical bar (|).
  • Import loads lines from a spreadsheet with the columns Item, SKU, Item Lot Type and Quantity.

Enter a Quantity above zero. Leave Unit Price empty to take the price list's price, or type the price you have agreed. For a charge with no item, leave Item empty and write the charge in Description.

After you save, the line shows its price, discounts and taxes, and the order's Amount Summary updates.

Step 2 — Open a line and read its progress

Select a line's number to open its record page. The header shows the order, item, quantity and unit price, with Edit and Delete. The Amounts panel shows Base Amount, Net Scheme Discount, Net Discount and the taxes, with Gross Amount as the total.

The page has two tabs:

  • Related lists what has been raised from the line: its allocation lines, invoice lines and delivery order lines.
  • Details groups the line's fields into panels: Item Details, Quantity Details, Pricing Details, Amount Details, UOM Details, Tax Details, Discount Details, Scheme Details, Inventory Details, Related Documents and System Details.

Quantity Details shows where the line has got to: how much is invoiced, cancelled, returned, allocated and delivered, and how much is still pending. Inventory Details shows Stock Available and Stock In Hand for the item at the order's branch.

Step 3 — Change a line

Choose Edit on the line, or on its row in the Lines tab. The edit form is the quick-add form: Item, SKU, Item Lot Type, Quantity, Unit Price, Tax Group and Description. On the line's record page you can also change the fields in the Details panels in place — for example the discount fields in Discount Details.

Keep these limits in mind:

  • Quantity cannot go below what has already been released to fulfilment, cancelled or returned.
  • On a package line, or a component of one, Item and SKU cannot be changed.
  • A component's quantity must stay within the minimum and maximum set on the package, and some components do not allow their quantity to be changed at all.
  • Leave the quantity counters in Quantity Details alone. The documents raised against the line keep them up to date, and the order's buttons and status rules read them.

Changing the quantity or tax group re-taxes the line. Changing the quantity, unit price or tax group evaluates the schemes again.

Step 4 — Cancel what will not be supplied

Use Cancel Order on the order (shown while Status is Draft). For every line it adds the quantity not yet released to fulfilment to Cancelled Quantity. Cancelled quantity comes off the line's pending quantities and its Base Amount, so the remainder is no longer processed or charged.

The shipped order page has no action that cancels a single line. Cancelled Quantity can be edited in place on the line's record page, but it cannot be more than Quantity.

Step 5 — Delete a line

Choose Delete on the line's row or record page and confirm. Deleting a package line also removes its component lines. Deletion is refused when:

  • part of the line has been released to fulfilment;
  • the line is a mandatory component of a package that stays on the order.

Only quantity released to fulfilment stops a delete. A line that has already been invoiced over the counter, with no fulfilment document, can still be deleted. Check the line's Related tab first, and cancel the quantity instead of deleting a line that has documents.

Step 6 — Work on mobile

On the mobile app, lines are usually added through Take Order during a visit, from the catalogue or by scanning. The prices, taxes and contract discounts are worked out on the device, and the lines are saved with the order when the device is online. See Creating and managing sales orders.

Fields

On the quick-add and edit form

FieldWhat it meansNotes
ItemWhat is soldRequired unless a Description is given. Must be active when the line is created
SKUThe variant of the itemRequired for items that need a SKU. Lists the item's SKUs only
Item Lot TypeThe lot category to sell fromLists the item's lot types only. Used to match price and tax rules and to choose lots
QuantityQuantity orderedRequired and above zero. Cannot drop below what is released, cancelled or returned
Unit PricePrice per unitFilled from the price list when empty. A price you type on a new line is kept. Must stay empty on a bundled package component
Tax GroupThe taxes that applyFilled from the tax rules. Changing it re-taxes the line
DescriptionFree text, or the charge itself on a line with no item

On the line's record page

FieldWhat it meansNotes
Item AliasA customer- or partner-specific product codeMust belong to the order's partner account (Item Alias is not valid.)
Original ItemThe item the line had before it was replaced by its successorSet by the platform
Item ComponentThe package component this line was created fromSet on component lines
Item LotA specific lot named on the lineLists lots of the line's item and SKU at the order's partner account and branch. Copied to the fulfilment document
Invoice Quantity, Delivery Quantity, Returned Quantity, Fulfilment Allocated QuantityHow much has passed each stageMaintained from the documents raised against the line
Allocated Invoiced Quantity, OTC Invoiced QuantityInvoiced quantity, split by whether it came from allocated stockMaintained from invoice lines
Cancelled QuantityQuantity that will not be suppliedSet by Cancel Order. Cannot exceed Quantity
Pending Invoice Quantity, Pending Delivery Quantity, Pending Fulfilment Allocation QuantityWhat each stage still has to doCalculated
Price List, Price List Rule, Price As On DateWhere the price came from and the pricing dateChanging any of them re-prices the line. The line's Price As On Date wins over the order's
Price BundledThe line is priced inside its packageA bundled line cannot carry a unit price
Amount, Base Amount, Gross AmountThe line's value before discounts, after discounts, and with taxCalculated
Scheme Discount Amount, Discount Amount, Cash Discount Amount, Contract Discount AmountDiscount valuesAn amount above zero wins over the matching percentage
UOM, UOM Quantity, UOM 1, UOM Quantity 1, Conversion Ratio, Conversion Ratio 1Quantity entered in up to two of the item's units, for example cases and piecesQuantity is worked out from them. A unit must be one the item has
Tax AmountTotal tax on the lineCalculated from the tax group
DiscountRegular discount percentageTaken from the order's Discount when that is set
Discount Group RuleThe discount-group rule that supplied the contract discountSet by the platform
Apply Post Tax DiscountTakes discounts off after tax instead of beforeChanges the line's amounts
Scheme Line, Scheme Benefit, Scheme DiscountThe scheme applied to the line and its percentageWritten by the scheme engine
Scheme GeneratedThe line was created by a scheme, such as a free item
Skip SchemeLeaves this line out of scheme evaluationThe rest of the order is still evaluated
Stock Available, Stock In HandFree and physical stock of the item at the order's branchRead-only
Storage LocationThe location the line draws fromCopied to the fulfilment document
Quote Line, Opportunity Line, Purchase Order LineThe source line this line was created fromSet when the order came from a quote, an opportunity or another organization's purchase order

Every field, including system and tax-slot fields, is listed in the Order Line entity reference.

Business rules

  • Item or description. A line needs an item or a description: Select an Item or enter a Description.
  • Item checks on create. The item must be active (Item is Inactive.), needs a SKU when it requires one (SKU is required for this item.), and the SKU must belong to it (Invalid SKU selected for this item.).
  • Quantity. Must be above zero (Quantity should not be less than 0). Once part of it is released to fulfilment, cancelled or returned, it cannot go below that total (Transacted quantity (n) cannot be reduced. Attempted quantity: m).
  • Cancelled quantity. Cannot be more than the quantity (Quantity cancelled cannot be greater than Quantity.).
  • Percentages. Discount, Discount2, Contract Discount and Scheme Discount must be between 0 and 100.
  • Order checks. A new line, or a line moved to another order, is checked against that order's partner account and branch.
  • Numbering. Each line gets its own number from the Order Line Document Name Setting, with the series SOL.
  • Packages. A package item adds its components as lines. The components follow the package's quantity, are removed with it, and cannot have their item or SKU changed. A mandatory component cannot be removed on its own (Mandatory package component cannot be removed.). Component quantities are checked against the package's minimum and maximum, and against whether the quantity may be changed.
  • Upstream counts. A line created from an opportunity counts against the opportunity line's ordered quantity. A line created from another organization's purchase order counts against that purchase order line. Adding, changing or deleting the line updates the count.
  • Invoice groups. When the order is invoiced, lines with different Invoice Group values go onto separate invoices. Lines with no group share one invoice.
  • Lot expiry. When Limit Expiry Days is set, allocation uses only lots that expire at least that many days from today. Schemes that add free items set it from the benefit.
  • Replenishment. Pending invoice quantity on open order lines counts as demand in auto order, unless Exclude In Auto Order is ticked on the line.
  • Delete. Refused once any quantity is released to fulfilment: There are downstream transactions. The record cannot be deleted.

Example

A hardware wholesaler takes an order for 50 boxes of wall plugs and 12 cordless drills, plus a delivery charge.

The sales coordinator saves the order header, opens Lines and uses Quick Add three times. Wall plugs come in at 4.20 a box from the price list, and the drill at 89.00. A volume scheme adds a 5% scheme discount to the wall plugs. For the delivery charge, the coordinator leaves Item empty, writes "Delivery to site" in Description and types 25.00 as the unit price.

The customer then asks for 10 drills instead of 12. The coordinator opens the drill line, chooses Edit, changes Quantity to 10 and saves. The line is re-taxed, and the order's Amount Summary drops accordingly.

The coordinator releases the whole order to fulfilment. Each line's Quantity Details now shows its full quantity as released to fulfilment, and nothing pending to release. A day later the customer drops two drills. Edit refuses a quantity of 8, with Transacted quantity (10) cannot be reduced. Cancel Order answers No eligible order lines found to cancel., because nothing is left unreleased. So the coordinator asks the warehouse to reduce the drills on the fulfilment document.

Training

Practice exercise

In a sandbox, as a user with the Sales Executive or System Admin profile:

  1. Create an order with a test customer, partner account and branch, then add a line with Quick Add for a stock item, quantity 5, with Unit Price empty. Expected: the price is filled from the price list and the Amount Summary updates.
  2. Add a line with no item and the description "Packing". Expected: the line saves. Now try a line with neither item nor description. Expected: Select an Item or enter a Description.
  3. Open the first line and read Quantity Details. Expected: Pending Invoice Quantity 5, and every other counter 0.
  4. Run Selective Invoice OTC on the order for 2 of the 5. Expected: the line's Invoice Quantity and OTC Invoiced Quantity are 2, and Pending Invoice Quantity is 3.
  5. Try to delete that line. Expected: the delete is allowed, because nothing was released to fulfilment. Cancel the delete.
  6. Edit the line's quantity to 0. Expected: Quantity should not be less than 0.

Quick reference

  • Add lines from the order's Lines tab: Quick Add, Product Catalogue, Barcode Scanner or Import.
  • Leave Unit Price empty to use the price list; a typed price is kept.
  • A charge with no item needs a Description.
  • Unit Price 2, when set, replaces Unit Price in the amounts.
  • An amount discount beats the percentage in the same pair.
  • The quantity counters are maintained from downstream documents — don't type into them.
  • Quantity can't go below what is released, cancelled or returned.
  • Cancel quantity with Cancel Order; only released quantity blocks a delete.

Permissions

Access is set on security profiles in Setup → Access Control → Profiles.

  • Entity access. The shipped System Admin, Standard User, Sales Manager, Sales Executive and Sales profiles have full access to Order Line. You need create access to add lines, edit access to change them and delete access to remove them. Without edit access, for example, a user does not see Edit on the line.
  • Order actions. The actions that move a line's quantities — invoicing, allocation, delivery, Cancel Order — are order actions, granted on the profile's Actions tab for Order. See Creating and managing sales orders.

Configuration

  • Line forms. The quick-add and edit form, the line's record page and the preview card are layouts of the Order Line entity in Design Studio. The shipped edit form has no discount, cancellation, lot or storage-location fields. Add them to the form if your users should set them while adding a line. See Design a form layout.
  • Lines tab. The toolbar actions (Quick Add, Product Catalogue, Import, Barcode Scanner), the row actions and the columns are set on the order's record page layout and the line view it uses.
  • Product Catalogue. The catalogue dialog shows the products of the store it is set up for. If it opens empty, point the dialog's catalogue widget at your store.
  • Barcode Scanner. The scanner dialog sets which fields a composite label fills, and in what order (shipped: item, SKU, quantity), and the separator (shipped: |).
  • Import. The import dialog uses the Import SO Lines view for its columns (shipped: Item, SKU, Item Lot Type, Quantity).
  • Numbering. Setup → Feature Hub → Platform → Document Settings, Order Line Document Name Setting: series SOL, separator -, a date part and a six-digit counter. See Email templates and document numbering.
  • Validations. The shipped line validations — quantity above zero, cancelled quantity not above quantity, item alias belongs to the partner — are on the Order Line entity's validations. Two more are shipped switched off: one refuses a zero or negative unit price, and one limits asset-tracked items to quantity 1. Switch them on if your process needs them.
  • Lookup filters. The shipped filters limit SKU and Item Lot Type to the line's item, and Item Lot to that item and SKU at the order's partner account and branch. Item has no filter, so an inactive item can be picked but is refused on save.
  • Stock reservation. The inventory-ledger rule that would soft-commit stock when a line is saved is shipped switched off. Stock is reserved by allocation.
  • Item master. The item's Invoice Group, Billing Type, Billing Frequency and Charge Type default onto new lines. Superseded alternates and package components are also set up on the item. See Items.
  • Pricing, discounts and tax. Price lists, discount groups and tax rules decide each line's price, contract discount and tax group — see Pricing, discounts and taxes. Trade schemes decide the scheme discounts and free-item lines — see Trade schemes.

Common problems

"Select an Item or enter a Description."

The line has neither. Pick an item, or for a charge with no item, write it in Description.

"Item is Inactive."

The item was deactivated. The Item picker still lists it, but a new line can't use it. Choose an active item, or ask your administrator to reactivate it.

"SKU is required for this item." or "Invalid SKU selected for this item."

The item is sold by SKU. Pick one of that item's SKUs.

"Quantity should not be less than 0"

The quantity is zero or negative. Enter a quantity above zero. To remove the whole line, delete it or cancel its quantity.

"Transacted quantity (…) cannot be reduced. Attempted quantity: …"

Part of the line has been released to fulfilment, cancelled or returned. Enter at least that quantity. Reduce the released part on the fulfilment document instead.

"Quantity cancelled cannot be greater than Quantity."

The Cancelled Quantity is more than the line's quantity. Lower it.

The line is a package or a package component, and its item or SKU can't change. Delete the package line and add the item you want.

"Quantity cannot be changed for this component." or "Quantity cannot exceed … for this component."

The package sets this component's quantity, or limits it. Change the package line's quantity instead — its components follow.

"Mandatory package component cannot be removed."

The component is required by its package. Delete the package line to remove all its components.

"There are downstream transactions. The record cannot be deleted."

Part of the line is on a fulfilment document. Leave the line and cancel what has not been released.

"This is a bundled item. You can not specify price for it"

The line is priced inside its package. Clear Unit Price.

"Item Alias is not valid."

The item alias belongs to a different partner account from the order's. Choose an alias for this partner account, or pick the item directly.

Common questions

Why didn't the price change when I changed the quantity?

Changing the quantity re-taxes the line and re-evaluates the schemes, but it does not re-price it. The line is priced from the price list when it is created, and again when you change its Price List, Price List Rule or Price As On Date. To re-price every line on the order, use Reprice on the order while it is at Draft. A price you typed yourself on a new line is kept until you re-price.

Why is the line's Amount lower than quantity × unit price?

Amount is the value after discounts. Base Amount is (quantity − cancelled quantity) × unit price, and Amount takes off the scheme discount, the regular, cash and contract discounts, and the line's share of any discount lines on the order. If Unit Price 2 is set, it is used instead of Unit Price. The Amounts panel on the line shows each part.

Can I cancel just one line?

Not from the shipped order page: Cancel Order cancels the unreleased quantity of every line at once. You can type a Cancelled Quantity on the line's record page, up to the line's quantity. It then comes off that line's pending quantities and its amount. Quantity already released to fulfilment has to be reduced on the fulfilment document.

Does adding a line reserve stock?

No. Saving a line finds the stock record and shows Stock Available and Stock In Hand, but nothing is reserved. Stock is reserved when the order is allocated, or drawn when it is invoiced over the counter. See Allocating stock to orders.

Why did my order produce two invoices?

The lines have different Invoice Group values, usually copied from their items. Each group goes onto its own invoice; lines with no group share one.