change order reservation -not finished

This commit is contained in:
phyusin
2018-05-09 11:28:01 +06:30
parent 313f1b2909
commit 4faee913f3
13 changed files with 211 additions and 35 deletions

View File

@@ -19,11 +19,14 @@
delivered_count = count_order.count
elsif count_order.status == "ready_to_delivery"
completed_count = count_order.count
elsif count_order.status == "delivered"
processed_count = count_order.count
end
end
end %>
end
if !@count_on_completed.nil?
processed_count = @count_on_completed.count
end
%>
<!-- end count function -->
<div class="row m-t--10">
<div class="col-lg-5 col-md-5 col-sm-5 div_order_margin">
@@ -237,7 +240,7 @@
<tbody>
<% i=1
@order.each do |order| %>
<% if order.status == 'delivered' %>
<% if order.status == 'delivered' && (order.created_at.utc.getlocal.strftime("%Y-%m-%d") == DateTime.now.strftime("%Y-%m-%d")) %>
<tr class="custom-tr fifth-<%=i%>" style="" data-id="<%=order.order_reservation_id%>" data-sr-no="<%= i %>">
<td width ="5%" class="align-left">
<%=i%>
@@ -443,6 +446,10 @@
</div>
</div>
</div>
<div id="notify_new_order"></div>
<div id="notify_order_send_to_kitchen"></div>
<div id="notify_order_ready_to_delivery"></div>
</div>
<p id="ref_no" class="hidden"></p>
@@ -508,6 +515,7 @@
<div class="modal-body">
<div class="form-group">
<textarea id="reject_reason" name="reject_reason" class="form-control" rows="3" cols="30"></textarea>
<span id="reject_reasonErr" style="color:red"></span>
</div>
</div>
<div class="modal-footer ">
@@ -557,7 +565,7 @@
</div>
</div>
<div class="modal fade " id="notify_new_order" tabindex="-1" role="dialog">
<!-- <div class="modal fade " id="notify_new_order" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -621,10 +629,5 @@
</div>
</div>
</div>
</div>
<!-- <div id="notify_new_order"></div>
<div id="notify_order_send_to_kitchen"></div>
<div id="notify_order_ready_to_delivery"></div> -->
</div> -->
</div>

View File

@@ -28,25 +28,104 @@
<div class="card">
<table class="table table-striped" border="0">
<thead>
<tr>
<th colspan="9"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
<th colspan="15"> <%= t("views.right_panel.detail.from_date") %> : <%= @from.utc.getlocal.strftime("%Y-%b-%d") rescue '-' %> - <%= t("views.right_panel.detail.to_date") %> : <%= @to.utc.getlocal.strftime("%Y-%b-%d") rescue '-'%></th>
</tr>
<% if @shift_from %>
<tr>
<% if @shift_data.employee %>
<% cashier_name = !@shift_data.nil? ? @shift_data.employee.name : '-' %>
<% end %>
<th colspan="9"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
<th colspan="15"><%= t("views.right_panel.detail.shift_name") %> = <%= @shift_from %> - <%= @shift_to %> ( <%= cashier_name %> )</th>
</tr>
<% end %>
<tr>
<th><%= t :customer %></th>
<th><%= t("views.right_panel.detail.type") %></th>
<th><%= t("views.right_panel.detail.requested_time") %></th>
<th><%= t("views.right_panel.detail.provider") %></th>
<th><%= t :payment_method %></th>
<th><%= t :payment %> <%= t("views.right_panel.detail.status")%></th>
<th><%= t("views.right_panel.detail.sub_total") %></th>
<th><%= t("views.right_panel.detail.discount_amount") %></th>
<th><%= t("views.right_panel.detail.delivery_fee") %></th>
<th><%= t("views.right_panel.detail.convenience_charge") %></th>
<th><%= t("views.right_panel.detail.delivery_tax") %></th>
<th><%= t("views.right_panel.detail.convenience_tax") %></th>
<th><%= t("views.right_panel.detail.commercial_tax") %></th>
<th><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.tax") %></th>
<th><%= t("views.right_panel.detail.grand_total") %></th>
</tr>
</thead>
<tbody>
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
precision = 0
end
#check delimiter
if @print_settings.delimiter
delimiter = ","
else
delimiter = ""
end %>
<%
total_amount = 0
discount_amount = 0
delivery_fee = 0
convenience_charge = 0
total_tax = 0
delivery_tax = 0
convenience_tax = 0
commercial_tax = 0
grand_total = 0
%>
<% unless @order_reservation_data.blank? %>
<% @order_reservation_data.each do |order_reservation| %>
<%
provider = ""
total_amount = order_reservation.total_amount
discount_amount = order_reservation.discount_amount
delivery_fee = order_reservation.delivery_fee
convenience_charge = order_reservation.convenience_charge
total_tax = order_reservation.total_tax
grand_total = order_reservation.grand_total
%>
<%
if order_reservation.provider == 'pick_up'
provider = "Pick-Up"
elsif order_reservation.provider == 'direct_delivery'
provider = "Direct Delivery"
else
provider = order_reservation.provider
end
# JSON.parse(order_reservation.taxes).each do |tax|
# delivery_tax = tax.delivery_tax
# convenience_tax = tax.convenience_tax
# commercial_tax = tax.commercial_tax
# end
%>
<tr>
<td><%= order_reservation.email %></td>
<td><%= order_reservation.order_reservation_type %></td>
<td><%= order_reservation.requested_time.utc.getlocal.strftime("%d %m %Y %I:%M %p") %></td>
<td><%= provider%></td>
<td><%= order_reservation.payment_type%></td>
<td><%= order_reservation.payment_status%></td>
<td><%= number_with_precision(total_amount , precision:precision.to_i,delimiter:delimiter)%></td>
<td><%= number_with_precision(discount_amount , precision:precision.to_i,delimiter:delimiter)%></td>
<td><%= number_with_precision(delivery_fee , precision:precision.to_i,delimiter:delimiter)%></td>
<td><%= number_with_precision(convenience_charge , precision:precision.to_i,delimiter:delimiter)%></td>
<td><%= number_with_precision(delivery_tax , precision:precision.to_i,delimiter:delimiter)%></td>
<td><%= number_with_precision(convenience_tax , precision:precision.to_i,delimiter:delimiter)%></td>
<td><%= number_with_precision(commercial_tax , precision:precision.to_i,delimiter:delimiter)%></td>
<td><%= number_with_precision(total_tax , precision:precision.to_i,delimiter:delimiter)%></td>
<td><%= number_with_precision(grand_total , precision:precision.to_i,delimiter:delimiter)%></td>
</tr>
<% end
end %>
</tbody>
</table>
</div>