Skip to content

Commit

Permalink
Merge pull request #59 from avadev/release/2.4.0-new
Browse files Browse the repository at this point in the history
CoreVAT support - Release 2.4.0
  • Loading branch information
avl-asheesh-singh authored Oct 7, 2022
2 parents ed42790 + 9e18cb1 commit 79341f9
Show file tree
Hide file tree
Showing 165 changed files with 2,789 additions and 105 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/Tests/Integration/credentials.php
/Test/Mftf
/Test/Integration/credentials.php
.DS_Store
/vendor
/.idea
38 changes: 38 additions & 0 deletions Api/RestDefinitionsInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/**
* ClassyLlama_AvaTax
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
*
* @copyright Copyright (c) 2016 Avalara, Inc.
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

namespace ClassyLlama\AvaTax\Api;

use ClassyLlama\AvaTax\Exception\AvataxConnectionException;
use ClassyLlama\AvaTax\Exception\DefinitionsException;
/**
* @codeCoverageIgnore
*/
interface RestDefinitionsInterface extends \ClassyLlama\AvaTax\Api\RestInterface
{
/**
* Perform REST request to get Definitions parameters
*
* @param \Magento\Framework\DataObject $request
* @param string|null $isProduction
* @param string|int|null $scopeId
* @param string $scopeType
*
* @return \ClassyLlama\AvaTax\Framework\Interaction\Rest\Definitions
* @throws DefinitionsException
* @throws AvataxConnectionException
*/
public function parameters($isProduction = null, $scopeId = null, $scopeType = \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
use Magento\Framework\Api\SearchCriteria\CollectionProcessor\FilterProcessor\CustomFilterInterface;
use Magento\Framework\Data\Collection\AbstractDb;

/**
* @codeCoverageIgnore
*/
class CountryFilter implements CustomFilterInterface
{
/**
Expand Down
2 changes: 1 addition & 1 deletion BaseProvider/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<tax>
<baseprovider>
<queue_enabled>0</queue_enabled>
<queue_batch_size>10</queue_batch_size>
<queue_batch_size>100</queue_batch_size>
<queue_limit>0</queue_limit>
<logging_enabled>0</logging_enabled>
<logging_mode>1</logging_mode>
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/CrossBorderClass/Edit/BackButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;
use Magento\Backend\Block\Widget\Context;

/**
* @codeCoverageIgnore
*/
class BackButton implements ButtonProviderInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/CrossBorderClass/Edit/DeleteButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
/**
* Class SaveAndContinueButton
*/
/**
* @codeCoverageIgnore
*/
class DeleteButton implements ButtonProviderInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/CrossBorderClass/Edit/ResetButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
* @codeCoverageIgnore
*/
class ResetButton implements ButtonProviderInterface
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
* @codeCoverageIgnore
*/
class SaveAndContinueButton implements ButtonProviderInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/CrossBorderClass/Edit/SaveButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
* @codeCoverageIgnore
*/
class SaveButton implements ButtonProviderInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/CrossBorderType/Edit/BackButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
* @codeCoverageIgnore
*/
class BackButton extends GenericButton implements ButtonProviderInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/CrossBorderType/Edit/DeleteButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
* @codeCoverageIgnore
*/
class DeleteButton extends GenericButton implements ButtonProviderInterface
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/CrossBorderType/Edit/GenericButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Backend\Block\Widget\Context;

/**
* @codeCoverageIgnore
*/
abstract class GenericButton
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
* @codeCoverageIgnore
*/
class SaveAndContinueButton extends GenericButton implements ButtonProviderInterface
{

Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/CrossBorderType/Edit/SaveButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

/**
* @codeCoverageIgnore
*/
class SaveButton extends GenericButton implements ButtonProviderInterface
{

Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/Customer/Edit/Region.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
use Magento\Backend\Model\UrlInterface as BackendUrl;
use ClassyLlama\AvaTax\Helper\Config as ConfigHelper;

/**
* @codeCoverageIgnore
*/
class Region extends \Magento\Framework\View\Element\Template
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/Form/Field/CompanyCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

use Magento\Config\Block\System\Config\Form\Field;

/**
* @codeCoverageIgnore
*/
class CompanyCode extends Field
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/Form/Field/CustomShippingMethods.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

namespace ClassyLlama\AvaTax\Block\Adminhtml\Form\Field;

/**
* @codeCoverageIgnore
*/
class CustomShippingMethods extends \Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray
{
/**
Expand Down
3 changes: 3 additions & 0 deletions Block/Adminhtml/Form/Field/ShippingModes.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use Magento\Framework\View\Element\Context;

/**
* @codeCoverageIgnore
*/
class ShippingModes extends \Magento\Framework\View\Element\Html\Select
{
/**
Expand Down
93 changes: 93 additions & 0 deletions Block/Adminhtml/Form/Field/Transport.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
<?php

namespace ClassyLlama\AvaTax\Block\Adminhtml\Form\Field;

use Magento\Config\Block\System\Config\Form\Field\FieldArray\AbstractFieldArray;
use Magento\Framework\DataObject;
use Magento\Framework\Exception\LocalizedException;
use ClassyLlama\AvaTax\Block\Adminhtml\Form\Field\TransportShippingColumn;
use ClassyLlama\AvaTax\Block\Adminhtml\Form\Field\TransportColumn;

/**
* Class Transport
*/
/**
* @codeCoverageIgnore
*/
class Transport extends AbstractFieldArray
{
/**
* @var TransportShippingColumn
*/
private $transportShippingRenderer;
/**
* @var TransportColumn
*/
private $transportRenderer;

/**
* Prepare rendering the new field by adding all the needed columns
*/
protected function _prepareToRender()
{
$this->addColumn('transport_shipping', [
'label' => __('Shipping Method'),
'renderer' => $this->getTransportShippingRenderer()
]);
$this->addColumn('transport', [
'label' => __('Transport'),
'renderer' => $this->getTransportRenderer()
]);
$this->_addAfter = false;
$this->_addButtonLabel = __('Add');
}

/**
* Prepare existing row data object
*
* @param DataObject $row
* @throws LocalizedException
*/
protected function _prepareArrayRow(DataObject $row): void
{
$options = [];

$transport = $row->getTransport();
if ($transport !== null) {
$options['option_' . $this->getTransportShippingRenderer()->calcOptionHash($transport)] = 'selected="selected"';
}

$row->setData('option_extra_attrs', $options);
}

/**
* @return TransportShippingColumn
* @throws LocalizedException
*/
private function getTransportShippingRenderer()
{
if (!$this->transportShippingRenderer) {
$this->transportShippingRenderer = $this->getLayout()->createBlock(
TransportShippingColumn::class,
'',
['data' => ['is_render_to_js_template' => true]]
);
}
return $this->transportShippingRenderer;
}
/**
* @return TransportColumn
* @throws LocalizedException
*/
private function getTransportRenderer()
{
if (!$this->transportRenderer) {
$this->transportRenderer = $this->getLayout()->createBlock(
TransportColumn::class,
'',
['data' => ['is_render_to_js_template' => true]]
);
}
return $this->transportRenderer;
}
}
Loading

0 comments on commit 79341f9

Please sign in to comment.