add delimiter at report
This commit is contained in:
@@ -43,6 +43,18 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<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
|
||||
%>
|
||||
<% grand_total = 0 %>
|
||||
<% @sale_data.each do |result| %>
|
||||
<% table_name=nil
|
||||
@@ -58,7 +70,7 @@
|
||||
<td><%= table_type %> - <%= table_name %></td>
|
||||
<td><%= result.receipt_no rescue '-' %> </td>
|
||||
<td><%= result.cashier_name rescue '-' %></td>
|
||||
<td><%=result.grand_total%></td>
|
||||
<td><%= number_with_precision(result.grand_total, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||
<!-- <td> </td> -->
|
||||
</tr>
|
||||
|
||||
@@ -84,8 +96,8 @@
|
||||
<% end %>
|
||||
</td>
|
||||
<td><%= item.qty rescue '-' %></td>
|
||||
<td><%= item.unit_price rescue '-' %></td>
|
||||
<td><%= item.price rescue '-' %></td>
|
||||
<td><%= number_with_precision(item.unit_price, precision:precision.to_i,delimiter:delimiter) rescue '-' %></td>
|
||||
<td><%= number_with_precision(item.price, precision:precision.to_i,delimiter:delimiter) rescue '-' %></td>
|
||||
<td><%=l item.created_at.utc.getlocal, :format => :short rescue '-' %> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -108,7 +120,7 @@
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><%= t("views.right_panel.detail.total") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><%= result.total_amount %></td>
|
||||
<td><%= number_with_precision(result.total_amount, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -120,7 +132,7 @@
|
||||
<td><%= t("views.right_panel.detail.total") %>
|
||||
<%= t("views.right_panel.detail.discount") %>
|
||||
<%= t("views.right_panel.detail.amount") %></td>
|
||||
<td> - <%= result.total_discount %> </td>
|
||||
<td> - <%= number_with_precision(result.total_discount, precision:precision.to_i,delimiter:delimiter) %> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -130,7 +142,7 @@
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>Tax Amount </td>
|
||||
<td><%= result.total_tax %> </td>
|
||||
<td><%= number_with_precision(result.total_tax, precision:precision.to_i,delimiter:delimiter) %> </td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -142,7 +154,7 @@
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td>Payment <%= rec.payment_method.upcase %></td>
|
||||
<td><%= rec.payment_amount %> ( <%= rec.payment_status %> )</td>
|
||||
<td><%= number_with_precision(rec.payment_amount, precision:precision.to_i,delimiter:delimiter) %> ( <%= rec.payment_status %> )</td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
@@ -162,7 +174,7 @@
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><%= t("views.right_panel.detail.change") %> <%= t("views.right_panel.detail.amount") %></td>
|
||||
<td><%= result.amount_changed %></td>
|
||||
<td><%= number_with_precision(result.amount_changed, precision:precision.to_i,delimiter:delimiter) %></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
<% end %>
|
||||
@@ -184,7 +196,7 @@
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td> </td>
|
||||
<td><b>Total Nett</b> - <b><%= grand_total %></b></td>
|
||||
<td><b>Total Nett</b> - <b><%= number_with_precision(grand_total, precision:precision.to_i,delimiter:delimiter) %></b></td>
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user