route conflit fix

This commit is contained in:
Zin Lin Phyo
2017-06-26 18:02:08 +06:30
110 changed files with 2477 additions and 441 deletions

View File

@@ -38,12 +38,21 @@
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<% @tables.each do |table| %>
<% if table.status == 'occupied' %>
<div class="card tables red text-white" data-id="<%= table.id %>">
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% if table.get_booking.nil? %>
<div class="card tables red text-white" data-id="<%= table.id %>">
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% else %>
<div class="card tables blue text-white" data-id="<%= table.id %>">
<div class="card-block">
Zone <%= table.zone_id %> <br>
Table <%= table.name %> ( <%= table.seater %> Seat )
</div>
</div>
<% end %>
<% else %>
<div class="card tables green text-white" data-id="<%= table.id %>">
<div class="card-block">
@@ -121,7 +130,7 @@ $(function() {
var timer;
function start() {
timer = setTimeout(function() { console.log("refresh");window.location.reload()}, 30000); //10000
timer = setTimeout(function() { console.log("refresh");window.location.reload()}, 10000); //10000
};
function stop() {

View File

@@ -38,16 +38,22 @@
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
<% @tables.each do |table| %>
<% if table.status == 'occupied' %>
<div class="card tables red text-white" data-id="<%= table.id %>">
<div class="card-block">
<%= table.name %>
<% if table.get_booking.nil? %>
<span style="font-size:12px;float:right;line-height:inherit;"> billed</span>
<% else %>
<span style="font-size:12px;float:right;line-height:inherit;"> new</span>
<% end %>
</div>
</div>
<% if table.get_booking.nil? %>
<div class="card tables red text-white" data-id="<%= table.id %>">
<div class="card-block">
<%= table.name %>
<span style="font-size:12px;float:right;line-height:inherit;"> billed</span>
<div style="font-size:12px;"></div>
</div>
</div>
<% else %>
<div class="card tables blue text-white" data-id="<%= table.id %>">
<div class="card-block">
<%= table.name %>
<span style="font-size:12px;float:right;line-height:inherit;"> new</span>
</div>
</div>
<% end %>
<% else %>
<div class="card tables green text-white" data-id="<%= table.id %>">
<div class="card-block">
@@ -108,9 +114,9 @@
<div class="card" >
<div class="card-header">
<% if @status_order == 'order' && @status_sale != 'sale' %>
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong></div>
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %></div>
<% elsif @status_sale == 'sale' %>
<div><strong id="order-title">INVOICE DETAILS </strong></div>
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %></div>
<% end %>
</div>
<div class="card-block">
@@ -126,13 +132,14 @@
<p>Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
</div>
</div>
<div class="card-title row">
<div class="col-lg-6 col-md-6 col-sm-6">
<p class="hidden customer-id"><%= @customer.customer_id %></p>
<p>Customer : <%= @customer.name %></p>
<%if @customer %>
<p class="hidden customer-id"><%= @customer.customer_id rescue "" %></p>
<p>Customer : <%= @customer.name rescue "" %></p>
<%end%>
</div>
</div>
<div class="card-text">
<table class="table table-striped" id="order-items-table">
@@ -174,7 +181,7 @@
count = 0
@order_items.each do |order_item |
count += 1
sub_total = sub_total + order_item.price
sub_total = sub_total + (order_item.price * order_item.qty)
unless order_item.price == 0 %>
<tr>
@@ -241,18 +248,18 @@
%>
</table>
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice </button>
<%
end
@sale_array.each do |sale|
<% end %>
<br><br>
Pending Payment
<% @sale_array.each do |sale|
if @sale_array.size > 1
unless sale.receipt_no == @sale_array[0].receipt_no
%>
<br><br>
Pending Payment
<table class="table table-striped">
<tr>
<td>Receipt No - <%= sale.receipt_no %></td>
<td><button class='btn btn-sm btn-primary '>Show Detail </button></td>
<td><button class='btn btn-sm btn-primary invoicedetails' id="<%= sale.sale_id %>">Show Detail </button></td>
</tr>
</table>
<%
@@ -292,12 +299,17 @@
<% end %>
<!-- Cashier Buttons -->
<button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button>
<!-- <button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button> -->
<% end %>
</div>
</div>
<script>
$(document).ready(function(){
$('.invoicedetails').on('click',function(){
var dining_id = "<%= @dining.id %>";
var sale_id = this.id;
window.location.href = '/origami/table/'+ dining_id + "/table_invoice/"+sale_id;
})
$(".tables").on('click', function(){
var customer_id=$(".customer-id").text();
@@ -348,6 +360,13 @@ $(document).ready(function(){
});
$('#re-print').click(function() {
var sale_id = $('#sale_id').val();
window.location.href = '/origami/'+ sale_id + "/reprint"
return false;
});
// Discount for Payment
$('#discount').click(function() {
var sale = $('#sale_id').val();
@@ -473,4 +492,5 @@ $('#edit').on('click',function(){
})
</script>