From 30bfb060df261f96a05e10edc53cefb759538f2f Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 13 Mar 2018 10:58:06 +0630 Subject: [PATCH] check payment and ability for split bill --- app/models/ability.rb | 10 ++++++++ app/views/origami/payments/show.html.erb | 29 ++++++++++++------------ 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/models/ability.rb b/app/models/ability.rb index 95c6005f..de43d71f 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -93,6 +93,11 @@ class Ability can :index, :home can :show, :home + #ability for split_bill + can :index, :split_bill + can :create, :split_bill + can :update_sale, :split_bill + elsif user.role == "cashier" # can :overall_void, :void @@ -191,6 +196,11 @@ class Ability can :index, :home can :show, :home + + #ability for split_bill + can :index, :split_bill + can :create, :split_bill + can :update_sale, :split_bill elsif user.role == "waiter" can :index, :home can :show, :home diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 26bd24af..ee006c3a 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -914,14 +914,15 @@ var customer_name = "<%= @customer.name %>"; function customer_display_view(data,status) { $.ajax({ - type: "POST", - url: '../../../customer_view', - data: {"data":data,"status":status}, - dataType: "json", - success:function(result){ - } - }); - } + type: "POST", + url: '../../../customer_view', + data: {"data":data,"status":status}, + dataType: "json", + success:function(result){ + } + }); + } + function calculate_member_discount(sale_id) { var sub_total = $('#sub-total').text(); var member_id = $('#membership_id').text(); @@ -969,12 +970,12 @@ var customer_name = "<%= @customer.name %>"; data: params, success:function(result){ console.log(result); - customer_display_view(null,"reload"); - // if (cashier_type=="cashier") { - // window.location.href = '/origami'; - // }else{ - // window.location.href = '/origami/quick_service'; - // } + if (cashier_type=="cashier") { + window.location.href = '/origami'; + }else{ + window.location.href = '/origami/quick_service'; + customer_display_view(null,"reload"); + } } }); // }