Class Invoice

    • Field Detail

      • documentName

        protected java.lang.String documentName
      • documentCode

        protected java.lang.String documentCode
      • number

        protected java.lang.String number
      • ownOrganisationFullPlaintextInfo

        protected java.lang.String ownOrganisationFullPlaintextInfo
      • referenceNumber

        protected java.lang.String referenceNumber
      • shipToOrganisationID

        protected java.lang.String shipToOrganisationID
      • shipToOrganisationName

        protected java.lang.String shipToOrganisationName
      • shipToStreet

        protected java.lang.String shipToStreet
      • shipToZIP

        protected java.lang.String shipToZIP
      • shipToLocation

        protected java.lang.String shipToLocation
      • shipToCountry

        protected java.lang.String shipToCountry
      • buyerOrderReferencedDocumentID

        protected java.lang.String buyerOrderReferencedDocumentID
      • buyerOrderReferencedDocumentIssueDateTime

        protected java.lang.String buyerOrderReferencedDocumentIssueDateTime
      • ownForeignOrganisationID

        protected java.lang.String ownForeignOrganisationID
      • ownOrganisationName

        protected java.lang.String ownOrganisationName
      • currency

        protected java.lang.String currency
      • paymentTermDescription

        protected java.lang.String paymentTermDescription
      • issueDate

        protected java.util.Date issueDate
      • dueDate

        protected java.util.Date dueDate
      • deliveryDate

        protected java.util.Date deliveryDate
      • deliveryAddress

        protected TradeParty deliveryAddress
      • cashDiscounts

        protected java.util.ArrayList<CashDiscount> cashDiscounts
      • notes

        protected java.util.ArrayList<java.lang.String> notes
      • sellerOrderReferencedDocumentID

        protected java.lang.String sellerOrderReferencedDocumentID
      • contractReferencedDocument

        protected java.lang.String contractReferencedDocument
      • xmlEmbeddedFiles

        protected java.util.ArrayList<FileAttachment> xmlEmbeddedFiles
      • totalPrepaidAmount

        protected java.math.BigDecimal totalPrepaidAmount
      • detailedDeliveryDateStart

        protected java.util.Date detailedDeliveryDateStart
      • detailedDeliveryPeriodEnd

        protected java.util.Date detailedDeliveryPeriodEnd
      • invoiceReferencedDocumentID

        protected java.lang.String invoiceReferencedDocumentID
      • invoiceReferencedIssueDate

        protected java.util.Date invoiceReferencedIssueDate
      • invoiceReferencedDocuments

        protected java.util.ArrayList<ReferencedDocument> invoiceReferencedDocuments
      • specifiedProcuringProjectID

        protected java.lang.String specifiedProcuringProjectID
      • specifiedProcuringProjectName

        protected java.lang.String specifiedProcuringProjectName
      • despatchAdviceReferencedDocumentID

        protected java.lang.String despatchAdviceReferencedDocumentID
      • vatDueDateTypeCode

        protected java.lang.String vatDueDateTypeCode
      • creditorReferenceID

        protected java.lang.String creditorReferenceID
    • Constructor Detail

      • Invoice

        public Invoice()
    • Method Detail

      • setDocumentName

        public Invoice setDocumentName​(java.lang.String documentName)
      • getDocumentCode

        public java.lang.String getDocumentCode()
        Specified by:
        getDocumentCode in interface IExportableTransaction
        Returns:
        Code number of Document type, e.g. "380" for invoiceF
      • setDocumentCode

        public Invoice setDocumentCode​(java.lang.String documentCode)
      • getAdditionalReferencedDocuments

        public FileAttachment[] getAdditionalReferencedDocuments()
        Description copied from interface: IExportableTransaction
        get additional referenced documents acccording to BG-24 XRechnung (Rechnungsbegruendende Unterlagen), i.e. ram:ApplicableHeaderTradeAgreement/ram:AdditionalReferencedDocument
        Specified by:
        getAdditionalReferencedDocuments in interface IExportableTransaction
        Returns:
        a array of objects from class FileAttachment
      • setAdditionalReferencedDocuments

        public Invoice setAdditionalReferencedDocuments​(FileAttachment[] fileArr)
        setter in case e.g. jackson tries to map attachments (normal use embedFileInXML)
        Parameters:
        fileArr - Array of FileAttachments
        Returns:
        fluent setter
      • setTenderReferencedDocument

        public Invoice setTenderReferencedDocument​(ReferencedDocument dr)
        BT-17
        Parameters:
        dr -
        Returns:
      • setTenderReferencedDocument

        public Invoice setTenderReferencedDocument​(java.lang.String ID)
      • setNumber

        public Invoice setNumber​(java.lang.String number)
      • setCorrection

        public Invoice setCorrection​(java.lang.String number)
        switch type to invoice correction and refer to document number. Please note that the quantities need to be negative, if you e.g. delivered 100 and take 50 back the quantity should be -50 in the corrected invoice, which will result in negative VAT and a negative payment amount
        Parameters:
        number - the invoice number to be corrected
        Returns:
        this object (fluent setter)
      • setCreditNote

        public Invoice setCreditNote()
      • getOwnOrganisationFullPlaintextInfo

        public java.lang.String getOwnOrganisationFullPlaintextInfo()
        Description copied from interface: IExportableTransaction
        this should be the full sender institution name, details, manager and tax registration. It is one of the few functions which may return null. e.g. Lieferant GmbH Lieferantenstraße 20 80333 München Deutschland Geschäftsführer: Hans Muster Handelsregisternummer: H A 123 It is written as an includedNode with subjectCode SubjectCode.REG. See also IExportableTransaction.getNotesWithSubjectCode()
        Specified by:
        getOwnOrganisationFullPlaintextInfo in interface IExportableTransaction
        Returns:
        null or full sender institution name, details, manager and tax registration
      • setOwnOrganisationFullPlaintextInfo

        public Invoice setOwnOrganisationFullPlaintextInfo​(java.lang.String ownOrganisationFullPlaintextInfo)
      • getReferenceNumber

        public java.lang.String getReferenceNumber()
        Description copied from interface: IExportableTransaction
        get BuyerReference (BT-10) an identifier assigned by the buyer and used for internal routing. Used for the Leitweg-ID.
        Specified by:
        getReferenceNumber in interface IExportableTransaction
        Returns:
        the BuyerReference of this document
      • setReferenceNumber

        public Invoice setReferenceNumber​(java.lang.String referenceNumber)
      • getShipToOrganisationID

        public java.lang.String getShipToOrganisationID()
        Description copied from interface: IExportableTransaction
        consignee identification (identification of the organisation the goods are shipped to [assigned by the costumer])
        Specified by:
        getShipToOrganisationID in interface IExportableTransaction
        Returns:
        the sender's identification
      • setShipToOrganisationID

        public Invoice setShipToOrganisationID​(java.lang.String shipToOrganisationID)
      • setShipToOrganisationName

        public Invoice setShipToOrganisationName​(java.lang.String shipToOrganisationName)
      • getShipToStreet

        public java.lang.String getShipToStreet()
        Description copied from interface: IExportableTransaction
        consignee street address (street of the organisation the goods are shipped to)
        Specified by:
        getShipToStreet in interface IExportableTransaction
        Returns:
        consignee street address
      • setShipToStreet

        public Invoice setShipToStreet​(java.lang.String shipToStreet)
      • getShipToZIP

        public java.lang.String getShipToZIP()
        Description copied from interface: IExportableTransaction
        consignee street postal code (postal code of the organisation the goods are shipped to)
        Specified by:
        getShipToZIP in interface IExportableTransaction
        Returns:
        consignee postal code
      • setShipToZIP

        public Invoice setShipToZIP​(java.lang.String shipToZIP)
      • setShipToLocation

        public Invoice setShipToLocation​(java.lang.String shipToLocation)
      • getShipToCountry

        public java.lang.String getShipToCountry()
        Description copied from interface: IExportableTransaction
        consignee two digit country code (country code of the organisation the goods are shipped to)
        Specified by:
        getShipToCountry in interface IExportableTransaction
        Returns:
        the consignee's two character country iso code
      • setShipToCountry

        public Invoice setShipToCountry​(java.lang.String shipToCountry)
      • getSellerOrderReferencedDocumentID

        public java.lang.String getSellerOrderReferencedDocumentID()
        Description copied from interface: IExportableTransaction
        get the ID of the SellerOrderReferencedDocument, which sits in the ApplicableSupplyChainTradeAgreement/ApplicableHeaderTradeAgreement
        Specified by:
        getSellerOrderReferencedDocumentID in interface IExportableTransaction
        Returns:
        the ID of the document
      • setSellerOrderReferencedDocumentID

        public Invoice setSellerOrderReferencedDocumentID​(java.lang.String sellerOrderReferencedDocumentID)
      • setBuyerOrderReferencedDocumentID

        public Invoice setBuyerOrderReferencedDocumentID​(java.lang.String buyerOrderReferencedDocumentID)
        usually the order number
        Parameters:
        buyerOrderReferencedDocumentID - string with number
        Returns:
        fluent setter
      • setInvoiceReferencedDocumentID

        public Invoice setInvoiceReferencedDocumentID​(java.lang.String invoiceReferencedDocumentID)
        usually in case of a correction the original invoice number
        Parameters:
        invoiceReferencedDocumentID - string with number
        Returns:
        fluent setter
      • setInvoiceReferencedIssueDate

        public Invoice setInvoiceReferencedIssueDate​(java.util.Date issueDate)
      • getBuyerOrderReferencedDocumentIssueDateTime

        public java.lang.String getBuyerOrderReferencedDocumentIssueDateTime()
        Description copied from interface: IExportableTransaction
        get the issue timestamp of the BuyerOrderReferencedDocument, which sits in the ApplicableSupplyChainTradeAgreement
        Specified by:
        getBuyerOrderReferencedDocumentIssueDateTime in interface IExportableTransaction
        Returns:
        the IssueDateTime in format CCYY-MM-DDTHH:MM:SS
      • setTotalPrepaidAmount

        public Invoice setTotalPrepaidAmount​(java.math.BigDecimal prepaid)
        allow to set a amount which has already been paid
        Parameters:
        prepaid - null is possible to omit
        Returns:
        fluent setter
      • getTotalPrepaidAmount

        public java.math.BigDecimal getTotalPrepaidAmount()
        Description copied from interface: IExportableTransaction
        get the TotalPrepaidAmount located in SpecifiedTradeSettlementMonetarySummation (v1) or SpecifiedTradeSettlementHeaderMonetarySummation (v2)
        Specified by:
        getTotalPrepaidAmount in interface IExportableTransaction
        Returns:
        the total sum (incl. VAT) of prepayments, i.e. the difference between GrandTotalAmount and DuePayableAmount
      • setBuyerOrderReferencedDocumentIssueDateTime

        public Invoice setBuyerOrderReferencedDocumentIssueDateTime​(java.lang.String buyerOrderReferencedDocumentIssueDateTime)
        when the order (or whatever reference in BuyerOrderReferencedDocumentID) was issued (@todo switch to date?)
        Parameters:
        buyerOrderReferencedDocumentIssueDateTime - IssueDateTime in format CCYY-MM-DDTHH:MM:SS
        Returns:
        fluent setter
      • setOwnTaxID

        @Deprecated
        public Invoice setOwnTaxID​(java.lang.String ownTaxID)
        Deprecated.
      • getOwnVATID

        public java.lang.String getOwnVATID()
        Description copied from interface: IExportableTransaction
        VAT ID (Umsatzsteueridentifikationsnummer) of the sender
        Specified by:
        getOwnVATID in interface IExportableTransaction
        Returns:
        VAT ID (Umsatzsteueridentifikationsnummer) of the sender
      • setOwnVATID

        @Deprecated
        public Invoice setOwnVATID​(java.lang.String ownVATID)
        Deprecated.
      • setOwnForeignOrganisationID

        @Deprecated
        public Invoice setOwnForeignOrganisationID​(java.lang.String ownForeignOrganisationID)
        Deprecated.
      • setOwnOrganisationName

        @Deprecated
        public Invoice setOwnOrganisationName​(java.lang.String ownOrganisationName)
        Deprecated.
      • getNotes

        public java.lang.String[] getNotes()
        Description copied from interface: IExportableTransaction
        additional text description
        Specified by:
        getNotes in interface IExportableTransaction
        Returns:
        an array of strings of document wide "includedNotes" (descriptive text values)
      • setNotesWithSubjectCode

        public Invoice setNotesWithSubjectCode​(java.util.List<IncludedNote> theList)
      • setCurrency

        public Invoice setCurrency​(java.lang.String currency)
      • setPaymentTermDescription

        public Invoice setPaymentTermDescription​(java.lang.String paymentTermDescription)
      • setIssueDate

        public Invoice setIssueDate​(java.util.Date issueDate)
      • setDueDate

        public Invoice setDueDate​(java.util.Date dueDate)
      • setDeliveryDate

        public Invoice setDeliveryDate​(java.util.Date deliveryDate)
      • getRoundingAmount

        public java.math.BigDecimal getRoundingAmount()
        for currency rounding differences to 5ct e.g. in Netherlands ("Rappenrundung")
        Specified by:
        getRoundingAmount in interface IExportableTransaction
        Returns:
        null if not set, otherwise BigDecimal of Euros
      • setRoundingAmount

        public Invoice setRoundingAmount​(java.math.BigDecimal amount)
        set the cent e.g. to reach the next 5ct mark for currencies in certain countries e.g. in the Netherlands ("Rappenrundung")
        Parameters:
        amount -
        Returns:
        fluent setter
      • setOwnContact

        @Deprecated
        public Invoice setOwnContact​(Contact ownContact)
        Deprecated.
        use setSender
        sets a named sender contact
        Parameters:
        ownContact - the sender contact
        Returns:
        fluent setter
        See Also:
        Contact
      • setRecipient

        public Invoice setRecipient​(TradeParty recipient)
        required. sets the invoice receiving institution = invoicee
        Parameters:
        recipient - the invoicee organisation
        Returns:
        fluent setter
      • setSender

        public Invoice setSender​(TradeParty sender)
        required. sets the invoicing institution = invoicer
        Parameters:
        sender - the invoicer
        Returns:
        fluent setter
      • setInvoiceReferencedDocuments

        public void setInvoiceReferencedDocuments​(java.util.ArrayList<ReferencedDocument> invoiceReferencedDocuments)
      • setZFAllowances

        public Invoice setZFAllowances​(Allowance[] iza)
        this is wrong and only used from jackson
        Parameters:
        iza - the Array of allowances/charges
        Returns:
        fluent setter
      • setZFCharges

        public Invoice setZFCharges​(Charge[] iza)
        this is wrong and only used from jackson
        Parameters:
        iza - the array of charges
        Returns:
        fluent setter
      • addPaymentTerms

        public Invoice addPaymentTerms​(IZUGFeRDPaymentTerms paymentTerm)
        Set multiple payment terms when using the EXTENDED profile.
        Returns:
      • setPaymentReference

        public Invoice setPaymentReference​(java.lang.String paymentReference)
      • setDeliveryAddress

        public Invoice setDeliveryAddress​(TradeParty deliveryAddress)
        if the delivery address is not the recipient address, it can be specified here
        Parameters:
        deliveryAddress - the goods receiving organisation
        Returns:
        fluent setter
      • getPayee

        public TradeParty getPayee()
        Description copied from interface: IExportableTransaction
        payee / payment receiver, if different from seller, ram:Payee (only supported for zf2)
        Specified by:
        getPayee in interface IExportableTransaction
        Returns:
        the IZUGFeRDExportableTradeParty payment receiver, if different from sellver
      • setPayee

        public Invoice setPayee​(TradeParty payee)
        if the payee is not the seller, it can be specified here
        Parameters:
        payee - the payment receiving organisation
        Returns:
        fluent setter
      • addCashDiscount

        public Invoice addCashDiscount​(CashDiscount c)
        Adds a cash discount (skonto)
        Parameters:
        c - the CashDiscount percent/period combination
        Returns:
        fluent setter
      • addItem

        public Invoice addItem​(IZUGFeRDExportableItem item)
        required adds invoice "lines" :-)
        Parameters:
        item - the invoice line
        Returns:
        fluent setter
        See Also:
        Item
      • isValid

        public boolean isValid()
        checks if all required items are set in order to be able to export it
        Returns:
        true if all required items are set
      • addCharge

        public Invoice addCharge​(IZUGFeRDAllowanceCharge izac)
        adds a document level addition to the price
        Parameters:
        izac - the charge to be applied
        Returns:
        fluent setter
        See Also:
        Charge
      • addAllowance

        public Invoice addAllowance​(IZUGFeRDAllowanceCharge izac)
        adds a document level rebate
        Parameters:
        izac - the allowance to be applied
        Returns:
        fluent setter
        See Also:
        Allowance
      • setContractReferencedDocument

        public Invoice setContractReferencedDocument​(java.lang.String s)
        adds the ID of a contract referenced in the invoice
        Parameters:
        s - the contract number
        Returns:
        fluent setter
      • setDetailedDeliveryPeriod

        public Invoice setDetailedDeliveryPeriod​(java.util.Date start,
                                                 java.util.Date end)
        sets a document level delivery period, which is optional additional to the mandatory deliverydate and which will become a BillingSpecifiedPeriod-Element
        Parameters:
        start - the date of first delivery
        end - the date of last delivery
        Returns:
        fluent setter
      • getDetailedDeliveryPeriodFrom

        public java.util.Date getDetailedDeliveryPeriodFrom()
        Description copied from interface: IExportableTransaction
        specifies the document level delivery period, will be included in a BillingSpecifiedPeriod element
        Specified by:
        getDetailedDeliveryPeriodFrom in interface IExportableTransaction
        Returns:
        the beginning of the delivery period
      • setDetailedDeliveryPeriodFrom

        public Invoice setDetailedDeliveryPeriodFrom​(java.util.Date dt)
      • getDetailedDeliveryPeriodTo

        public java.util.Date getDetailedDeliveryPeriodTo()
        Description copied from interface: IExportableTransaction
        specifies the document level delivery period, will be included in a BillingSpecifiedPeriod element
        Specified by:
        getDetailedDeliveryPeriodTo in interface IExportableTransaction
        Returns:
        the end of the delivery period
      • setDetailedDeliveryPeriodTo

        public Invoice setDetailedDeliveryPeriodTo​(java.util.Date dt)
      • addNote

        public Invoice addNote​(java.lang.String text)
        adds a free text paragraph, which will become an includedNote element
        Parameters:
        text - freeform UTF8 plain text
        Returns:
        fluent setter
      • addGeneralNote

        public Invoice addGeneralNote​(java.lang.String content)
        adds a free text paragraph, which will become an includedNote element with explicit subjectCode SubjectCode.AAI
        Parameters:
        content - freeform UTF8 plain text
        Returns:
        fluent setter
      • addRegulatoryNote

        public Invoice addRegulatoryNote​(java.lang.String content)
        adds a free text paragraph, which will become an includedNote element with explicit subjectCode SubjectCode.REG
        Parameters:
        content - freeform UTF8 plain text
        Returns:
        fluent setter
      • addLegalNote

        public Invoice addLegalNote​(java.lang.String content)
        adds a free text paragraph, which will become an includedNote element with explicit subjectCode SubjectCode.ABL
        Parameters:
        content - freeform UTF8 plain text
        Returns:
        fluent setter
      • addCustomsNote

        public Invoice addCustomsNote​(java.lang.String content)
        adds a free text paragraph, which will become an includedNote element with explicit subjectCode SubjectCode.CUS
        Parameters:
        content - freeform UTF8 plain text
        Returns:
        fluent setter
      • addSellerNote

        public Invoice addSellerNote​(java.lang.String content)
        adds a free text paragraph, which will become an includedNote element with explicit subjectCode SubjectCode.SUR
        Parameters:
        content - freeform UTF8 plain text
        Returns:
        fluent setter
      • addTaxNote

        public Invoice addTaxNote​(java.lang.String content)
        adds a free text paragraph, which will become an includedNote element with explicit subjectCode SubjectCode.TXD
        Parameters:
        content - freeform UTF8 plain text
        Returns:
        fluent setter
      • addIntroductionNote

        public Invoice addIntroductionNote​(java.lang.String content)
        adds a free text paragraph, which will become an includedNote element with explicit subjectCode SubjectCode.ACY
        Parameters:
        content - freeform UTF8 plain text
        Returns:
        fluent setter
      • addDiscountBonusNote

        public Invoice addDiscountBonusNote​(java.lang.String content)
        adds a free text paragraph, which will become an includedNote element with explicit subjectCode SubjectCode.AAK
        Parameters:
        content - freeform UTF8 plain text
        Returns:
        fluent setter
      • setSpecifiedProcuringProjectID

        public Invoice setSpecifiedProcuringProjectID​(java.lang.String specifiedProcuringProjectID)
      • setDespatchAdviceReferencedDocumentID

        public Invoice setDespatchAdviceReferencedDocumentID​(java.lang.String despatchAdviceReferencedDocumentID)
      • setSpecifiedProcuringProjectName

        public Invoice setSpecifiedProcuringProjectName​(java.lang.String specifiedProcuringProjectName)
      • setVATDueDateTypeCode

        public Invoice setVATDueDateTypeCode​(java.lang.String vatDueDateTypeCode)
        Decide when the VAT should be collected.
        Parameters:
        vatDueDateTypeCode - use EventTimeCodeTypeConstants
        Returns:
        fluent setter
      • setCreditorReferenceID

        public Invoice setCreditorReferenceID​(java.lang.String creditorReferenceID)