(function ($) { "use strict"; /*================================================================== [ Focus input ]*/ $('.input100').each(function(){ $(this).on('blur', function(){ if($(this).val().trim() != "") { $(this).addClass('has-val'); } else { $(this).removeClass('has-val'); } }) }) /*================================================================== [ Validate ]*/ var input = $('.validate-input .input100'); $('.validate-form').on('submit',function(){ var check = true; for(var i=0; i= alturaARRIBA) { clearInterval(id); elem.innerHTML = (100-height) * 1 + '%'; } else { height++; elem.style.height = height + '%'; elem.innerHTML = (100-height) * 1 + '%'; } } }*/ function move(id2,valor) { var elem = document.getElementById(id2); var height = 101; /*altura total del div*/ if(valor > 100){ valor = 100; } var alturaARRIBA = 100-valor; /*altura a la que debe quedar el div*/ var id = setInterval(frame, 10); function frame() { if(height <= alturaARRIBA){ clearInterval(id); elem.innerHTML = (100-height) * 1 + '%'; } else { height--; elem.style.height = height + '%'; elem.innerHTML = (100-height) * 1 + '%'; } } } /* FORMATO PARA NUMEROS*************************************************************************/ function number_format(amount, decimals) { amount += ''; // por si pasan un numero en vez de un string amount = parseFloat(amount.replace(/[^0-9\.]/g, '')); // elimino cualquier cosa que no sea numero o punto decimals = decimals || 0; // por si la variable no fue fue pasada // si no es un numero o es igual a cero retorno el mismo cero if (isNaN(amount) || amount === 0) return parseFloat(0).toFixed(decimals); // si es mayor o menor que cero retorno el valor formateado como numero amount = '' + amount.toFixed(decimals); var amount_parts = amount.split('.'), regexp = /(\d+)(\d{3})/; while (regexp.test(amount_parts[0])) amount_parts[0] = amount_parts[0].replace(regexp, '$1' + '.' + '$2'); return amount_parts.join('.'); } /* DESPLEGAR RESULTADO DE BUSQUEDA DE PILETAS*************************************************************************/ function buscar_lista_de_piletas(datos){ //menues $("#piletasOption").hide();$("#totalesOption").show();$("#buscarPiletas").show(); //loader $(".container-login100").addClass(".altoTotal"); $("#myContent").empty(); $(".wrap-login100").hide(); $("#myPreContent").show(); //console.log(datos); $.ajax({url: path_busqueda_por_totales, type: 'POST', data: datos, dataType: 'json', success: function(response){ lista_de_piletas = response.pileta; //console.log("El tag pileta es array: "+Array.isArray(response.pileta)); //console.log("La cantidad de piletas es: "+response.pileta.length); //alert(response.pileta[0].desc); // alert(lista_de_piletas[0].desc); var valor =[]; var miKey =[]; $(".wrap-login100").show(); $("#myPreContent").hide(); $(".container-login100").removeClass(".altoTotal"); if(Array.isArray(response.pileta)){ for (var i = 0; i < response.pileta.length ; i++){ var headerList = '
'+response.pileta[i].desc+'

'+response.pileta[i].id+'

'; headerList +='
saldo:'+number_format(response.pileta[i].saldo, 0)+'
'; headerList +='
azucar:'+response.pileta[i].azucar+'
'; headerList +='
alcohol:'+response.pileta[i].alcohol+'
'; headerList +='
acvol:'+response.pileta[i].acvol+'
'; $("#myContent").append(headerList); valor[i] = (response.pileta[i].saldo*100)/response.pileta[i].cap; miKey[i] = 'myBar'+i; } for(var i = 0; i < response.pileta.length ; i++){ move(miKey[i],valor[i]); } }else{ var headerList = '
'+response.pileta.desc+'

'+response.pileta.id+'

'; headerList +='
saldo:'+number_format(response.pileta.saldo, 0)+'
'; headerList +='
azucar:'+response.pileta.azucar+'
'; headerList +='
alcohol:'+response.pileta.alcohol+'
'; headerList +='
acvol:'+response.pileta.acvol+'
'; $("#myContent").append(headerList); valor[0] = (response.pileta.saldo*100)/response.pileta.cap; miKey[0] = 'myBar0'; move(miKey[0],valor[0]); } $(".myItem").click(function(){ var oID = $(this).attr("id"); var res = oID.split("-"); if(!document.getElementById( "details-"+res[1])){ var parametros = { "pileta" : res[1] }; crear_detalles_de_pileta(parametros, $(this)); } }); }}); } function menuTogle(){ $("#myMenuIcon").toggleClass("menuIcon"); $("#myMenuIcon").toggleClass("cancelIcon"); $("#myNavy").toggle(); $("#myMenuDiv").toggleClass("backBlack"); } $("#myMenuDiv").click(function(){ menuTogle(); }); $(".nav-item").click(function(){ menuTogle(); }); /* DESPLEGAR TOTALES*************************************************************************/ function crear_lista_de_totales(){ $("#totalesOption").hide();$("#piletasOption").show();$("#buscarPiletas").hide(); //loader $(".container-login100").addClass(".altoTotal"); $("#myContent").empty(); $(".wrap-login100").hide(); $("#myPreContent").show(); var total_de_mosto, total_de_vino, lista_de_totales, nodo_aux; var lista_de_mosto= ''; var lista_de_vino= ''; $.ajax({url: path_totales, type: 'POST', dataType: 'json', success: function(response){ lista_de_totales = response.total; /* quito efecto del loader y muestro container*/ $(".container-login100").removeClass(".altoTotal"); $("#myPreContent").hide();; $(".wrap-login100").show(); for (let i = 0; i < response.total.length; i++) { nodo_aux = '
'; if (response.total[i].tipo === 'Mosto') { if(response.total[i].categ === 'TODO'){ nodo_aux += '
Totales de '+response.total[i].tipo+' - '+response.total[i].categ+'
'; }else{ nodo_aux += '
Totales de '+response.total[i].tipo+' - '+response.total[i].categ+'
'; } } if (response.total[i].tipo === 'Vino') { if(response.total[i].categ === 'TODO'){ nodo_aux += '
Totales de '+response.total[i].tipo+' - '+response.total[i].categ+'
'; }else{ nodo_aux += '
Totales de '+response.total[i].tipo+' - '+response.total[i].categ+'
'; } } nodo_aux += '
'; nodo_aux += 'cantidad:   '; nodo_aux += ''+number_format((parseFloat(response.total[i].cant)/100), 0)+'
'; nodo_aux += '
'; nodo_aux += 'azucar: '; nodo_aux += ''+response.total[i].azucar+'
'; nodo_aux += '
'; nodo_aux += 'alco: '; nodo_aux += ''+response.total[i].alco+'
'; nodo_aux += '
'; nodo_aux += 'acidez: '; nodo_aux += ''+response.total[i].acidez+'
'; nodo_aux += '
'; nodo_aux += 'ph: '; nodo_aux += ''+response.total[i].ph+'
'; nodo_aux += '
'; nodo_aux += 'acvol: '; nodo_aux += ''+response.total[i].acvol+'
'; nodo_aux += '
'; nodo_aux += 'so2l: '; nodo_aux += ''+response.total[i].so2l+'
'; nodo_aux += '
'; nodo_aux += 'so2t: '; nodo_aux += ''+response.total[i].so2t+'
'; nodo_aux += '
'; nodo_aux += 'col420: '; nodo_aux += ''+response.total[i].col420+'
'; nodo_aux += '
'; nodo_aux += 'col520: '; nodo_aux += ''+response.total[i].col520+'
'; nodo_aux += '
'; nodo_aux += 'colsum: '; nodo_aux += ''+response.total[i].colsum+'
'; nodo_aux += '
'; nodo_aux += 'colmat: '; nodo_aux += ''+response.total[i].colmat+'
'; nodo_aux += '
'; nodo_aux += 'colind: '; nodo_aux += ''+response.total[i].colind+'
'; nodo_aux += '
'; if (response.total[i].tipo === 'Mosto') { if(response.total[i].categ === 'TODO'){ total_de_mosto = nodo_aux; }else{ lista_de_mosto += nodo_aux; } } if (response.total[i].tipo === 'Vino') { if(response.total[i].categ === 'TODO'){ total_de_vino += nodo_aux; }else{ lista_de_vino += nodo_aux; } } } $("#myContent").append(lista_de_mosto); $("#myContent").append(total_de_mosto); $("#myContent").append(lista_de_vino); $("#myContent").append(total_de_vino); $(".myTotalItem").click(function(){ var oID = $(this).attr("id"); var res = oID.split("|"); var parametros = { "codtipo" : res[0], "codcateg" : res[1] }; buscar_lista_de_piletas(parametros); }); } }); } /* DESPLEGAR DETALLES DE PILETAS*************************************************************************/ function crear_detalles_de_pileta(nro,ido){ $.ajax({url: path_detalles, type: 'POST', data: nro, dataType: 'json', success: function(response){ //console.log(response.detalle); var nodos = document.getElementsByClassName("salir"); if(nodos.length>0){ for(var i = 0 ; i < nodos.length ; i++){ nodos[i].remove(); } } /*ARMO PANTALLA*/ var detallesList = '
'; detallesList += '
'; detallesList += '
'; detallesList += 'cap:   '; var cap_number = parseInt(response.detalle.cap, 10); detallesList += ''+number_format(cap_number, 0)+'
'; detallesList += '
'; detallesList += 'saldo:   '; var saldo_number = parseInt(response.detalle.saldo, 10); detallesList += ''+(number_format(saldo_number, 0))+'
'; detallesList += '
'; detallesList += 'alco: '; detallesList += ''+response.detalle.alco+'
'; detallesList += '
'; detallesList += 'azucar: '; detallesList += ''+response.detalle.azucar+'
'; detallesList += '
'; detallesList += 'acidez: '; detallesList += ''+response.detalle.acidez+'
'; detallesList += '
'; detallesList += 'ph: '; detallesList += ''+response.detalle.ph+'
'; detallesList += '
'; detallesList += 'acvol: '; detallesList += ''+response.detalle.acvol+'
'; detallesList += '
'; detallesList += 'so2l: '; detallesList += ''+response.detalle.so2l+'
'; detallesList += '
'; detallesList += 'so2t: '; detallesList += ''+response.detalle.so2t+'
'; detallesList += '
'; detallesList += 'col420: '; detallesList += ''+response.detalle.col420+'
'; detallesList += '
'; detallesList += 'col520: '; detallesList += ''+response.detalle.col520+'
'; detallesList += '
'; detallesList += 'colsum: '; detallesList += ''+response.detalle.colsum+'
'; detallesList += '
'; detallesList += 'colmat: '; detallesList += ''+response.detalle.colmat+'
'; detallesList += '
'; detallesList += 'colind: '; detallesList += ''+response.detalle.colind+'
'; detallesList += '
'; ido.after(detallesList); $(".myItem-details").click(function(){ $(this).remove(); }); } }); } /* DESPLEGAR LISTA DE PILETAS *************************************************************************/ function crear_lista_de_piletas(){ $("#piletasOption").hide();$("#totalesOption").show(); $("#buscarPiletas").show(); //loader $(".container-login100").addClass(".altoTotal"); $("#myContent").empty(); $(".wrap-login100").hide(); $("#myPreContent").show(); $.ajax({url: path_piletas, type: 'POST', dataType: 'json', success: function(response){ lista_de_piletas = response.pileta; //console.log(response); var valor =[]; var miKey =[]; $(".container-login100").removeClass(".altoTotal"); $("#myPreContent").hide();; $(".wrap-login100").show(); for (var i = 0; i < response.pileta.length ; i++){ var headerList = '
'; headerList +='
'; headerList +='
'; headerList +='
'+response.pileta[i].desc+'

'+response.pileta[i].id+'

'; headerList +='
saldo:'+number_format(response.pileta[i].saldo, 0)+'
'; headerList +='
azucar:'+response.pileta[i].azucar+'
'; headerList +='
alcohol:'+response.pileta[i].alcohol+'
'; headerList +='
acvol:'+response.pileta[i].acvol+'
'; headerList +='
ulmov.:'+response.pileta[i].ulmov+'
'; $("#myContent").append(headerList); valor[i] = (response.pileta[i].saldo*100)/response.pileta[i].cap; miKey[i] = 'myBar'+i; } for(var i = 0; i < response.pileta.length ; i++){ move(miKey[i],valor[i]); } $(".myItem").click(function(){ var oID = $(this).attr("id"); var res = oID.split("-"); if(!document.getElementById( "details-"+res[1])){ var parametros = { "pileta" : res[1] }; crear_detalles_de_pileta(parametros, $(this)); } }); }}); } $("#buscarPiletas").click(function(){ //$("#myQuest").toggleClass("invisible"); $("#myQuest").toggle(); }); $("#cerrarQuest").click(function(){ //$("#myQuest").toggleClass("invisible"); $("#myQuest").toggle(); }); /* ELEMENTOS DEL FORMULARIO BUSQUEDA ***********************************************************************************/ function agreagar_options_quest(obj){ while (obj.hasChildNodes()) { obj.removeChild(obj.firstChild); } var nombres = []; var agregar_item=" "; var misCampos = document.getElementsByClassName("selectColection"); for (i = 0; i < misCampos.length; i++) { //console.log(misCampos[i].value) ; nombres.push (misCampos[i].value); } if (nombres.indexOf("alcohol") < 0) { agregar_item += '';} if (nombres.indexOf("azucar") < 0) { agregar_item += '';} if (nombres.indexOf("acidez") < 0) { agregar_item += '';} if (nombres.indexOf("ph") < 0) { agregar_item += '';} if (nombres.indexOf("acvol") < 0) { agregar_item += '';} if (nombres.indexOf("so2l") < 0) { agregar_item += '';} if (nombres.indexOf("so2t") < 0) { agregar_item += '';} if (nombres.indexOf("colsum") < 0) { agregar_item += '';} if (nombres.indexOf("colmat") < 0) { agregar_item += '';} if (nombres.indexOf("colin") < 0) { agregar_item += ''; } $(obj).append(agregar_item); } function agregar_item_quest(cant_item){ cant_item=cant_item+1; var agregar_item = '
'; // agregar_item += ''; var misCampos = document.getElementsByClassName("selectColection"); var nombres = []; for (i = 0; i < misCampos.length; i++) { //console.log(misCampos[i].value) ; nombres.push (misCampos[i].value); } if (nombres.indexOf("alcohol") < 0) { agregar_item += '';} if (nombres.indexOf("azucar") < 0) { agregar_item += '';} if (nombres.indexOf("acidez") < 0) { agregar_item += '';} if (nombres.indexOf("ph") < 0) { agregar_item += '';} if (nombres.indexOf("acvol") < 0) { agregar_item += '';} if (nombres.indexOf("so2l") < 0) { agregar_item += '';} if (nombres.indexOf("so2t") < 0) { agregar_item += '';} if (nombres.indexOf("colsum") < 0) { agregar_item += '';} if (nombres.indexOf("colmat") < 0) { agregar_item += '';} if (nombres.indexOf("colin") < 0) { agregar_item += ''; } /* agregar_item += ''; agregar_item += ''; agregar_item += ''; agregar_item += ''; agregar_item += ''; agregar_item += ''; agregar_item += ''; agregar_item += ''; agregar_item += ''; agregar_item += ''; */ agregar_item += ''; agregar_item += ''; agregar_item += ''; agregar_item += '
  -
'; $("#questingThings").append(agregar_item); return cant_item; } function quitar_item_quest(obj){ var oID = obj.attributes[1].value; var res = oID.split("-"); var parent = document.getElementById("questingThings"); var child = document.getElementById("mySubFormQuest-"+res[1]); parent.removeChild(child); } function validar_input_isNum(){ var elems = document.body.getElementsByTagName("input"); var flag = true; for(i = 0; i < elems.length; i++) { var valor = elems[i].value; var res = valor.match(/^[0-9]+([.][0-9]+)?$/); if(!res) { flag = false; } } if(flag==false) alert("Los campos de entrada solo pueden tener números con el formato (000.00) y no deben estar vacíos"); return flag; } function busqueda_de_filtros(){ var elems = document.body.getElementsByTagName("form"); var parametros = "{"; for(i = 0; i < elems.length; i++) { var aux = (elems[i].id).split("-"); var campoi = document.getElementById("myItemQuest-"+aux[1]+"-1").value; var operator = document.getElementById("myItemQuest-"+aux[1]+"-2").value; var values = document.getElementById("myItemQuest-"+aux[1]+"-3").value; var myObj = {campo: campoi, operador: operator, valor: values}; if (i==0) { parametros += '"'+i+'":'+JSON.stringify(myObj); }else{ parametros += ',"'+i+'":'+JSON.stringify(myObj); } //console.log(parametros); } parametros += "}"; parametros2 = JSON.parse(parametros); /* var parametros = new Object(); for(i = 0; i < elems.length; i++) { var aux = (elems[i].id).split("-"); var campoi = document.getElementById("myItemQuest-"+aux[1]+"-1").value; var operator = document.getElementById("myItemQuest-"+aux[1]+"-2").value; var values = document.getElementById("myItemQuest-"+aux[1]+"-3").value; var myObj = {campo: campoi, operador: operator, valor: values}; parametros.i= myObj; } */ /* var parametros= { "codtipo" : res[0], "codcateg" : res[1] }; */ // console.log(parametros2); //loader $(".container-login100").addClass(".altoTotal"); $("#myContent").empty(); $(".wrap-login100").hide(); $("#myPreContent").show(); $("#myQuest").hide(); $.ajax({url: path_busqueda, type: 'POST', data: parametros2, dataType: 'json', success: function(response){ lista_de_piletas = response.pileta; // console.log(lista_de_piletas); var valor =[]; var miKey =[]; $(".wrap-login100").show(); $("#myPreContent").hide(); $(".container-login100").removeClass(".altoTotal"); if(Array.isArray(response.pileta)){ for (var i = 0; i < response.pileta.length ; i++){ var headerList = '
'+response.pileta[i].desc+'

'+response.pileta[i].id+'

'; headerList +='
saldo:'+number_format(response.pileta[i].saldo, 0)+'
'; headerList +='
azucar:'+response.pileta[i].azucar+'
'; headerList +='
alcohol:'+response.pileta[i].alcohol+'
'; headerList +='
acvol:'+response.pileta[i].acvol+'
'; $("#myContent").append(headerList); valor[i] = (response.pileta[i].saldo*100)/response.pileta[i].cap; miKey[i] = 'myBar'+i; } for(var i = 0; i < response.pileta.length ; i++){ move(miKey[i],valor[i]); } }else{ var headerList = '
'+response.pileta.desc+'

'+response.pileta.id+'

'; headerList +='
saldo:'+number_format(response.pileta.saldo, 0)+'
'; headerList +='
azucar:'+response.pileta.azucar+'
'; headerList +='
alcohol:'+response.pileta.alcohol+'
'; headerList +='
acvol:'+response.pileta.acvol+'
'; $("#myContent").append(headerList); valor[0] = (response.pileta.saldo*100)/response.pileta.cap; miKey[0] = 'myBar0'; move(miKey[0],valor[0]); } $(".myItem").click(function(){ var oID = $(this).attr("id"); var res = oID.split("-"); if(!document.getElementById( "details-"+res[1])){ var parametros = { "pileta" : res[1] }; crear_detalles_de_pileta(parametros, $(this)); } }); }}); } function openStock(evt, stockName) { // Declare all variables var i, tabcontent, tablinks, aux; if (document.getElementById(stockName).style.display==="block") { aux=1; } // Get all elements with class="tabcontent" and hide them tabcontent = document.getElementsByClassName("tabcontent"); for (i = 0; i < tabcontent.length; i++) { tabcontent[i].style.display = "none"; } // Get all elements with class="tablinks" and remove the class "active" tablinks = document.getElementsByClassName("tablinks"); for (i = 0; i < tablinks.length; i++) { tablinks[i].className = tablinks[i].className.replace(" active", ""); } // Show the current tab, and add an "active" class to the button that opened the tab if (aux==1) { document.getElementById(stockName).style.display = "none"; }else{ document.getElementById(stockName).style.display = "block"; evt.currentTarget.className += " active"; } // console.log("igualdad es= "+document.getElementById(stockName).style.display); } function formatNumber(num) { if (!num || num == 'NaN') return '-'; if (num == 'Infinity') return '∞'; num = num.toString().replace(/\$|\,/g, ''); if (isNaN(num)) num = "0"; sign = (num == (num = Math.abs(num))); num = Math.floor(num * 100 + 0.50000000001); cents = num % 100; num = Math.floor(num / 100).toString(); if (cents < 10) cents = "0" + cents; for (var i = 0; i < Math.floor((num.length - (1 + i)) / 3) ; i++) num = num.substring(0, num.length - (4 * i + 3)) + '.' + num.substring(num.length - (4 * i + 3)); return (((sign) ? '' : '-') + num + ',' + cents); } function verStocks(){ $("#piletasOption").show(); $("#totalesOption").show(); $("#buscarPiletas").hide(); $("#myQuest").hide(); //loader $(".container-login100").addClass(".altoTotal"); $("#myContent").empty(); $(".wrap-login100").hide(); $("#myPreContent").show(); $.ajax({url: path_stocks, type: 'POST', dataType: 'json', success: function(response){ //lista_de_stocks = response.salsto; //console.log(lista_de_stocks.estado); var lista_de_stocks = response.salsto; //console.log(lista_de_stocks[1]); console.log(lista_de_stocks); $(".container-login100").removeClass(".altoTotal"); $("#myPreContent").hide();; $(".wrap-login100").show(); var aux= ''; var headerList = '
'; headerList += ''; headerList += '
'; headerList += '
'; for (i = 0; i < lista_de_stocks.length; i++) { if (lista_de_stocks[i].estado=="STKMP") { headerList += '
'; headerList += '
'+lista_de_stocks[i].descprod+'
'; headerList += '
Cod.:  '+lista_de_stocks[i].producto+' '+lista_de_stocks[i].umed+'
'; headerList += '
Cant.:  '+number_format((lista_de_stocks[i].cant/100), 0)+'
'; headerList += '
Ult-mov.:  '+lista_de_stocks[i].ulfec+'
'; headerList += '
'; }else{ aux += '
'; aux += '
'+lista_de_stocks[i].descprod+'
'; aux += '
Cod.:  '+lista_de_stocks[i].producto+' '+lista_de_stocks[i].umed+'
'; aux += '
Cant.:  '+number_format((lista_de_stocks[i].cant/100), 0)+'
'; aux += '
Ult-mov.:  '+lista_de_stocks[i].ulfec+'
'; aux += '
'; } } headerList += '
'; headerList += '
'; headerList += aux; headerList += '
'; $("#myContent").append(headerList); } }); } function verStocks(){ //buttoms $("#piletasOption").show(); $("#totalesOption").show(); $("#buscarPiletas").hide(); $("#myQuest").hide(); //loader $(".container-login100").addClass(".altoTotal"); $("#myContent").empty(); $(".wrap-login100").hide(); $("#myPreContent").show(); $.ajax({url: path_stocks, type: 'POST', dataType: 'json', success: function(response){ var lista_de_stocks = response.salsto; console.log(lista_de_stocks); $(".container-login100").removeClass(".altoTotal"); $("#myPreContent").hide();; $(".wrap-login100").show(); var headerList = '
'; headerList += ''; headerList += ''; headerList += ''; headerList += ''; headerList += ''; headerList += '
'; var divs_planchadas = '
'; var divs_ventas = '
'; var divs_frac = '
'; var divs_bode = '
'; var divs_gral = '
'; for (i = 0; i < lista_de_stocks.length; i++) { var fecha = lista_de_stocks[i].ulfec; if (lista_de_stocks[i].estado=="STKMP") { if(lista_de_stocks[i].uso=="FRAC"){ divs_frac += '
'; divs_frac += '
'+lista_de_stocks[i].descprod+'
'; divs_frac += '
Cod.:  '+lista_de_stocks[i].producto+'
'; divs_frac += '
Cant.:  '+number_format((lista_de_stocks[i].cant/100), 0)+' '+lista_de_stocks[i].umed+'
'; divs_frac += '
Ult-mov.:  '+fecha+'
'; divs_frac += '
'; }else if (lista_de_stocks[i].uso=="BODE") { divs_bode +='
'; divs_bode += '
'+lista_de_stocks[i].descprod+'
'; divs_bode += '
Cod.:  '+lista_de_stocks[i].producto+'
'; divs_bode += '
Cant.:  '+number_format((lista_de_stocks[i].cant/100), 0)+' '+lista_de_stocks[i].umed+'
'; divs_bode += '
Ult-mov.:  '+fecha+'
'; divs_bode += '
'; }else if (lista_de_stocks[i].uso=="VENTA") { divs_ventas += '
'; divs_ventas += '
'+lista_de_stocks[i].descprod+'
'; divs_ventas += '
Cod.:  '+lista_de_stocks[i].producto+'
'; divs_ventas += '
Cant.:  '+number_format((lista_de_stocks[i].cant/100), 0)+' '+lista_de_stocks[i].umed+'
'; divs_ventas += '
Ult-mov.:  '+fecha+'
'; divs_ventas += '
'; }else{ divs_gral += '
'; divs_gral += '
'+lista_de_stocks[i].descprod+'
'; divs_gral += '
Cod.:  '+lista_de_stocks[i].producto+'
'; divs_gral += '
Cant.:  '+number_format((lista_de_stocks[i].cant/100), 0)+' '+lista_de_stocks[i].umed+'
'; divs_gral += '
Ult-mov.:  '+fecha+'
'; divs_gral += '
'; } }else{ divs_planchadas += '
'; divs_planchadas += '
'+lista_de_stocks[i].descprod+'
'; divs_planchadas += '
Cod.:  '+lista_de_stocks[i].producto+'
'; divs_planchadas += '
Cant.:  '+number_format((lista_de_stocks[i].cant/100), 0)+' '+lista_de_stocks[i].umed+'
'; divs_planchadas += '
Ult-mov.:  '+fecha+'
'; divs_planchadas += '
'; } } divs_planchadas += '
'; divs_ventas += '
'; divs_frac += '
'; divs_bode += '
'; divs_gral += '
'; $("#myContent").append(headerList); $("#tablink_planch").append(divs_planchadas); $("#tablink_ven").append(divs_ventas); $("#tablink_bode").append(divs_bode); $("#tablink_frac").append(divs_frac); $("#tablink_gral").append(divs_gral); } }); } function topFunction() { document.body.scrollTop = 0; // For Safari document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera } /* COMIENZA LA CARGA DE COMPORTAMIENTO DE PAGINA ***************************************************************************************/ var cant_item= 1; $( document ).ready(function() { $("#myNavy").removeClass("invisible"); $("#myNavy").hide(); $("#myQuest").removeClass("invisible"); $("#myQuest").hide(); $("#totalesOption").hide(); $(".wrap-login100").removeClass("invisible"); $(".wrap-login100").hide(); $("#piletasOption").click(function(){ crear_lista_de_piletas(); }); $("#totalesOption").click(function(){ crear_lista_de_totales(); $("#buscarPiletas").hide(); }); $("#stocksOption").click(function(){ verStocks(); // getStocks(); }); $(".botonAgregar").click(function(){ cant_item= agregar_item_quest(cant_item); }); $(".botonBuscar").click(function(){ var isOk= validar_input_isNum(); if (isOk==true) busqueda_de_filtros(); }); $("#myMenuIcon2").hide(); crear_lista_de_totales(); $(window).scroll(function(){ if ($(this).scrollTop() > 250) { $('#boton-top').fadeIn(); } else { $('#boton-top').fadeOut(); } }); });