Class EinvoicePaymentTerms() Professional

Payment terms of an invoice.

Description

The EinvoicePaymentTerms class contains the payment terms of an invoice. These are the payment due date (BT-9), the payment terms as free text (BT-20) and any number of early payment discounts (Skonto). The payment terms are assigned to an invoice via AbstractEinvoice():setPaymentTerms().

An EinvoicePaymentTerms object can be created in one of the following ways:

EinvoicePaymentTerms():new() - Creates an empty object whose values are assigned via the methods :setDueDate(), :setText() and :addSkonto().

EinvoicePaymentTerms():new( oInit ) - Creates an object from a DataObject whose members have the same names as the values, for example :DueDate and :Text.

Both ways call the same methods, so the values are normalized identically. Texts are converted to UTF-8, and the percentage and base amount of each early payment discount are stored as EinvoiceDecimal objects.

Each early payment discount is written to the payment terms text (BT-20) using the German XRechnung convention "#SKONTO#TAGE=..#PROZENT=..#" (BR-DE-18). The method :addSkonto() can be called more than once to define a tiered discount.

Constructors
:new()
Initializes a new payment terms object.
Class Methods
:from()
Converts a value into a payment terms object.
Methods
:addSkonto()
Adds an early payment discount (Skonto, BT-20).
:getDueDate()
Returns the payment due date (BT-9).
:getSkonto()
Returns the early payment discounts (Skonto, BT-20).
:getText()
Returns the payment terms text (BT-20).
:setDueDate()
Sets the payment due date (BT-9).
:setText()
Sets the payment terms text (BT-20).
Examples
Due date with an early payment discount
oInvoice:setPaymentTerms( EinvoicePaymentTerms():new():setDueDate(dDue):addSkonto(14, 2) ) 

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.