90 lines
1.8 KiB
JavaScript
Executable File
90 lines
1.8 KiB
JavaScript
Executable File
function ReporteComprados()
|
|
{
|
|
new Ajax.Request(WEB_ROOT+'/ajax/reportes-compras.php',
|
|
{
|
|
method:'post',
|
|
parameters: $('formComprado').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 ExportProdC()
|
|
{
|
|
var fechaini=$("fechaI").value;
|
|
var fechafin=$("fechaF").value;
|
|
if(ValidaCamposFecha(fechaini,fechafin))
|
|
{
|
|
$('formComprado').submit();return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
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;
|
|
} |