add delimiter at report

This commit is contained in:
NyanLinHtut
2019-09-26 10:10:07 +06:30
parent 9d330bb28c
commit ec9e4fb7eb
5 changed files with 53 additions and 19 deletions

View File

@@ -45,6 +45,18 @@
<tbody>
<% if @print_settings.precision.to_i > 0
precision = @print_settings.precision
else
precision = 0
end
#check delimiter
if @print_settings.delimiter
delimiter = ","
else
delimiter = ""
end
%>
<% receipt_arr = Array.new %>
<% menu_cat_arr = Array.new %>
<% footer_arr = Array.new %>
@@ -65,10 +77,10 @@
<td>&nbsp;</td>
<% end %>
<td><%= sale.product_name %></td>
<td><%= sale.product_code %></td>
<td><%= sale.product_code.to_i %></td>
<td><%= sale.qty.to_i %></td>
<td><%= sale.unit_price %></td>
<td><%= sale.price %></td>
<td><%= number_with_precision(sale.unit_price, precision:precision.to_i,delimiter:delimiter) %></td>
<td><%= number_with_precision(sale.price, precision:precision.to_i,delimiter:delimiter) %></td>
</tr>
@@ -79,13 +91,13 @@
<td colspan="2" style="text-align:right"> <strong>Total Qty: </strong></td>
<td>
<span class="underline" style="text-align:right">
<strong><%= waste_and_spoil_item_count %></strong>
<strong><%= number_with_precision(waste_and_spoil_item_count, precision:precision.to_i,delimiter:delimiter) %></strong>
<% waste_and_spoil_item_count = 0%>
</span></td>
<td style="text-align:right"> <strong>Grand Total: </strong></td>
<td >
<span class="underline" style="text-align:right">
<strong><%= grand_total %></strong>
<strong><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) %></strong>
</span>
</td>
</tr>