Changed raw SQL query to activerecord

This commit is contained in:
yarzar_code
2020-01-03 10:16:45 +06:30
parent 2a856c3cc1
commit 0202bc7827
10 changed files with 124 additions and 241 deletions

View File

@@ -36,11 +36,10 @@
<tbody>
<% grand_total = 0 %>
<% @sale_data.each do |result| %>
<% grand_total = grand_total.to_f + result.grand_total.to_f%>
<% table_name=nil
<% grand_total = grand_total.to_f + result.grand_total.to_f%>
<% table_name=nil
table_type =nil
if result.table_id.to_i>0
table = DiningFacility.find(result.table_id)
if table = result.bookings[0].dining_facility
table_type = table.type
table_name = table.name
end %>