add checkin checkout time in origami
This commit is contained in:
@@ -78,13 +78,13 @@ class DiningFacility < ApplicationRecord
|
|||||||
def get_checkout_booking
|
def get_checkout_booking
|
||||||
booking = self.get_current_checkout_booking
|
booking = self.get_current_checkout_booking
|
||||||
if booking
|
if booking
|
||||||
now = Time.now.utc
|
now = Time.now.utc.getlocal
|
||||||
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
|
||||||
if !booking.checkout_at.nil?
|
if !booking.checkout_at.nil?
|
||||||
checkout_at = booking.checkout_at.utc
|
checkout_at = booking.checkout_at.utc.getlocal
|
||||||
checkout_at_hr = (checkout_at.utc.strftime("%H").to_i).to_int
|
checkout_at_hr = (checkout_at.strftime("%H").to_i).to_int
|
||||||
checkout_at_min = (checkout_at.utc.strftime("%M").to_i).to_int
|
checkout_at_min = (checkout_at.strftime("%M").to_i).to_int
|
||||||
checkout_at_min -= min
|
checkout_at_min -= min
|
||||||
if (checkout_at_hr <= hr) && (checkout_at_min <= 15)
|
if (checkout_at_hr <= hr) && (checkout_at_min <= 15)
|
||||||
return booking
|
return booking
|
||||||
|
|||||||
@@ -132,7 +132,11 @@
|
|||||||
<div id="save_order_id" data-order="">
|
<div id="save_order_id" data-order="">
|
||||||
<% end %>
|
<% end %>
|
||||||
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
<strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? && %>
|
||||||
|
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% else %>
|
||||||
|
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% elsif @status_sale == 'sale' %>
|
<% elsif @status_sale == 'sale' %>
|
||||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @dining.name rescue "" %>
|
||||||
|
|||||||
@@ -132,12 +132,20 @@
|
|||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<% if @status_order == 'order' %>
|
<% if @status_order == 'order' %>
|
||||||
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @room.name rescue "" %>
|
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @room.name rescue "" %>
|
||||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? && %>
|
||||||
|
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% else %>
|
||||||
|
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% elsif @status_sale == 'sale' %>
|
<% elsif @status_sale == 'sale' %>
|
||||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @room.name rescue "" %>
|
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @room.name rescue "" %>
|
||||||
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
<% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? && %>
|
||||||
|
<span class="float-right"><%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% else %>
|
||||||
|
<span class="float-right">Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Reference in New Issue
Block a user