update query data for origami
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
if (@booking)
|
||||
json.id @booking.id
|
||||
json.id @booking.booking_id
|
||||
json.status @booking.booking_status
|
||||
json.checkin_at @booking.checkin_at
|
||||
json.checkin_by @booking.checkin_by
|
||||
@@ -12,7 +12,8 @@ if (@booking)
|
||||
end
|
||||
@total_amount = 0.00
|
||||
@total_tax = 0.00
|
||||
|
||||
|
||||
@booking_orders = BookingOrder.where("booking_id = #{@booking.booking_id}").all;
|
||||
if @booking.booking_orders
|
||||
order_items = []
|
||||
@booking.booking_orders.each do |bo|
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<%= simple_form_for(@crm_customer) do |f| %>
|
||||
|
||||
<%= simple_form_for([:crm,@crm_customer]) do |f| %>
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
@@ -7,7 +8,7 @@
|
||||
<%= f.input :contact_no %>
|
||||
<%= f.input :email %>
|
||||
<%= f.input :date_of_birth %>
|
||||
<%= f.association :membership %>
|
||||
|
||||
<%= f.input :membership_type %>
|
||||
<%= f.input :membership_authentication_code %>
|
||||
</div>
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
|
||||
<%= render 'form', crm_customer: @crm_customer %>
|
||||
|
||||
<%= link_to 'Show', @crm_customer %> |
|
||||
<%= link_to 'Show', @crm_customers_path %> |
|
||||
<%= link_to 'Back', crm_customers_path %>
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
<td><%= crm_customer.contact_no %></td>
|
||||
<td><%= crm_customer.email %></td>
|
||||
<td><%= crm_customer.date_of_birth %></td>
|
||||
<td><%= crm_customer.membership %></td>
|
||||
<td><%= crm_customer.membership_id %></td>
|
||||
<td><%= crm_customer.membership_type %></td>
|
||||
<td><%= crm_customer.membership_authentication_code %></td>
|
||||
<td><%= link_to 'Show', crm_customer %></td>
|
||||
<td><%= link_to 'Show', crm_customer_path(crm_customer) %></td>
|
||||
<td><%= link_to 'Edit', edit_crm_customer_path(crm_customer) %></td>
|
||||
<td><%= link_to 'Destroy', crm_customer, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
<td><%= link_to 'Destroy', crm_customer_path(crm_customer), method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<% @i = 0 %>
|
||||
<% @booking.each do |booking| %>
|
||||
<% if booking.booking_status == "new" %>
|
||||
<% if booking.booking_status == "assign" %>
|
||||
<div class="card">
|
||||
<div class="card-block booking_click" data-ref="<%= api_booking_path booking.id%>" id="card-block booking_block" style="width:100%;">
|
||||
<h4 class="card-title">
|
||||
@@ -40,7 +40,7 @@ $(function(){
|
||||
$(".summary-items tbody tr").remove();
|
||||
$("#cancel").removeAttr("disabled");
|
||||
$("#assign").removeAttr("disabled");
|
||||
var url = $(this).attr('data-ref');
|
||||
var url = $(this).attr('data-ref');alert(url);
|
||||
show_details(url);
|
||||
});
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</small>
|
||||
</p>
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.id %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
</div>
|
||||
<!-- <div class="card-footer">
|
||||
<button id=<%= 'assigned_queue_' + qid.id.to_s %> class="btn btn-primary btn-lg btn-block order-complete">COMPLETE</button>
|
||||
@@ -112,10 +112,10 @@
|
||||
</p>
|
||||
<!-- Hidden Fields for Items -->
|
||||
<p class="hidden order-customer"><%= qid.customer_name %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.id %></p>
|
||||
<p class="hidden assigned-order-item"><%= qid.assigned_order_item_id %></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id=<%= 'assigned_queue_' + qid.id.to_s %> class="btn btn-primary btn-lg btn-block order-complete">COMPLETE</button>
|
||||
<button id=<%= 'assigned_queue_' + qid.assigned_order_item_id.to_s %> class="btn btn-primary btn-lg btn-block order-complete">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
<%
|
||||
@@ -193,7 +193,7 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- OQS Buttons -->
|
||||
<button type="button" title="Print Order Item" id="print_order_item" class="btn btn-primary btn-lg btn-block">Print</a>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" id="print_order_item" disabled>Print <br/>Order<br/>Summary</button>
|
||||
<button type="button" class="btn btn-primary btn-lg btn-block" id="print_order_summary">Print <br/>Order<br/>Summary</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -31,15 +31,13 @@
|
||||
<span id="table-name-<%=booking_order.sale_id%>" class="table-name"><%=booking_order.table_name%></span></h4>
|
||||
<span>Receipt No : <%=booking_order.receipt_no%></span><br/>
|
||||
<span>Order Status : <%=booking_order.order_status %></span>
|
||||
<span>sale_<%=booking_order.sale_id %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card" id="table-order-<%=booking_order.booking_id%>" onclick="callOrderDetails('order_<%=booking_order.booking_id%>')">
|
||||
<div class="card" id="table-order-<%=booking_order.id%>" onclick="callOrderDetails('order_<%=booking_order.id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><span id="table-name-<%=booking_order.booking_id%>" class="table-name"><%=booking_order.table_name%></span></h4>
|
||||
<h4 class="card-title"><span id="table-name-<%=booking_order.id%>" class="table-name"><%=booking_order.table_name%></span></h4>
|
||||
<span>Order Status : <%=booking_order.order_status %></span>
|
||||
<span>sale_<%=booking_order.sale_id %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -55,18 +53,18 @@
|
||||
<% if @booking_rooms %>
|
||||
<% @booking_rooms.each do |booking_room| %>
|
||||
<% if !booking_room.order_status = 'new'%>
|
||||
<div style="background-color: red;color: white;" class="card" id="table-order-<%=booking_room.booking_id%>" onclick="callOrderDetails('sale_<%=booking_room.booking_id%>')">
|
||||
<div style="background-color: red;color: white;" class="card" id="table-order-<%=booking_room.id%>" onclick="callOrderDetails('sale_<%=booking_room.id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">
|
||||
<span id="table-name-<%=booking_room.booking_id%>" class="table-name"><%=booking_room.room_name%></span></h4>
|
||||
<span id="table-name-<%=booking_room.id%>" class="table-name"><%=booking_room.room_name%></span></h4>
|
||||
<span>Receipt No : <%=booking_room.receipt_no%></span><br/>
|
||||
<span>Order Status : <%=booking_room.order_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card" id="table-order-<%=booking_room.booking_id%>" onclick="callOrderDetails('order_<%=booking_room.booking_id%>')">
|
||||
<div class="card" id="table-order-<%=booking_room.id%>" onclick="callOrderDetails('order_<%=booking_room.id%>')">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><span id="table-name-<%=booking_room.booking_id%>" class="table-name"><%=booking_room.room_name%>ddd</span></h4> \
|
||||
<h4 class="card-title"><span id="table-name-<%=booking_room.id%>" class="table-name"><%=booking_room.room_name%>ddd</span></h4> \
|
||||
<span>Order Status : <%=booking_room.order_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -205,26 +203,21 @@
|
||||
var table_or_order_id = 0
|
||||
|
||||
function callOrderDetails(sale_order_id){
|
||||
|
||||
var order_id = 0
|
||||
var data_val = ""
|
||||
sale_order = sale_order_id.split("_")[0]
|
||||
if (sale_order == 'sale') {
|
||||
order_id = sale_order_id.split("_")[1]
|
||||
url = "origami/"+sale_order_id.split("_")[1]
|
||||
|
||||
data_val = { sale_id: sale_order_id.split("_")[1]}
|
||||
|
||||
}else{
|
||||
order_id = sale_order_id.split("_")[1]
|
||||
url = "origami/"+order_id
|
||||
|
||||
data_val = { order_id: sale_order_id.split("_")[1]}
|
||||
|
||||
|
||||
}
|
||||
table_or_order_id = order_id
|
||||
|
||||
var tbody = ""
|
||||
$("#append-table").html("")
|
||||
if (old_order_id != order_id){
|
||||
@@ -237,10 +230,8 @@ function callOrderDetails(sale_order_id){
|
||||
$("#sub-total").html("")
|
||||
$.ajax({type: "GET",
|
||||
url: url,
|
||||
|
||||
data: data_val,
|
||||
success:function(result){
|
||||
|
||||
var sub_total = 0
|
||||
var discount_amount = 0
|
||||
var receipt_no = ""
|
||||
|
||||
Reference in New Issue
Block a user