Merge branch 'adminbsb_ui_changes' of bitbucket.org:code2lab/sxrestaurant

This commit is contained in:
Yan
2017-12-07 14:27:33 +06:30
4 changed files with 21 additions and 12 deletions

View File

@@ -67,7 +67,7 @@ class DiningFacility < ApplicationRecord
end end
def get_current_checkout_booking def get_current_checkout_booking
booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and sale_id is not null").limit(1) booking = Booking.where("dining_facility_id = #{self.id} and booking_status ='assign' and checkin_by is null").limit(1)
if booking.count > 0 then if booking.count > 0 then
return booking[0] return booking[0]
else else
@@ -81,14 +81,11 @@ class DiningFacility < ApplicationRecord
now = Time.now.utc now = Time.now.utc
hr = (now.strftime("%H").to_i).to_int hr = (now.strftime("%H").to_i).to_int
min = (now.strftime("%M").to_i).to_int min = (now.strftime("%M").to_i).to_int
checkout_at = booking.checkout_at.utc checkout_at = booking.checkout_at.utc
checkout_at_hr = (checkout_at.utc.strftime("%H").to_i).to_int
checkout_at = checkout_at - hr.hour checkout_at_min = (checkout_at.utc.strftime("%M").to_i).to_int
checkout_at = checkout_at - min.minutes checkout_at_min -= min
checkout_at = checkout_at.utc.strftime("%M").to_i if (checkout_at_hr <= hr) && (checkout_at_min <= 15)
if checkout_at <= 15
return booking return booking
end end
end end

View File

@@ -40,7 +40,11 @@
<% @tables.each do |table| %> <% @tables.each do |table| %>
<% if table.status == 'occupied' %> <% if table.status == 'occupied' %>
<% if table.get_booking.nil? %> <% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %>
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>"> <div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block"> <div class="card-block">
<%= table.name %> <%= table.name %>
<span class="float-right font-12 new_text_<%= table.id %>"> billed</span> <span class="float-right font-12 new_text_<%= table.id %>"> billed</span>

View File

@@ -40,14 +40,22 @@
<% @tables.each do |table| %> <% @tables.each do |table| %>
<% if table.status == 'occupied' %> <% if table.status == 'occupied' %>
<% if table.get_booking.nil? %> <% if table.get_booking.nil? %>
<% if table.get_checkout_booking.nil? %>
<div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>"> <div class="card tables red text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block"> <div class="card-block">
<%= table.name %> <%= table.name %>
<span class="pull-right font-12 new_text_<%= table.id %>"> billed</span> <span class="pull-right font-12 new_text_<%= table.id %>"> billed</span>
</div> </div>
</div> </div>
<% else %> <% else %>
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>"> <% if table.get_checkout_booking.nil? %>
<div class="card tables blue text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% else %>
<div class="card tables orange text-white table_<%= table.id %>" data-id="<%= table.id %>">
<% end %>
<div class="card-block"> <div class="card-block">
<%= table.name %> <%= table.name %>
<span class="pull-right font-12 new_text_<%= table.id %>"> new</span> <span class="pull-right font-12 new_text_<%= table.id %>"> new</span>

View File

@@ -1,5 +1,5 @@
<div class="page-header" style="width:125%;"> <div class="page-header" style="width:130%;">
<ol class="breadcrumb"> <ol class="breadcrumb">
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li> <li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li> <li class="breadcrumb-item active"><%= t("views.right_panel.detail.daily_sale_report") %></li>
@@ -19,7 +19,7 @@
<div class="row"> <div class="row">
<div class="col-md-12 col-lg-12"> <div class="col-md-12 col-lg-12">
<div class="card" style="width:125%;"> <div class="card" style="width:129%;">
<div class="body table-responsive"> <div class="body table-responsive">
<table class="table table-bordered"> <table class="table table-bordered">
<thead> <thead>