optimize query for credit payment report
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<tr>
|
||||
<th colspan="7"><%= t("views.right_panel.detail.from_date") %> : <%= params[:from] rescue '-'%> , <%= t("views.right_panel.detail.to_date") %> : <%= params[:to] rescue '-'%></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th> <%= t("views.right_panel.detail.shift_name") %> </th>
|
||||
<th> <%= t("views.right_panel.detail.receipt_no") %></th>
|
||||
@@ -33,10 +33,10 @@
|
||||
<tbody>
|
||||
<% total_credit_amount = 0
|
||||
total_credit_payment = 0 %>
|
||||
<% @sale_data.each do |credit| %>
|
||||
<% @sale_data.each do |credit| %>
|
||||
<% total_credit_amount += credit.payment_amount
|
||||
total_credit_payment += credit.credit_payment %>
|
||||
<tr>
|
||||
<tr>
|
||||
<% if @shift_from.nil? && @shift_to.nil? %>
|
||||
<td><%= credit.sale_date.utc.getlocal.strftime("%e %b %I:%M%p") rescue '-'%></td>
|
||||
<% else %>
|
||||
@@ -50,10 +50,10 @@
|
||||
Quick Service
|
||||
<% else %>
|
||||
Online Order
|
||||
<% end %>
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= credit.cashier_name rescue '-' %></td>
|
||||
<td><%= credit.sale.customer.name rescue '-' %></td>
|
||||
<td><%= credit.customer_name rescue '-' %></td>
|
||||
<td><%= credit.payment_amount rescue '-' %></td>
|
||||
<td>
|
||||
<%if credit.credit_payment_shift_name == '-' %>
|
||||
@@ -78,4 +78,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user