diff --git a/application/views/dailyBatchCardListing.php b/application/views/dailyBatchCardListing.php index c55ac922..e90c4393 100755 --- a/application/views/dailyBatchCardListing.php +++ b/application/views/dailyBatchCardListing.php @@ -925,6 +925,7 @@ $(function(){ var alldata = $("#abstracttable").tableToJSON(); alldata = JSON.stringify(alldata); // alert(alldata); + var excelpath = ""; var month = $("#month").val(); $('#jsonodata').val(alldata); @@ -932,8 +933,7 @@ $(function(){ $('#abstractform').attr('method','POST'); - $('#abstractform').attr('action','saveBatchCardtoExcel'); - + $('#abstractform').attr('action',excelpath); $('#abstractform').submit(); @@ -955,6 +955,8 @@ $(function(){ document.getElementById('PH1').textContent = PH1; document.getElementById('T1').textContent = (parseFloat($('#total_ed_receipt').text()) + parseFloat(os1)); document.getElementById('CS1').textContent = parseFloat($('#T1').text()) - parseFloat($('#C1').text()); + if($('#PS1').text() != ''){ + document.getElementById('D1').textContent = parseFloat($('#PS1').text()-$('#CS1').text());} //Rotary Details diesel var os2 = $('#OS2').text() == '' ? '0' : parseFloat($('#OS2').text()); @@ -966,6 +968,8 @@ $(function(){ document.getElementById('PH2').textContent = PH2; document.getElementById('T2').textContent = (parseFloat($('#total_rotary_input').text()) + parseFloat(os2)); document.getElementById('CS2').textContent = parseFloat($('#T2').text()) - parseFloat($('#C2').text()); + if($('#PS2').text() != ''){ + document.getElementById('D2').textContent = parseFloat($('#PS2').text()-$('#CS2').text());} //Rotary Details diesel/ton var os3 = $('#OS3').text() == '' ? '0' : parseFloat($('#OS3').text()); @@ -977,6 +981,8 @@ $(function(){ document.getElementById('PH3').textContent = PH3; document.getElementById('T3').textContent = (parseFloat($('#total_diesel_rotary_bull_r').text()) + parseFloat(os3)); document.getElementById('CS3').textContent = parseFloat($('#T3').text()) - parseFloat($('#C3').text()); + if($('#PS3').text() != ''){ + document.getElementById('D3').textContent = parseFloat($('#PS3').text()-$('#CS3').text());} //Diesel/Bull @@ -989,6 +995,8 @@ $(function(){ document.getElementById('PH4').textContent = PH4; document.getElementById('T4').textContent = (parseFloat($('#total_diesel_bull_r').text()) + parseFloat(os4)); document.getElementById('CS4').textContent = parseFloat($('#T4').text()) - parseFloat($('#C4').text()); + if($('#PS4').text() != ''){ + document.getElementById('D4').textContent = parseFloat($('#PS4').text()-$('#CS4').text());} //Rough Sand var os5 = $('#OS5').text() == '' ? '0' : parseFloat($('#OS5').text()); @@ -1000,6 +1008,8 @@ $(function(){ document.getElementById('PH5').textContent = PH5; document.getElementById('T5').textContent = (parseFloat($('#total_rough_sand_r').text()) + parseFloat(os5)); document.getElementById('CS5').textContent = parseFloat($('#T5').text()) - parseFloat($('#C5').text()); + if($('#PS5').text() != ''){ + document.getElementById('D5').textContent = parseFloat($('#PS5').text()-$('#CS5').text());} //Fine Sand @@ -1012,6 +1022,8 @@ $(function(){ document.getElementById('PH6').textContent = PH6; document.getElementById('T6').textContent = (parseFloat($('#total_fine_sand_r').text()) + parseFloat(os6)); document.getElementById('CS6').textContent = parseFloat($('#T6').text()) - parseFloat($('#C6').text()); + if($('#PS6').text() != ''){ + document.getElementById('D6').textContent = parseFloat($('#PS6').text()-$('#CS6').text());} //TRP total Sand @@ -1037,6 +1049,8 @@ $(function(){ document.getElementById('PH8').textContent = PH8; document.getElementById('T8').textContent = (parseFloat($('#total_gas_r').text()) + parseFloat(os8)); document.getElementById('CS8').textContent = parseFloat($('#T8').text()) - parseFloat($('#C8').text()); + if($('#PS8').text() != ''){ + document.getElementById('D8').textContent = parseFloat($('#PS8').text()-$('#CS8').text());} //WATER var os9 = $('#OS9').text() == '' ? '0' : parseFloat($('#OS9').text()); @@ -1045,10 +1059,14 @@ $(function(){ document.getElementById('C9').textContent = parseFloat($('#total_water_c').text()); var PH9 = (parseFloat($('#OS7').text()) / (parseFloat($('#total_water_c').text()))).toFixed(3); - if((isNaN(PH9)) || (isFinite(PH9))){PH9 = '0';} + //if((isNaN(PH9)) || (isFinite(PH9))){PH9 = '0';} + if((isNaN(PH9)) || (isFinite(PH9))){PH9 = PH9;}else{PH9='0';} document.getElementById('PH9').textContent = PH9; document.getElementById('T9').textContent = (parseFloat($('#total_water_r').text()) + parseFloat(os9)); document.getElementById('CS9').textContent = parseFloat($('#T9').text()) - parseFloat($('#C9').text()); + if($('#PS9').text() != ''){ + document.getElementById('D9').textContent = parseFloat($('#PS9').text()-$('#CS9').text());} + //POWER document.getElementById('C10').textContent = parseFloat($('#total_power_total').text()); @@ -1070,7 +1088,7 @@ $(function(){ var currentyearmonth = currentmonth[1]+'-'+(monthnumber <= 9 ? '0'+monthnumber : monthnumber ); //alert(monthnumber); //alert(currentmonth[1]); - alert(currentyearmonth); + //alert(currentyearmonth); var currmonth = monthnumber; var curryear = currentmonth[1];