diff --git a/app/views/origami/order_reservation/index.html.erb b/app/views/origami/order_reservation/index.html.erb
index 049c507d..052d29e8 100644
--- a/app/views/origami/order_reservation/index.html.erb
+++ b/app/views/origami/order_reservation/index.html.erb
@@ -72,7 +72,7 @@
<% i=1
@order.each do |order| %>
- <% if order.status == 'new' %>
+ <% if order.status == 'new' && !order.delivery.nil? %>
|
<%=i%>
@@ -95,14 +95,16 @@
|
- <% if order.delivery.delivery_type == 'service' %>
- DELIVERY
- <% elsif order.delivery.delivery_type == 'pick_up' %>
- PICK-UP
- <% elsif order.delivery.delivery_type == 'turbo' %>
- TURBO
- <% else %>
- DIRECT DELIVERY
+ <% if !order.delivery.nil? %>
+ <% if order.delivery.delivery_type == 'service' %>
+ DELIVERY
+ <% elsif order.delivery.delivery_type == 'pick_up' %>
+ PICK-UP
+ <% elsif order.delivery.delivery_type == 'turbo' %>
+ TURBO
+ <% else %>
+ DIRECT DELIVERY
+ <% end %>
<% end %>
|
@@ -124,7 +126,7 @@
<% i=1
@order.each do |order| %>
- <% if order.status == 'accepted' %>
+ <% if order.status == 'accepted' && !order.delivery.nil? %>
|
<%=i%>
@@ -147,14 +149,16 @@
|
- <% if order.delivery.delivery_type == 'service' %>
- DELIVERY
- <% elsif order.delivery.delivery_type == 'pick_up' %>
- PICK-UP
- <% elsif order.delivery.delivery_type == 'turbo' %>
- TURBO
- <% else %>
- DIRECT DELIVERY
+ <% if !order.delivery.nil? %>
+ <% if order.delivery.delivery_type == 'service' %>
+ DELIVERY
+ <% elsif order.delivery.delivery_type == 'pick_up' %>
+ PICK-UP
+ <% elsif order.delivery.delivery_type == 'turbo' %>
+ TURBO
+ <% else %>
+ DIRECT DELIVERY
+ <% end %>
<% end %>
|
@@ -175,7 +179,7 @@
<% i=1
@order.each do |order| %>
- <% if order.status == 'send_to_kitchen' %>
+ <% if order.status == 'send_to_kitchen' && !order.delivery.nil? %>
|
<%=i%>
@@ -198,14 +202,16 @@
|
- <% if order.delivery.delivery_type == 'service' %>
- DELIVERY
- <% elsif order.delivery.delivery_type == 'pick_up' %>
- PICK-UP
- <% elsif order.delivery.delivery_type == 'turbo' %>
- TURBO
- <% else %>
- DIRECT DELIVERY
+ <% if !order.delivery.nil? %>
+ <% if order.delivery.delivery_type == 'service' %>
+ DELIVERY
+ <% elsif order.delivery.delivery_type == 'pick_up' %>
+ PICK-UP
+ <% elsif order.delivery.delivery_type == 'turbo' %>
+ TURBO
+ <% else %>
+ DIRECT DELIVERY
+ <% end %>
<% end %>
|
@@ -226,7 +232,7 @@
<% i=1
@order.each do |order| %>
- <% if order.status == 'ready_to_delivery' %>
+ <% if order.status == 'ready_to_delivery' && !order.delivery.nil? %>
|
<%=i%>
@@ -249,14 +255,16 @@
|
- <% if order.delivery.delivery_type == 'service' %>
- DELIVERY
- <% elsif order.delivery.delivery_type == 'pick_up' %>
- PICK-UP
- <% elsif order.delivery.delivery_type == 'turbo' %>
- TURBO
- <% else %>
- DIRECT DELIVERY
+ <% if !order.delivery.nil? %>
+ <% if order.delivery.delivery_type == 'service' %>
+ DELIVERY
+ <% elsif order.delivery.delivery_type == 'pick_up' %>
+ PICK-UP
+ <% elsif order.delivery.delivery_type == 'turbo' %>
+ TURBO
+ <% else %>
+ DIRECT DELIVERY
+ <% end %>
<% end %>
|
@@ -277,7 +285,7 @@
<% i=1
@order.each do |order| %>
- <% if order.status == 'delivered' && (order.created_at.utc.getlocal.strftime("%Y-%m-%d") == DateTime.now.strftime("%Y-%m-%d")) %>
+ <% if order.status == 'delivered' && (order.created_at.utc.getlocal.strftime("%Y-%m-%d") == DateTime.now.strftime("%Y-%m-%d")) && !order.delivery.nil? %>
|
<%=i%>
@@ -300,14 +308,16 @@
|
- <% if order.delivery.delivery_type == 'service' %>
- DELIVERY
- <% elsif order.delivery.delivery_type == 'pick_up' %>
- PICK-UP
- <% elsif order.delivery.delivery_type == 'turbo' %>
- TURBO
- <% else %>
- DIRECT DELIVERY
+ <% if !order.delivery.nil? %>
+ <% if order.delivery.delivery_type == 'service' %>
+ DELIVERY
+ <% elsif order.delivery.delivery_type == 'pick_up' %>
+ PICK-UP
+ <% elsif order.delivery.delivery_type == 'turbo' %>
+ TURBO
+ <% else %>
+ DIRECT DELIVERY
+ <% end %>
<% end %>
|