Invoice lines
An invoice line (BG-25) states what is invoiced: a quantity, a price, the item and its VAT category. Each snippet is one invoiceLine entry of the base invoice.
Quantity and price
invoicedQuantity (BT-129) carries a unit code (BT-130) from UN/ECE Recommendation 20. A price (BT-146) can apply to more than one unit: state the baseQuantity (BT-149) it is for.
const boxes: InvoiceLineInput = {
id: '1',
invoicedQuantity: { value: 10, unitCode: 'H87' }, // H87: piece
item: { name: 'Printer paper', classifiedTaxCategory: { id: 'S', percent: 25 } },
price: {
priceAmount: 12.5,
baseQuantity: { value: 5, unitCode: 'H87' }, // 12.50 per 5 pieces
},
};
// lineExtensionAmount: 10 × 12.50 ÷ 5 = 25.00Computed: lineExtensionAmount (BT-131), rounded to two decimals.
Gross price and discount
When the net price results from a discount on a gross price, state both in the price's allowanceCharge: the discount (BT-147) and the gross price (BT-148).
const discounted: InvoiceLineInput = {
id: '2',
invoicedQuantity: { value: 2, unitCode: 'H87' },
item: { name: 'Toner', classifiedTaxCategory: { id: 'S', percent: 25 } },
price: {
priceAmount: 90, // net price (BT-146)
allowanceCharge: { amount: 10, baseAmount: 100 }, // discount (BT-147) off the gross price (BT-148)
},
};Defaulted: the price allowance's chargeIndicator is 'false'. The builder does not derive the net price from the gross price: state priceAmount yourself.
Item identifiers, classification and attributes
The item (BG-31) needs a name (BT-153) and a VAT category (BG-30). Identify it with the buyer's, the seller's or a standard identifier (BT-156, BT-155, BT-157), classify it (BT-158, with a classification scheme) and describe it with name-value attributes (BG-32).
const identified: InvoiceLineInput = {
id: '3',
invoicedQuantity: { value: 1, unitCode: 'H87' },
item: {
description: 'Laser printer, 30 pages per minute',
name: 'Printer',
buyersItemIdentification: { id: 'B-4711' },
sellersItemIdentification: { id: 'S-0815' },
standardItemIdentification: { id: { schemeId: '0088', value: '7300010000001' } },
originCountry: { identificationCode: 'DE' },
commodityClassification: [{ itemClassificationCode: { value: '44101501', listId: 'STI' } }],
classifiedTaxCategory: { id: 'S', percent: 25 },
additionalItemProperty: [{ name: 'Colour', value: 'Black' }],
},
price: { priceAmount: 250 },
};Line period, note and references
A line can carry its own period (BG-26), a note (BT-127), the buyer's accounting reference (BT-133) and the line of the purchase order it answers (BT-132).
const subscription: InvoiceLineInput = {
id: '4',
note: 'Support subscription, renewed yearly',
invoicedQuantity: { value: 12, unitCode: 'MON' },
accountingCost: 'IT-4711',
invoicePeriod: { startDate: '2017-01-01', endDate: '2017-12-31' },
orderLineReference: { lineId: '3' },
item: { name: 'Support', classifiedTaxCategory: { id: 'S', percent: 25 } },
price: { priceAmount: 20 },
};Defaulted: nothing. An orderLineReference needs an orderReference on the document.