sales_per_month.js.erb 1020 B

12345678910111213141516171819
  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. $('#prods_total').html('<%= @prods_total %>');
  8. $('#sales_quantity').html('<%= @sales_quantity %>');
  9. $('#cash_sales_income').html(accounting.formatMoney('<%= @cash_sales_income %>'));
  10. $('#reserved_sales_income').html(accounting.formatMoney('<%= @reserved_sales_income %>'));
  11. $('#credit_sales_income').html(accounting.formatMoney('<%= @credit_sales_income %>'));
  12. $('#sales_income').html(accounting.formatMoney('<%= @sales_income %>'));
  13. $('#cash_sales_total').html(accounting.formatMoney('<%= @cash_sales_total %>'));
  14. $('#reserved_sales_total').html(accounting.formatMoney('<%= @reserved_sales_total %>'));
  15. $('#credit_sales_total').html(accounting.formatMoney('<%= @credit_sales_total %>'));
  16. $('#sales_total').html(accounting.formatMoney('<%= @sales_total %>'));