From d80a17d987832e2cf57618b9f48d798ebe9f90d6 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Mon, 14 May 2018 15:54:22 +0630 Subject: [PATCH] update payment detal for discount --- app/views/origami/payments/show.html.erb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 734264a1..ca5f6762 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -633,33 +633,33 @@ var customer_name = "<%= @customer.name %>"; $('#pay').click(function() { sub_total = $('#sub-total').text(); - if (payment_type == 'MPU' && $('.mpu').text() == 0 && sub_total != 0.0) { + if (parseInt(jQuery.inArray("MPU", payment_type)) != -1 && $('.mpu').text() == 0 && sub_total != 0.0) { swal("Oops","Please Pay with MPU Payment","warning"); - }else if(payment_type == "Redeem" && $('#ppamount').text()==0 && sub_total != 0.0){ + }else if(parseInt(jQuery.inArray("Redeem", payment_type)) != -1 && $('#ppamount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with Redeem Payment","warning"); - }else if(payment_type == "VISA" && $('#visacount').text()==0 && sub_total != 0.0){ + }else if(parseInt(jQuery.inArray("VISA", payment_type)) != -1 && $('#visacount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with Visa Payment","warning"); - }else if(payment_type == "JCB" && $('#jcbcount').text()==0 && sub_total != 0.0){ + }else if(parseInt(jQuery.inArray("JCB", payment_type)) != -1 && $('#jcbcount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with jcb Payment","warning"); } - else if(payment_type == "Master" && $('#mastercount').text()==0 && sub_total != 0.0){ + else if(parseInt(jQuery.inArray("Master", payment_type)) != -1 && $('#mastercount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with Master Payment","warning"); } else if(payment_type == "UNIONPAY" && $('#unionpaycount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with UNIONPAY Payment","warning"); } - else if(payment_type == "Alipay" && $('#alipaycount').text()==0 && sub_total != 0.0){ + else if(parseInt(jQuery.inArray("Alipay", payment_type)) != -1 && $('#alipaycount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with Alipay Payment","warning"); } - else if(payment_type == "JUNCTIONPAY" && $('#junctionpaycount').text()==0 && sub_total != 0.0){ + else if(parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 != -1 && $('#junctionpaycount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with JUNCTIONPAY Payment","warning"); } else if(payment_type == "Credit" && $('#credit').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with Credit Payment","warning"); - }else if(payment_type == "PAYMAL" && $('#paymalcount').text()==0 && sub_total != 0.0){ + }else if(parseInt(jQuery.inArray("PAYMAL", payment_type)) != -1 && $('#paymalcount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with Paymal Payment","warning"); - }else if(payment_type == "DINGA" && $('#dingacount').text()==0 && sub_total != 0.0){ + }else if(parseInt(jQuery.inArray("DINGA", payment_type)) != -1 && $('#dingacount').text()==0 && sub_total != 0.0){ swal("Oops","Please Pay with Dinga Payment","warning"); }else{