diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index d1ed02b1..a38912b8 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -515,20 +515,20 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas success: function(data) { console.log(data); if (data.status) { - // if(status != "completed"){ - // swal({ - // title: 'Information', - // text: "Order has been "+data.message, - // type: 'success', - // html: true, - // closeOnConfirm: false, - // closeOnCancel: false, - // allowOutsideClick: false - // }, function () { - // window.location.href = '/origami/order_reservation'; - // }); - // }else{ - // if((data.filepath != undefined) && (data.filepath != "")){ + if(status != "completed"){ + swal({ + title: 'Information', + text: "Order has been "+data.message, + type: 'success', + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false + }, function () { + window.location.href = '/origami/order_reservation'; + }); + }else{ + if((data.filepath != undefined) && (data.filepath != "")){ //PDF lightbox data var pdfPath = "/en/pdfjs/minimal?file=" + data.filepath.substring(6); $("#sale_id").val(data.sale_id); @@ -539,20 +539,20 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas $("#receiptpdfModal").modal({show : true, backdrop : false, keyboard : false}); $("#receiptpdfModalLabel").text("Receipt: " + data.receipt_no); - // }else{ - // swal({ - // title: 'Information', - // text: "Order has been "+data.message, - // type: 'success', - // html: true, - // closeOnConfirm: false, - // closeOnCancel: false, - // allowOutsideClick: false - // }, function () { - // window.location.href = '/origami/order_reservation'; - // }); - // } - // } + }else{ + swal({ + title: 'Information', + text: "Order has been "+data.message, + type: 'success', + html: true, + closeOnConfirm: false, + closeOnCancel: false, + allowOutsideClick: false + }, function () { + window.location.href = '/origami/order_reservation'; + }); + } + } }else{ swal({ title: 'Oops',