var table = $('#sales_table').DataTable();
$('#sales_table').dataTable().fnClearTable();
<% @sales.each_with_index do |sale, key| %>
  var row = $('<%= j render partial: "sale_for_report", locals: {sale: sale} %>');
  table.row.add(row).draw();
<% end %>

$('#prods_total').html('<%= @prods_total %>');
$('#sales_quantity').html('<%= @sales_quantity %>');

$('#cash_sales_income').html(accounting.formatMoney('<%= @cash_sales_income %>'));
$('#reserved_sales_income').html(accounting.formatMoney('<%= @reserved_sales_income %>'));
$('#credit_sales_income').html(accounting.formatMoney('<%= @credit_sales_income %>'));
$('#sales_income').html(accounting.formatMoney('<%= @sales_income %>'));

$('#cash_sales_total').html(accounting.formatMoney('<%= @cash_sales_total %>'));
$('#reserved_sales_total').html(accounting.formatMoney('<%= @reserved_sales_total %>'));
$('#credit_sales_total').html(accounting.formatMoney('<%= @credit_sales_total %>'));
$('#sales_total').html(accounting.formatMoney('<%= @sales_total %>'));