check and fixed SQA feedback
This commit is contained in:
@@ -467,8 +467,16 @@
|
||||
{
|
||||
var id = $("#table_id").val();
|
||||
var type = $("#type").val();
|
||||
var booking_id = "";
|
||||
<% if !@booking_order.nil? %>
|
||||
booking_id = "<%= @booking_order.booking_id %>";
|
||||
<% end %>
|
||||
if (cashier_type == "quick_service") {
|
||||
if(booking_id!= "" && page == "pending"){
|
||||
window.location.href = '/origami/'+cashier_type+'/pending_order/'+booking_id;
|
||||
}else{
|
||||
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/customers/payment/';
|
||||
}
|
||||
}else{
|
||||
if(page == "payment"){
|
||||
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/customers/payment/';
|
||||
@@ -496,7 +504,10 @@
|
||||
if (cashier_type == "quick_service") {
|
||||
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||
}else{
|
||||
if(page == "payment"){
|
||||
if(page == "pending"){
|
||||
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/pending/';
|
||||
}
|
||||
else if(page == "payment"){
|
||||
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment/';
|
||||
}else{
|
||||
if (type=="Table") {
|
||||
|
||||
@@ -425,10 +425,7 @@
|
||||
<%= t("views.btn.back") %>
|
||||
</button>
|
||||
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.add") %> <%= t("views.right_panel.detail.order") %></button>
|
||||
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" || current_login_employee.role == "supervisor" || current_login_employee.role == "cashier" || current_login_employee.role == "waiter" %>
|
||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||
<% end %>
|
||||
<% if current_login_employee.role != "waiter" %>
|
||||
<% if @dining.status != "available" %>
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
|
||||
@@ -455,10 +452,10 @@
|
||||
<% if current_login_employee.role != "waiter" %>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" data-toggle="modal" data-target="#voidModal" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> > Void</button>
|
||||
|
||||
<% end %>
|
||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||
<% end %>
|
||||
|
||||
<% if !@split_bill.nil? %>
|
||||
<% if @split_bill == '1' %>
|
||||
<button type="button" id="split_bills" class="btn btn-block bg-blue waves-effect">Split Bill</button>
|
||||
@@ -515,7 +512,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -44,11 +44,15 @@
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;" >
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% if room.get_booking.nil? %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<% else %>
|
||||
<div class="card rooms blue text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
|
||||
@@ -59,18 +59,22 @@
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;" >
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<% if room.get_booking.nil? %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<% else %>
|
||||
<div class="card rooms blue text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<% end %>
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -708,7 +708,7 @@ var customer_name = "<%= @customer.name %>";
|
||||
var sale_id = $('#dining').text();
|
||||
}
|
||||
//var table_id = $('.tables').attr("data-id");
|
||||
window.location.href = '/origami/' + sale_id +"/"+ cashier_type + "/surveys"
|
||||
window.location.href = '/origami/' + sale_id +"/"+ cashier_type + "/surveys";
|
||||
});
|
||||
|
||||
// bind customer to order or sale
|
||||
@@ -720,7 +720,7 @@ var customer_name = "<%= @customer.name %>";
|
||||
var sale_id = $('#save_order_id').attr('data-order');
|
||||
}
|
||||
var table_id = $('.tables').attr("data-id");
|
||||
window.location.href = '/origami/' + sale_id + "/"+cashier_type+"/customers"
|
||||
window.location.href = '/origami/' + sale_id + "/"+cashier_type+"/customers/payment";
|
||||
});
|
||||
|
||||
// Add Other Charges
|
||||
|
||||
@@ -153,6 +153,14 @@
|
||||
<% if current_user.role != "waiter" || @status != "sale"%>
|
||||
<button type="button" id="addorder" class="btn bg-blue btn-block">Add Order</button>
|
||||
<%end%>
|
||||
<!-- <% if @status != "order"%>
|
||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect"><%= t("views.right_panel.detail.survey") %></button>
|
||||
<% end %>
|
||||
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" >Customer</button>
|
||||
<% if @status != "order"%>
|
||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||
<% end %> -->
|
||||
<% if current_user.role != "waiter" && @status != "order"%>
|
||||
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
||||
<%end%>
|
||||
@@ -163,6 +171,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var cashier_type = "quick_service";
|
||||
$(document).ready(function(){
|
||||
$(".sales").on('click',function(){
|
||||
var sale_id = $(this).attr("data-id");
|
||||
@@ -203,5 +212,61 @@ $(document).ready(function(){
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// bind survey to order or sale
|
||||
$("#survey").on('click', function () {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/' + sale_id +"/"+ cashier_type + "/surveys";
|
||||
});
|
||||
|
||||
// bind customer to order or sale
|
||||
$("#customer").on('click', function () {
|
||||
var sale = $('#sale_id').val();
|
||||
|
||||
if (sale.includes("SAL")) {
|
||||
var sale_id = sale;
|
||||
} else {
|
||||
var sale_id = $('#save_order_id').val();
|
||||
}
|
||||
window.location.href = '/origami/' + sale_id + "/"+cashier_type+"/customers/pending";
|
||||
});
|
||||
|
||||
// Add Other Charges
|
||||
$('#other-charges').click(function () {
|
||||
var sale = $('#sale_id').val();
|
||||
if (sale != "") {
|
||||
var sale_id = sale
|
||||
} else {
|
||||
var sale_id = $('#save_order_id').val();
|
||||
}
|
||||
if (sale_id != "") {
|
||||
window.location.href = '/origami/' + sale_id +"/"+cashier_type+ '/other_charges';
|
||||
}
|
||||
else {
|
||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||
}
|
||||
return false;
|
||||
});
|
||||
// Discount for Payment
|
||||
$('#discount').click(function () {
|
||||
if ($(this).attr('active')=== "true") {
|
||||
var sale = $('#sale_id').val();
|
||||
if (sale != "") {
|
||||
var sale_id = sale
|
||||
} else {
|
||||
var sale_id = $('#save_order_id').val();
|
||||
}
|
||||
|
||||
if (sale_id != "") {
|
||||
window.location.href = '/origami/' + sale_id + "/"+cashier_type+'/discount';
|
||||
}
|
||||
else {
|
||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||
}
|
||||
}else{
|
||||
swal("Oops","You are not authorized for Discount","warning")
|
||||
}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -392,10 +392,7 @@
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i> Back</button>
|
||||
<button type="button" id="add_order" class="btn btn-block btn- bg-blue waves-effect">Add Order</button>
|
||||
<% if current_login_employee.role == "administrator" || current_login_employee.role == "manager" || current_login_employee.role == "supervisor" || current_login_employee.role == "cashier" || current_login_employee.role == "waiter" %>
|
||||
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect">Survey</button>
|
||||
<% end %>
|
||||
<% if current_login_employee.role != "waiter" %>
|
||||
<% if @room.bookings.length >= 1 %>
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<!-- <button type="button" class="btn bg-blue btn-block" >Add Order</button> -->
|
||||
@@ -419,14 +416,14 @@
|
||||
<!-- <button type="button" class="btn bg-blue btn-block" disabled>Add Order</button> -->
|
||||
<button type="button" id="customer" class="btn bg-blue btn-block" >Customer</button>
|
||||
<% if current_login_employee.role != "waiter" %>
|
||||
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" <%= (can? :overall_void, :void)? ' ': 'disabled=' %> active="true"> Void</button>
|
||||
<% end %>
|
||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn bg-blue btn-block" >Charges</button>
|
||||
|
||||
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||
<% end %>
|
||||
<% if !@split_bill.nil? %>
|
||||
<% if @split_bill == '1' %>
|
||||
<button type="button" id="split_bills" class="btn btn-block bg-blue waves-effect">Split Bill</button>
|
||||
@@ -481,7 +478,6 @@
|
||||
<% end %>
|
||||
<!-- <button type="button" id="re-print" class="btn bg-blue btn-block" >Re.Print</button> -->
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -582,7 +578,7 @@ $(document).ready(function(){
|
||||
var sale_id = "<%= @room.id %>";
|
||||
}
|
||||
//var table_id = $('.tables').attr("data-id");
|
||||
window.location.href = '/origami/' + sale_id + "/surveys"
|
||||
window.location.href = '/origami/' + sale_id +"/"+cashier_type+ "/surveys"
|
||||
});
|
||||
// bind customer to order or sale
|
||||
$("#customer").on('click', function(){
|
||||
@@ -617,7 +613,7 @@ $(document).ready(function(){
|
||||
}
|
||||
|
||||
if (sale_id != "") {
|
||||
window.location.href = '/origami/' + sale_id + '/discount'
|
||||
window.location.href = '/origami/' + sale_id +"/"+cashier_type+ '/discount'
|
||||
}
|
||||
else {
|
||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||
@@ -639,7 +635,7 @@ $(document).ready(function(){
|
||||
}
|
||||
|
||||
if(sale_id!=""){
|
||||
window.location.href = '/origami/' + sale_id + '/other_charges'
|
||||
window.location.href = '/origami/' + sale_id +"/"+cashier_type+ '/other_charges'
|
||||
}
|
||||
else {
|
||||
swal ( "Oops" , "Please select an table!" , "warning" );
|
||||
|
||||
Reference in New Issue
Block a user