Package org.mustangproject
Class TradeParty
- java.lang.Object
-
- org.mustangproject.TradeParty
-
- All Implemented Interfaces:
IZUGFeRDExportableTradeParty
public class TradeParty extends java.lang.Object implements IZUGFeRDExportableTradeParty
A organisation, i.e. usually a company
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringadditionalAddressprotected java.lang.StringadditionalAddressExtensionprotected java.util.List<BankDetails>bankDetailsprotected Contactcontactprotected java.lang.Stringcountryprotected java.util.List<DirectDebit>debitDetailsprotected java.lang.Stringdescriptionprotected SchemedIDglobalIdprotected java.lang.StringIDprotected LegalOrganisationlegalOrgprotected java.lang.Stringlocationprotected java.lang.Stringnameprotected java.lang.Stringstreetprotected java.lang.StringtaxIDprotected java.lang.StringtaxSchemeprotected SchemedIDuriUniversalCommunicationIdprotected java.lang.StringvatIDprotected java.lang.Stringzip
-
Constructor Summary
Constructors Constructor Description TradeParty()Default constructor.TradeParty(java.lang.String name, java.lang.String street, java.lang.String zip, java.lang.String location, java.lang.String country)TradeParty(org.w3c.dom.NodeList nodes)XML parsing constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TradePartyaddBankDetails(BankDetails s)required (for senders, if payment is not debit): the BIC and IBANTradePartyaddDebitDetails(DirectDebit debitDetail)(optional)TradePartyaddGlobalID(SchemedID schemedID)TradePartyaddTaxID(java.lang.String taxID)a general tax IDTradePartyaddUriUniversalCommunicationID(SchemedID schemedID)TradePartyaddVATID(java.lang.String vatID)the USt-IDjava.lang.StringgetAdditionalAddress()returns additional address information which is display in xml tag "LineTwo" e.g.java.lang.StringgetAdditionalAddressExtension()Returns even advanced additional address information, e.g. which floor (if LineTwo=setAdditionalAddress has already been used e.g. for which building)IZUGFeRDTradeSettlement[]getAsTradeSettlement()java.util.List<BankDetails>getBankDetails()IZUGFeRDExportableContactgetContact()the named contact person for inquiriesjava.lang.StringgetCountry()two-letter country code of the contactjava.util.List<DirectDebit>getDebitDetails()primarily for invoiceimporter and JSONjava.lang.StringgetDescription()java.lang.StringgetGlobalID()customer global identification assigned by the sellerjava.lang.StringgetGlobalIDScheme()customer global identification schemejava.lang.StringgetID()customer identification assigned by the sellerIZUGFeRDLegalOrganisationgetLegalOrganisation()gets the official representationjava.lang.StringgetLocation()Returns the city of the contactjava.lang.StringgetName()e.g. first and last name of the ownerjava.lang.StringgetStreet()Returns the street address (street+number) of the contactjava.lang.StringgetTaxID()obligatory for sender but not for recipientjava.lang.StringgetUriUniversalCommunicationID()The URIID of URIUniversalCommunicationID (e.g. email address) It is used by some countries, i.e.java.lang.StringgetUriUniversalCommunicationIDScheme()URIUniversalCommunication scheme (see EAS code list of the ZUGFeRD documentation) I believe EM for Emailjava.lang.StringgetVatID()java.lang.StringgetVATID()VAT ID (Umsatzsteueridentifikationsnummer) of the contactjava.lang.StringgetZIP()Postal code of the recipientprotected voidparseFromUBL(org.w3c.dom.NodeList nodes)TradePartysetAdditionalAddress(java.lang.String additionalAddress)additional info of the address, e.g. which building or which floor.TradePartysetAdditionalAddress(java.lang.String additionalAddress1, java.lang.String additionalAddress2)Sets two parts of additional address at once, e.g. which building and which floor (if building is not in question which floor can also be set with the first part only :-))TradePartysetAdditionalAddressExtension(java.lang.String additionalAddress2)Sets even advanced additional address information, e.g. which floor (if LineTwo has already been used e.g. for which building) This could sometimes be BT-165?TradePartysetContact(Contact c)(optional) a named contact personTradePartysetCountry(java.lang.String country)two-letter ISO code of the countryTradePartysetDescription(java.lang.String description)required, usually done in the constructor: the complete name of the organisationTradePartysetEmail(java.lang.String eMail)sets the email of the organization (not the one of the contact person) (while setEmail has to be defined here getEmail comes from IZUGFeRDExportableTradeParty)TradePartysetGlobalID(java.lang.String ID)for jackson, primarily, use addGlobalID(SchemedID) insteadTradePartysetGlobalIDScheme(java.lang.String scheme)for jackson, primarily, use addGlobalID(SchemedID) insteadTradePartysetID(java.lang.String ID)if it's a customer, this can e.g. be the customer IDTradePartysetLegalOrganisation(LegalOrganisation legalOrganisation)TradePartysetLocation(java.lang.String location)usually set in constructor, usually required in germany, the city of the organisationTradePartysetName(java.lang.String name)required, usually done in the constructor: the complete name of the organisationTradePartysetStreet(java.lang.String street)usually set in constructor, required in germany, street and house numberTradePartysetTaxID(java.lang.String tax)TradePartysetVATID(java.lang.String VATid)TradePartysetZIP(java.lang.String zip)usually set in the constructor, required for recipients in german invoices: postcode-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.mustangproject.ZUGFeRD.IZUGFeRDExportableTradeParty
getEmail
-
-
-
-
Field Detail
-
name
protected java.lang.String name
-
zip
protected java.lang.String zip
-
street
protected java.lang.String street
-
location
protected java.lang.String location
-
country
protected java.lang.String country
-
taxScheme
protected java.lang.String taxScheme
-
taxID
protected java.lang.String taxID
-
vatID
protected java.lang.String vatID
-
ID
protected java.lang.String ID
-
description
protected java.lang.String description
-
additionalAddress
protected java.lang.String additionalAddress
-
additionalAddressExtension
protected java.lang.String additionalAddressExtension
-
bankDetails
protected java.util.List<BankDetails> bankDetails
-
debitDetails
protected java.util.List<DirectDebit> debitDetails
-
contact
protected Contact contact
-
legalOrg
protected LegalOrganisation legalOrg
-
globalId
protected SchemedID globalId
-
uriUniversalCommunicationId
protected SchemedID uriUniversalCommunicationId
-
-
Constructor Detail
-
TradeParty
public TradeParty()
Default constructor. Probably a bad idea but might be needed by jackson or similar
-
TradeParty
public TradeParty(java.lang.String name, java.lang.String street, java.lang.String zip, java.lang.String location, java.lang.String country)- Parameters:
name- of the companystreet- street and number (use setAdditionalAddress for more parts)zip- postcode of the companylocation- city of the companycountry- two letter ISO code
-
TradeParty
public TradeParty(org.w3c.dom.NodeList nodes)
XML parsing constructor- Parameters:
nodes- the nodelist returned e.g. from xpath
-
-
Method Detail
-
parseFromUBL
protected void parseFromUBL(org.w3c.dom.NodeList nodes)
-
getID
public java.lang.String getID()
Description copied from interface:IZUGFeRDExportableTradePartycustomer identification assigned by the seller- Specified by:
getIDin interfaceIZUGFeRDExportableTradeParty- Returns:
- customer identification
-
getGlobalID
public java.lang.String getGlobalID()
Description copied from interface:IZUGFeRDExportableTradePartycustomer global identification assigned by the seller- Specified by:
getGlobalIDin interfaceIZUGFeRDExportableTradeParty- Returns:
- customer identification
-
getGlobalIDScheme
public java.lang.String getGlobalIDScheme()
Description copied from interface:IZUGFeRDExportableTradePartycustomer global identification scheme- Specified by:
getGlobalIDSchemein interfaceIZUGFeRDExportableTradeParty- Returns:
- customer identification
-
getUriUniversalCommunicationID
public java.lang.String getUriUniversalCommunicationID()
Description copied from interface:IZUGFeRDExportableTradePartyThe URIID of URIUniversalCommunicationID (e.g. email address) It is used by some countries, i.e. Luxembourg, Peppol- Specified by:
getUriUniversalCommunicationIDin interfaceIZUGFeRDExportableTradeParty- Returns:
- the URI as string
-
getUriUniversalCommunicationIDScheme
public java.lang.String getUriUniversalCommunicationIDScheme()
Description copied from interface:IZUGFeRDExportableTradePartyURIUniversalCommunication scheme (see EAS code list of the ZUGFeRD documentation) I believe EM for Email- Specified by:
getUriUniversalCommunicationIDSchemein interfaceIZUGFeRDExportableTradeParty- Returns:
- String with code
-
setEmail
public TradeParty setEmail(java.lang.String eMail)
sets the email of the organization (not the one of the contact person) (while setEmail has to be defined here getEmail comes from IZUGFeRDExportableTradeParty)- Parameters:
eMail- address of institution (not contact)- Returns:
- fluent setter
-
setID
public TradeParty setID(java.lang.String ID)
if it's a customer, this can e.g. be the customer ID- Parameters:
ID- customer/seller number- Returns:
- fluent setter
-
setContact
public TradeParty setContact(Contact c)
(optional) a named contact person- Parameters:
c- the named contact person- Returns:
- fluent setter
- See Also:
Contact
-
setGlobalID
public TradeParty setGlobalID(java.lang.String ID)
for jackson, primarily, use addGlobalID(SchemedID) instead- Parameters:
ID- the id part without scheme- Returns:
- fluent setter
-
setGlobalIDScheme
public TradeParty setGlobalIDScheme(java.lang.String scheme)
for jackson, primarily, use addGlobalID(SchemedID) instead- Parameters:
scheme- the scheme part without id- Returns:
- fluent setter
-
addGlobalID
public TradeParty addGlobalID(SchemedID schemedID)
-
addUriUniversalCommunicationID
public TradeParty addUriUniversalCommunicationID(SchemedID schemedID)
-
addBankDetails
public TradeParty addBankDetails(BankDetails s)
required (for senders, if payment is not debit): the BIC and IBAN- Parameters:
s- bank credentials- Returns:
- fluent setter
-
addDebitDetails
public TradeParty addDebitDetails(DirectDebit debitDetail)
(optional)- Parameters:
debitDetail- e.g. containing IBAN and mandate- Returns:
- fluent setter
-
getDebitDetails
public java.util.List<DirectDebit> getDebitDetails()
primarily for invoiceimporter and JSON- Returns:
- the list of sepa mandates
-
getLegalOrganisation
public IZUGFeRDLegalOrganisation getLegalOrganisation()
Description copied from interface:IZUGFeRDExportableTradePartygets the official representation- Specified by:
getLegalOrganisationin interfaceIZUGFeRDExportableTradeParty- Returns:
- the interface with the attributes of the legal organisation
-
setLegalOrganisation
public TradeParty setLegalOrganisation(LegalOrganisation legalOrganisation)
-
getBankDetails
public java.util.List<BankDetails> getBankDetails()
-
addTaxID
public TradeParty addTaxID(java.lang.String taxID)
a general tax ID- Parameters:
taxID- tax number of the organisation- Returns:
- fluent setter
-
addVATID
public TradeParty addVATID(java.lang.String vatID)
the USt-ID- Parameters:
vatID- Ust-ID- Returns:
- fluent setter
-
getVATID
public java.lang.String getVATID()
Description copied from interface:IZUGFeRDExportableTradePartyVAT ID (Umsatzsteueridentifikationsnummer) of the contact- Specified by:
getVATIDin interfaceIZUGFeRDExportableTradeParty- Returns:
- VAT ID (Umsatzsteueridentifikationsnummer) of the contact
-
setVATID
public TradeParty setVATID(java.lang.String VATid)
-
getTaxID
public java.lang.String getTaxID()
Description copied from interface:IZUGFeRDExportableTradePartyobligatory for sender but not for recipient- Specified by:
getTaxIDin interfaceIZUGFeRDExportableTradeParty- Returns:
- the tax id as string
-
setTaxID
public TradeParty setTaxID(java.lang.String tax)
-
getName
public java.lang.String getName()
Description copied from interface:IZUGFeRDExportableTradePartye.g. first and last name of the owner- Specified by:
getNamein interfaceIZUGFeRDExportableTradeParty- Returns:
- full name of the party
-
setName
public TradeParty setName(java.lang.String name)
required, usually done in the constructor: the complete name of the organisation- Parameters:
name- complete legal name- Returns:
- fluent setter
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescriptionin interfaceIZUGFeRDExportableTradeParty- Returns:
- String the description, e.g. if it's a vat exempt company
-
setDescription
public TradeParty setDescription(java.lang.String description)
required, usually done in the constructor: the complete name of the organisation- Parameters:
description- human readable description- Returns:
- fluent setter
-
getZIP
public java.lang.String getZIP()
Description copied from interface:IZUGFeRDExportableTradePartyPostal code of the recipient- Specified by:
getZIPin interfaceIZUGFeRDExportableTradeParty- Returns:
- Postal code of the recipient
-
setZIP
public TradeParty setZIP(java.lang.String zip)
usually set in the constructor, required for recipients in german invoices: postcode- Parameters:
zip- postcode- Returns:
- fluent setter
-
getStreet
public java.lang.String getStreet()
Description copied from interface:IZUGFeRDExportableTradePartyReturns the street address (street+number) of the contact- Specified by:
getStreetin interfaceIZUGFeRDExportableTradeParty- Returns:
- street address (street+number) of the contact
-
setStreet
public TradeParty setStreet(java.lang.String street)
usually set in constructor, required in germany, street and house number- Parameters:
street- street name and number- Returns:
- fluent setter
-
getLocation
public java.lang.String getLocation()
Description copied from interface:IZUGFeRDExportableTradePartyReturns the city of the contact- Specified by:
getLocationin interfaceIZUGFeRDExportableTradeParty- Returns:
- Returns the city of the recipient
-
setLocation
public TradeParty setLocation(java.lang.String location)
usually set in constructor, usually required in germany, the city of the organisation- Parameters:
location- city- Returns:
- fluent setter
-
getCountry
public java.lang.String getCountry()
Description copied from interface:IZUGFeRDExportableTradePartytwo-letter country code of the contact- Specified by:
getCountryin interfaceIZUGFeRDExportableTradeParty- Returns:
- two-letter iso country code of the contact
-
setCountry
public TradeParty setCountry(java.lang.String country)
two-letter ISO code of the country- Parameters:
country- two-letter-code- Returns:
- fluent setter
-
getVatID
public java.lang.String getVatID()
-
getContact
public IZUGFeRDExportableContact getContact()
Description copied from interface:IZUGFeRDExportableTradePartythe named contact person for inquiries- Specified by:
getContactin interfaceIZUGFeRDExportableTradeParty- Returns:
- contact
-
getAsTradeSettlement
public IZUGFeRDTradeSettlement[] getAsTradeSettlement()
-
getAdditionalAddress
public java.lang.String getAdditionalAddress()
Description copied from interface:IZUGFeRDExportableTradePartyreturns additional address information which is display in xml tag "LineTwo" e.g. "Rear building"- Specified by:
getAdditionalAddressin interfaceIZUGFeRDExportableTradeParty- Returns:
- additional address information
-
setAdditionalAddress
public TradeParty setAdditionalAddress(java.lang.String additionalAddress)
additional info of the address, e.g. which building or which floor. Street address will become "lineOne", this will become "lineTwo". (see setAdditionalAddressExtension for "lineThree")- Parameters:
additionalAddress- additional address description- Returns:
- fluent setter
-
setAdditionalAddress
public TradeParty setAdditionalAddress(java.lang.String additionalAddress1, java.lang.String additionalAddress2)
Sets two parts of additional address at once, e.g. which building and which floor (if building is not in question which floor can also be set with the first part only :-))- Parameters:
additionalAddress1- first part of additional info, e.g. "Rear building"additionalAddress2- second part of additional address info, e.g. "2nd floor"- Returns:
- fluent setter
-
setAdditionalAddressExtension
public TradeParty setAdditionalAddressExtension(java.lang.String additionalAddress2)
Sets even advanced additional address information, e.g. which floor (if LineTwo has already been used e.g. for which building) This could sometimes be BT-165?- Parameters:
additionalAddress2- e.g. which floor, as String- Returns:
- fluent setter
-
getAdditionalAddressExtension
public java.lang.String getAdditionalAddressExtension()
Returns even advanced additional address information, e.g. which floor (if LineTwo=setAdditionalAddress has already been used e.g. for which building)- Specified by:
getAdditionalAddressExtensionin interfaceIZUGFeRDExportableTradeParty- Returns:
- lineThree
-
-