fix addorder UI
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
<div class="tab-content h-100">
|
||||
<div class="tab-content h-100 d-flex flex-column">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane h-100 <%= params[:active] == 'completed' ? 'active' : '' %>" id="complete" role="tabpanel">
|
||||
<div class="d-flex flex-column h-100">
|
||||
@@ -90,10 +90,9 @@
|
||||
<%= link_to foodcourt_app_order_by_booking_path(pending_id: pc.sale_id, active: 'completed'), class: 'item-card' do %>
|
||||
<div class="card <%= bg_color %> text-white">
|
||||
<div class="card-block">
|
||||
<%= pc.receipt_no %>
|
||||
<span class="float-right"><%= pc.created_at.strftime('%I:%M %p') %></span>
|
||||
<%= pc.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"> <%= pc.created_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||
<br>
|
||||
<span class="float-right"><%= pc.sale_status %></span>
|
||||
<span style="font-size:12px;float:right;line-height: 30px;"><%= pc.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -105,7 +104,7 @@
|
||||
<!-- Panel 1 - Pending Orders -->
|
||||
<div class="tab-pane <%= 'active' if params[:active].blank? %> h-100" id="pending_order" role="tabpanel">
|
||||
<div class="h-100 d-flex flex-column">
|
||||
<div id="foodcourt-order-slimscroll">
|
||||
<div id="foodcourt-order-slimscroll" class="h-100">
|
||||
<div class="card-columns p-l-10">
|
||||
<% @pending_sales.each do |sale| %>
|
||||
<% if @pending.present? %>
|
||||
@@ -123,7 +122,7 @@
|
||||
<%= sale.receipt_no %>
|
||||
<span class="float-right"><%= sale.created_at.strftime('%I:%M %p') %></span>
|
||||
<br>
|
||||
<span class = 'float-right'>Billed</span>
|
||||
<span class = 'float-right m-t-5'>Billed</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -144,7 +143,7 @@
|
||||
<%= order.booking_id %>
|
||||
<span class="float-right"><%= order.created_at.strftime('%I:%M-%p') %></span>
|
||||
<br>
|
||||
<span class="float-right">new</span>
|
||||
<span class="float-right m-t-5">new</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -188,7 +187,7 @@
|
||||
</div>
|
||||
|
||||
<% if !@booking.nil?%>
|
||||
<div class="col-md-4 col-lg-4 col-sm-12 h-100 d-flex flex-column m-l--15">
|
||||
<div class="col-md-5 col-lg-5 col-sm-12 h-100 d-flex flex-column m-l--15" style="padding-right: 15px">
|
||||
<span id="sale_id" style="display:none"><%= @booking.sale_id %></span>
|
||||
<div class="card h-100" style="margin-bottom: 10px !important">
|
||||
<div class="card-header" style="padding: 0.12rem 0.25rem">
|
||||
@@ -203,7 +202,7 @@
|
||||
<span class="font-14 float-left d-inline"><b>Booking</b> - <%=@booking.booking_id%></span>
|
||||
<span class="font-14 float-right d-inline"><b>Order No</b> - <%=@booking.order_id%></span>
|
||||
</div>
|
||||
<div class="card-text h-100" id="foodcourt-order-slimscroll" style="overflow-y: auto">
|
||||
<div class="card-text h-100" id="foodcourt-table-slimscroll" style="overflow-y: auto">
|
||||
<table class="table table-striped summary-items fixed-header">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -256,16 +255,13 @@
|
||||
<td style="padding:2px; text-align:" width="25%" class="item-attr"><strong id="sub_total"><%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i )%></strong></td>
|
||||
</tr>
|
||||
</table>
|
||||
<button type="button" class="btn btn-primary action-btn create col-md-12" id="done_order" style="margin: 10px 0 -2px 12px; width: 95%; font-size: 1.3rem">
|
||||
DONE
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @pending %>
|
||||
<div class="col-md-4 col-lg-4 col-sm-12 h-100 d-flex flex-column m-l--15">
|
||||
<div class="col-md-5 col-lg-5 col-sm-12 h-100 d-flex flex-column m-l--15" style="padding-right: 15px">
|
||||
<% if @status == 'sale' %>
|
||||
<span id="sale_id" style="display:none"><%= @pending.try(:sale_id) %></span>
|
||||
<% elsif @status == 'order' %>
|
||||
@@ -312,90 +308,97 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div id="order-detail-slimscroll" data-height="140">
|
||||
<div class="card-text" style="">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</th>
|
||||
<th class="item-attr">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @status == 'sale' %>
|
||||
<% sub_total = 0
|
||||
@pending.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
<% else %>
|
||||
<% sub_total = 0
|
||||
total = 0
|
||||
@pending.order_items.each do |order_item|
|
||||
total = order_item.qty * order_item.price
|
||||
sub_total = sub_total + total %>
|
||||
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= total %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<div class="card-block d-flex flex-column h-100">
|
||||
<div class="card-text h-100" id="foodcourt-table-slimscroll" style="overflow-y: auto">
|
||||
<table class="table table-striped fixed-header" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</th>
|
||||
<th class="item-attr">Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% if @status == 'sale' %>
|
||||
<% sub_total = 0
|
||||
@pending.sale_items.each do |sale_item|
|
||||
sub_total = sub_total + sale_item.price %>
|
||||
<tr>
|
||||
<td class='item-name'><%= sale_item.product_name %></td>
|
||||
<td class='item-attr'><%= sale_item.qty %></td>
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pending-order card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<% if @status == 'sale' %>
|
||||
<tr>
|
||||
<%if @pending.discount_type == 'member_discount'%>
|
||||
<td class="charges-name"><strong>Member Discount:</strong></td>
|
||||
<%else%>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<%end%>
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @sale.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @sale.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Rounding Adj:</strong></td>
|
||||
<td class="item-attr"><strong id="order-round-adj"><%= @sale.rounding_adjustment rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @sale.grand_total rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr class="rebate_amount"></tr>
|
||||
<% else%>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</table>
|
||||
<% else %>
|
||||
<% sub_total = 0
|
||||
total = 0
|
||||
@pending.order_items.each do |order_item|
|
||||
total = order_item.qty * order_item.price
|
||||
sub_total = sub_total + total %>
|
||||
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= total %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end%>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<table class="table" id="order-charges-table" border="0">
|
||||
<% if @status == 'sale' %>
|
||||
<tr>
|
||||
<%if @pending.discount_type == 'member_discount'%>
|
||||
<td class="charges-name"><strong>Member Discount:</strong></td>
|
||||
<%else%>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
<%end%>
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @sale.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @sale.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Rounding Adj:</strong></td>
|
||||
<td class="item-attr"><strong id="order-round-adj"><%= @sale.rounding_adjustment rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @sale.grand_total rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr class="rebate_amount"></tr>
|
||||
<% else%>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Sub Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-sub-total"><%= sub_total %></strong></td>
|
||||
</tr>
|
||||
<% end%>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<div class="col-md-2 col-lg-2 col-sm-12 h-100 d-flex flex-column" style="padding: 0 15px 0 5px;">
|
||||
<% if @pending || @booking %>
|
||||
<div class="col-md-1 col-lg-1 col-sm-12 h-100 d-flex flex-column" style="padding-right: 5px; margin-left: -5px;">
|
||||
<% else %>
|
||||
<div class="col-md-2 col-lg-2 col-sm-12 h-100 d-flex flex-column" style="padding: 0 15px 0 5px;">
|
||||
<% end %>
|
||||
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
|
||||
<i class="material-icons">reply</i>
|
||||
<%= t("views.btn.back") %>
|
||||
</button>
|
||||
<% if !@booking.nil?%>
|
||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void</a>
|
||||
<% if @booking && @booking.booking_status == 'assign' %>
|
||||
<button type="button" class="btn btn-primary btn-block waves-effect create" id="done_order">
|
||||
DONE
|
||||
</button>
|
||||
<% end %>
|
||||
<% if @booking && @booking.booking_status != 'void' %>
|
||||
<a class="btn btn-block bg-red waves-effect access_modal" data-toggle="modal" data-type="void"> Void </a>
|
||||
<% end %>
|
||||
|
||||
<!-- pending order button list -->
|
||||
|
||||
Reference in New Issue
Block a user