Merge branch 'ui_ux_changes' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes
This commit is contained in:
@@ -5,42 +5,65 @@
|
|||||||
|
|
||||||
<table class="table table-striped" border="0">
|
<table class="table table-striped" border="0">
|
||||||
<h5 class="p-l-10 p-t-10">Report For <%= @sale_type? @sale_type : 'Waste' %></h5>
|
<h5 class="p-l-10 p-t-10">Report For <%= @sale_type? @sale_type : 'Waste' %></h5>
|
||||||
<% @sale_data.each do |sale| %>
|
<% receipt_arr = Array.new %>
|
||||||
|
<% menu_cat_arr = Array.new %>
|
||||||
|
<% footer_arr = Array.new %>
|
||||||
|
<% count = 0 %>
|
||||||
<% waste_and_spoil_item_count = 0%>
|
<% waste_and_spoil_item_count = 0%>
|
||||||
|
|
||||||
|
<% @sale_data.each do |sale| %>
|
||||||
|
<% if !receipt_arr.include?(sale.receipt_no) %>
|
||||||
<thead>
|
<thead>
|
||||||
|
<td> </td>
|
||||||
<tr>
|
<tr>
|
||||||
<td >
|
<td >
|
||||||
<strong>Receipt No :<%= sale.receipt_no %></strong>
|
<strong>Receipt No :<%= sale.receipt_no %></strong>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
|
<td></td>
|
||||||
<td colspan="3" style="text-align:right"><strong>Date : <%= sale.created_at.utc.getlocal.strftime("%e,%b %Y %I:%M %p") %></strong></td>
|
<td colspan="3" style="text-align:right"><strong>Date : <%= sale.created_at.utc.getlocal.strftime("%e,%b %Y %I:%M %p") %></strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<tr>
|
<tr>
|
||||||
|
<td><strong>Menu Category</strong></td>
|
||||||
<td><strong>Item Name</strong></td>
|
<td><strong>Item Name</strong></td>
|
||||||
<td><strong>Item Code</strong></td>
|
<td><strong>Item Code</strong></td>
|
||||||
<td><strong>Qty</strong></td>
|
<td><strong>Qty</strong></td>
|
||||||
<td><strong>Price</strong></td>
|
<td><strong>Price</strong></td>
|
||||||
<td><strong>Total Price</strong></td>
|
<td><strong>Total Price</strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<% receipt_arr.push(sale.receipt_no) %>
|
||||||
|
<% menu_cat_arr.clear %>
|
||||||
|
<% count = 0 %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% sale.sale_items.each do |item| %>
|
<tbody>
|
||||||
<% if !item.item_instance_code.nil?%>
|
|
||||||
<% waste_and_spoil_item_count += item.qty.to_i%>
|
<% if !sale.item_instance_code.nil?%>
|
||||||
|
<% waste_and_spoil_item_count += sale.qty.to_i %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= item.product_name %></td>
|
<% if !menu_cat_arr.include?(sale.name) %>
|
||||||
<td><%= item.product_code %></td>
|
<td><%= sale.name %></td>
|
||||||
<td><%= item.qty %></td>
|
<% menu_cat_arr.push(sale.name) %>
|
||||||
<td><%= item.price %></td>
|
<% else %>
|
||||||
<td><%= item.price %></td>
|
<td> </td>
|
||||||
|
<% end %>
|
||||||
|
<td><%= sale.product_name %></td>
|
||||||
|
<td><%= sale.product_code %></td>
|
||||||
|
<td><%= sale.qty.to_i %></td>
|
||||||
|
<td><%= sale.unit_price %></td>
|
||||||
|
<td><%= sale.price %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% count = count + 1 %>
|
||||||
|
<% if sale.sale_items.count == count %>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td></td>
|
||||||
<td colspan="2" style="text-align:right"> <strong>Total Qty: </strong></td>
|
<td colspan="2" style="text-align:right"> <strong>Total Qty: </strong></td>
|
||||||
<td><span class="underline" style="text-align:right">
|
<td>
|
||||||
|
<span class="underline" style="text-align:right">
|
||||||
<strong><%= waste_and_spoil_item_count %></strong>
|
<strong><%= waste_and_spoil_item_count %></strong>
|
||||||
|
<% waste_and_spoil_item_count = 0%>
|
||||||
</span></td>
|
</span></td>
|
||||||
<td style="text-align:right"> <strong>Grand Total: </strong></td>
|
<td style="text-align:right"> <strong>Grand Total: </strong></td>
|
||||||
<td >
|
<td >
|
||||||
@@ -49,6 +72,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<% footer_arr.push(sale.sale_id) %>
|
||||||
|
<% end %>
|
||||||
</tbody>
|
</tbody>
|
||||||
<% end %>
|
<% end %>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
Reference in New Issue
Block a user