init
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/** @var \Esun\CustomerVat\Block\Account\Vat $block */
|
||||
/** @var \Magento\Framework\Escaper $escaper */
|
||||
$application = $block->getCurrentApplication();
|
||||
?>
|
||||
<div class="esun-vat-account esun-vat-form-page">
|
||||
<?php if ($application && $application->getData('status') === 'approved'): ?>
|
||||
<div class="message warning"><span><?= $escaper->escapeHtml(__('Changing an approved VAT number will return it to Pending Review and suspend its tax exemption eligibility.')) ?></span></div>
|
||||
<?php endif; ?>
|
||||
<form class="form vat-number-form" method="post"
|
||||
action="<?= $escaper->escapeUrl($block->getUrl('esun_customer_vat/vat/save')) ?>"
|
||||
data-mage-init='{"validation":{}}'>
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<?php if ($application): ?><input type="hidden" name="id" value="<?= (int)$application->getId() ?>"/><?php endif; ?>
|
||||
<fieldset class="fieldset esun-vat-form__fields">
|
||||
<div class="field company-name required">
|
||||
<label class="label" for="vat-company-name"><span><?= $escaper->escapeHtml(__('Company Name')) ?></span></label>
|
||||
<div class="control"><input class="input-text" id="vat-company-name" name="company_name" required maxlength="255" value="<?= $escaper->escapeHtmlAttr((string)($application?->getData('company_name') ?? '')) ?>"/></div>
|
||||
</div>
|
||||
<div class="field country required">
|
||||
<label class="label" for="vat-country"><span><?= $escaper->escapeHtml(__('Country')) ?></span></label>
|
||||
<div class="control">
|
||||
<select id="vat-country" name="country_id" required>
|
||||
<option value=""><?= $escaper->escapeHtml(__('Please select a country')) ?></option>
|
||||
<?php foreach ($block->getCountryOptions() as $option): ?>
|
||||
<option value="<?= $escaper->escapeHtmlAttr((string)$option['value']) ?>" <?= $application?->getData('country_id') === $option['value'] ? 'selected' : '' ?>><?= $escaper->escapeHtml((string)$option['label']) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field vat-number required">
|
||||
<label class="label" for="vat-number"><span><?= $escaper->escapeHtml(__('VAT Number')) ?></span></label>
|
||||
<div class="control"><input class="input-text" id="vat-number" name="vat_number" required maxlength="64" value="<?= $escaper->escapeHtmlAttr((string)($application?->getData('vat_number') ?? '')) ?>"/></div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="actions-toolbar esun-vat-form__actions">
|
||||
<div class="primary"><button type="submit" class="action primary"><span><?= $escaper->escapeHtml(__('Submit for Review')) ?></span></button></div>
|
||||
<div class="secondary"><a class="action back" href="<?= $escaper->escapeUrl($block->getUrl('esun_customer_vat/vat/index')) ?>"><span><?= $escaper->escapeHtml(__('Back')) ?></span></a></div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/** @var \Esun\CustomerVat\Block\Account\Vat $block */
|
||||
/** @var \Magento\Framework\Escaper $escaper */
|
||||
?>
|
||||
<div class="esun-vat-account">
|
||||
<div class="esun-vat-account__heading">
|
||||
<p><?= $escaper->escapeHtml(__('Submit VAT numbers for review. You can register a different VAT number for each EU country.')) ?></p>
|
||||
<a class="action primary" href="<?= $escaper->escapeUrl($block->getUrl('esun_customer_vat/vat/new')) ?>">
|
||||
<span><?= $escaper->escapeHtml(__('Add VAT Number')) ?></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<?php if ($block->getApplications()->getSize()): ?>
|
||||
<div class="table-wrapper vat-applications">
|
||||
<table class="data table table-vat-applications">
|
||||
<caption class="table-caption"><?= $escaper->escapeHtml(__('VAT Number Applications')) ?></caption>
|
||||
<thead><tr>
|
||||
<th scope="col"><?= $escaper->escapeHtml(__('Company Name')) ?></th>
|
||||
<th scope="col"><?= $escaper->escapeHtml(__('VAT Number')) ?></th>
|
||||
<th scope="col"><?= $escaper->escapeHtml(__('Country')) ?></th>
|
||||
<th scope="col"><?= $escaper->escapeHtml(__('Status')) ?></th>
|
||||
<th scope="col"><?= $escaper->escapeHtml(__('Actions')) ?></th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($block->getApplications() as $application): ?>
|
||||
<tr>
|
||||
<td data-th="<?= $escaper->escapeHtmlAttr(__('Company Name')) ?>"><?= $escaper->escapeHtml((string)$application->getData('company_name')) ?></td>
|
||||
<td data-th="<?= $escaper->escapeHtmlAttr(__('VAT Number')) ?>"><?= $escaper->escapeHtml((string)$application->getData('vat_number')) ?></td>
|
||||
<td data-th="<?= $escaper->escapeHtmlAttr(__('Country')) ?>"><?= $escaper->escapeHtml($block->getCountryName((string)$application->getData('country_id'))) ?></td>
|
||||
<td data-th="<?= $escaper->escapeHtmlAttr(__('Status')) ?>">
|
||||
<span class="vat-status vat-status--<?= $escaper->escapeHtmlAttr((string)$application->getData('status')) ?>">
|
||||
<?= $escaper->escapeHtml($block->getStatusLabel((string)$application->getData('status'))) ?>
|
||||
</span>
|
||||
<?php if ($application->getData('review_note')): ?>
|
||||
<small><?= $escaper->escapeHtml((string)$application->getData('review_note')) ?></small>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td data-th="<?= $escaper->escapeHtmlAttr(__('Actions')) ?>" class="actions">
|
||||
<a href="<?= $escaper->escapeUrl($block->getUrl('esun_customer_vat/vat/edit', ['id' => $application->getId()])) ?>"><?= $escaper->escapeHtml(__('Edit')) ?></a>
|
||||
<form method="post" action="<?= $escaper->escapeUrl($block->getUrl('esun_customer_vat/vat/delete')) ?>" data-mage-init='{"validation":{}}'>
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<input type="hidden" name="id" value="<?= (int)$application->getId() ?>"/>
|
||||
<button type="submit" class="action delete" data-confirm="<?= $escaper->escapeHtmlAttr(__('Deleting an approved VAT number immediately removes its exemption eligibility. Continue?')) ?>">
|
||||
<span><?= $escaper->escapeHtml(__('Delete')) ?></span>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="message info empty"><span><?= $escaper->escapeHtml(__('You have not submitted any VAT numbers.')) ?></span></div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user