receipt no report tax

This commit is contained in:
phyusin
2018-06-28 18:06:46 +06:30
parent 57163a04fe
commit ecfecf2e6f
2 changed files with 30 additions and 2 deletions

View File

@@ -93,6 +93,12 @@
<% tax_profile_count = @tax_profiles.length %>
<% sale_tax_count = result.sale_taxes.length %>
<% tax_count = tax_profile_count - sale_tax_count %>
<% tax_flag = true %>
<% result.sale_taxes.each do |tax|
if tax.tax_name.downcase.include?("service")
tax_flag = false
end
end %>
<tr>
<td><%= result.receipt_no rescue '-' %> </td>
@@ -105,7 +111,7 @@
<%end%> -->
<% if !result.sale_taxes.empty? %>
<% num = 1
if tax_count > 0 %>
if tax_flag && tax_count > 0 %>
<% while num <= tax_count %>
<td>
<%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %>
@@ -118,6 +124,15 @@
<%= number_with_precision(tax.tax_payable_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %>
</td>
<%end%>
<% num = 1
if tax_flag==false && tax_count > 0 %>
<% while num <= tax_count %>
<td>
<%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %>
</td>
<% num += 1
end %>
<% end %>
<% else %>
<% @tax_profiles.each do |tax| %>
<td><%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>