change receipt no report ui and add sale taxes for dining charges
This commit is contained in:
@@ -59,17 +59,35 @@
|
||||
<% discount_amt += result.total_discount.to_f %>
|
||||
<% rounding_adj += result.rounding_adjustment.to_f %>
|
||||
|
||||
<% tax_profile_count = @tax_profiles.length %>
|
||||
<% sale_tax_count = result.sale_taxes.length %>
|
||||
<% tax_count = tax_profile_count - sale_tax_count %>
|
||||
<tr>
|
||||
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%= result.total_amount rescue '-' %></td>
|
||||
<td><%= result.total_discount rescue '-' %></td>
|
||||
<%if result.customer.customer_type == "Takeaway"%>
|
||||
<!-- <%if result.customer.customer_type == "Takeaway"%>
|
||||
<td>0.0</td>
|
||||
<%end%>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<td><%= tax.tax_payable_amount rescue '-' %></td>
|
||||
<%end%> -->
|
||||
<% if !result.sale_taxes.empty? %>
|
||||
<% num = 1
|
||||
if tax_count > 0 %>
|
||||
<% while num <= tax_count %>
|
||||
<td>0</td>
|
||||
<% num += 1
|
||||
end %>
|
||||
<% end %>
|
||||
<% result.sale_taxes.each do |tax| %>
|
||||
<td>
|
||||
<%= tax.tax_payable_amount rescue '-' %>
|
||||
</td>
|
||||
<%end%>
|
||||
<% else %>
|
||||
<% @tax_profiles.each do |tax| %>
|
||||
<td>0</td>
|
||||
<% end %>
|
||||
<%end%>
|
||||
|
||||
<td><%= result.grand_total %></td>
|
||||
|
||||
Reference in New Issue
Block a user