Method EinvoiceAllowanceCharge():from() Professional

Converts a value into an allowance or charge object.

Syntax
:from( <xSpec> ) --> oAllowanceCharge
Parameters
<xSpec>
The allowance or charge, specified either as an EinvoiceAllowanceCharge() object or as a DataObject with the corresponding members. If NIL is passed, an empty object is created.
Return

An EinvoiceAllowanceCharge object.

Description

Returns an EinvoiceAllowanceCharge() object for <xSpec>. If <xSpec> is already an EinvoiceAllowanceCharge object, it is returned unchanged. Otherwise, a new object is created via EinvoiceAllowanceCharge():new( xSpec ). This allows a DataObject with the corresponding members to be used wherever an EinvoiceAllowanceCharge object is expected.

The method is used by AbstractEinvoice:addAllowance() and AbstractEinvoice:addCharge(). Refer to the method :init() for the supported members. If <xSpec> is neither NIL nor an object, a runtime error is raised.

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.