init
This commit is contained in:
+5
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body><referenceContainer name="content"><uiComponent name="esun_customer_vat_listing"/></referenceContainer></body>
|
||||
</page>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body><referenceContainer name="content">
|
||||
<block class="Esun\CustomerVat\Block\Adminhtml\Application\View" name="esun.customer.vat.admin.view"
|
||||
template="Esun_CustomerVat::application/view.phtml"/>
|
||||
</referenceContainer></body>
|
||||
</page>
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
/** @var \Esun\CustomerVat\Block\Adminhtml\Application\View $block */
|
||||
/** @var \Magento\Framework\Escaper $escaper */
|
||||
$application = $block->getApplication();
|
||||
$customer = $block->getCustomer();
|
||||
?>
|
||||
<div class="admin__page-section">
|
||||
<div class="admin__page-section-title"><span class="title"><?= $escaper->escapeHtml(__('VAT Application')) ?></span></div>
|
||||
<div class="admin__page-section-content"><table class="admin__table-secondary">
|
||||
<tr><th><?= $escaper->escapeHtml(__('Customer')) ?></th><td><?= $escaper->escapeHtml($customer->getFirstname() . ' ' . $customer->getLastname()) ?> (#<?= (int)$customer->getId() ?>)</td></tr>
|
||||
<tr><th><?= $escaper->escapeHtml(__('Email')) ?></th><td><?= $escaper->escapeHtml($customer->getEmail()) ?></td></tr>
|
||||
<tr><th><?= $escaper->escapeHtml(__('Company Name')) ?></th><td><?= $escaper->escapeHtml((string)$application->getData('company_name')) ?></td></tr>
|
||||
<tr><th><?= $escaper->escapeHtml(__('Country')) ?></th><td><?= $escaper->escapeHtml($block->getCountryName((string)$application->getData('country_id'))) ?> (<?= $escaper->escapeHtml((string)$application->getData('country_id')) ?>)</td></tr>
|
||||
<tr><th><?= $escaper->escapeHtml(__('VAT Number')) ?></th><td><?= $escaper->escapeHtml((string)$application->getData('vat_number')) ?></td></tr>
|
||||
<tr><th><?= $escaper->escapeHtml(__('Submitted At')) ?></th><td><?= $escaper->escapeHtml((string)$application->getData('created_at')) ?></td></tr>
|
||||
<tr><th><?= $escaper->escapeHtml(__('Current Status')) ?></th><td><?= $escaper->escapeHtml((string)(\Esun\CustomerVat\Model\VatApplication::getStatuses()[$application->getData('status')] ?? $application->getData('status'))) ?></td></tr>
|
||||
</table></div>
|
||||
</div>
|
||||
<div class="admin__page-section">
|
||||
<form method="post" action="<?= $escaper->escapeUrl($block->getUrl('esun_customer_vat/application/review')) ?>">
|
||||
<?= $block->getBlockHtml('formkey') ?>
|
||||
<input type="hidden" name="id" value="<?= (int)$application->getId() ?>"/>
|
||||
<div class="admin__field field">
|
||||
<label class="admin__field-label" for="vat-status"><span><?= $escaper->escapeHtml(__('Status')) ?></span></label>
|
||||
<div class="admin__field-control"><select class="admin__control-select" id="vat-status" name="status">
|
||||
<?php foreach (\Esun\CustomerVat\Model\VatApplication::getStatuses() as $value => $label): ?>
|
||||
<option value="<?= $escaper->escapeHtmlAttr($value) ?>" <?= $application->getData('status') === $value ? 'selected' : '' ?>><?= $escaper->escapeHtml($label) ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select></div>
|
||||
</div>
|
||||
<div class="admin__field field">
|
||||
<label class="admin__field-label" for="review-note"><span><?= $escaper->escapeHtml(__('Review Note')) ?></span></label>
|
||||
<div class="admin__field-control"><textarea class="admin__control-textarea" id="review-note" name="review_note" rows="5"><?= $escaper->escapeHtml((string)$application->getData('review_note')) ?></textarea></div>
|
||||
</div>
|
||||
<div style="margin-top:20px"><button type="submit" class="action-primary"><span><?= $escaper->escapeHtml(__('Save Review')) ?></span></button>
|
||||
<a class="action-secondary" href="<?= $escaper->escapeUrl($block->getUrl('esun_customer_vat/application/index')) ?>"><?= $escaper->escapeHtml(__('Back')) ?></a></div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0"?>
|
||||
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
|
||||
<argument name="data" xsi:type="array"><item name="js_config" xsi:type="array">
|
||||
<item name="provider" xsi:type="string">esun_customer_vat_listing.esun_customer_vat_listing_data_source</item>
|
||||
</item></argument>
|
||||
<settings><spinner>esun_customer_vat_columns</spinner><deps><dep>esun_customer_vat_listing.esun_customer_vat_listing_data_source</dep></deps></settings>
|
||||
<dataSource name="esun_customer_vat_listing_data_source" component="Magento_Ui/js/grid/provider">
|
||||
<settings><storageConfig><param name="indexField" xsi:type="string">entity_id</param></storageConfig><updateUrl path="mui/index/render"/></settings>
|
||||
<aclResource>Esun_CustomerVat::applications</aclResource>
|
||||
<dataProvider class="Magento\Framework\View\Element\UiComponent\DataProvider\DataProvider" name="esun_customer_vat_listing_data_source">
|
||||
<settings><requestFieldName>id</requestFieldName><primaryFieldName>entity_id</primaryFieldName></settings>
|
||||
</dataProvider>
|
||||
</dataSource>
|
||||
<listingToolbar name="listing_top">
|
||||
<settings><sticky>true</sticky></settings>
|
||||
<bookmark name="bookmarks"/>
|
||||
<columnsControls name="columns_controls"/>
|
||||
<filters name="listing_filters"/>
|
||||
<massaction name="listing_massaction">
|
||||
<action name="approve">
|
||||
<settings>
|
||||
<confirm>
|
||||
<message translate="true">Are you sure you want to approve the selected VAT applications?</message>
|
||||
<title translate="true">Approve VAT Applications</title>
|
||||
</confirm>
|
||||
<url path="esun_customer_vat/application/massApprove"/>
|
||||
<type>approve</type>
|
||||
<label translate="true">Approve</label>
|
||||
</settings>
|
||||
</action>
|
||||
<action name="reject">
|
||||
<settings>
|
||||
<confirm>
|
||||
<message translate="true">Are you sure you want to reject the selected VAT applications?</message>
|
||||
<title translate="true">Reject VAT Applications</title>
|
||||
</confirm>
|
||||
<url path="esun_customer_vat/application/massReject"/>
|
||||
<type>reject</type>
|
||||
<label translate="true">Reject</label>
|
||||
</settings>
|
||||
</action>
|
||||
</massaction>
|
||||
<paging name="listing_paging"/>
|
||||
</listingToolbar>
|
||||
<columns name="esun_customer_vat_columns">
|
||||
<selectionsColumn name="ids" sortOrder="0">
|
||||
<settings>
|
||||
<indexField>entity_id</indexField>
|
||||
<resizeEnabled>false</resizeEnabled>
|
||||
<resizeDefaultWidth>55</resizeDefaultWidth>
|
||||
</settings>
|
||||
</selectionsColumn>
|
||||
<column name="entity_id" sortOrder="10"><settings><filter>textRange</filter><label translate="true">ID</label><sorting>desc</sorting></settings></column>
|
||||
<column name="status" component="Magento_Ui/js/grid/columns/select" sortOrder="20"><settings><filter>select</filter><dataType>select</dataType><options class="Esun\CustomerVat\Model\Source\Status"/><label translate="true">Status</label></settings></column>
|
||||
<column name="customer_id" sortOrder="30"><settings><filter>textRange</filter><label translate="true">Customer ID</label></settings></column>
|
||||
<column name="company_name" sortOrder="40"><settings><filter>text</filter><label translate="true">Company Name</label></settings></column>
|
||||
<column name="country_id" sortOrder="50"><settings><filter>text</filter><label translate="true">Country</label></settings></column>
|
||||
<column name="vat_number" sortOrder="60"><settings><filter>text</filter><label translate="true">VAT Number</label></settings></column>
|
||||
<column name="created_at" class="Magento\Ui\Component\Listing\Columns\Date" sortOrder="70"><settings><filter>dateRange</filter><dataType>date</dataType><label translate="true">Submitted At</label></settings></column>
|
||||
<column name="reviewed_at" class="Magento\Ui\Component\Listing\Columns\Date" sortOrder="80"><settings><filter>dateRange</filter><dataType>date</dataType><label translate="true">Reviewed At</label></settings></column>
|
||||
<actionsColumn name="actions" class="Esun\CustomerVat\Ui\Component\Listing\Column\Actions" sortOrder="90"><settings><indexField>entity_id</indexField><resizeEnabled>false</resizeEnabled><resizeDefaultWidth>100</resizeDefaultWidth></settings></actionsColumn>
|
||||
</columns>
|
||||
</listing>
|
||||
Reference in New Issue
Block a user