Class Item

    • Field Detail

      • price

        protected java.math.BigDecimal price
      • quantity

        protected java.math.BigDecimal quantity
      • tax

        protected java.math.BigDecimal tax
      • grossPrice

        protected java.math.BigDecimal grossPrice
      • lineTotalAmount

        protected java.math.BigDecimal lineTotalAmount
      • basisQuantity

        protected java.math.BigDecimal basisQuantity
      • detailedDeliveryPeriodFrom

        protected java.util.Date detailedDeliveryPeriodFrom
      • detailedDeliveryPeriodTo

        protected java.util.Date detailedDeliveryPeriodTo
      • id

        protected java.lang.String id
      • buyerOrderReferencedDocumentLineID

        protected java.lang.String buyerOrderReferencedDocumentLineID
      • buyerOrderReferencedDocumentID

        protected java.lang.String buyerOrderReferencedDocumentID
      • product

        protected Product product
      • notes

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

        protected java.util.ArrayList<ReferencedDocument> referencedDocuments
      • additionalReference

        protected java.util.ArrayList<ReferencedDocument> additionalReference
      • includedNotes

        protected java.util.List<IncludedNote> includedNotes
      • accountingReference

        protected java.lang.String accountingReference
    • Constructor Detail

      • Item

        public Item​(Product product,
                    java.math.BigDecimal price,
                    java.math.BigDecimal quantity)
        default constructor
        Parameters:
        product - contains the products name, tax rate, and unit
        price - the base price of one item the product
        quantity - the number, dimensions or the weight of the delivered product or good in this context
      • Item

        public Item()
        empty constructor do not use, but might be used e.g. by jackson
      • Item

        public Item​(org.w3c.dom.NodeList itemChilds,
                    boolean recalcPrice)
    • Method Detail

      • addBuyerOrderReferencedDocumentLineID

        public Item addBuyerOrderReferencedDocumentLineID​(java.lang.String s)
      • addReferencedLineID

        @Deprecated(since="2.14.0")
        public Item addReferencedLineID​(java.lang.String s)
        Deprecated.
      • addBuyerOrderReferencedDocumentID

        public Item addBuyerOrderReferencedDocumentID​(java.lang.String s)
      • getBuyerOrderReferencedDocumentLineID

        public java.lang.String getBuyerOrderReferencedDocumentLineID()
        BT 132 (issue https://github.com/ZUGFeRD/mustangproject/issues/247)
        Specified by:
        getBuyerOrderReferencedDocumentLineID in interface IZUGFeRDExportableItem
        Returns:
        the line ID of the order (BT132)
      • getLineTotalAmount

        public java.math.BigDecimal getLineTotalAmount()
      • setNotesWithSubjectCode

        public Item setNotesWithSubjectCode​(java.util.List<IncludedNote> theList)
      • setLineTotalAmount

        public Item setLineTotalAmount​(java.math.BigDecimal lineTotalAmount)
        should only be set by calculator classes or maybe when reading from XML
        Parameters:
        lineTotalAmount - price*quantity of this line
        Returns:
        fluent setter
      • getGrossPrice

        public java.math.BigDecimal getGrossPrice()
      • setGrossPrice

        public Item setGrossPrice​(java.math.BigDecimal grossPrice)
        the list price without VAT (sic!), refer to EN16931-1 for definition
        Parameters:
        grossPrice - the list price without VAT
        Returns:
        fluent setter
      • getTax

        public java.math.BigDecimal getTax()
      • setTax

        public Item setTax​(java.math.BigDecimal tax)
      • setId

        public Item setId​(java.lang.String id)
      • setPrice

        public Item setPrice​(java.math.BigDecimal price)
      • setBasisQuantity

        public Item setBasisQuantity​(java.math.BigDecimal basis)
      • setQuantity

        public Item setQuantity​(java.math.BigDecimal quantity)
      • setItemAllowances

        public void setItemAllowances​(java.util.ArrayList<Allowance> theAllowances)
        jackson convenience method
      • setItemCharges

        public void setItemCharges​(java.util.ArrayList<Charge> theCharges)
        jackson convenience method
      • getNotes

        public java.lang.String[] getNotes()
        Description copied from interface: IZUGFeRDExportableItem
        descriptive texts
        Specified by:
        getNotes in interface IZUGFeRDExportableItem
        Returns:
        an array of strings of item specific "includedNotes", text values
      • setProduct

        public Item setProduct​(Product product)
      • addCharge

        public Item addCharge​(IZUGFeRDAllowanceCharge izac)
        Adds a item level addition to the price (will be multiplied by quantity)
        Parameters:
        izac - a relative or absolute charge
        Returns:
        fluent setter
        See Also:
        Charge
      • addAllowance

        public Item addAllowance​(IZUGFeRDAllowanceCharge izac)
        Adds a item level reduction the price (will be multiplied by quantity)
        Parameters:
        izac - a relative or absolute allowance
        Returns:
        fluent setter
        See Also:
        Allowance
      • addNote

        public Item addNote​(java.lang.String text)
        adds item level freetext fields (includednote)
        Parameters:
        text - UTF8 plain text
        Returns:
        fluent setter
      • addNote

        public Item addNote​(IncludedNote theNote)
        adds categorized item level freetext fields (includednote)
        Parameters:
        theNote - IncludedNote to add
        Returns:
        fluent setter
      • addReferencedDocument

        public Item addReferencedDocument​(ReferencedDocument doc)
        adds item level Referenced documents along with their typecodes and issuerassignedIDs
        Parameters:
        doc - the ReferencedDocument to add
        Returns:
        fluent setter
      • addAdditionalReference

        public Item addAdditionalReference​(ReferencedDocument doc)
        adds item level references along with their typecodes and issuerassignedIDs (contract ID, cost centre, ...)
        Parameters:
        doc - the ReferencedDocument to add
        Returns:
        fluent setter
      • setDetailedDeliveryPeriod

        public Item setDetailedDeliveryPeriod​(java.util.Date from,
                                              java.util.Date to)
        specify a item level delivery period (apart from the document level delivery period, and the document level delivery day, which is probably anyway required)
        Parameters:
        from - start date
        to - end date
        Returns:
        fluent setter
      • getDetailedDeliveryPeriodFrom

        public java.util.Date getDetailedDeliveryPeriodFrom()
        specifies the item level delivery period (there is also one on document level), this will be included in a BillingSpecifiedPeriod element
        Specified by:
        getDetailedDeliveryPeriodFrom in interface IZUGFeRDExportableItem
        Returns:
        the beginning of the delivery period
      • getDetailedDeliveryPeriodTo

        public java.util.Date getDetailedDeliveryPeriodTo()
        specifies the item level delivery period (there is also one on document level), this will be included in a BillingSpecifiedPeriod element
        Specified by:
        getDetailedDeliveryPeriodTo in interface IZUGFeRDExportableItem
        Returns:
        the end of the delivery period