Class EinvoiceLineItem() Professional

An invoice line of an electronic invoice.

Description

The EinvoiceLineItem class represents an invoice line (BG-25) as defined by the European standard EN 16931. An invoice line consists of the invoiced quantity, the unit of measure, the net price and optionally the gross price and the price base quantity. It also holds the information used to determine the VAT of the line, namely the kind of supply, the VAT category, the VAT rate and the exemption reason, as well as item identifiers such as the seller's and buyer's item identifiers and the GTIN, and an optional invoice line period.

A line item object can be created in two ways. EinvoiceLineItem():new() can be called with a DataObject which contains members with the same names as the line fields. Alternatively, an empty line item can be created with EinvoiceLineItem():new() and filled with the setter methods such as :setName(), :setQuantity() and :setPrice(). Both ways call the same setter methods, so the values are normalized identically. Character strings passed to the text setters are converted to UTF-8 according to the current SET CHARSET setting. Values of other types are stored unchanged.

The line item is added to an invoice with AbstractEinvoice():addLineItem(). If not set explicitly, the quantity defaults to 1, the unit code defaults to EINV_UNIT_ONE and the kind of supply defaults to "goods".

If the VAT category and the VAT rate are not set, the scenario classes DomesticEinvoice, IntraEuEinvoice and ExportEinvoice determine them from the kind of supply and the seller profile. For a ManualEinvoice(), the VAT category must be set explicitly on every line.

Constructors
:new()
Initializes a new line item object.
Class Methods
:from()
Converts a value into a line item object.
Methods
:getBaseQuantity()
Returns the price base quantity (BT-149).
:getBuyerItemId()
Returns the buyer's item identifier (BT-156).
:getDescription()
Returns the item description (BT-154).
:getExemptionReason()
Returns the VAT exemption reason of the line (BT-120).
:getExemptionReasonCode()
Returns the VAT exemption reason code of the line (BT-121).
:getGrossPrice()
Returns the gross unit price (BT-148).
:getGtin()
Returns the GTIN of the item (BT-157).
:getId()
Returns the line identifier (BT-126).
:getKind()
Returns the kind of supply of the line.
:getName()
Returns the item name (BT-153).
:getNetAmount()
Calculates the net amount of the line (BT-131).
:getNote()
Returns the note of the line (BT-127).
:getOrderLineRef()
Returns the purchase order line reference (BT-132).
:getPeriod()
Returns the invoice line period (BT-26).
:getPrice()
Returns the net unit price (BT-146).
:getQuantity()
Returns the invoiced quantity (BT-129).
:getSellerItemId()
Returns the seller's item identifier (BT-155).
:getUnitCode()
Returns the unit of measure code (BT-130).
:getVatCategory()
Returns the VAT category of the line (BT-151).
:getVatRate()
Returns the VAT rate of the line (BT-152).
:setBaseQuantity()
Sets the price base quantity (BT-149).
:setBuyerItemId()
Sets the buyer's item identifier (BT-156).
:setDescription()
Sets the item description (BT-154).
:setExemptionReason()
Sets the VAT exemption reason of the line (BT-120).
:setGrossPrice()
Sets the gross unit price (BT-148).
:setGtin()
Sets the GTIN of the item (BT-157).
:setId()
Sets the line identifier (BT-126).
:setKind()
Sets the kind of supply of the line.
:setName()
Sets the item name (BT-153).
:setNote()
Sets the note of the line (BT-127).
:setOrderLineRef()
Sets the purchase order line reference (BT-132).
:setPeriod()
Sets the invoice line period (BT-26).
:setPrice()
Sets the net unit price (BT-146).
:setQuantity()
Sets the invoiced quantity (BT-129).
:setSellerItemId()
Sets the seller's item identifier (BT-155).
:setUnitCode()
Sets the unit of measure code (BT-130).
:setVatCategory()
Sets the VAT category of the line (BT-151).
:setVatRate()
Sets the VAT rate of the line (BT-152).
Examples
Add a simple goods line
LOCAL oLine 

oLine := EinvoiceLineItem():new():setName( "Widget" ):setQuantity( 2 ):setPrice( 9.50 ) 
oInvoice:addLineItem( oLine ) 

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.