check payment and ability for split bill
This commit is contained in:
@@ -93,6 +93,11 @@ class Ability
|
|||||||
can :index, :home
|
can :index, :home
|
||||||
can :show, :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"
|
elsif user.role == "cashier"
|
||||||
|
|
||||||
# can :overall_void, :void
|
# can :overall_void, :void
|
||||||
@@ -191,6 +196,11 @@ class Ability
|
|||||||
|
|
||||||
can :index, :home
|
can :index, :home
|
||||||
can :show, :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"
|
elsif user.role == "waiter"
|
||||||
can :index, :home
|
can :index, :home
|
||||||
can :show, :home
|
can :show, :home
|
||||||
|
|||||||
@@ -914,14 +914,15 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
|
|
||||||
function customer_display_view(data,status) {
|
function customer_display_view(data,status) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: '../../../customer_view',
|
url: '../../../customer_view',
|
||||||
data: {"data":data,"status":status},
|
data: {"data":data,"status":status},
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
success:function(result){
|
success:function(result){
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function calculate_member_discount(sale_id) {
|
function calculate_member_discount(sale_id) {
|
||||||
var sub_total = $('#sub-total').text();
|
var sub_total = $('#sub-total').text();
|
||||||
var member_id = $('#membership_id').text();
|
var member_id = $('#membership_id').text();
|
||||||
@@ -969,12 +970,12 @@ var customer_name = "<%= @customer.name %>";
|
|||||||
data: params,
|
data: params,
|
||||||
success:function(result){
|
success:function(result){
|
||||||
console.log(result);
|
console.log(result);
|
||||||
customer_display_view(null,"reload");
|
if (cashier_type=="cashier") {
|
||||||
// if (cashier_type=="cashier") {
|
window.location.href = '/origami';
|
||||||
// window.location.href = '/origami';
|
}else{
|
||||||
// }else{
|
window.location.href = '/origami/quick_service';
|
||||||
// window.location.href = '/origami/quick_service';
|
customer_display_view(null,"reload");
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
|
|||||||
Reference in New Issue
Block a user