29 lines
860 B
PHP
29 lines
860 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Esun\CustomerVat\Setup\Patch\Data;
|
|
|
|
use Magento\Framework\Setup\ModuleDataSetupInterface;
|
|
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
|
|
|
class FixTaxRatePostcodeFlags implements DataPatchInterface
|
|
{
|
|
public function __construct(private readonly ModuleDataSetupInterface $moduleDataSetup)
|
|
{
|
|
}
|
|
|
|
public function apply(): self
|
|
{
|
|
$connection = $this->moduleDataSetup->getConnection();
|
|
$connection->update(
|
|
$this->moduleDataSetup->getTable('tax_calculation_rate'),
|
|
['zip_is_range' => null, 'zip_from' => null, 'zip_to' => null],
|
|
['code LIKE ?' => 'ESUN-%']
|
|
);
|
|
return $this;
|
|
}
|
|
|
|
public static function getDependencies(): array { return [ConfigureTaxRules::class]; }
|
|
public function getAliases(): array { return []; }
|
|
}
|