Class EinvoiceParty() Professional

Represents a party of an electronic invoice.

Description

The EinvoiceParty class represents a seller (BG-4), buyer (BG-7), payee (BG-10) or deliver-to party (BG-13) of an electronic invoice. A party consists of the name, the legal, VAT and tax registration data, the postal address, the contact point and the electronic address.

A party object can be created in two ways. Either a DataObject with the corresponding members is passed to EinvoiceParty():new(), or an empty party is created and filled via the builder methods such as :setName(), :setVatId() and :setAddress(). Each builder method returns the party object, so calls can be chained. Both ways use the same builder methods internally and therefore normalize the data identically. The VAT identification number is stripped of whitespace and converted to upper case, and text values are converted to UTF-8.

The seller is assigned to an invoice via AbstractEinvoice:setSeller(). The buyer, the payee and the deliver-to party are assigned via AbstractEinvoice:addRecipient(). Alternatively, the seller and the buyer can be passed to EinvFactory():createInvoice().

Constructors
:new()
Initializes a new party object.
Class Methods
:from()
Converts a value into a party object.
Methods
:getAddress()
Returns the postal address of the party (BT-5/BG-8/BG-15).
:getContact()
Returns the contact point of the party (BT-6/BG-9).
:getCountryCode()
Returns the country code of the party.
:getElectronicAddress()
Returns the electronic address of the party (BT-34/BG-49).
:getGlobalIdScheme()
Returns the scheme of the global identifier (BT-29(-1)/BT-26(-1)).
:getGlobalIdValue()
Returns the value of the global identifier (BT-29/BT-46).
:getId()
Returns the identifier of the party (BT-29/BT-46).
:getLegalId()
Returns the legal registration identifier (BT-30/BT-47).
:getName()
Returns the party name (BT-27/BT-44).
:getSmallBusiness()
Checks whether the party is a small enterprise.
:getTaxNumber()
Returns the national tax registration number (BT-32).
:getTradingName()
Returns the trading name of the party (BT-28).
:getVatCountry()
Returns the country of the VAT identification number.
:getVatId()
Returns the VAT identification number (BT-31/BT-48).
:hasValidVatIdFor()
Checks whether the VAT identification number is valid for a country.
:setAddress()
Sets the postal address of the party (BT-5/BG-8).
:setContact()
Sets the contact point of the party (BT-6/BG-9)).
:setElectronicAddress()
Sets the electronic address of the party (BT-34/BT-49).
:setGlobalId()
Sets a global identifier of the party (BT-29(-1)/BT-46(-1)).
:setId()
Sets the identifier of the party (BT-29/BT-46).
:setLegalId()
Sets the legal registration identifier (BT-30/BT-47).
:setName()
Sets the party name (BT-27/BT-44).
:setSmallBusiness()
Marks the party as a small enterprise.
:setTaxNumber()
Sets the national tax registration number (BT-32).
:setTradingName()
Sets the trading name of the party (BT-28).
:setVatId()
Sets the VAT identification number (BT-31/BT-48).
Examples
Building a seller with the builder methods
LOCAL oSeller 

oSeller := EinvoiceParty():new() 
oSeller:setName( "Northwind Inc., Germany" ) 
oSeller:setVatId( "DE123456789" ) 
oSeller:setAddress( EinvoiceAddress():new():setLine1("Alexanderplatz 7"):setPostcode("10178"):setCity("Berlin"):setCountryCode("DE") ) 

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.