receipt no report tax
This commit is contained in:
@@ -93,6 +93,12 @@
|
|||||||
<% tax_profile_count = @tax_profiles.length %>
|
<% tax_profile_count = @tax_profiles.length %>
|
||||||
<% sale_tax_count = result.sale_taxes.length %>
|
<% sale_tax_count = result.sale_taxes.length %>
|
||||||
<% tax_count = tax_profile_count - sale_tax_count %>
|
<% 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>
|
<tr>
|
||||||
|
|
||||||
<td><%= result.receipt_no rescue '-' %> </td>
|
<td><%= result.receipt_no rescue '-' %> </td>
|
||||||
@@ -105,7 +111,7 @@
|
|||||||
<%end%> -->
|
<%end%> -->
|
||||||
<% if !result.sale_taxes.empty? %>
|
<% if !result.sale_taxes.empty? %>
|
||||||
<% num = 1
|
<% num = 1
|
||||||
if tax_count > 0 %>
|
if tax_flag && tax_count > 0 %>
|
||||||
<% while num <= tax_count %>
|
<% while num <= tax_count %>
|
||||||
<td>
|
<td>
|
||||||
<%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) %>
|
<%= 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 '-' %>
|
<%= number_with_precision(tax.tax_payable_amount, precision: precision.to_i ,delimiter: delimiter) rescue '-' %>
|
||||||
</td>
|
</td>
|
||||||
<%end%>
|
<%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 %>
|
<% else %>
|
||||||
<% @tax_profiles.each do |tax| %>
|
<% @tax_profiles.each do |tax| %>
|
||||||
<td><%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
<td><%= number_with_precision(0, precision: precision.to_i ,delimiter: delimiter) rescue '-' %></td>
|
||||||
|
|||||||
@@ -62,6 +62,12 @@
|
|||||||
<% tax_profile_count = @tax_profiles.length %>
|
<% tax_profile_count = @tax_profiles.length %>
|
||||||
<% sale_tax_count = result.sale_taxes.length %>
|
<% sale_tax_count = result.sale_taxes.length %>
|
||||||
<% tax_count = tax_profile_count - sale_tax_count %>
|
<% 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>
|
<tr>
|
||||||
|
|
||||||
<td><%= result.receipt_no rescue '-' %> </td>
|
<td><%= result.receipt_no rescue '-' %> </td>
|
||||||
@@ -73,7 +79,7 @@
|
|||||||
<%end%> -->
|
<%end%> -->
|
||||||
<% if !result.sale_taxes.empty? %>
|
<% if !result.sale_taxes.empty? %>
|
||||||
<% num = 1
|
<% num = 1
|
||||||
if tax_count > 0 %>
|
if tax_flag && tax_count > 0 %>
|
||||||
<% while num <= tax_count %>
|
<% while num <= tax_count %>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
<% num += 1
|
<% num += 1
|
||||||
@@ -84,6 +90,13 @@
|
|||||||
<%= tax.tax_payable_amount rescue '-' %>
|
<%= tax.tax_payable_amount rescue '-' %>
|
||||||
</td>
|
</td>
|
||||||
<%end%>
|
<%end%>
|
||||||
|
<% num = 1
|
||||||
|
if tax_flag==false && tax_count > 0 %>
|
||||||
|
<% while num <= tax_count %>
|
||||||
|
<td>0</td>
|
||||||
|
<% num += 1
|
||||||
|
end %>
|
||||||
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% @tax_profiles.each do |tax| %>
|
<% @tax_profiles.each do |tax| %>
|
||||||
<td>0</td>
|
<td>0</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user