diff --git a/app/models/ability.rb b/app/models/ability.rb index d3082a1b..8877fc61 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -165,6 +165,7 @@ class Ability can :create, :discount can :remove_discount_items, :discount can :remove_all_discount, :discount + can :member_discount, :discount can :manage, Customer can :manage, DiningQueue diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 372efa83..91f25ad2 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -605,7 +605,7 @@ var sale_id = $('#sale_id').val(); type = $('.payment_method').val(); if(parseInt(jQuery.inArray("Credit", type)) == -1){ - if (parseInt(jQuery.inArray("MPU", type)) > 0 || parseInt(jQuery.inArray("VISA", type)) > 0 || parseInt(jQuery.inArray("JCB", type)) > 0 || parseInt(jQuery.inArray("Master", type)) > 0 || parseInt(jQuery.inArray("UNIONPAY", type)) > 0 || parseInt(jQuery.inArray("Redeem", type)) > 0) { + if (parseInt(jQuery.inArray("MPU", type)) != -1 || parseInt(jQuery.inArray("VISA", type)) != -1 || parseInt(jQuery.inArray("JCB", type)) != -1 || parseInt(jQuery.inArray("Master", type)) != -1 || parseInt(jQuery.inArray("UNIONPAY", type)) != -1 || parseInt(jQuery.inArray("Redeem", type)) != -1) { calculate_member_discount(sale_id,"Card"); }else{ diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index 00350f1b..af581777 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -608,7 +608,7 @@ $(".choose_payment").on('click', function () { var sale_id = $('#sale_id').val(); type = $('.payment_method').val(); if(parseInt(jQuery.inArray("Credit", type)) == -1){ - if (parseInt(jQuery.inArray("MPU", type)) > 0 || parseInt(jQuery.inArray("VISA", type)) > 0 || parseInt(jQuery.inArray("JCB", type)) > 0 || parseInt(jQuery.inArray("Master", type)) > 0 || parseInt(jQuery.inArray("UNIONPAY", type)) > 0 || parseInt(jQuery.inArray("Redeem", type)) > 0) { + if (parseInt(jQuery.inArray("MPU", type)) != -1 || parseInt(jQuery.inArray("VISA", type)) != -1 || parseInt(jQuery.inArray("JCB", type)) != -1 || parseInt(jQuery.inArray("Master", type)) != -1 || parseInt(jQuery.inArray("UNIONPAY", type)) != -1 || parseInt(jQuery.inArray("Redeem", type)) != -1) { calculate_member_discount(sale_id,"Card"); }else{