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

Install Vertex #2085

Merged
merged 10 commits into from
Aug 14, 2023
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