'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',
[ 'invoiceData' =>
json_encode($invoiceConfig, \JSON_THROW_ON_ERROR
),
'documentConfigId' =>
$invoiceData['id'
],
] );
} }}