Class TradeParty

    • 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
      • 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 company
        street - street and number (use setAdditionalAddress for more parts)
        zip - postcode of the company
        location - city of the company
        country - 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)
      • 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
      • 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
      • 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
      • setVATID

        public TradeParty setVATID​(java.lang.String VATid)
      • setTaxID

        public TradeParty setTaxID​(java.lang.String tax)
      • 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
      • 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
      • 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
      • 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
      • 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
      • 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()
      • 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:
        getAdditionalAddressExtension in interface IZUGFeRDExportableTradeParty
        Returns:
        lineThree