diff --git a/app/models/ability.rb b/app/models/ability.rb
index e6cdf9c3..560e0192 100755
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -96,6 +96,7 @@ class Ability
can :read, Order
can :update, Order
can :menage, Booking
+ can :manage, OrderQueueStation
can :read, Sale
can :update, Sale
can :get_customer, Customer
diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb
index 29903480..f162be5d 100755
--- a/app/views/origami/home/show.html.erb
+++ b/app/views/origami/home/show.html.erb
@@ -390,7 +390,7 @@
<% if @status_sale == 'sale' %>
Customer
Edit
- Discount
+ Discount
Charges
Commissions
@@ -419,7 +419,7 @@
Choose Payment
-
+
Cash
Credit
<% @payment_methods.each do |pay| %>
@@ -552,6 +552,8 @@
// Discount for Payment
$('#discount').click(function () {
+
+ if ($(this).attr('active')=== "true") {
var sale = $('#sale_id').val();
if (sale != "") {
var sale_id = sale
@@ -565,7 +567,9 @@
else {
swal ( "Oops" , "Please select an table!" , "warning" );
}
-
+ }else{
+ swal("Opps","You are not authorized for void","warning")
+ }
return false;
});
});
diff --git a/app/views/origami/others_payments/index.html.erb b/app/views/origami/others_payments/index.html.erb
index c0185182..4e07274a 100755
--- a/app/views/origami/others_payments/index.html.erb
+++ b/app/views/origami/others_payments/index.html.erb
@@ -34,11 +34,12 @@
}
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
- if(payment_type) {
- $(".others-payment").hide();
- $("."+payment_type).show();
- }
-
+ if(payment_type) {
+ $(".others-payment").hide();
+ $(payment_type).each(function(i){
+ $("."+payment_type[i]).show();
+ });
+ }
/* end check first bill or not*/
$('.others-payment').on('click',function(){
diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb
index dfff29cc..5e99509f 100755
--- a/app/views/origami/payments/show.html.erb
+++ b/app/views/origami/payments/show.html.erb
@@ -310,16 +310,20 @@
receipt_no = ($("#receipt_no").html()).trim();
}
- payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment")
- if(payment_type=="Cash"){
+ payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment")
+ // console.log(jQuery.inArray("Credit", payment_type))
+ // console.log(payment_type)
+ if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
+ $("#credit_payment").hide();
+ } else{
+ $("#credit_payment").show();
+ }
+
+ if(parseInt(jQuery.inArray("MPU", payment_type)) > 0 || parseInt(jQuery.inArray("VISA", payment_type)) > 0 || parseInt(jQuery.inArray("JCB", payment_type)) > 0 || parseInt(jQuery.inArray("Master", payment_type)) > 0 || parseInt(jQuery.inArray("UNIONPAY", payment_type)) > 0 || parseInt(jQuery.inArray("Redeem", payment_type)) > 0){
+ $("#card_payment").show();
+ } else{
$("#card_payment").hide();
- $("#credit_payment").hide();
- }else if(payment_type=="Credit"){
- $("#card_payment").hide();
- $("#others_payment").hide();
- }else if(payment_type=="MPU"||payment_type=="VISA"||payment_type=="JCB"||payment_type=="Master" || payment_type=="UNIONPAY"){
- $("#credit_payment").hide();
- }
+ }
/* end check first bill or not*/
var dining_id = "<%= @sale_data.bookings[0].dining_facility_id %>";
diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb
index 3b7a5144..e01b2829 100755
--- a/app/views/origami/rooms/show.html.erb
+++ b/app/views/origami/rooms/show.html.erb
@@ -393,7 +393,7 @@
Choose Payment
-
+
Cash
<% @payment_methods.each do |pay| %>