Skip to content
D365 Reference

CustInvoiceJour

transaction

Posted customer invoice header — one row per invoice issued from a sales order (or free-text posting), with totals, currency, due date, and the ledger voucher it posted under

Module: Sales & MarketingCompany-partitioned (DataAreaId)

Header & line

CustInvoiceJour is the header for its lines in CustInvoiceTrans.

Fields

23 fields · 4 key

KeyFieldEDTDescriptionTypeLengthFlags
KeyInvoiceIdInvoiceIdThe invoice number; unique only together with InvoiceDate, numberSequenceGroup, and SalesIdstring20
KeyInvoiceDateDate the invoice was posted — the primary analysis date for revenue reportingdate
KeynumberSequenceGroupNumber-sequence group the invoice number was drawn from; part of the composite key (often blank)string10
KeySalesIdSalesIdSales order the invoice was posted from; part of the composite keystring20
InvoiceAccountCustAccountCustomer account the invoice is billed tostring20
OrderAccountCustAccountCustomer account that placed the underlying order (can differ from the invoice account)string20
CustGroupCustGroupIdCustomer group of the invoiced customer at posting timestring10
InvoiceAmountTotal invoice amount in the transaction currencyreal
InvoiceAmountMSTTotal invoice amount converted to the company (accounting) currencyreal
SalesBalanceNet line amount of the invoice before tax and charges, in the transaction currencyreal
SumTaxTotal sales tax on the invoice in the transaction currencyreal
SumLineDiscTotal line discount across the invoice in the transaction currencyreal
CurrencyCodeCurrencyCodeTransaction currency of the invoicestring3
ExchRateExchange rate used to convert the invoice to the accounting currencyreal
DueDatePayment due date derived from the invoice date and payment termsdate
QtyTotal quantity invoiced across the linesreal
WeightTotal weight of the invoiced goodsreal
LedgerVoucherLedger voucher the invoice posted under — the bridge to general-ledger transactionsstring20
SalesTypeType of the originating sales order (journal, subscription, sales order, returned order…)enum
DlvModeMode of delivery on the invoicestring10
DlvTermTerms of delivery on the invoicestring10
DeliveryPostalAddressRecIdRecId of the ship-to address in LogisticsPostalAddressint64
InvoicePostalAddressRecIdRecId of the bill-to address in LogisticsPostalAddressint64

Field provenance: hand-curated.

Boilerplate SQL

Starting point for reading CustInvoiceJouron Databricks — enums are decoded, 1900-01-01 dates are wrapped to NULL, and the DataAreaId anchor is in place. Set your Unity Catalog location, company, and filter values below; they’re substituted into the SQL and the copy button.

Query parameters
-- ============================================================
-- Table  : CustInvoiceJour Posted customer invoice header — one row per invoice issued from a sales order (or free-text posting), with totals, currency, due date, and the ledger voucher it posted under
-- Purpose: Column-selected read of CustInvoiceJour — auto-generated from field metadata
-- Grain  : One row per company (dataareaid) + InvoiceId + InvoiceDate + numberSequenceGroup + SalesId
-- Notes  : Auto-generated skeleton for Synapse Link / Fabric Link-landed F&O data (lowercase column names). Enums decoded inline where verified; datetimes stored in UTC; 1900-01-01 dates are sentinels mapped to NULL. System/audit columns omitted — see the quirks guide.
-- ============================================================
SELECT
  c.invoiceid AS "The invoice number; unique only together with InvoiceDate, numberSequenceGroup, and SalesId",
  c.invoicedate AS "Date the invoice was posted — the primary analysis date for revenue reporting",
  c.numbersequencegroup AS "Number-sequence group the invoice number was drawn from; part of the composite key (often blank)",
  c.salesid AS "Sales order the invoice was posted from; part of the composite key",
  c.invoiceaccount AS "Customer account the invoice is billed to",
  c.orderaccount AS "Customer account that placed the underlying order (can differ from the invoice account)",
  c.custgroup AS "Customer group of the invoiced customer at posting time",
  c.invoiceamount AS "Total invoice amount in the transaction currency",
  c.invoiceamountmst AS "Total invoice amount converted to the company (accounting) currency",
  c.salesbalance AS "Net line amount of the invoice before tax and charges, in the transaction currency",
  c.sumtax AS "Total sales tax on the invoice in the transaction currency",
  c.sumlinedisc AS "Total line discount across the invoice in the transaction currency",
  c.currencycode AS "Transaction currency of the invoice",
  c.exchrate AS "Exchange rate used to convert the invoice to the accounting currency",
  c.duedate AS "Payment due date derived from the invoice date and payment terms",
  c.qty AS "Total quantity invoiced across the lines",
  c.weight AS "Total weight of the invoiced goods",
  c.ledgervoucher AS "Ledger voucher the invoice posted under — the bridge to general-ledger transactions",
  c.salestype AS "Type of the originating sales order (journal, subscription, sales order, returned order…)",  -- enum: decode c.salestype via GlobalOptionsetMetadata join — see quirks guide #enums
  c.dlvmode AS "Mode of delivery on the invoice",
  c.dlvterm AS "Terms of delivery on the invoice",
  c.deliverypostaladdress AS "RecId of the ship-to address in LogisticsPostalAddress",
  c.invoicepostaladdress AS "RecId of the bill-to address in LogisticsPostalAddress"
FROM <catalog>.<schema>.custinvoicejour c
-- Resolve LogisticsPostalAddress (via DeliveryPostalAddress): uncomment to join on its RecId surrogate key
-- LEFT JOIN <catalog>.<schema>.logisticspostaladdress deliverypostaladdress ON deliverypostaladdress.recid = c.deliverypostaladdress
-- Resolve LogisticsPostalAddress (via InvoicePostalAddress): uncomment to join on its RecId surrogate key
-- LEFT JOIN <catalog>.<schema>.logisticspostaladdress invoicepostaladdress ON invoicepostaladdress.recid = c.invoicepostaladdress
WHERE
  c.dataareaid = '<company>'
  -- AND c.salesid = '<SalesId>'
  -- AND c.invoicedate >= '<DATE_FROM>'  -- yyyy-MM-dd (UTC)
  -- AND c.invoicedate <= '<DATE_TO>'  -- yyyy-MM-dd (UTC)
ORDER BY c.invoiceid;

6 parameters not filled: <catalog>, <schema>, <company>, <SalesId>, <DATE_FROM>, <DATE_TO>

Relationships

1-hop neighbors — click a table to navigate there. RecId and InventDim edges are highlighted; they’re the joins newcomers most often get wrong.

Join details

  • CustInvoiceJourCustInvoiceTransheader line · 1:N
    ON custinvoicejour.invoiceid = custinvoicetrans.invoiceid
  • CustInvoiceJourCustTableforeign key · N:1
    ON custinvoicejour.invoiceaccount = custtable.accountnum
  • CustInvoiceJourCustTableforeign key · N:1
    ON custinvoicejour.orderaccount = custtable.accountnum
  • CustInvoiceJourLogisticsPostalAddressRecId ref · N:1
    ON custinvoicejour.deliverypostaladdress = logisticspostaladdress.recid
  • CustInvoiceJourLogisticsPostalAddressRecId ref · N:1
    ON custinvoicejour.invoicepostaladdress = logisticspostaladdress.recid

Data Entities That Expose This Table