File tree 3 files changed +20
-5
lines changed
modules/hotelreservationsystem
templates/admin/order_refund_requests/helpers/view
3 files changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -326,10 +326,10 @@ public function postProcess()
326
326
} else {
327
327
$ this ->errors [] = $ this ->l ('Invalid refund state. ' );
328
328
}
329
- if ($ voucher_expiry_date = Tools::getValue ('voucher_expiry_date ' )) {
330
- if (!Validate:: isDate ( $ voucher_expiry_date )) {
331
- $ this -> errors [] = $ this -> l ( ' Invalid voucher expiry date. ' );
332
- }
329
+ if (! $ voucher_expiry_date = Tools::getValue ('voucher_expiry_date ' )) {
330
+ $ this -> errors [] = $ this -> l ( ' Voucher expiry date is required. ' );
331
+ } elseif (!Validate:: isDate ( $ voucher_expiry_date )) {
332
+ $ this -> errors [] = $ this -> l ( ' Invalid voucher expiry date. ' );
333
333
}
334
334
} else {
335
335
$ this ->errors [] = $ this ->l ('Invalid refund information found. ' );
Original file line number Diff line number Diff line change @@ -23,6 +23,21 @@ $(document).ready(function() {
23
23
manageRefundOptions ( ) ;
24
24
}
25
25
26
+ $ ( '#order_return_form' ) . on ( 'submit' , function ( ) {
27
+ if ( $ ( "#id_refund_state option:selected" ) . attr ( 'refunded' ) == 1 ) {
28
+ if ( $ ( '#generateDiscount:checked' ) . length ) {
29
+ if ( $ ( '#voucher_expiry' ) . val ( ) == '' ) {
30
+ $ ( '#voucher_expiry' ) . parent ( ) . addClass ( 'has-error' ) ;
31
+ return false ;
32
+ }
33
+ }
34
+ }
35
+ } ) ;
36
+
37
+ $ ( '#voucher_expiry' ) . on ( 'focus' , function ( ) {
38
+ $ ( '#voucher_expiry' ) . parent ( ) . removeClass ( 'has-error' ) ;
39
+ } ) ;
40
+
26
41
// initialize tootip for room price
27
42
if ( $ ( '#rooms_refund_info .price_info' ) . length ) {
28
43
$ ( '#rooms_refund_info .price_info' ) . each ( function ( i , element ) {
Original file line number Diff line number Diff line change 372
372
<div class =" generate_discount_fields" style =" display :none ;" >
373
373
<div class =" form-group" >
374
374
<div class =" col-sm-3" >
375
- <label for =" voucher_expiry" class =" control-label" >
375
+ <label for =" voucher_expiry" class =" control-label required " >
376
376
<span title =" " data-toggle =" tooltip" class =" label-tooltip" data-original-title =" { l s= ' Please select the date until which the voucher can be used.' mod =' hotelreservationsystem' } " >{ l s= ' Voucher expiry date' mod =' hotelreservationsystem' } </span > :
377
377
</label >
378
378
</div >
You can’t perform that action at this time.
0 commit comments