Class Product

    • Field Detail

      • unit

        protected java.lang.String unit
      • name

        protected java.lang.String name
      • sellerAssignedID

        protected java.lang.String sellerAssignedID
      • buyerAssignedID

        protected java.lang.String buyerAssignedID
      • description

        protected java.lang.String description
      • taxExemptionReason

        protected java.lang.String taxExemptionReason
      • taxCategoryCode

        protected java.lang.String taxCategoryCode
      • VATPercent

        protected java.math.BigDecimal VATPercent
      • isReverseCharge

        protected boolean isReverseCharge
      • isIntraCommunitySupply

        protected boolean isIntraCommunitySupply
      • countryOfOrigin

        protected java.lang.String countryOfOrigin
      • charges

        protected java.util.ArrayList<Charge> charges
      • allowances

        protected java.util.ArrayList<Allowance> allowances
      • attributes

        protected java.util.HashMap<java.lang.String,​java.lang.String> attributes
    • Constructor Detail

      • Product

        public Product​(java.lang.String name,
                       java.lang.String description,
                       java.lang.String unit,
                       java.math.BigDecimal VATPercent)
        default constructor
        Parameters:
        name - product short name
        description - product long name
        unit - a two/three letter UN/ECE rec 20 unit code, e.g. "C62" for piece
        VATPercent - product vat rate
      • Product

        public Product​(org.w3c.dom.Node node)
      • Product

        public Product()
        empty constructor just for jackson etc
    • Method Detail

      • setTaxExemptionReason

        public Product setTaxExemptionReason​(java.lang.String taxExemptionReasonText)
        Parameters:
        taxExemptionReasonText - String e.g. Kleinunternehmer gemäß §19 UStG https://github.com/ZUGFeRD/mustangproject/issues/463
        Returns:
        fluent setter
      • getTaxCategoryCode

        public java.lang.String getTaxCategoryCode()
        Specified by:
        getTaxCategoryCode in interface IZUGFeRDExportableProduct
        Returns:
        e.g. S (normal tax), Z=zero rated, E (e.g. small business) or K (intrra community supply)
      • setTaxCategoryCode

        public Product setTaxCategoryCode​(java.lang.String code)
        Parameters:
        code - e.g. S (normal tax), Z=zero rated, E (e.g. small business) or K (intrra community supply) see also https://github.com/ZUGFeRD/mustangproject/issues/463
        Returns:
        fluent setter
      • setSellerAssignedID

        public Product setSellerAssignedID​(java.lang.String sellerAssignedID)
        how the seller identifies this type of product
        Parameters:
        sellerAssignedID - a unique String
        Returns:
        fluent setter
      • setBuyerAssignedID

        public Product setBuyerAssignedID​(java.lang.String buyerAssignedID)
        if the buyer provided an ID how he refers to this product
        Parameters:
        buyerAssignedID - a string the buyer provided
        Returns:
        fluent setter
      • setReverseCharge

        public Product setReverseCharge()
        sets reverse charge(=delivery to outside EU)
        Returns:
        fluent setter
      • setIntraCommunitySupply

        public Product setIntraCommunitySupply()
        sets intra community supply(=delivery outside the country inside the EU)
        Returns:
        fluent setter
      • getUnit

        public java.lang.String getUnit()
        Description copied from interface: IZUGFeRDExportableProduct
        Unit code of the product Most common ones are C62 one (piece) DAY day HAR hectare HUR hour KGM kilogram KTM kilometre KWH kilowatt hour LS lump sum LTR litre MIN minute MMK square millimetre MMT millimetre MTK square metre MTQ cubic metre MTR metre NAR number of articles NPR number of pairs P1 percent SET set TNE tonne (metric ton) WEE week
        Specified by:
        getUnit in interface IZUGFeRDExportableProduct
        Returns:
        a UN/ECE rec 20 unit code see https://www.unece.org/fileadmin/DAM/cefact/recommendations/rec20/rec20_rev3_Annex2e.pdf
      • setUnit

        public Product setUnit​(java.lang.String unit)
        sets a UN/ECE rec 20 or 21 code which unit the product ships in, e.g. C62=piece
        Parameters:
        unit - 2-3 letter UN/ECE rec 20 or 21
        Returns:
        fluent setter
      • setName

        public Product setName​(java.lang.String name)
        name of the product
        Parameters:
        name - short name
        Returns:
        fluent setter
      • setDescription

        public Product setDescription​(java.lang.String description)
        description of the product (required)
        Parameters:
        description - long name
        Returns:
        fluent setter
      • setVATPercent

        public Product setVATPercent​(java.math.BigDecimal VATPercent)
        VAT rate of the product
        Parameters:
        VATPercent - vat rate of the product
        Returns:
        fluent setter
      • setCountryOfOrigin

        public Product setCountryOfOrigin​(java.lang.String countryOfOrigin)
      • setAttributes

        public Product setAttributes​(java.util.Map<java.lang.String,​java.lang.String> attributes)
      • addAttribute

        public Product addAttribute​(java.lang.String name,
                                    java.lang.String value)
      • setClassificationsClass

        public Product setClassificationsClass​(DesignatedProductClassification[] classifications)
        Provide Jackson a hint as to use DesignatedProductClassification for the IDesignatedProductClassification product classifications
        Parameters:
        classifications - the new set of classifications
        Returns:
        fluent setter
      • setCharges

        public Product setCharges​(java.util.ArrayList<Charge> charges)
        Jackson courtesy function, please use addCharge if you have the choice
        Returns:
        array of or null, if none
      • getCharges

        public Charge[] getCharges()
        returns the AppliedTradeAllowanceCharges of this product which are actually Charges
        Specified by:
        getCharges in interface IZUGFeRDExportableProduct
        Returns:
        array of or null, if none
      • setAllowances

        public Product setAllowances​(java.util.ArrayList<Allowance> allowances)
        Jackson courtesy function, please use addAllowance if you have the choice
        Returns:
        array of or null, if none