Interface TaxRoundingTarget

All Superinterfaces:
JsonEnum
All Known Implementing Classes:
TaxRoundingTarget.TaxRoundingTargetEnum

public interface TaxRoundingTarget extends JsonEnum

For a TaxRate that is included in the price, this value determines which of the two derived amounts the RoundingMode set by taxRoundingMode is applied to. The other amount is the exact difference from the gross price, so totalNet plus totalTax on TaxedPrice always equals totalGross.

This field has no effect if includedInPrice is false. In that case, the net price is supplied exactly, so rounding the gross price and rounding the tax amount give the same result.

For more information, see Tax rounding target.

  • Field Details

    • NET

      static final TaxRoundingTarget NET

      taxRoundingMode is applied to the net price and the tax amount is the exact remainder.

      For example, with a rate of 20% included in a gross price of 1.23 and taxRoundingMode: HalfEven, the net price rounds to 1.02 and the tax amount is 0.21.

      This is the default value for a new Tax Rate.

    • TAX

      static final TaxRoundingTarget TAX

      taxRoundingMode is applied to the tax amount and the net price is the exact remainder.

      For example, with a rate of 20% included in a gross price of 1.23 and taxRoundingMode: HalfEven, the tax amount rounds to 0.20 and the net price is 1.03.

  • Method Details

    • getJsonName

      String getJsonName()
      the JSON value
      Specified by:
      getJsonName in interface JsonEnum
      Returns:
      json value
    • name

      String name()
      the enum value
      Specified by:
      name in interface JsonEnum
      Returns:
      name
    • toString

      String toString()
      convert value to string
      Specified by:
      toString in interface JsonEnum
      Overrides:
      toString in class Object
      Returns:
      string representation
    • findEnum

      static TaxRoundingTarget findEnum(String value)
      factory method for a enum value of TaxRoundingTarget if no enum has been found an anonymous instance will be created
      Parameters:
      value - the enum value to be wrapped
      Returns:
      enum instance
    • findEnumViaJsonName

      static Optional<TaxRoundingTarget> findEnumViaJsonName(String jsonName)
      method to find enum using the JSON value
      Parameters:
      jsonName - the json value to be wrapped
      Returns:
      optional of enum instance
    • values

      static TaxRoundingTarget[] values()
      possible enum values
      Returns:
      array of possible enum values