Skip to content

Commit

Permalink
Merge pull request #2085 from spryker/feature/pbc-2073/dev-tax-app-in…
Browse files Browse the repository at this point in the history
…tegration-guide

Install Vertex
  • Loading branch information
Vadym Sachenko authored Aug 14, 2023
2 parents 0d2b9f1 + 9fe37cb commit 56524e8
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class OrderCustomerWithVertexCodeExpanderPlugin extends AbstractPlugin implement
*/
public function expand(OrderTransfer $orderTransfer): OrderTransfer
{
$orderTransfer->getTaxMetadata()->setCustomer(['customerCode' => 'vertex-customer-code']);
$orderTransfer->getTaxMetadata()->setCustomer(['customerCode' => ['classCode' => 'vertex-customer-code']]);

return $orderTransfer;
}
Expand All @@ -292,20 +292,50 @@ use Spryker\Zed\TaxAppExtension\Dependency\Plugin\CalculableObjectTaxAppExpander
class CalculableObjectCustomerWithVertexCodeExpanderPlugin extends AbstractPlugin implements CalculableObjectTaxAppExpanderPluginInterface
{
/**
* @param \Generated\Shared\Transfer\CalculableObjectTransfer $quoteTransfer
* @param \Generated\Shared\Transfer\CalculableObjectTransfer $calculableObjectTransfer
*
* @return \Generated\Shared\Transfer\CalculableObjectTransfer
*/
public function expand(CalculableObjectTransfer $quoteTransfer): CalculableObjectTransfer
public function expand(CalculableObjectTransfer $calculableObjectTransfer): CalculableObjectTransfer
{
$quoteTransfer->getTaxMetadata()->setCustomer(['customerCode' => 'vertex-customer-code']);
$calculableObjectTransfer->getTaxMetadata()->setCustomer(['customerCode' => ['classCode' => 'vertex-customer-code']]);

return $calculableObjectTransfer;
}
}
```

#### Configure Customer Exemption Certificate Expander plugins

For order:

`Pyz/Zed/{YourDesiredModule}/Communication/Plugin/Order/OrderCustomerWithVertexExemptionCertificateExpanderPlugin.php`

and for quote:

`Pyz/Zed/{YourDesiredModule}/Communication/Plugin/Quote/CalculableObjectCustomerWithVertexExemptionCertificateExpanderPlugin.php`

The following code sample shows how to implement the previously mentioned plugins:

return $quoteTransfer;
```php
// ...
class OrderCustomerWithVertexExemptionCertificateExpanderPlugin extends AbstractPlugin implements CalculableObjectTaxAppExpanderPluginInterface
{
/**
* @param \Generated\Shared\Transfer\CalculableObjectTransfer $calculableObjectTransfer
*
* @return \Generated\Shared\Transfer\CalculableObjectTransfer
*/
public function expand(CalculableObjectTransfer $calculableObjectTransfer): CalculableObjectTransfer
{
$calculableObjectTransfer->getTaxMetadata()->setCustomer(['exemptionCertificate' => ['exemptionCertificateNumber' => 'vertex-exemption-certificate-number']]);

return $calculableObjectTransfer;
}
}
```

#### Configure Product Class Code Expanders
#### Configure Product Class Code Expander plugins

For order items:

Expand Down Expand Up @@ -399,6 +429,7 @@ class TaxAppDependencyProvider extends SprykerTaxAppDependencyProvider
{
return [
new CalculableObjectCustomerWithTaxCodeExpanderPlugin(), // to extend quote with customer class code
new CalculableObjectCustomerWithVertexExemptionCertificateExpanderPlugin(), // to extend quote with customer exemption certificate
new CalculableObjectExpensesWithTaxCodeExpanderPlugin(), // to extend quote expenses with product class codes
new CalculableObjectItemProductOptionWithTaxCodeExpanderPlugin(), // to extend quote item product options with product class codes
new CalculableObjectItemWithProductClassCodeExpandePlugin(), // to extend quote items with product class codes
Expand All @@ -413,6 +444,7 @@ class TaxAppDependencyProvider extends SprykerTaxAppDependencyProvider
{
return [
new OrderCustomerWithTaxCodeExpanderPlugin(), // to extend order with customer class code
new OrderCustomerWithVertexExemptionCertificateExpanderPlugin(), // to extend order with customer exemption certificate
new OrderExpensesWithTaxCodeExpanderPlugin(), // to extend order expenses with product class codes
new OrderItemProductOptionWithTaxCodeExpanderPlugin(), // to extend order item product options with product class codes
new OrderItemWithProductClassCodeExpandePlugin(), // to extend order items with product class codes
Expand Down

0 comments on commit 56524e8

Please sign in to comment.