Interface ITaxProvider

All Known Implementing Classes:
StandardTaxProvider

public interface ITaxProvider
Tax calculation interface
Author:
Elaine
  • Method Details

    • calculateOrderTaxTotal

      boolean calculateOrderTaxTotal(MTaxProvider provider, MOrder order)
      Calculate order tax
      Parameters:
      provider -
      order -
      Returns:
      true if success, false otherwise
    • updateOrderTax

      boolean updateOrderTax(MTaxProvider provider, MOrderLine line)
      Update order tax for line
      Parameters:
      provider -
      line -
      Returns:
      true if success, false otherwise
    • recalculateTax

      boolean recalculateTax(MTaxProvider provider, MOrderLine line, boolean newRecord)
      Re-calculate order tax for line (if line tax id change)
      Parameters:
      provider -
      line -
      newRecord -
      Returns:
      true if success, false otherwise
    • updateHeaderTax

      boolean updateHeaderTax(MTaxProvider provider, MOrderLine line)
      Update order tax total
      Parameters:
      provider -
      line -
      Returns:
      true if success, false otherwise
    • calculateInvoiceTaxTotal

      boolean calculateInvoiceTaxTotal(MTaxProvider provider, MInvoice invoice)
      Calculate invoice tax total
      Parameters:
      provider -
      invoice -
      Returns:
      true if success, false otherwise
    • updateInvoiceTax

      boolean updateInvoiceTax(MTaxProvider provider, MInvoiceLine line)
      Update invoice tax for line
      Parameters:
      provider -
      line -
      Returns:
      true if success, false otherwise
    • recalculateTax

      boolean recalculateTax(MTaxProvider provider, MInvoiceLine line, boolean newRecord)
      Re-calculate invoice tax for line (if line tax id change)
      Parameters:
      provider -
      line -
      newRecord -
      Returns:
      true if success, false otherwise
    • updateHeaderTax

      boolean updateHeaderTax(MTaxProvider provider, MInvoiceLine line)
      Update invoice tax total
      Parameters:
      provider -
      line -
      Returns:
      true if success, false otherwise
    • calculateRMATaxTotal

      boolean calculateRMATaxTotal(MTaxProvider provider, MRMA rma)
      Calculate rma tax total
      Parameters:
      provider -
      rma -
      Returns:
      true if success, false otherwise
    • updateRMATax

      boolean updateRMATax(MTaxProvider provider, MRMALine line)
      Update rma tax for rma line
      Parameters:
      provider -
      line -
      Returns:
      true if success, false otherwise
    • recalculateTax

      boolean recalculateTax(MTaxProvider provider, MRMALine line, boolean newRecord)
      Re-calculate rma tax for ram line (if line tax id change)
      Parameters:
      provider -
      line -
      newRecord -
      Returns:
      true if success, false otherwise
    • updateHeaderTax

      boolean updateHeaderTax(MTaxProvider provider, MRMALine line)
      Update rma header total
      Parameters:
      provider -
      line -
      Returns:
      true if success, false otherwise
    • validateConnection

      String validateConnection(MTaxProvider provider, ProcessInfo pi) throws Exception
      Validate connection to online tax calculation service.
      Parameters:
      provider -
      pi -
      Returns:
      error message or null
      Throws:
      Exception
    • isTaxIncludedSummarySupported

      default boolean isTaxIncludedSummarySupported()
      Does this provider correctly handle a tax-included price combined with a summary tax?
      The native calculation (StandardTaxProvider) does not, so this combination is forbidden for it (see IDEMPIERE-6749).
      A custom provider that delegates the whole tax calculation and computes this case correctly can override this method to return true, allowing the line to be saved (see IDEMPIERE-7069).
      Returns:
      true if the provider computes a tax-included summary tax correctly - false by default