Method EinvoiceLineItem():new() Professional

Initializes a new line item object.

Syntax
:new( [<oInit>] ) --> self
Parameters
<oInit>
An optional DataObject with the line fields. This defaults to NIL, meaning an empty line item with default values is created.
Return

This method returns self.

Description

Initializes a line item object, optionally from a DataObject. The DataObject can contain the members :Id, :Name, :Description, :Quantity, :UnitCode, :Price, :GrossPrice, :BaseQuantity, :VatRate, :Kind, :VatCategory, :ExemptionReason, :ExemptionReasonCode, :SellerItemId, :BuyerItemId, :Gtin, :Note, :OrderLineRef and :Period. All members are optional. Each value is passed to the corresponding setter method, so it is normalized and checked in the same way as a value assigned via :setName(), :setQuantity() and the other setter methods. The member :Period must be a DataObject with the members :Start and :End, which are passed to :setPeriod().

If <oInit> is NIL or a member is missing, the defaults of the setter methods apply. The quantity is 1, the unit code is EINV_UNIT_ONE, the net price is zero and the kind of supply is "goods".

A runtime error is raised if <oInit> is neither NIL nor an object. A runtime error is also raised if a member contains a value which is rejected by the corresponding setter method, for example an invalid :Kind or an invalid date in :Period.

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.