From 99da3cae20ea5c1c8ddedf5c367a0f6d43aae51b Mon Sep 17 00:00:00 2001 From: Maksym Ohnyanikov Date: Thu, 10 Aug 2023 12:59:50 +0300 Subject: [PATCH 1/3] PBC-2073: Additional info added --- .../202307.0/vertex/install-vertex.md | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md b/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md index 4fe3f24dbd6..227b7003c61 100644 --- a/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md +++ b/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md @@ -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; } @@ -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 introduce the following expander 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: From a4f409e41515f37fa645e8d4e955c65451616320 Mon Sep 17 00:00:00 2001 From: Maksym Ohnyanikov Date: Thu, 10 Aug 2023 13:05:33 +0300 Subject: [PATCH 2/3] PBC-2073: Additional info added --- docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md b/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md index 227b7003c61..d40ba09e3a2 100644 --- a/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md +++ b/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md @@ -429,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 @@ -443,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 From ef55caffc4b10ffdba4ff7242687c1501e85938b Mon Sep 17 00:00:00 2001 From: Maksym Ohnyanikov Date: Thu, 10 Aug 2023 15:27:04 +0300 Subject: [PATCH 3/3] PBC-2073: Fixed by CR --- docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md b/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md index d40ba09e3a2..8f9082755b9 100644 --- a/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md +++ b/docs/pbc/all/tax-management/202307.0/vertex/install-vertex.md @@ -315,7 +315,7 @@ and for quote: `Pyz/Zed/{YourDesiredModule}/Communication/Plugin/Quote/CalculableObjectCustomerWithVertexExemptionCertificateExpanderPlugin.php` -The following code sample shows how to introduce the following expander plugins: +The following code sample shows how to implement the previously mentioned plugins: ```php // ...