From 2837e4dd405c3d1dd4ddb47b84a4e29952065aff Mon Sep 17 00:00:00 2001 From: phyusin Date: Tue, 16 Jan 2018 13:22:58 +0630 Subject: [PATCH] check booking in movetable --- app/views/origami/movetable/move_dining.html.erb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/views/origami/movetable/move_dining.html.erb b/app/views/origami/movetable/move_dining.html.erb index 01be4bb3..131407f0 100755 --- a/app/views/origami/movetable/move_dining.html.erb +++ b/app/views/origami/movetable/move_dining.html.erb @@ -94,11 +94,13 @@ <% else %>
<% end %> - ORDER DETAILS | Table <%= @dining.name rescue "" %> - <% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? %> - <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %> - <% else %> - Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> + <% if !@booking.nil? %> + ORDER DETAILS | Table <%= @dining.name rescue "" %> + <% if @booking.checkout_by.nil? && !@booking.reserved_by.nil? %> + <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> - <%= @booking.checkout_at.utc.getlocal.strftime("%I:%M %p") %> + <% else %> + Checkin Time : <%= @booking.checkin_at.utc.getlocal.strftime("%I:%M %p") %> + <% end %> <% end %>
<% elsif @status_sale == 'sale' %> @@ -149,10 +151,10 @@
- <% if @status_sale == 'sale' %> + <% if @status_sale == 'sale' && !@sale_array.empty? %>   Customer : <%= @sale_array[0].customer.name rescue '' %> - <% elsif @status_order == 'order' + <% elsif @status_order == 'order' && !@customer.nil? %>   Customer : <%= @customer.name rescue "" %>