diff --git a/modules/EcmActions/js/EditViewDocumentReady.js b/modules/EcmActions/js/EditViewDocumentReady.js index de114834..36170a89 100644 --- a/modules/EcmActions/js/EditViewDocumentReady.js +++ b/modules/EcmActions/js/EditViewDocumentReady.js @@ -12,21 +12,12 @@ $(document).ready(function () { //$('#cost_hour').attr('disabled','disabled'); startCat = $('#category').find(":selected").val(); startIndex = $('#indeks').val(); - if ($('#indeks').val() == '') { - categoryChange(); - } $("#cost_action").change(function () { cost_actionChange(); }); $("#cost_hour").change(function () { cost_hourChange(); }); - $('#category').change(function () { - categoryChange(); - }); - $('#indeks').change(function () { - indeksChange(); - }); $('#cost_other').change(function () { cost_otherChange(); }); @@ -200,44 +191,10 @@ function categoryChange() { } } -function indeksChange() { - var checkindeks = $.trim($("#indeks").val()).toUpperCase(); - if (checkindeks.length > 0) { - if (checkindeks.length > 10) { - checkindeks = checkindeks.substring(0, 10); - } - $("#indeks").val(checkindeks); - var condition = false; - var category = $('#category').find(":selected").val(); - $.ajax({ - type: "POST", - url: "index.php?module=EcmActions&action=indeksIncrement&to_pdf=1", - dataType: "json", - async: false, - data: { - job: "checkIndeks", - indeks: checkindeks, - category: category, - }, - success: function (data) { - condition = data; - } - }); - if (condition) { - alert("Podany indeks dla danej kategorii już istnieje"); - $("#indeks").val(''); - } - } else { - alert("Indeks nie może być pusty"); - } -} function indeksChek(){ var checkindeks = $.trim($("#indeks").val()).toUpperCase(); if (checkindeks.length > 0) { - if (checkindeks.length > 10) { - checkindeks = checkindeks.substring(0, 10); - } $("#indeks").val(checkindeks); var condition = false; var category = $('#category').find(":selected").val(); @@ -269,7 +226,7 @@ function updateTime() { var seconds = parseInt($("#seconds").val()); var tmp = hours + minutes + seconds; $("#time").val(tmp); - + var time = tmp; var cost_hour = UnformatNumber($("#cost_hour").val())*100; if (isNaN(cost_hour) || cost_hour == 'NaN,NaN') { @@ -281,7 +238,7 @@ function updateTime() { } var tmp = ((cost_hour_h*time)/100).toFixed(2); $("#cost_action").val(FormatNumber(tmp)); - + var tmp2 = (((cost_netto_s*time)/100)).toFixed(2); $("#cost_other").val(FormatNumber(tmp2)); }