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/Entity Reference/Invoice Line — entity reference
REFERENCE · Last reviewed

Invoice Line — entity reference

One item or one charge billed on a sales invoice, and the level at which price, discount and tax are resolved. Most lines are created by invoicing an order (over the counter or from allocated stock) or a delivery order, which copy item, SKU, prices, tax group, discounts and billing details from the source line; on a hand-made invoice lines are added with Quick Add on the invoice's Lines tab. On creation xMatix checks the invoice's partner account and branch, the item (active, sellable on its own, valid SKU), swaps a superseded item for its successor, defaults billing details and HSN/SAC from the item, resolves tax group, price and discount group, copies the invoice discount, computes taxes and TCS, evaluates automatic schemes, explodes package components and updates the source order line's invoiced counts. Item and SKU cannot change after the first save. Saving a line posts no stock; Post Inventory on the invoice does. A financial change to a line of a posted invoice re-posts the invoice's journal. A line with returned quantity cannot be deleted. Lines have no list of their own in any app.

Fields

FieldLabelTypeRequiredWhat it does
AccountIdAccountCalculated (calculated)A denormalised copy of the parent invoice's customer, calculated as the invoice's AccountId converted to text. Note it is stored as a string rather than a key, so it is not a usable foreign key or lookup — join through the parent invoice instead.
AllocatedQuantityAllocated QuantityDecimalWhat was still allocated, not picked or delivered, on the allocation line when this line was invoiced. Zero on lines with no allocation.
AmountAmountCalculated (calculated)The line value after discounts: Base Amount less Net Discount, Net Scheme Discount and Additional Discount Share. With Apply Post Tax Discount it is Base Amount less the additional discount share, and the discounts come off Gross Amount instead. Becomes the GL Amount posted to the sales account.
ApplyPostTaxDiscountApply Post Tax DiscountBooleanWhen ticked, discounts are worked out on base plus tax and taken off after tax, so they reduce Gross Amount rather than Amount.
AssessableAmountAssessable AmountCalculated (calculated)
AssetIdAssetLookup → Asset
BarcodeBarcodeText
BaseAmountBase AmountCalculated (calculated)Quantity times the unit price (Unit Price (Alt) when above zero, else Unit Price). Unlike an order line, cancelled quantity is not deducted.
BenefitIndexBenefit IndexNumber
BillingFrequencyBilling FrequencyText
BillingTypeBilling TypeText
BranchIdBranchText
CancelledQuantityCancelled QuantityDecimalSet to the full quantity when the invoice is cancelled. Not deducted from Base Amount.
ChargeTypeCharge TypeTextValues: One Time.
ClaimLineIdClaim LineLookup → ClaimLine
ContractDiscountContract DiscountPercentContract discount percentage from the discount-group rule, 0 to 100.
ContractDiscountAmountContract Discount AmountCurrency
ConversionRatioConversion RatioDecimal
ConversionRatio1Conversion Ratio 1Decimal
CostPriceCost PriceCurrencyDead: no code path anywhere populates it. An earlier invoice-time cost-of-goods-sold block summed this field and therefore always computed zero; it was removed deliberately, and cost of goods sold is now recognised at goods issue from engine cost instead. Do not use this field for margin.
CreatedByIdCreated ByLookup → UserAccountYes
CreatedDateTimeCreated DateDateAndTimeYes
DeliveredQuantityDelivered QuantityDecimalWhat was already delivered from the allocation line before this line was invoiced. Zero on lines with no allocation. Delivery orders raised from the invoice count in Delivery Quantity instead.
DeliveryOrderLineIdDelivery Order LineLookup → DeliveryOrderLineThe delivery order line this line was invoiced from, on invoices created from a delivery order.
DeliveryQuantityDelivery QuantityDecimalTotal quantity on delivery order lines raised from this invoice line.
DiscountDiscountPercentRegular discount percentage, 0 to 100. Taken from the invoice's Discount when that is set.
Discount2Cash DiscountPercentCash discount percentage, 0 to 100.
DiscountAmountDiscount AmountCurrencyIt is one of three pairs (with Discount2/DiscountAmount2 and ContractDiscount/ContractDiscountAmount) that add up into NetDiscount.
DiscountAmount2Cash Discount AmountCurrency
DiscountGroupRuleIdDiscount Group RuleLookup → DiscountGroupRule
EligibleReturnQuantityEligible Return QuantityCalculated (calculated)Quantity less Cancelled Quantity and Returned Quantity: what can still be returned on a credit note.
ExternalIdExternal IDText
FieldSalesIdField SalesLookup → FieldSales
FreeQuantityFreeQuantityDecimalNot an independently entered figure: it is the line's own Quantity when the line was generated by the promotional-scheme engine, and zero otherwise. It exists so free-goods lines can be reported without inspecting the scheme linkage, and it is both a stored column and a calculated fallback.
GeneralLedgerIdGeneral LedgerLookup → GeneralLedger
GLAccountIdGL AccountLookup → GLAccountOptional sales account for this line. When set it wins over posting definitions and the chart-of-accounts default sales account when the invoice is posted.
GLAmountGL AmountCalculated (calculated)The value posted to the line's sales account; equal to Amount.
GLPostingTypeGL Posting TypeText
GrossAmountGross AmountCalculated (calculated)Amount plus Tax Amount, less the discounts when Apply Post Tax Discount is on. This is what the line adds to the invoice total.
HsnSacCodeHSN/SAC CodeTextThe goods or services code used on GST returns and e-invoices. Copied from the item when blank and again when the item changes; must be 4, 6 or 8 digits.
IdIdGuidYes
InventoryFulfilmentAllocationLineIdInventory Fulfillment Allocation LineLookup → InventoryFulfilmentAllocationLineThe allocation line this line was invoiced from, on lines invoiced from allocated stock. Decides which stock figures the inventory posting moves.
InventoryLedgerIdInventory LedgerLookup → InventoryLedgerThe inventory ledger entry the line posted. Set by Post Inventory on the invoice; while set, quantity or price changes re-post the stock movement.
InvLineNameInvLineName (For E-invoice)TextA system-generated line document name in the form INVL-ddMMyyyy followed by the last three digits of the sequence, reformatted from the name the document-naming service produced. It is stamped on insert and not maintained afterwards.
InvoiceDiscountInvoice DiscountCalculated (calculated)The invoice header's discount percentage, read from the invoice.
InvoiceIdSale InvoiceLookup → InvoiceThe sales invoice the line belongs to. A new line, or a line moved to another invoice, is checked against that invoice's partner account and branch.
IsClaimedClaimedBooleanThe line has been included in a trade claim.
IsGLPostedGL PostedBoolean
IsGLPostingApprovedGL Posting ApprovedBoolean
IsILPostedIL PostedBoolean
IsILPostingApprovedIL Posting ApprovedBooleanSet when the line is posted to the inventory ledger. An asset-tracked item needs an Item Lot first.
IsPriceBundledPrice BundledBooleanThe line is priced inside its package, so its unit price must be zero.
IsSchemeGeneratedScheme GeneratedBooleanThe line was created by a scheme, such as a free item.
ItemAliasIdItem AliasLookup → ItemAlias
ItemAlternateIdAlternate ItemLookup → ItemAlternate
ItemComponentIdItem ComponentLookup → ItemComponent
ItemIdItemLookup → ItemThe item billed. Required unless a Description is given. On creation it must be active and not a package-only component; a superseded item is swapped for its successor. It cannot be changed after the line is saved, and on a line created from an order it follows the order line.
ItemLotIdItem LotLookup → ItemLotThe specific lot billed, limited to lots of the line's item and SKU. Set from the allocation line on lines invoiced from allocated stock. Required before inventory posting for an asset-tracked item.
ItemLotTypeIdItem Lot TypeLookup → ItemLotTypeThe lot category billed, limited to the item's lot types and used when matching price and tax rules.
ItemNameItem NameText
ItemServiceContractIdService ContractLookup → ItemServiceContract
LimitExpiryDaysLimit Expiry DaysNumber
LineNumberLine NumberText
ModifiedByIdModified ByLookup → UserAccountYes
NameDocument NumberTextThe line's own document number, generated on save from the Invoice Line Document Name Setting (series SIL, a date part and a six-digit counter).
NetDiscountNet DiscountCalculated (calculated)The regular, cash and contract discounts together. In each pair an amount above zero wins over the percentage; percentages apply to the base, or to base plus tax when Apply Post Tax Discount is on.
NetSchemeDiscountNet Scheme DiscountCalculated (calculated)The scheme benefit: Scheme Discount Amount when above zero, otherwise Scheme Discount percent of the base.
OrderLineIdOrder LineLookup → OrderLineThe sales order line this line was invoiced from. The order line's Invoice Quantity, Allocated Invoiced Quantity and OTC Invoiced Quantity are summed from its invoice lines.
OriginalAssetIdOriginal AssetLookup → Asset
OriginalItemIdOriginal ItemLookup → ItemThe item the line was entered with before it was replaced by its successor or a chosen alternate.
OwnerIdOwnerLookup → UserAccountYes
PackageInvoiceLineIdPackage Invoice LineLookup → InvoiceLineThe package line this component line belongs to. Deleting the package line deletes its components; a mandatory component cannot be deleted on its own.
PackageOrderLineIdPackage Order LineLookup → OrderLine
PartnerAccountIdPartner AccountCalculated (calculated)A denormalised copy of the parent invoice's owning company, calculated as the invoice's PartnerAccountId converted to text. Like AccountId on this entity it is a string, not a key, so it cannot be used as a relation and exists only to make line-level queries filterable by company.
PendingDeliveryQuantityPending Delivery QuantityCalculated (calculated)Quantity less Cancelled Quantity and Delivered Quantity. The invoice's Delivery action needs at least one line above zero.
PendingShipmentQuantityPending Shipment QuantityCalculated (calculated)Quantity less Shipment Quantity.
PickedQuantityPicked QuantityDecimalWhat was already picked on the allocation line when this line was invoiced. Zero on lines with no allocation.
PriceAsOnDatePrice As On DateDateThe date prices are read for. Changing it re-prices the line.
PriceListIdPrice ListLookup → PriceListThe price list the line was priced from. Changing it re-prices the line.
PriceListRuleIdPrice List RuleLookup → PriceListRuleThe price-list rule that supplied the price. Changing it re-prices the line.
QuantityQuantityDecimalQuantity billed. Defaults to 0 and must be above zero. It cannot be reduced below the returned quantity. Changing it re-taxes the line, re-evaluates schemes and re-posts stock already in the inventory ledger.
RecordTypeIdRecord TypeGuid, hidden
RequestedQuantityRequested QuantityDecimal
ReturnedQuantityReturned QuantityDecimalTotal quantity on sale-return credit note lines raised against this line. Cannot exceed Quantity, and any returned quantity blocks deleting the line.
RNAExternalIdRNA External IDText
RNASaleInvoiceExternalIdRNA Sale Invoice External IDText
SchemeBenefitIdScheme BenefitLookup → SchemeBenefit
SchemeDiscountScheme DiscountPercentScheme discount percentage written by the scheme engine, 0 to 100.
SchemeDiscountAmountScheme Discount AmountCurrency
SchemeLineIdScheme SlabLookup → SchemeLine
SchemeRewardPointsScheme Reward PointsLargeNumber
ServiceOrderLineIdService Order LineLookup → ServiceOrderLineThe service order line this line bills.
ShipmentQuantityShipment QuantityDecimal
SkipSchemeSkip SchemeBooleanLeaves this line out of scheme evaluation.
SKUIdSKULookup → SKUThe item variant billed. Required for items that need a SKU and limited to the item's SKUs. It cannot be changed after the line is saved.
SoftCommittedQuantitySoft Committed QuantityCalculated (calculated)The line's quantity when its source order line or service order line has an inventory ledger entry, otherwise zero.
StorageLocationIdStorage LocationLookup → StorageLocation
SubscriptionIdSubscriptionLookup → Subscription
SubscriptionUsageIdSubscription UsageLookup → SubscriptionUsage
SubscriptionUsageSummaryIdSubscription Usage SummaryLookup → SubscriptionUsageSummary
Tax1Tax 1CurrencyThe first of six generic tax-component slots, not a fixed tax type. Which component lands here is decided by the posting-field name configured on the Tax master in the line's tax group, so slot 1 might be CGST on one tenant and IGST on another. Every slot is cleared and recomputed whenever the line's taxes are recalculated.
Tax1NameTax Name 1Text
Tax1RateTax Rate 1Currency
Tax1TypeTax Type 1TextA copy of the tax type from the Tax master that filled slot 1, stamped when the line's taxes were computed. Posting uses it to pick the tax account for the leg (an account whose subtype names this component wins over the generic tax account), and a slot with an empty type is skipped entirely at posting time even if its amount is non-zero.
Tax2Tax 2Currency
Tax2NameTax Name 2Text
Tax2RateTax Rate 2Currency
Tax2TypeTax Type 2Text
Tax3Tax 3Currency
Tax3NameTax Name 3Text
Tax3RateTax Rate 3Currency
Tax3TypeTax Type 3Text
Tax4Tax 4Currency
Tax4NameTax Name 4Text
Tax4RateTax Rate 4Currency
Tax4TypeTax Type 4Text
Tax5Tax 5Currency
Tax5NameTax Name 5Text
Tax5RateTax Rate 5Currency
Tax5TypeTax Type 5Text
Tax6Tax 6Currency
Tax6NameTax Name 6Text
Tax6RateTax Rate 6Currency
Tax6TypeTax Type 6Text
TaxAmountTax AmountCurrencyTotal tax on the line, calculated from its tax group into the Tax 1 to Tax 6 slots.
TaxGroupIdTax GroupLookup → TaxGroupThe taxes that apply, picked from the tax rules when the line is created. Changing it re-taxes the line; on a line created from an order it cannot be changed.
TdsSectionIdTDS SectionLookup → TdsSectionThe tax-collected-at-source section for the line, offered on the finance quick-add form. Changing it recalculates the line's TCS.
UIPropsUI PropsText
UnitCostUnit CostCurrencyThe cost side of the line, copied from the inventory fulfilment allocation line when the invoice is built from allocated stock, so it reflects the lot or layer cost actually drawn. It does not participate in any price, discount or tax formula and is not what the cost-of-goods-sold journal uses.
UnitPriceUnit PriceCurrencyPrice per unit, filled from the price list when left empty. Cannot be negative, and must be zero on a bundled package component.
UnitPrice2Unit Price (Alt)CurrencyAlternative unit price. When above zero it replaces Unit Price in Base Amount and in the tax calculation. Copied from the order line on invoiced lines.
UOMUOMText
UOM1UOM1Text
UOMQuantityUOM QuantityDecimal
UOMQuantity1UOM Quantity 1Decimal
UpdatedDateTimeModified DateDateAndTimeYes

Actions

ActionLabelTypeWhat it does
BulkDeleteDeleteDelete the selected records.
CloneCloneServerAction (Clone)Create a copy of this record
DeleteDeleteDeleteDelete
DeleteInListDeleteDeleteDelete in a list page
EditEditEditEdit
EditInLineEditEditInlineEditInLine
EditInListEditEditEdit
NewNewNewNew
NewInLineQuick AddNewInlineNew In Line

Validations

ValidationApplies toError messageNotes
Quantity Rule ValidationQuantity, ErrorQuantity should be in Positive.Quantity should be in Positive.
Returned Quantity ValidationReturnedQuantity, ErrorReturned Quantity can not be greater than QuantityReturned Quantity can not be greater than Quantity
Unit Price Rule ValidationUnitPrice, ErrorUnit price can not be NegativeUnit price can not be Negative

Lookup filters

FilterLookup fieldNotes
Lot For SKUItemLotId
Lot Type for ItemItemLotTypeId
SKU For ItemSKUId