|
|
|
@ -6,25 +6,25 @@ $(function() { |
|
|
|
el.val(new_val); |
|
|
|
el.val(new_val); |
|
|
|
} |
|
|
|
} |
|
|
|
var calc_summa = function (e) { |
|
|
|
var calc_summa = function (e) { |
|
|
|
var $this = $(this); |
|
|
|
var el = $(this); |
|
|
|
var qty = parseFloat($this.closest('tr.row').find('td.qty input').val()); |
|
|
|
var qty = parseFloat(el.closest('tr.row').find('td.qty input').val()); |
|
|
|
var price = parseFloat($this.closest('tr.row').find('td.price input').val()); |
|
|
|
var price = parseFloat(el.closest('tr.row').find('td.price input').val()); |
|
|
|
var total_price = qty * price; |
|
|
|
var total_price = qty * price; |
|
|
|
if (total_price) { |
|
|
|
if (total_price) |
|
|
|
$this.closest('tr.row').find('td.total_price input').val(qty * price); |
|
|
|
el.closest('tr.row').find('td.total_price input').val(total_price.toFixed(2)); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
var calc_itogo_nds = function() { |
|
|
|
var calc_itogo_nds = function() { |
|
|
|
$('#itogo_nds_text').html('НДС ' + $('#id_nds_value option:selected').text()); |
|
|
|
$('#itogo_nds_text').html('НДС ' + $('#id_nds_value option:selected').text()); |
|
|
|
$('#itogo_nds').html(parseFloat($('#id_nds_value').val()) * parseFloat($('#itogo').html()) / 100); |
|
|
|
var nds = parseFloat($('#id_nds_value').val()) * parseFloat($('#itogo').html()) / 100; |
|
|
|
|
|
|
|
$('#itogo_nds').html(nds.toFixed(2)); |
|
|
|
} |
|
|
|
} |
|
|
|
window.calc_itogo = function (e) { |
|
|
|
window.calc_itogo = function (e) { |
|
|
|
var itogo_sum = 0; |
|
|
|
var itogo_sum = 0; |
|
|
|
$('#tbl_items').find('.total_price input:visible').each(function(){ |
|
|
|
$('#tbl_items').find('.total_price input:visible').each(function() { |
|
|
|
var itogo_sum_row = $(this).val()? parseInt($(this).val()) : 0; |
|
|
|
var itogo_sum_row = $(this).val() ? parseFloat($(this).val()) : 0; |
|
|
|
itogo_sum += itogo_sum_row; |
|
|
|
itogo_sum += itogo_sum_row; |
|
|
|
}) |
|
|
|
}) |
|
|
|
$('#itogo').html(itogo_sum); |
|
|
|
$('#itogo').html(itogo_sum.toFixed(2)); |
|
|
|
calc_itogo_nds(); |
|
|
|
calc_itogo_nds(); |
|
|
|
} |
|
|
|
} |
|
|
|
window.set_events = function set_events() { |
|
|
|
window.set_events = function set_events() { |
|
|
|
|