set voucher expiry is required

This commit is contained in:
Shreesh Arora
2024-07-11 13:19:11 +05:30
parent c4a6babd25
commit ac0de7b6f5
3 changed files with 20 additions and 5 deletions

View File

@@ -326,10 +326,10 @@ class AdminOrderRefundRequestsController extends ModuleAdminController
} else {
$this->errors[] = $this->l('Invalid refund state.');
}
if ($voucher_expiry_date = Tools::getValue('voucher_expiry_date')) {
if (!Validate::isDate($voucher_expiry_date)) {
$this->errors[] = $this->l('Invalid voucher expiry date.');
}
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.');