Files
grzanieplus.pl/plugins/stTaxPlugin/modules/stTaxBackend/templates/_ratesByCountry.php
2025-03-12 17:06:23 +01:00

39 lines
2.0 KiB
PHP

<?php if (!empty($requiredRates)): ?>
<?php echo st_admin_table_start() ?>
<thead>
<tr>
<th style="width: 200px"><?php echo __("Kraj dostawy wg konfiguracji") ?></th>
<th><?php echo __("Stawka VAT") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($countries as $countryCode => $country):
if (!isset($requiredRates[$countryCode])) continue;
$rates = $requiredRates[$countryCode];
$value = isset($values[$countryCode]) && $values[$countryCode] !== "" ? $values[$countryCode] : null;
?>
<tr>
<td style="text-align: right"><b><?php echo $country ?></b></td>
<td><?php echo select_tag('tax[rates_by_country]['.$countryCode.']', options_for_select($rates, $value, array('include_custom' => '---')), array(
'class' => null !== $value ? 'not-required' : '',
'style' => 'width: 200px',
)) ?></td>
</tr>
<?php endforeach ?>
</tbody>
<?php echo st_admin_table_end() ?>
<?php endif ?>
<?php echo st_admin_table_start(array(
array('label' => __("Kraj"), 'options' => array('style' => 'width: 200px')),
array('label' => __("Stawka VAT")),
), array('style' => 'margin-top: 10px')) ?>
<tbody>
<?php foreach ($countries as $countryCode => $country): if (!isset($moreRates[$countryCode])) continue; $rates = $moreRates[$countryCode] ?>
<tr>
<td style="text-align: right"><?php echo $country ?></td>
<td><?php echo select_tag('tax[rates_by_country]['.$countryCode.']', options_for_select($rates, isset($values[$countryCode]) ? $values[$countryCode] : null, array('include_custom' => '---')), array('style' => 'width: 200px', 'class' => 'not-required')) ?></td>
</tr>
<?php endforeach ?>
</tbody>
<?php echo st_admin_table_end() ?>