} private function addDeliveryCountriesIntoInvoiceDocumentConfig(Connection
$connection): void
{ $listInvoiceData =
$connection->
fetchAllAssociative( 'SELECT `document_base_config`.`id`, `document_base_config`.`config` FROM `document_base_config`
LEFT JOIN `document_type` ON `document_base_config`.`document_type_id` = `document_type`.`id`
WHERE `document_type`.`technical_name` = :documentName',
['documentName' => InvoiceRenderer::TYPE
] );
$euStates =
$connection->
fetchFirstColumn( 'SELECT `id` FROM `country` WHERE `iso`
IN (\'AT\', \'BE\', \'BG\', \'CY\', \'CZ\', \'DE\', \'DK\', \'EE\', \'GR\', \'ES\', \'FI\', \'FR\', \'GB\', \'HU\', \'IE\', \'IT\',
\'LT\', \'LU\', \'LV\', \'MT\', \'NL\', \'PL\', \'PT\', \'RO\', \'SE\', \'SI\', \'SK\', \'HR\')'
);
foreach ($listInvoiceData as $invoiceData) { $invoiceConfig =
json_decode($invoiceData['config'
] ?? '[]', true, 512, \JSON_THROW_ON_ERROR
);
$invoiceConfig['deliveryCountries'
] = Uuid::
fromBytesToHexList($euStates);
$connection->
executeStatement( 'UPDATE `document_base_config` SET `config` = :invoiceData WHERE `id` = :documentConfigId',
[