-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #59 from avadev/release/2.4.0-new
CoreVAT support - Release 2.4.0
- Loading branch information
Showing
165 changed files
with
2,789 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} |
Oops, something went wrong.