Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New structure for Tax Management #2080

Merged
merged 11 commits into from
Aug 15, 2023
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
title: Apply Avalara tax codes
description: Apply Avalara tax codes to calculate taxes
last_updated: Aug 3, 2023
template: concept-topic-template
---

[Avalara tax codes](https://help.avalara.com/Avalara_AvaTax_Update/Avalara_tax_codes) are processed in the background to define taxes for order items, and are not displayed on the Storefront or in the Back Office. Taxes are calculated during the checkout, and, by default, the taxes are shown at the final checkout step.

To automate tax calculations for your shop, you need to apply the tax codes by importing them into your shop. You can import Avalara tax codes for the following entities:

| ENTITY | IMPORT FILE DETAILS |
|-|-|
| Abstract product | [File details: product_abstract.csv](/docs/pbc/all/product-information-management/{{page.version}}/base-shop/import-and-export-data/products-data-import/file-details-product-abstract.csv.html) |
| Product option | [File details: product_option.csv](/docs/pbc/all/product-information-management/{{page.version}}/base-shop/import-and-export-data/product-options/file-details-product-option.csv.html) |
| Shipment | [File details: shipment.csv](/docs/scos/dev/data-import/{{page.version}}/data-import-categories/commerce-setup/file-details-shipment.csv.html) |

{% info_block infoBox %}

Because shipment and products fall under different taxability categories, the Avalara tax code for shipment is different from that of the abstract product or product option. For details about the codes and categories, see [Avalara tax code search](https://taxcode.avatax.avalara.com/).

{% endinfo_block %}
23 changes: 23 additions & 0 deletions docs/pbc/all/tax-management/202212.0/avalara/avalara.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
title: Avalara
description: Avalara technology partner
last_updated: Jun 18, 2021
template: concept-topic-template
redirect_from:
- /docs/scos/user/technology-partners/202212.0/taxes/avalara.html
- /docs/pbc/all/tax-management/202212.0/base-shop/third-party-integrations/avalara.html
---

![Avalara-hero](https://spryker.s3.eu-central-1.amazonaws.com/docs/pbc/all/tax-management/Avalara/avalara-hero.png)

*Avalara AvaTax* is a cloud-based software that provides the latest sales and tax calculations to your shopping cart or invoicing system at the point of purchase, while accounting for the following:

* Tax rates for each state, county, and city.
* Laws, rules, and jurisdiction boundaries.
* Special circumstances like tax holidays and product exemptions.

When calculating taxes, Avalara takes the items' [warehouse addresses](/docs/pbc/all/warehouse-management-system/{{page.version}}/base-shop/inventory-management-feature-overview.html#defining-a-warehouse-address) into account. Therefore, each order item you calculate a tax for, must have a warehouse assigned. To learn how warehouses are assigned to order items by default, see [Avalara: Warehouse assignment to order items](/docs/pbc/all/warehouse-management-system/{{page.version}}/base-shop/inventory-management-feature-overview.html#avalara-warehouse-assignment-to-order-items).

## Next steps

[Install Avalara](/docs/pbc/all/tax-management/{{page.version}}/avalara/integrate-avalara.html)
Original file line number Diff line number Diff line change
@@ -1,38 +1,31 @@
---
title: Integrate Avalara Tax + Product Options
title: Install Avalara + Product Options
description: Integrate the Avalara Tax + Product Options feature into your project
last_updated: Jun 18, 2021
template: concept-topic-template
last_updated: Aug 3, 2023
template: feature-integration-guide-template
originalLink: https://documentation.spryker.com/2021080/docs/avalara-tax-product-options-feature-integration
originalArticleId: baa66b26-825e-404a-a8e4-1b48cb00cd67
redirect_from:
- /2021080/docs/avalara-tax-product-options-feature-integration
- /2021080/docs/en/avalara-tax-product-options-feature-integration
- /docs/avalara-tax-product-options-feature-integration
- /docs/en/avalara-tax-product-options-feature-integration
- /docs/scos/user/technology-partners/202212.0/taxes/avalara-tax-product-options-feature-integration.html
- /docs/scos/dev/technology-partner-guides/202212.0/taxes/avalara/integrating-avalara-tax-product-options.html
related:
- title: Tax feature overview
link: docs/scos/user/features/page.version/tax-feature-overview.html
---

To enable the AvalaraTax + Product Options component of the Avalara partner integration, use the [spryker-eco/avalara-tax-product-option](https://github.com/spryker-eco/avalara-tax-product-option) module.
To enable the Avalara + Product Options component of the Avalara partner integration, use the [spryker-eco/avalara-tax-product-option](https://github.com/spryker-eco/avalara-tax-product-option) module.

## Install feature core

Follow the steps below to install the feature core.

### Prerequisites

To start the feature integration, overview and install the necessary features:
Install the necessary features:

|NAME | VERSION | INTEGRATION GUIDE |
|NAME | VERSION | INSTALLATION GUIDE |
|--- | --- | --- |
| Product Options | master | |
| Avalara Tax | master | [Avalara Tax integration](/docs/pbc/all/tax-management/{{site.version}}/base-shop/third-party-integrations/integrate-avalara.html)|
| Avalara Tax | master | [Install Avalara](/docs/pbc/all/tax-management/{{site.version}}/base-shop/third-party-integrations/integrate-avalara.html) |

### 1) Install the required modules using Composer
### Install the required modules using Composer

Install the required modules:

Expand All @@ -51,9 +44,9 @@ Ensure that the following modules have been installed:

{% endinfo_block %}

### 2) Set up database schema
### Set up database schema

Apply database changes, generate entity and transfer changes:
Apply database changes, generate entity and transfer changes:

```bash
console propel:install
Expand All @@ -62,22 +55,22 @@ console transfer:generate

{% info_block warningBox "Verification" %}

Make sure that the following changes have been applied by checking your database:
Make sure that the following changes have been applied by checking your database:

|DATABASE ENTITY| TYPE| EVENT |
|--- |---| ---|
|spy_product_option_value.avalara_tax_code |column | created |

{% endinfo_block %}

### 3) Set up behavior
### Set up behavior

1. Activate the following plugins:

| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
| --- | --- | --- | --- |
| AvalaraProductOptionCreateTransactionRequestExpanderPlugin | Expands `AvalaraCreateTransactionRequestTransfer` with product option data. | None | SprykerEco\Zed\AvalaraTaxProductOption\Communication\Plugin\AvalaraTax |
| AvalaraProductOptionCreateTransactionRequestAfterPlugin | Calculates taxes for `ProductOptions` based on `AvalaraCreateTransactionResponseTransfer`. | None | SprykerEco\Zed\AvalaraTaxProductOption\Communication\Plugin\AvalaraTax |
| AvalaraProductOptionCreateTransactionRequestExpanderPlugin | Expands `AvalaraCreateTransactionRequestTransfer` with product option data. | | SprykerEco\Zed\AvalaraTaxProductOption\Communication\Plugin\AvalaraTax |
| AvalaraProductOptionCreateTransactionRequestAfterPlugin | Calculates taxes for `ProductOptions` based on `AvalaraCreateTransactionResponseTransfer`. | | SprykerEco\Zed\AvalaraTaxProductOption\Communication\Plugin\AvalaraTax |

<details>
<summary markdown='span'>src/Pyz/Zed/AvalaraTax/AvalaraTaxDependencyProvider.php</summary>
Expand Down Expand Up @@ -119,21 +112,19 @@ class AvalaraTaxDependencyProvider extends SprykerAvalaraTaxDependencyProvider

{% info_block warningBox "Verification" %}

Make sure you’ve enabled the plugins:

1. Add an item with a product option to a cart.
2. Proceeding to checkout.
2. Proceed to checkout.
3. On the summary page, you should see the calculated tax amount for your order, including taxes for product options.

{% endinfo_block %}

Update the following data import .csv files:
2. Update the following data import files:

|FILE NAME | COLUMN TO ADD | LOCATION |
|--- | --- | --- |
|product_option.csv | avalara_tax_code | data/import/common/common/product_option.csv|
|product_option.csv | avalara_tax_code | data/import/common/common/product_option.csv |

To handle the new field, adjust `ProductOption` data importer using the following example:
3. To handle the new field, adjust `ProductOption` data importer using the following example:

**data/import/common/common/product\_option.csv**
```csv
Expand All @@ -152,3 +143,7 @@ console data:import product-option
Make sure that the data has been imported to `spy_product_option_value`.

{% endinfo_block %}

## Next steps

[Install Avalara + Shipment](/docs/pbc/all/tax-management/{{page.version}}/avalara/install-avalara-shipment.html)
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
---
title: Integrate Avalara Tax + Shipment
description: Integrate Avalara Tax + Shipment feature into your project.
title: Install Avalara + Shipment
description: Install Avalara + Shipment.
last_updated: Jun 18, 2021
template: concept-topic-template
template: feature-integration-guide-template
originalLink: https://documentation.spryker.com/2021080/docs/avalara-tax-shipment-feature-integration
originalArticleId: a93d12c8-c40a-4cbb-b866-755ad29f2852
redirect_from:
- /2021080/docs/avalara-tax-shipment-feature-integration
- /2021080/docs/en/avalara-tax-shipment-feature-integration
- /docs/avalara-tax-shipment-feature-integration
- /docs/en/avalara-tax-shipment-feature-integration
- /docs/scos/user/technology-partners/202212.0/taxes/avalara-tax-shipment-feature-integration.html
- /docs/scos/dev/technology-partner-guides/202212.0/taxes/avalara/integrating-avalara-tax-shipment.html
- /docs/pbc/all/tax-management/third-party-integrations/integrate-avalara-tax-shipment.html
Expand All @@ -18,25 +14,25 @@ related:
link: docs/scos/user/features/page.version/tax-feature-overview.html
---

To enable the AvalaraTax + Shipment component of the Avalara partner integration, use the [spryker-eco/avalara-tax-shipment](https://github.com/spryker-eco/avalara-tax-shipment) module.
To enable the Avalara + Shipment component of the Avalara partner integration, use the [spryker-eco/avalara-tax-shipment](https://github.com/spryker-eco/avalara-tax-shipment) module.

## Install feature core

Follow the steps below to install the feature core.

### Prerequisites

To start the feature integration, overview and install the necessary features:
Install the necessary features:

| NAME | VERSION | INTEGRATION GUIDE |
| --- | --- | --- |
| Shipment | master | [Shipment feature integration guide](/docs/pbc/all/carrier-management/{{site.version}}/base-shop/install-and-upgrade/install-features/install-the-shipment-feature.html) |
| Avalara Tax | master | [Avalara Tax integration](/docs/pbc/all/tax-management/{{site.version}}/base-shop/third-party-integrations/integrate-avalara.html) |

### 1) Install the required modules using Composer
### Install the required modules


Install the required modules:
Install the required modules using Composer:

```bash
composer require spryker-eco/avalara-tax-shipment:"^0.1.0" --update-with-dependencies
Expand All @@ -52,9 +48,9 @@ Make sure that the following modules have been installed:

{% endinfo_block %}

### 2) Set up database schema
### Set up database schema

Apply database changes, generate entity and transfer changes:
Apply database changes, generate entity and transfer changes:

```bash
console propel:install
Expand All @@ -63,22 +59,22 @@ console transfer:generate

{% info_block warningBox "Verification" %}

Make sure that the following changes have been applied by checking your database:
Make sure that the following changes have been applied by checking your database:

| DATABASE ENTITY | TYPE | EVENT |
|---|---|---|
| spy_shipment_method.avalara_tax_code | column | created |

{% endinfo_block %}

### 3) Set up behavior
### Set up behavior

1. Activate the following plugins:

| PLUGIN | SPECIFICATION | PREREQUISITES | NAMESPACE |
| --- | --- | --- | --- |
| AvalaraShipmentCreateTransactionRequestExpanderPlugin | Expands `AvalaraCreateTransactionRequestTransfer` with shipments. | None | SprykerEco\Zed\AvalaraTaxShipment\Communication\Plugin\AvalaraTax |
|AvalaraShipmentCreateTransactionRequestAfterPlugin | Calculates taxes for shipment methods based on `AvalaraCreateTransactionResponseTransfer`. | None | SprykerEco\Zed\AvalaraTaxShipment\Communication\Plugin\AvalaraTax |
| AvalaraShipmentCreateTransactionRequestExpanderPlugin | Expands `AvalaraCreateTransactionRequestTransfer` with shipments. | | SprykerEco\Zed\AvalaraTaxShipment\Communication\Plugin\AvalaraTax |
|AvalaraShipmentCreateTransactionRequestAfterPlugin | Calculates taxes for shipment methods based on `AvalaraCreateTransactionResponseTransfer`. | | SprykerEco\Zed\AvalaraTaxShipment\Communication\Plugin\AvalaraTax |

**src/Pyz/Zed/AvalaraTax/AvalaraTaxDependencyProvider.php**

Expand Down Expand Up @@ -117,20 +113,19 @@ class AvalaraTaxDependencyProvider extends SprykerAvalaraTaxDependencyProvider

{% info_block warningBox "Verification" %}

Make sure you’ve enabled the plugins:
1. Add an item to a cart.
2. Proceeding to checkout.
3. On the summary page, you should see the calculated tax amount for your order, including taxes for product options and shipment methods.
2. Proceed to checkout.
3. On the summary page, you should see the calculated tax amount for your order, including the taxes for shipment methods.

{% endinfo_block %}

2. Update the following data import .csv files:
2. Update the following data import files:

| FILE NAME | COLUMN TO ADD | LOCATION |
| --- | --- | --- |
| shipment.csv | avalara_tax_code | data/import/common/common/shipment.csv |

3. To handle the new field, adjust `Shipment` data importer using the following example:
3. To handle the new field, adjust the `Shipment` data importer using the following example:

**data/import/common/common/shipment.csv**

Expand All @@ -139,7 +134,7 @@ shipment_method_key,name,carrier,taxSetName,avalaraTaxCode
spryker_dummy_shipment-standard,Standard,Spryker Dummy Shipment,Shipment Taxes,PC040111
```

### 4) Import data:
### Import data

Import data using the following command:

Expand All @@ -152,3 +147,7 @@ console data:import shipment
Make sure that the data has been imported to `spy_shipment_method`.

{% endinfo_block %}

## Next steps

[Apply Avalara tax codes](/docs/pbc/all/tax-management/{{page.version}}/avalara/apply-avalara-tax-codes.html)
Loading
Loading