sales_per_month.js.erb 683 B

1234567891011121314
  1. var table = $('#sales_table').DataTable();
  2. $('#sales_table').dataTable().fnClearTable();
  3. <% @sales.each_with_index do |sale, key| %>
  4. var row = $('<%= j render partial: "sale_for_report", locals: {sale: sale} %>');
  5. table.row.add(row).draw();
  6. <% end %>
  7. $('#sales_total').html(accounting.formatMoney('<%= @sales_total %>'));
  8. $('#prods_total').html('<%= @prods_total %>');
  9. $('#sales_quantity').html('<%= @sales_quantity %>');
  10. $('#cash_sales_total').html(accounting.formatMoney('<%= @cash_sales_total %>'));
  11. $('#reserved_sales_total').html(accounting.formatMoney('<%= @reserved_sales_total %>'));
  12. $('#credit_sales_total').html(accounting.formatMoney('<%= @credit_sales_total %>'));