| 12345678910111213141516 |
- $('#products_table').dataTable().fnGetNodes().forEach(function(row) {
- trTxt = $(row).attr('id');
- id = parseInt(trTxt.substring(trTxt.lastIndexOf('_') + 1, trTxt.length));
- if (id == <%= @pre_sale.id %>) {
- $(row).find('td:eq(0) input').val('<%= @pre_sale.amount.round(2) %>');
- $(row).find('td:eq(7) label').text('<%= number_to_currency(@pre_sale.discount, precision: 2) %>');
- $(row).find('td:eq(7) input').val('<%= @pre_sale.discount.round(2) %>');
- $(row).find('td:eq(6) label').text('<%= number_to_currency(@pre_sale.tax, precision: 2) %>');
- $(row).find('td:eq(6) input').val('<%= @pre_sale.tax.round(2) %>');
- $(row).find('td:eq(8) label').text('<%= number_to_currency(@pre_sale.total, precision: 2) %>');
- $(row).find('td:eq(8) input').val('<%= @pre_sale.total.round(2) %>');
- $(row).find(".hagglebutton").addClass("disabled").click(function(e){ e.preventDefault();});
- }
- });
- calculateTotals();
- $('#dialog').modal('toggle');
|