food court and Booking ID for order and receipt

This commit is contained in:
phyusin
2018-10-08 17:41:22 +06:30
parent 5535a5db81
commit 03fd7c79b8
44 changed files with 1155 additions and 378 deletions

View File

@@ -9,9 +9,11 @@
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#pending_order" role="tab">Pending</a>
</li>
<% if @cashier_type == "quick_service" %>
<li class="nav-item credit_items">
<a class="nav-link" data-toggle="tab" href="#credits" role="tab"><%= t :credits %></a>
</li>
<% end %>
</ul>
<div id="custom-slimscroll">
<div class="tab-content m-t-15">
@@ -47,37 +49,39 @@
</div>
<!-- Credit Sale Panel -->
<div class="tab-pane dining" id="credits" role="tabpanel">
<div class="card-block">
<div class="row m-t-10 m-l-10 clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<input type="text" name="filter" id="filter" onchange="getCreditData('quick_service');" style="height: 32px;" placeholder="Receipt No." class="form-control">
<% if @cashier_type == "quick_service" %>
<div class="tab-pane dining" id="credits" role="tabpanel">
<div class="card-block">
<div class="row m-t-10 m-l-10 clearfix">
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<input type="text" name="filter" id="filter" onchange="getCreditData('quick_service');" style="height: 32px;" placeholder="Receipt No." class="form-control">
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<select class="form-control" id="sel_customer" name="sel_customer" placeholder="Select Customer" onchange="getCreditData('quick_service');">
<option value="">-- Select Customer --</option>
<% if !@customers.empty? %>
<% @customers.each do |cus| %>
<option value="<%= cus[0] %>"><%= cus[1] %></option>
<% end %>
<% end %>
</select>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 col-xs-12">
<select class="form-control" id="sel_customer" name="sel_customer" placeholder="Select Customer" onchange="getCreditData('quick_service');">
<option value="">-- Select Customer --</option>
<% if !@customers.empty? %>
<% @customers.each do |cus| %>
<option value="<%= cus[0] %>"><%= cus[1] %></option>
<% end %>
<% end %>
</select>
<div class="row clearfix m-t-20 m-l-10">
<table class="table table-responsive tbl_credit_lists">
<thead>
<th><%= t :credit %> <%= t :sale %> <%= t("views.right_panel.detail.date") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t :customer %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t("views.right_panel.detail.credit_amount") %> </th>
</thead>
<tbody class="tbd_credit_lists"></tbody>
</table>
</div>
</div>
<div class="row clearfix m-t-20 m-l-10">
<table class="table table-responsive tbl_credit_lists">
<thead>
<th><%= t :credit %> <%= t :sale %> <%= t("views.right_panel.detail.date") %></th>
<th><%= t("views.right_panel.detail.receipt_no") %></th>
<th> <%= t :cashier %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t :customer %> <%= t("views.right_panel.detail.name") %></th>
<th> <%= t("views.right_panel.detail.credit_amount") %> </th>
</thead>
<tbody class="tbd_credit_lists"></tbody>
</table>
</div>
</div>
</div>
<% end %>
<!-- Credit Sale Panel -->
</div>
</div>
@@ -244,40 +248,40 @@
<!-- script data for credit lists -->
<script>
var cashier_type = "quick_service";
var cashier_type = "<%= @cashier_type %>";
$(document).ready(function(){
getCreditSales("","",cashier_type); //credit sales script data binding
$(".sales").on('click',function(){
var sale_id = $(this).attr("data-id");
window.location.href = '/origami/quick_service/pending_order/' + sale_id;
window.location.href = '/origami/'+cashier_type+'/pending_order/' + sale_id;
})
$(".completed").on('click',function(){
var sale_id = $(this).attr("data-id");
window.location.href = '/origami/quick_service/completed_sale/' + sale_id;
window.location.href = '/origami/'+cashier_type+'/completed_sale/' + sale_id;
})
$('#pay').on('click', function () {
var sale_id = $('#sale_id').val();
window.location.href = '/origami/sale/' + sale_id + "/quick_service/payment";
window.location.href = '/origami/sale/' + sale_id + "/"+cashier_type+"/payment";
});
$('#back').on('click', function () {
window.location.href = '/origami/quick_service';
window.location.href = '/origami/'+cashier_type;
});
$('#addorder').on('click', function () {
var table_id = "<%=@table_id%>";
var booking_id = "<%=@bookings.booking_id%>";
var sale_id = $("#sale_id").val();
if (table_id) {
window.location.href = '/origami/quick_service/modify_order/' + table_id+"/"+sale_id;
window.location.href = '/origami/'+cashier_type+'/modify_order/' + table_id+"/"+sale_id;
}else{
window.location.href = '/origami/quick_service/modify_order/'+ booking_id+"/" +sale_id;
window.location.href = '/origami/'+cashier_type+'/modify_order/'+ booking_id+"/" +sale_id;
}
});
// Bill Request
$('#request_bills').click(function () {
var order_id = $('#save_order_id').val();
var ajax_url = "../../../origami/" +order_id+ "/request_bills";
var ajax_url = "/origami/" +order_id+ "/request_bills";
console.log(ajax_url)
$.ajax({
type: "GET",
@@ -288,7 +292,7 @@ $(document).ready(function(){
swal("Information!", result.error_message);
}
else {
window.location.href = '/origami/sale/'+result.data+'/quick_service/payment';
window.location.href = '/origami/sale/'+result.data+'/'+cashier_type+'/payment';
}
}
});
@@ -352,7 +356,7 @@ $(document).ready(function(){
$('#close_cashier').on('click',function(e){
e.preventDefault(); // Prevent the href from redirecting directly
var linkURL = '/origami/shift/quick_service/close';
var linkURL = '/origami/shift/'+cashier_type+'/close';
occupied_count = $(this).data("count");
warnBeforeRedirect(linkURL,occupied_count);
});
@@ -385,11 +389,11 @@ $(document).ready(function(){
});
$('#cash_in').on('click',function(){
window.location.href = '/origami/quick_service/cash_ins';
window.location.href = '/origami/'+cashier_type+'/cash_ins';
})
$('#cash_out').on('click',function(){
window.location.href = '/origami/quick_service/cash_outs';
window.location.href = '/origami/'+cashier_type+'/cash_outs';
})
});
</script>