From b3caf45aa425b8640cdceb7969e3be78bcb400e5 Mon Sep 17 00:00:00 2001 From: Grzegorz Sadowski Date: Thu, 22 Jun 2023 07:13:36 +0200 Subject: [PATCH] [Documentation] Add info about new decimal tax calculator to docs --- docs/book/orders/taxation.rst | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/book/orders/taxation.rst b/docs/book/orders/taxation.rst index b395a15e91..2182dedf7b 100644 --- a/docs/book/orders/taxation.rst +++ b/docs/book/orders/taxation.rst @@ -145,11 +145,24 @@ which has the services that implement the `OrderTaxesApplicatorInterface `_. +For calculating Taxes **Sylius** is using tax calculators. + +To select a proper service we have a one that decides for us +- the `DelegatingCalculator `_. +Basing on the **TaxRate** assigned on the Product it will get its calculator type calculate the amount properly. + You can create your custom calculator for taxes by creating a class that implements -the `CalculatorInterface `_ +the `CalculatorInterface `_ and registering it as a ``sylius.tax_calculator.your_calculator_name`` service. +Built-in Calculators +'''''''''''''''''''' + +The already defined calculators in Sylius: + +* **DefaultCalculator** - calculates the ``amount`` with rounding. +* **DecimalCalculator** - calculates the ``amount`` without rounding, which results in a distribution of decimal values among the items. + Learn more ----------