Class Charge

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.math.BigDecimal basisAmount
      the value the percentage is applied upon
      protected java.lang.String categoryCode
      the category ID why this charge has been applied
      protected java.math.BigDecimal percent
      the percentage, null if not relative at all
      protected java.lang.String reason
      a simple human readable description
      protected java.lang.String reasonCode
      Code from list UNTDID 5189
      protected java.math.BigDecimal taxPercent
      the tax rate the charge belongs to
      protected java.math.BigDecimal totalAmount
      the absolute value if not percentage
    • Constructor Summary

      Constructors 
      Constructor Description
      Charge()
      Bean connstructor
      Charge​(java.math.BigDecimal totalAmount)
      creates a item level or invoice level charge
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.math.BigDecimal getBasisAmount()
      returns a basis the precentage is calculated from
      java.lang.String getCategoryCode()
      the category ID why this has been applied
      java.math.BigDecimal getPercent()
      returns a percentage, if relative abount, or null for absolute amounts
      java.lang.String getReason()
      get a description for the allowance/charge
      java.lang.String getReasonCode()
      get the code for the allowance/charge
      java.math.BigDecimal getTaxPercent()
      get the applicable tax percentage for the allowance/charge
      java.math.BigDecimal getTotalAmount()  
      java.math.BigDecimal getTotalAmount​(IAbsoluteValueProvider currentItem)
      returns the absolute amount, even if it was relative in the first place
      boolean isCharge()
      Always to return true for IZUGFeRDAllowanceCharge
      Charge setBasisAmount​(java.math.BigDecimal basis)
      sets a potential basis for the potential percentage
      Charge setCategoryCode​(java.lang.String categoryCode)
      the category ID why this has been applied
      Charge setPercent​(java.math.BigDecimal percent)
      if relative charge: percent to increase the item
      Charge setReason​(java.lang.String reason)
      Freetext (?)
      Charge setReasonCode​(java.lang.String reasonCode)
      Reason code for the charge
      Charge setTaxPercent​(java.math.BigDecimal taxPercent)
      charges can be applied to VAT items, in which case they take the same VAT rate
      Charge setTotalAmount​(java.math.BigDecimal totalAmount)
      sets the total amount to be changed to, e.g. if not specified via constructor
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • percent

        protected java.math.BigDecimal percent
        the percentage, null if not relative at all
      • totalAmount

        protected java.math.BigDecimal totalAmount
        the absolute value if not percentage
      • basisAmount

        protected java.math.BigDecimal basisAmount
        the value the percentage is applied upon
      • taxPercent

        protected java.math.BigDecimal taxPercent
        the tax rate the charge belongs to
      • reason

        protected java.lang.String reason
        a simple human readable description
      • reasonCode

        protected java.lang.String reasonCode
        Code from list UNTDID 5189
      • categoryCode

        protected java.lang.String categoryCode
        the category ID why this charge has been applied
    • Constructor Detail

      • Charge

        public Charge()
        Bean connstructor
      • Charge

        public Charge​(java.math.BigDecimal totalAmount)
        creates a item level or invoice level charge
        Parameters:
        totalAmount - (the absolute amount)
    • Method Detail

      • setTotalAmount

        public Charge setTotalAmount​(java.math.BigDecimal totalAmount)
        sets the total amount to be changed to, e.g. if not specified via constructor
        Parameters:
        totalAmount - 2 decimal money amount
        Returns:
        fluid setter
      • setPercent

        public Charge setPercent​(java.math.BigDecimal percent)
        if relative charge: percent to increase the item
        Parameters:
        percent - as bigdecimal
        Returns:
        fluid setter
      • setTaxPercent

        public Charge setTaxPercent​(java.math.BigDecimal taxPercent)
        charges can be applied to VAT items, in which case they take the same VAT rate
        Parameters:
        taxPercent - the tax percentage on the charge
        Returns:
        fluid setter
      • setReason

        public Charge setReason​(java.lang.String reason)
        Freetext (?) reason for the charge
        Parameters:
        reason - freetext
        Returns:
        fluid setter
      • setBasisAmount

        public Charge setBasisAmount​(java.math.BigDecimal basis)
        sets a potential basis for the potential percentage
        Parameters:
        basis - the basis amount
        Returns:
        fluid setter
      • setReasonCode

        public Charge setReasonCode​(java.lang.String reasonCode)
        Reason code for the charge
        Parameters:
        reasonCode - from list UNTDID 5189
        Returns:
        fluid setter
      • getTotalAmount

        public java.math.BigDecimal getTotalAmount​(IAbsoluteValueProvider currentItem)
        Description copied from interface: IZUGFeRDAllowanceCharge
        returns the absolute amount, even if it was relative in the first place
        Specified by:
        getTotalAmount in interface IZUGFeRDAllowanceCharge
        Parameters:
        currentItem - the class delivering the initial value
        Returns:
        the calculated value (e.g. when percentage)
      • getTotalAmount

        public java.math.BigDecimal getTotalAmount()
      • getPercent

        public java.math.BigDecimal getPercent()
        Description copied from interface: IZUGFeRDAllowanceCharge
        returns a percentage, if relative abount, or null for absolute amounts
        Specified by:
        getPercent in interface IZUGFeRDAllowanceCharge
        Returns:
        null or Percentage as Bigdecimal
      • isCharge

        public boolean isCharge()
        Always to return true for IZUGFeRDAllowanceCharge
        Specified by:
        isCharge in interface IZUGFeRDAllowanceCharge
        Returns:
        true since it is supposed to be calculated negatively
      • setCategoryCode

        public Charge setCategoryCode​(java.lang.String categoryCode)
        the category ID why this has been applied
        Parameters:
        categoryCode - usually S
        Returns:
        fluid setter