Updated: Validation for refund voucher creation and action of the refund form in Admin refund request controller

This commit is contained in:
Sumit Panwar
2024-07-13 16:09:15 +05:30
parent ae1cb8b2b7
commit c1e89d52d6
2 changed files with 8 additions and 5 deletions

View File

@@ -326,10 +326,13 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
} else {
$this->errors[] = $this->l('Invalid refund state.');
}
if (!$voucher_expiry_date = Tools::getValue('voucher_expiry_date')) {
$this->errors[] = $this->l('Voucher expiry date is required.');
} elseif (!Validate::isDate($voucher_expiry_date)) {
$this->errors[] = $this->l('Invalid voucher expiry date.');
if (Tools::isSubmit('generateDiscount')) {
if (!$voucher_expiry_date = Tools::getValue('voucher_expiry_date')) {
$this->errors[] = $this->l('Voucher expiry date is required.');
} elseif (!Validate::isDate($voucher_expiry_date)) {
$this->errors[] = $this->l('Invalid voucher expiry date.');
}
}
} else {
$this->errors[] = $this->l('Invalid refund information found.');

View File

@@ -5,7 +5,7 @@
<i class="icon-info-circle"></i> &nbsp;{l s='Order Cancellation Request Information' mod='hotelreservationsystem'}
</div>
<br>
<form id="{$table|escape:'htmlall':'UTF-8'}_form" class="defaultForm {$name_controller|escape:'htmlall':'UTF-8'} form-horizontal" action="{$current|escape:'htmlall':'UTF-8'}&{if !empty($submit_action)}{$submit_action|escape:'htmlall':'UTF-8'}{/if}&token={$token|escape:'htmlall':'UTF-8'}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style|escape:'htmlall':'UTF-8'}"{/if}>
<form id="{$table|escape:'htmlall':'UTF-8'}_form" class="defaultForm {$name_controller|escape:'htmlall':'UTF-8'} form-horizontal" action="{$link->getAdminLink('AdminOrderRefundRequests')|escape:'html':'UTF-8'}&amp;vieworder_return&amp;id_order_return={$orderReturnInfo['id']|escape:'html':'UTF-8'|intval}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style|escape:'htmlall':'UTF-8'}"{/if}>
<div class="panel">
{if isset($customer_name)}
<div class="row">