Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add docs and guides about taxes
Anna Siwik381714d6fda6
diff --git a/docs/architecture/money.rst b/docs/architecture/money.rstindex 86415f80f0..99ab3492eb 100644--- a/docs/architecture/money.rst+++ b/docs/architecture/money.rst@@ -1,7 +1,8 @@Handling Money Amounts======================-Saleor uses the `Prices <https://github.com/mirumee/prices/>`_ and `django-prices <https://github.com/mirumee/django-prices/>`_ libraries to store, calculate and display amounts of money, prices and ranges of those.+Saleor uses the `Prices <https://github.com/mirumee/prices/>`_ and `django-prices <https://github.com/mirumee/django-prices/>`_ libraries to store, calculate and display amounts of money, prices and ranges of those and `django-prices-vatlayer <https://github.com/mirumee/django-prices-vatlayer>`_ to handle VAT tax rates in European Union (optionally).+Default currency----------------@@ -12,6 +13,7 @@ All prices are entered and stored in a single default currency controlled by theThe currency is not stored in the database. Changing the default currency in a production environment will not recalculate any existing orders. All numbers will remain the same and will be incorrectly displayed as the new currency.+Money and TaxedMoney--------------------@@ -19,15 +21,12 @@ In Saleor's codebase, money amounts exist either as `Money` or `TaxedMoney` inst`Money` is a type representing amount of money in specific currency: 100 USD is represented by `Money(100, 'USD')`. This type doesn't hold any additional information useful for commerce but, unlike `Decimal`, it implements safeguards and checks for calculations and comparisions of monetary values. Money amounts are stored on model using `MoneyField` that provides its own safechecks on currency and precision of stored amount. If you ever need to get to the `Decimal` of your `Money` object, you'll find it on the `amount` property.-Products and shipping methods prices are stored using `MoneyField` and are assumed to be gross amounts. Those amounts are then naively converted to `TaxedMoney` objects using the `TaxedAmount(net=item.price, gross=item.price)` approach with conversion happening before resolving item's final price (before taxes and discounts).+Products and shipping methods prices are stored using `MoneyField`. All prices displayed in dashboard, excluding orders, are as they have been entered in the forms. You can decide if those prices are treated as gross or net in dashboard ``Taxes`` tab.-.. note::+Prices displayed in orders are gross or net depending on setting how prices are displayed for customers, both in storefront and dashboard. This way staff users will always see the same state of an order as the customer.- In future Saleor will support setting for store administrators to change this approach to use net values instead if this fits their business more.TaxedMoneyRange---------------Sometimes a product may be available under more than single price due to it's variants defining custom prices different from base brice. For such situations `Product` defines additional `get_price_range` method that return `TaxedMoneyRange` object defining minimum and maximum prices on its `start` and `stop` attributes. This object is then used by the UI to differentiate between displaying price as "10 USD" or "from 10 USD" in case of products where prices differ between variants.--TaxedMoneyRange is also used in for displaying other money ranges, like min and maximum cost and margin on product's variant in dashboard.diff --git a/docs/gettingstarted/configuration.rst b/docs/gettingstarted/configuration.rstindex 150adc1795..b28ab37815 100644--- a/docs/gettingstarted/configuration.rst+++ b/docs/gettingstarted/configuration.rst@@ -57,3 +57,12 @@ Environment variables``STATIC_URL``Controls production assets' mount path. Defaults to ``/static/assets/``.++``VATLAYER_ACCESS_KEY``+ Access key to `vatlayer API <https://vatlayer.com/>`_. Enables VAT support within European Union.++ To update the tax rates run the following command at least once per day:++ .. code-block:: console++ $ python manage.py get_vat_ratesdiff --git a/docs/gettingstarted/installation-macos.rst b/docs/gettingstarted/installation-macos.rstindex 688330ef79..1d6802a878 100644--- a/docs/gettingstarted/installation-macos.rst+++ b/docs/gettingstarted/installation-macos.rst@@ -119,7 +119,7 @@ InstallationUnless configured otherwise the store will use ``saleor`` as both username and password. Remember to give your user the ``SUPERUSER`` privilege so it can create databases and database extensions.- ..code-block:: console+ .. code-block:: console$ createuser --superuser --pwprompt saleordiff --git a/docs/guides.rst b/docs/guides.rstindex 8ae5dcc73d..5666b00891 100644--- a/docs/guides.rst+++ b/docs/guides.rst@@ -6,3 +6,4 @@ Guidesguides/ordersguides/navigation+ guides/taxesdiff --git a/docs/guides/taxes.rst b/docs/guides/taxes.rstnew file mode 100644index 0000000000..e26e99fedb--- /dev/null+++ b/docs/guides/taxes.rst@@ -0,0 +1,32 @@+Taxes+=====++Saleor gives a possibility to configure taxes. It can be done in dashboard ``Taxes`` tab.++Taxes are charged according to the rates applicable in the country to which the order is delivered. If tax rate set for the product is not available, standard tax rate is used by default.++For now, only taxes in European Union are handled.+++Configuring taxes+-----------------++There are three ways in which you can configure taxes:++#. All taxes are included in my prices++ If selected, all prices entered and displayed in dashboard will be treated as gross prices. For example: product with entered price 4.00 € and 19% VAT will have net price calculated to 3.36 € (rounded).++#. Show customers gross prices in storefront++ If selected, prices displayed for customers in storefront will be gross. Taxes will be properly calculated at checkout. Changing this setting has no effect on displaying orders placed in the past.++#. Charge taxes on shipping rates++ If selected, standard tax rate will be charged on shipping price.+++Tax rates preview+-----------------++You can preview tax rates in dashboard ``Taxes`` tab. It lists all countries taxes are handled for. You can see all available tax rates for each country in its details view.diff --git a/docs/integrations/smo.rst b/docs/integrations/smo.rstindex 2e0404cf1b..ab478da914 100644--- a/docs/integrations/smo.rst+++ b/docs/integrations/smo.rst@@ -4,6 +4,6 @@ Social Media Optimization (SMO)Open Graph-----------For more effective and efficient social media engagement, we've added `Open Graph Protocol<http://ogp.me/>`_ to the Homepage and all products/categories.+For more effective and efficient social media engagement, we've added `Open Graph Protocol <http://ogp.me/>`_ to the Homepage and all products/categories.Open Graph meta tags allows to control what content shows up (description, title, url, photo, etc.) when page is shared on social media, turning your web page into a rich object in a social graph.diff --git a/saleor/dashboard/taxes/views.py b/saleor/dashboard/taxes/views.pyindex 40e5f3ab56..c3c7f07e3b 100644--- a/saleor/dashboard/taxes/views.py+++ b/saleor/dashboard/taxes/views.py@@ -52,4 +52,4 @@ def configure_taxes(request, site_pk):messages.success(request, msg)return redirect('dashboard:taxes')ctx = {'site': site_settings, 'taxes_form': taxes_form}- return TemplateResponse(request, 'dashboard/sites/taxes_form.html', ctx)+ return TemplateResponse(request, 'dashboard/taxes/form.html', ctx)diff --git a/templates/dashboard/sites/taxes_form.html b/templates/dashboard/taxes/form.htmlsimilarity index 93%rename from templates/dashboard/sites/taxes_form.htmlrename to templates/dashboard/taxes/form.htmlindex 93a39da24f..a377f7360c 100644--- a/templates/dashboard/sites/taxes_form.html+++ b/templates/dashboard/taxes/form.html@@ -77,14 +77,14 @@<div class="col s12 checkbox-helptext"><h6>{% blocktrans context "Dashboard site taxes settings form help text" %}- If selected, standard rate tax is charged on shipping price.+ If selected, standard tax rate is charged on shipping price.{% endblocktrans %}</h6></div></div></div><div class="card-action right-align">- <a class="btn-flat waves-effect" href="{% url 'dashboard:site-details' pk=site.pk %}" target="_blank">+ <a class="btn-flat waves-effect" href="{% url 'dashboard:taxes' %}" target="_blank">{% trans "Cancel" context "Dashboard cancel action" %}</a><button type="submit" class="btn waves-effect">@@ -98,7 +98,7 @@<p class="grey-text"><svg data-src="{% static "dashboard/images/help.svg" %}" width="18" height="18" />{% blocktrans trimmed context "Taxes help text" %}- Taxes are charged according to the standard rate applicable in the country to which the order is delivered. For now, only rates in European Union are handled.+ Taxes are charged according to the rates applicable in the country to which the order is delivered. For now, only rates in European Union are handled.{% endblocktrans %}</p></div>