update origami for room
This commit is contained in:
@@ -69,16 +69,23 @@
|
||||
<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 %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<% if room.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 room.get_booking.nil? %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.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 rooms blue text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
@@ -114,7 +121,7 @@
|
||||
<div class="card-header">
|
||||
<% if @status == 'order' %>
|
||||
<div id="save_order_id" data-order="<%= @obj.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @room.name rescue "" %></div>
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
<% elsif @status == 'sale' %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @room.name rescue "" %></div>
|
||||
<% end %>
|
||||
|
||||
@@ -218,7 +225,7 @@
|
||||
</div>
|
||||
<br>
|
||||
<%
|
||||
if @status_sale == 'sale'
|
||||
if @status == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Pending New Order
|
||||
@@ -272,10 +279,10 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<% if @room.bookings.length >= 1 %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<% if @status == 'order' && @status != 'sale' %>
|
||||
<!-- <button type="button" class="btn btn-primary btn-block" >Add Order</button> -->
|
||||
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled >Discount</button>
|
||||
@@ -332,7 +339,7 @@ $(document).ready(function(){
|
||||
// })
|
||||
|
||||
$('.invoicedetails').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var dining_id = "<%= @room.id %>";
|
||||
var sale_id = this.id;
|
||||
window.location.href = '/origami/table/'+ dining_id + "/table_invoice/"+sale_id;
|
||||
})
|
||||
@@ -431,7 +438,7 @@ $("#first_bill").on('click', function(){
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var url = '/origami/sale/'+ sale_id + "/rounding_adj" ;
|
||||
alert(url)
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/origami/sale/'+ sale_id + "/rounding_adj",
|
||||
@@ -466,8 +473,8 @@ $('#back').on('click',function(){
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var dining_id = "<%= @room.id %>"
|
||||
var sale_id = "<%= @obj.sale_id rescue "" %>"
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -549,8 +556,8 @@ $('#add_invoice').on('click',function(){
|
||||
}
|
||||
|
||||
$('#edit').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var dining_id = "<%= @room.id %>"
|
||||
var sale_id = "<%= @obj.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user