Primer commit del sistema avantika sin cambios
This commit is contained in:
230
javascript/reportes-cuentaspagar.js
Executable file
230
javascript/reportes-cuentaspagar.js
Executable file
@@ -0,0 +1,230 @@
|
||||
function ReporteCuentasPend()
|
||||
{
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/reportes-cuentaspagar.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('frmCuentasPend').serialize(true),
|
||||
onLoading:function(req)
|
||||
{
|
||||
$('loadBusqueda').show();
|
||||
$('contenido').innerHTML="";
|
||||
},
|
||||
onSuccess: function(transport)
|
||||
{
|
||||
var response = transport.responseText || "no response text";
|
||||
$('loadBusqueda').hide();
|
||||
$("contenido").innerHTML=response;
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
}
|
||||
|
||||
function ExportCuentasPend()
|
||||
{
|
||||
/*var fechaini=$("fechaI").value;
|
||||
var fechafin=$("fechaF").value;
|
||||
if(ValidaCamposFecha(fechaini,fechafin))
|
||||
{*/
|
||||
$('frmCuentasPend').submit();return true;
|
||||
/* }
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
function ReporteMasComprado()
|
||||
{
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/reportes-productos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('formMcomprado').serialize(true),
|
||||
onLoading:function(req)
|
||||
{
|
||||
$('loadBusqueda').show();
|
||||
$('contenido').innerHTML="";
|
||||
},
|
||||
onSuccess: function(transport)
|
||||
{
|
||||
var response = transport.responseText || "no response text";
|
||||
$('loadBusqueda').hide();
|
||||
$("contenido").innerHTML=response;
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
}
|
||||
|
||||
function ExportProdMC()
|
||||
{
|
||||
var fechaini=$("fechaI").value;
|
||||
var fechafin=$("fechaF").value;
|
||||
if(ValidaCamposFecha(fechaini,fechafin))
|
||||
{
|
||||
$('formMcomprado').submit();return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ReporteMenosVendido()
|
||||
{
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/reportes-productos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('formMenVendido').serialize(true),
|
||||
onLoading:function(req)
|
||||
{
|
||||
$('loadBusqueda').show();
|
||||
$('contenido').innerHTML="";
|
||||
},
|
||||
onSuccess: function(transport)
|
||||
{
|
||||
var response = transport.responseText || "no response text";
|
||||
$('loadBusqueda').hide();
|
||||
$("contenido").innerHTML=response;
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
}
|
||||
|
||||
function ExportProdMenV()
|
||||
{
|
||||
var fechaini=$("fechaI").value;
|
||||
var fechafin=$("fechaF").value;
|
||||
if(ValidaCamposFecha(fechaini,fechafin))
|
||||
{
|
||||
$('formMenVendido').submit();return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function ReporteMenosComprado()
|
||||
{
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/reportes-productos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters: $('formMenComprado').serialize(true),
|
||||
onLoading:function(req)
|
||||
{
|
||||
$('loadBusqueda').show();
|
||||
$('contenido').innerHTML="";
|
||||
},
|
||||
onSuccess: function(transport)
|
||||
{
|
||||
var response = transport.responseText || "no response text";
|
||||
$('loadBusqueda').hide();
|
||||
$("contenido").innerHTML=response;
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
}
|
||||
|
||||
function ExportProdMenC()
|
||||
{
|
||||
var fechaini=$("fechaI").value;
|
||||
var fechafin=$("fechaF").value;
|
||||
if(ValidaCamposFecha(fechaini,fechafin))
|
||||
{
|
||||
$('formMenComprado').submit();return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function TipoReporte()
|
||||
{
|
||||
new Ajax.Request(WEB_ROOT+'/ajax/reportes-productos.php',
|
||||
{
|
||||
method:'post',
|
||||
parameters:$('formRproductos').serialize(true),
|
||||
onLoading: function(req)
|
||||
{
|
||||
$('loadBusqueda').show();
|
||||
$('tipoRp').innerHTML = "";
|
||||
$("contenido").innerHTML='';
|
||||
},
|
||||
onSuccess: function(transport)
|
||||
{
|
||||
var response = transport.responseText || "no response text";
|
||||
$('loadBusqueda').hide();
|
||||
$("tipoRp").innerHTML=response;
|
||||
$("contenido").innerHTML='';
|
||||
},
|
||||
onFailure: function(){ alert('Something went wrong...') }
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function ShowDesc(id)
|
||||
{
|
||||
var resp = $("grupo"+id).style.display;
|
||||
var status;
|
||||
var txt;
|
||||
if(resp == "none"){
|
||||
status = "";
|
||||
txt = "[-]";
|
||||
}else{
|
||||
status = "none";
|
||||
txt = "[+]";
|
||||
}
|
||||
$("grupo"+id).style.display = status;
|
||||
$("showHide"+id).innerHTML = txt;
|
||||
}
|
||||
|
||||
//valida
|
||||
function ValidaCamposFecha(fechaini,fechafin) {
|
||||
var validaFecha = false;
|
||||
|
||||
if (fechaini == '' && fechafin == '')
|
||||
{
|
||||
validaFecha = true;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (fechaini == '' || fechafin == '')
|
||||
{
|
||||
alert('no puedes dejar fecha inicial o final vacia');validaFecha = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
var fechaIniVal = fechaini;
|
||||
var fechaFinVal = fechafin;
|
||||
var inicio = fechaIniVal.split("-");
|
||||
var fin = fechaFinVal.split("-");
|
||||
if (fin[2] >= inicio[2]) {
|
||||
if(fin[1] >= inicio[1]){
|
||||
if(fin[0] < inicio[0] && fin[1]<=inicio[1]){
|
||||
alert('fecha inicial no puede ser mayor que la fecha final');validaFecha =false;
|
||||
}else {
|
||||
validaFecha = true;
|
||||
}
|
||||
}else{
|
||||
validaFecha = false;
|
||||
}
|
||||
}else{
|
||||
validaFecha = false;
|
||||
}
|
||||
}
|
||||
} //else
|
||||
return validaFecha;
|
||||
}
|
||||
Reference in New Issue
Block a user