Files
old-ribica/back-office/app/views/reports/orders_to_confirm.html.erb
2015-06-06 08:41:54 +02:00

64 lines
1.8 KiB
Plaintext

<h1>Orders to confirm</h1>
<style type="text/css">
.tg {border-collapse:collapse;border-spacing:0;}
.tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
.tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;}
</style>
<div><%= "report is nil" if @report.nil? %></div>
<% unless @report.nil? %>
<% @report.sections.each do |section| %>
<div>
<hr>
<% unless section.delivery_destination.nil? %>
<div><%= section.delivery_destination.name %></div>
<div><%= section.delivery_destination.address %> </div>
<div><%= section.delivery_destination.place %> <%= Place.name_from_code(section.delivery_destination.place) %></div>
<div><%= section.delivery_destination.email %></div>
<div><strong>+387 <%= section.delivery_destination.phone %></strong></div>
<% end %>
<p>
<table class="tg">
<tr>
<th class="tg-031e">Code</th>
<th class="tg-031e">Item name</th>
<th class="tg-031e">Amount</th>
<th class="tg-031e">Price</th>
<th class="tg-031e">Total</th>
</tr>
<% section.items.each do |item| %>
<tr>
<td class="tg-031e"><%= item.code %></td>
<td class="tg-031e"><%= item.name %></td>
<td class="tg-031e"><%= item.amount %></td>
<td class="tg-031e"><%= item.list_price %></td>
<td class="tg-031e"><%= item.sum_price %></td>
</tr>
<% end %>
<tr><td><strong>Total for cart: <%= section.sum_amount %></strong></td></tr>
</table>
</p>
</div>
<div><a href="<%= rails_admin.edit_url(model_name: 'cart', id: section.delivery_destination.order_id.to_i)%>" >Update Order</a></div>
<% end %>
<strong>Total: <%= @report.full_sum %></strong>
<% end %>