<?php
//@@
$StrCmd=V($_POST['TxtAc']);
$LStrPag=V($_POST['TxtPag']);
if($StrCmd=="F")$LStrPag="1";
//
$IdU=vbval($_SESSION['SYS_USER_ID']);
$PRO_ID_ALM=gn("pro_id_alm","usuarios","id_usuario=$IdU");
//
$Emp=V($_POST['Emp']);
$Doc=V($_POST['Doc']);
$Ser=V($_POST['Ser']);
$Num=V($_POST['Num']);
$Dex=V($_POST['Dex']);
$Hax=V($_POST['Hax']);
$Cli=V($_POST['Cli']);
$Anu=V($_POST['Anu']);
$DocM=V($_POST['DocM']);
$SerM=V($_POST['SerM']);
$NumM=V($_POST['NumM']);
/*
if($PRO_ID_ALM==0){
	if(strlen($Emp)==0)$Emp=GE("S");
	if(strlen($Alm)==0)$Alm=GA($Emp,"S");	
}else{
	$Emp=gs("ENC","vis_almacenes","IDA=$PRO_ID_ALM");
	$Alm=gs("ANC","vis_almacenes","IDA=$PRO_ID_ALM");
}
*/
if(strlen($Emp)==0)$Emp="TODOS";
if(strlen($Alm)==0)$Alm="TODOS";
if(strlen($Doc)==0)$Doc="TODOS";
if(strlen($Anu)==0)$Anu="TODOS";
if(strlen($DocM)==0)$DocM="TODOS";
//
$Emp_=LIKE($Emp);
$Alm_=LIKE($Alm);
$Doc_=LIKE($Doc);
$Ser_="%".$Ser;
$Num_="%".$Num;
$Dex_=val_dex($Dex);
$Hax_=val_hax($Hax);
$Cli_="%".$Cli."%";
$Anu_=LIKE($Anu);
$DocM_=LIKE($DocM);
$SerM_="%".$SerM;
$NumM_="%".$NumM;
//
$FF="ID>0 AND EMP_NC LIKE '$Emp_' AND ALM_NC LIKE '$Alm_' AND COM LIKE '$Doc_' AND 
     SER LIKE '$Ser_' AND NUM LIKE '$Num_' AND FEC>='$Dex_' AND FEC<='$Hax_' AND 
	 CLI LIKE '$Cli_' AND ANU LIKE '$Anu_' AND COM_M LIKE '$DocM_' AND 
	 SER_M LIKE '$SerM_' AND NUM_M  LIKE '$NumM_' ";//
$VP_RegXPag=19;
$LStrTR=gn("count(*)","vis_fe_ventaz",$FF);
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;
?>


