<?php
session_start();
include("cls_conexion.php");
$CNN=new ClsMySQL();
include("conexion23.php");
include("phpmnu_fun.php");
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
/*
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
*/
$HW=V($_SESSION['SYS_HW']);
//-++++++
$StrGT="";$LStrMsg="";$LStrFoc="";$LStrMM="";
$LStrPag=V($_POST['TxtPag']);
//+++++++
$SYS_MSG="";
$SYS_FOC="Prv";
$SYS_KOD=0;
//+++++
$PRV_ORI="";
$PRV_NUM="";
$ES_XML=V($_POST['ES_XML']);
//
$IdUsu=vbval(V($_SESSION['SYS_USER_ID']));
//
$TODO_OK=1;
//
$MODO_AR=0;
include("xls_02_fun.php");
include("ges_facturas_fun.php");
//
$VP_RegXPag=10;
$LStrTR=0;//gn("count(*)","temp_compras","temc_index>0 AND cod_temc='$StrHWND'");
$LStrPag=0;//PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;
//++++
$AT=gs("at","usuarios","id_usuario=$IdUsu");
//++++
$ACC_INV_ELI=USU_PER_GET($IdUsu,"INV_ELI");
$ACC_INV_EDI=USU_PER_GET($IdUsu,"INV_EDI");
?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Facturas Xml</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="NumeroALetras.js"></script>
<script type="text/javascript" src="ja/ges_facturas28z.js"></script>
<script type="text/javascript" src="ja/funciones28.js"></script>
<!--FIN_SCRIPT------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />
<link rel="stylesheet" type="text/css" href="css/mnu.css"  />

<link rel="stylesheet" type="text/css" href="tcal.css" />
<script type="text/javascript" src="tcal.js"></script> 


<style type="text/css">
.tableFixHead          { overflow-y: auto; }
.tableFixHead thead th { position: sticky; top: 0; }
table  {border-collapse:collapse;width:100%;}
th, td {padding: 3px 3px;}
th     {background:#CCC;}


.cF {height:600px;width:1250px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

.tzt{
	background-color:transparent; width:100%; font-size:11px; position:inherit!Important; border:none;
}


.container {
  width: 300px;
}

.inner {
  display: flex;
  overflow-x: scroll;
}

.inner::-webkit-scrollbar {
  height: 8px;
}
  
.inner::-webkit-scrollbar-thumb {
  background-color:blue;
}

.inner::-webkit-scrollbar-track-piece:end {
  margin-right:20px; 
}

.inner::-webkit-scrollbar-track-piece:start {
  margin-left:20px;
}

.tdb{
	white-space:nowrap;
}


.tdx{
	white-space:nowrap; background-color:#F4F0A2;
}
.tdy{
	white-space:nowrap; background-color:#9BD6F4;
}
</style>
<script>
$(document).ready(function(){
   Inicializar();
   SYS_LOAD();  
   /*
   var acc_inv_eli=gv("ACC_INV_ELI");
   var acc_inv_edi=gv("ACC_INV_EDI");
   if(acc_inv_eli=="NO"){
	   document.getElementById("CmdE").disabled=true;
   }
   if(acc_inv_edi=="NO"){
	   document.getElementById("CmdG").disabled=true;
   }
   */
   if(gv("Ori")=="XML" || jL(gv("Ori"))==0){
   	document.getElementById("Fec").style.backgroundColor="#CCC";
   }
   //jF("Fec");
});
//----------------------------------------------------------
var FOCO=0;
//
var XML_EMP_TOT=<?php echo gn("count(*)","ges_xml_empresas","id>0");?>;
var XML_EMP_RUC=new Array();
var XML_EMP_RET=new Array();

//
<?php
$IDX=0;
$s="SELECT * FROM ges_xml_empresas WHERE id>0";
$rs=grs($s);
while($r=$rs->fetch_assoc()){
	$RUC=$r['emp_ruc'];
	$RET=$r['emp_age'];
	$IDX++;
?>
	XML_EMP_RUC[<?php echo $IDX;?>]="<?php echo $RUC;?>";
	XML_EMP_RET[<?php echo $IDX;?>]="<?php echo $RET;?>";
<?php
}
?>
</script>

</head>

<body >
<div align="center">

<div class="mM" align="left" style="font-size:12px">
<?php
echo GEN_MENU($IdUsu);
?>
</div>


<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;" >
<form id="Frm" name="Frm" method="post" action="ges_facturas.php" enctype="multipart/form-data"
autocomplete="off" style="margin:0px; padding:0px; display:inline;" onSubmit="return false;">
<!--TITULO-------------------------------->
<div id="DivT" class="dT" >
<img src="png/ges_invoi.png" width="53" height="53" class="iT" />
<div class="tT">XML FACTURAS</div>
</div>


<!--TEXTOS-------------------------------->


<div class="s1" style="left: 581px; top: 71px; width: 630px; height: 53px; background-color: #F4FCDC; border-radius: 5px;">
<div class="s1" style="left: 9px; top: 5px; width: 139px;"><b>IMPORTANTE</b></div>
<div class="s1" style="left: 9px; top: 18px; width: 613px;">En origen de datos manual, puede ingrese ruc y presionar Enter para completar el nombre del emisor o cliente previamente registrado. Tambien al digitar el sub total se calculara el igv y total. </div>

</div>


<div class="s1" style="left: 35px; top: 136px; width: 140px;"> ORIGEN DE DATOS
</div>
<select name="Ori" id="Ori"  onChange="OriOC()" 
class="lt" style="left: 35px; top: 154px; width: 119px" 
tabindex="<?php echo ++$TI;?>">
<?php 
	if(vbval($StrId)==0){
		if($ES_XML==0){
			echo FCBO("aux_des","auxiliar","aux_nom='FE_ORI'",$Ori,"N","S");
		}else{
			echo FCBO("aux_des","auxiliar","aux_nom='FE_ORI' AND aux_des='XML' ",$Ori,"N","N");
		}
	}else{
		echo FCBO("aux_des","auxiliar","aux_nom='FE_ORI' AND aux_des='$Ori' ",$Ori,"N","N");
	}
?>
</select>
<?php
$CSS_ROI="roi";
if($Ori=="MANUAL"){
	$CSS_ROI="";
}
?>

<div class="s1" style="left: 172px; top: 136px; width: 92px;">
SERIE</div>
<input name="Ser"  type="text" id="Ser"
class="lt <?php echo $CSS_ROI;?>" style="left: 170px; top: 154px; width: 77px" 
value="<?php echo $Ser;?>" 
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 259px; top: 136px; width: 80px;">
NUMERO</div>
<input name="Num"  type="text" id="Num"
class="lt <?php echo $CSS_ROI;?>" style="left: 260px; top: 154px; width: 94px" 
value="<?php echo $Num;?>" 
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 366px; top: 136px; width: 168px;">
FECHA</div>
<input name="Fec"  type="text" id="Fec" 
class="fez tcal <?php echo $CSS_ROI;?>  " style="left: 368px; top: 154px; width: 112px" 
value="<?php echo FEP($Fec);?>" 
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 491px; top: 136px; width: 91px;">
MONEDA</div>
<select name="Mnd" id="Mnd"  onChange="MndOC()" 
class="lt <?php echo $CSS_ROI;?>" style="left: 491px; top: 154px; width: 95px" 
tabindex="<?php echo ++$TI;?>">
<?php
	if($ES_XML==1){
		echo FCBO("nom","ges_xml_mnd","id>0 AND nom='$Mnd'",$Mnd,"N","N");
	}else{
		echo FCBO("nom","ges_xml_mnd","id>0",$Mnd,"N","S");
	}
?>
</select>
<script>
	function MndOC(){
		var mnd=gv("Mnd");
		if(mnd=="PEN"){
			sv("Tca","1");
		}else{
			sv("Tca","");
		}
	}
</script>


<div class="s1" style="left: 597px; top: 136px; width: 126px;">
EMISOR RUC+</div>
<input name="EmiRuc"  type="text" id="EmiRuc"
class="ltx <?php echo $CSS_ROI;?>" style="left: 596px; top: 154px; width: 140px" 
value="<?php echo $EmiRuc;?>"  maxlength="11"  onKeyDown="fKeyEmiRuc('CliRuc')"
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 745px; top: 136px; width: 187px;">
EMISOR NOMBRE</div>
<input name="EmiNom"  type="text" id="EmiNom"
class="lt <?php echo $CSS_ROI;?>" style="left: 743px; top: 154px; width: 468px" 
value="<?php echo $EmiNom;?>" 
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 35px; top: 197px; width: 125px;">
CLIENTE RUC+</div>
<input name="CliRuc"  type="text" id="CliRuc"
class="ltx <?php echo $CSS_ROI;?>" style="left: 35px; top: 215px; width: 119px" 
value="<?php echo $CliRuc;?>"  maxlength="11" onKeyDown="fKeyCliRuc('CliNom')"
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 170px; top: 197px; width: 178px;">
CLIENTE NOMBRE</div>
<input name="CliNom"  type="text" id="CliNom"
class="lt <?php echo $CSS_ROI;?>" style="left: 170px; top: 215px; width: 311px" 
value="<?php echo $CliNom;?>" 
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 491px; top: 196px; width: 100px;">
SUB TOTAL +</div>
<input name="Sto"  type="text" id="Sto"
class="ndd <?php echo $CSS_ROI;?>" style="left: 491px; top: 214px; width: 95px" 
value="<?php echo NF2(vbval($Sto),2);?>"  onKeyUp="fxSto();"
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 596px; top: 196px; width: 66px;">
IGV</div>
<input name="Igv"  type="text" id="Igv"
class="ndd <?php echo $CSS_ROI;?>" style="left: 596px; top: 214px; width: 93px" 
value="<?php echo NF2(vbval($Igv),2);?>" 
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 698px; top: 196px; width: 68px;">
TOTAL</div>
<input name="Tot"  type="text" id="Tot"
class="ndd <?php echo $CSS_ROI;?>" style="left: 698px; top: 214px; width: 107px" 
value="<?php echo NF2(vbval($Tot),2);?>" 
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 814px; top: 182px; width: 74px;"> FORMA DE PAGO
</div>
<select name="Fdp" id="Fdp"  
class="lt <?php echo $CSS_ROI;?>" style="left: 813px; top: 214px; width: 88px" 
tabindex="<?php echo ++$TI;?>">
<?php
	if($ES_XML==1){
		echo FCBO("valor","ges_xml_aux","tab='FDP' AND valor='$Fdp' ",$Fdp,"N","N");
	}else{
		echo FCBO("valor","ges_xml_aux","tab='FDP'",$Fdp,"N","S");
	}
?>
</select>

<?php
if(strlen($Ret)==0)$Ret="SI";
?>
<div class="s1" style="left: 911px; top: 183px; width: 81px;">APLICAR RETENCION</div>
<select name="Ret" id="Ret"  
class="lt <?php echo $CSS_ROI;?>" style="left: 912px; top: 214px; width: 80px" 
tabindex="<?php echo ++$TI;?>">
<?php
	echo FCBO("aux_nom","auxiliar","aux_des='SN'",$Ret,"N","N");
?>
</select>


<div class="s1" style="left: 1004px; top: 183px; width: 105px;"> TIPO DE CAMBIO (referencial)
</div>
<input name="Tca"  type="text" id="Tca"
class="ndd " style="left: 1004px; top: 214px; width: 104px" 
value="<?php echo NF2(vbval($Tca),2);?>" 
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 1116px; top: 196px; width: 60px;">
LOTE</div>
<input name="Lot"  type="text" id="Lot"
class="lt" style="left: 1116px; top: 214px; width: 94px" 
value="<?php echo $Lot;?>" 
tabindex="<?php echo ++$TI;?>"/>




<p>&nbsp;</p>
<?php if(strlen($Fec)==0)$Fec=date("d-m-y");?>
<div class="s1" id="DivInvEli" style="left:223px; top: 53px; width: 251px; height:25px; background-color:#FF9; display:none">
  <table width="100%" border="0" style="font-family:Tahoma, Geneva, sans-serif; font-size:11px">
<tr>
<td>
<input type="checkbox" name="CH_INV_ELI" id="CH_INV_ELI" style="position:inherit" >
</td>
<td>&nbsp;</td>
<td>CONFIRMAR ELIMINAR FACTURA</td>
</tr>
</table>
</div>


<div class="s1" style="left: 35px; top: 244px; width: 258px;">
<b>CUOTAS</b></div>



<div class="s1" style="left: 35px; top: 265px; width: 73px;">CUOTA NRO</div>
<input name="CuoNro"  type="text" id="CuoNro"
class="lt" style="left: 35px; top: 282px; width: 93px" 
value=""  maxlength="15"
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 139px; top: 265px; width: 126px;">
FECHA (dd-mm-yyyy)</div>
<input name="CuoFec"  type="text" id="CuoFec"
class="fez tcal" style="left: 140px; top: 282px; width: 127px" 
value="" 
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 286px; top: 265px; width: 65px;">
TOTAL</div>
<input name="CuoTot"  type="text" id="CuoTot"
class="ndd" style="left: 286px; top: 282px; width: 110px" 
value="" 
tabindex="<?php echo ++$TI;?>"/>



<div class="s1" style="left: 410px; top: 265px; width: 73px;"> TIPO
</div>
<select name="CuoTip" id="CuoTip"  
class="lt" style="left: 410px; top: 282px; width: 128px" 
tabindex="<?php echo ++$TI;?>">
<?php 
	echo FCBO("valor","ges_xml_aux","tab='TC'","","N","S");
?>
</select>


<div class="s1" style="left: 549px; top: 265px; width: 239px;">
OBSERVACION</div>
<input name="CuoObs"  type="text" id="CuoObs"
class="lt" style="left: 548px; top: 282px; width: 434px" 
value=""  maxlength="50" 
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 991px; top: 249px; width: 132px;"> FECHA PROGRAMADA ( Opcional )
</div>
<input name="CuoFecPro"  type="text" id="CuoFecPro"
class="fez tcal" style="left: 990px; top: 282px; width: 127px" 
value="" 
tabindex="<?php echo ++$TI;?>"/>



<input type="button" name="CmdAddCuo" id="CmdAddCuo" 
value="Agregar" tabindex="<?php echo ++$TI;?>"
onClick="fxImpCuo()"  
style="position: absolute; left: 1121px; top: 282px; width: 89px;"
/>







<div class="tableFixHead" style="position: absolute; left: 35px; top: 319px; width: 1175px; height: 170px; overflow: auto; border: solid 1px #A9A9A9">
<table width="100%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px;" >
<thead>

<tr>
<th style="border: 1px solid black;" width="2%" height="21">O</th>
<th style="border: 1px solid black;" width="4%">Nro</th>
<th style="border: 1px solid black;" width="5%">FECHA</th>
<th style="border: 1px solid black;" width="5%">TOTAL</th>
<th style="border: 1px solid black;" width="4%">TIPO</th>
<th style="border: 1px solid black;" width="8%">OBS.</th>

<th style="border: 1px solid black;" width="9%">F.PROGRAMADA</th>
<th style="border: 1px solid black;" width="3%">&nbsp;</th>

<th style="border: 1px solid black;" width="7%">P.REGULAR</th>
<th style="border: 1px solid black;" width="16%">P.ESTADO</th>
<th style="border: 1px solid black;" width="9%">F.PAGO</th>
<th style="border: 1px solid black;" width="11%">RETENCION</th>
<th style="border: 1px solid black;" width="5%">R.ESTADO</th>

<th style="border: 1px solid black;" width="2%" >&nbsp;</th>
<th style="border: 1px solid black;" width="5%" >&nbsp;</th>
<th style="border: 1px solid black;" width="5%" >&nbsp;</th>
</tr>

</thead>
<tbody>

<?php
	$TOTAL_CUO=0;
	$TOTAL_CUO_PAG=0;	
	$ZX=0;
	$s="SELECT * FROM ges_xml_tmp_cuo WHERE hw='$HW' AND usu=$IdUsu ORDER BY id_cuo";
	$rs=grs($s);
	while($r=$rs->fetch_assoc()){
		$ZX++;
		$CSS="";
		if($ZX%2==0)$CSS=' style="background-color:#DADADA" ';
		if($r['cuo_anu']=="NO"){
			$TOTAL_CUO=$TOTAL_CUO + $r['cuo_tot'];
		}
		/*
		if($r['cuo_pag']=="SI"){
			$TOTAL_CUO_PAG=$TOTAL_CUO_PAG + $r['cuo_tot'];
		}
		*/
		//
		$TOTAL_CUO_PAG=$TOTAL_CUO_PAG + ($r['cuo_ret_tot'] + $r['cuo_pag_tot']);
		//
		$TD_KEY="td_".$r['id_cuo'];
		$TR_CUO="tr_".$r['id_cuo'];
		//
		$CMD_ANU="cmd_anu_".$r['id_cuo'];
		$CMD_PAG="cmd_pag_".$r['id_cuo'];
		//
		$ESTADO="";
		$PAG_DIS="";
		$ANU_DIS="";
		if($r['cuo_anu']=="SI"){
			$ESTADO="ANULADO";
			$PAG_DIS=" disabled ";
			$ANU_DIS=" disabled ";
		}else{
			if($r['cuo_pag_tot']>0){
				$ESTADO="<b>PAGADO</b>";
				$ANU_DIS=" disabled ";
			}else{
				$ESTADO="PENDIENTE";
			}
		}
		//
		$ESTADO_RET="";
		if($r['cuo_ret_tot']>0){
			$ESTADO_RET="<b>PAGADO</b>";
		}else{
			if($r['cuo_tot_ret']>0){
				$ESTADO_RET="PENDIENTE";
			}
		}
		
	?>
		<tr  <?php echo $CSS;?> id="<?php echo $TR_CUO;?>" >
		<!----------------------------------------------->
        <td style="border: 1px solid black;white-space: nowrap;" align="center" ><?php echo substr($r['cuo_ori'],0,1);?></td>
		<td style="border: 1px solid black;white-space: nowrap;" ><?php echo $r['cuo_nro'];?></td>
		<td style="border: 1px solid black;white-space: nowrap;" align="center" ><?php echo FEP($r['cuo_fec']);?></td>
        <td style="border: 1px solid black;white-space: nowrap;" align="right"><?php echo NF2($r['cuo_tot'],2);?></td>
        <td style="border: 1px solid black;white-space: nowrap;" align="center" ><?php echo $r['cuo_tip'];?></td>
        <td style="border: 1px solid black;white-space: nowrap;" ><?php echo $r['cuo_obs'];?></td>
        
        <td style="border: 1px solid black;white-space: nowrap;" align="center" ><?php echo FEP($r['cuo_fep']);?></td>
        
        <td style="border: 1px solid black;white-space: nowrap;" align="center" >
          <img src="img/b_edit.png" width="16" height="16" style="cursor:pointer" onClick="fxFecPro('<?php echo $r['id_cuo'];?>')">
        </td>
        
        
        <td style="border: 1px solid black;white-space: nowrap;" align="right" ><?php echo NF2($r['cuo_tot_pag'],2);?></td>
        
        <td style="border: 1px solid black;white-space: nowrap;" align="center" ><?php echo $ESTADO;?></td>
        <td style="border: 1px solid black;white-space: nowrap;" align="center" ><?php echo FEP($r['cuo_pag_fec']);?></td>

        
        
        <td style="border: 1px solid black;white-space: nowrap;" align="right" ><?php echo NF2($r['cuo_tot_ret'],2);?></td>
        <td style="border: 1px solid black;white-space: nowrap;" align="center" ><?php echo $ESTADO_RET;?></td>
        
        
        
        <td style="border: 1px solid black;white-space: nowrap;" >        
        <?php if(!($r['cuo_anu']=="SI" || $r['cuo_pag']=="SI")){ ?>
        <img src="img/el.png"  style="cursor:pointer" width="16" height="16" 
        onClick="fxCuoKil('<?php echo $r['id_cuo'];?>','<?php echo $r['cuo_ori'];?>')"></td>
        <?php }?>
        
        <td style="border: 1px solid black;white-space: nowrap;" >
        <input name="<?php echo $CMD_ANU;?>"  <?php echo $ANU_DIS; ?> 
        onClick="fxCuoAnu('<?php echo $r['id_cuo'];?>')"
        id="<?php echo $CMD_ANU;?>" type="button" 
        value="Anular" style="width:100%"> 
        </td>
        
        <td style="border: 1px solid black;white-space: nowrap;" >
        <input name="<?php echo $CMD_PAG;?>"  
        onClick="fxCuoPag('<?php echo $r['id_cuo'];?>',this)"
        id="<?php echo $CMD_PAG;?>" type="button" <?php echo $PAG_DIS; ?>
        value="Ver" style="width:50px"> 
        </td>
        
        <!----------------------------------------------->
        </tr>
	<?php
		
	}		
?>
<script>
function POP_ACT(){
	//alert("OK");+++
	SM("ACTUALIZAR");
}
</script>
</tbody>
</table>
</div>


<div class="s1" style="left: 706px; top: 497px; width: 157px;">
<b>MONTO TOTAL CUOTAS</b></div>

<input  type="text" 
class="rod" style="left: 707px; top: 515px; width: 147px; height: 25px; border: none;"
value="<?php echo NF2($TOTAL_CUO,2);?>" />


<div class="s1" style="left: 872px; top: 497px; width: 230px;">
<b>MONTO TOTAL CUOTAS PAGADAS</b></div>

<input  type="text" 
class="rod" style="left: 872px; top: 515px; width: 199px; height: 25px; border: none;"
value="<?php echo NF2($TOTAL_CUO_PAG,2);?>" />



<div class="s1" style="left: 1091px; top: 497px; width: 121px; text-align: right">
<b>SALDO PENDIENTE</b></div>

<input type="text"  
class="rod" style="left: 1091px; top: 515px; width: 119px; height: 25px; border: none;"
value="<?php echo NF2($TOTAL_CUO - $TOTAL_CUO_PAG,2);?>" />





<input name="TXT_TI" type="hidden" id="TXT_TI" value="<?php echo $ZX;?>"/>

<?php
$BIS=" disabled ";
/*
if(vbval($StrId)>0){
	
}
*/
?>
<div class="s1" style="left: 35px; top: 506px; width: 188px;">
SELECCIONAR XML</div>

<div  align="left"
style="position: absolute; left: 35px; top: 523px; width: 291px; height: 24px">
<input name="Productos" type="file" id="Productos"  <?php echo $BIS; ?>
tabindex="<?php echo ++$TI;?>"/>
</div>


<input type="button" name="CmdXls1" id="CmdXls1" 
value="Importar xml"  <?php echo $BIS; ?>
onClick="fxImpXml()" style="position: absolute; left: 35px; top: 548px; width: 100px;"
/>
<input type="button" name="CmdRpt1" id="CmdRpt1"  style="position: absolute; left: 175px; top: 567px; width: 88px; background-color:#FC6"
value="Empresas"  
onClick="verEmpresas()" />
<script>
function verEmpresas(){
	document.getElementById("LnkEmp").click();
}
</script>
<a href="ges_xml_empresas.php" id="LnkEmp" style="display:none" target="new">ges_xml_empresas.php</a>

<div class="s1" style="left: 317px; top: 549px; width: 188px;">
<b>REPORTE DE CUOTAS</b></div>
<input type="button" name="CmdRpt1" id="CmdRpt1"  style="position: absolute; left: 314px; top: 567px; width: 180px; background-color: #C4EFA3"
value="Pendientes por programar"  
onClick="fBuscar('ges_facturas_rpt_por_programar.php');" />


<input type="button" name="CmdRpt1" id="CmdRpt1"  
style="position: absolute; left: 501px; top: 567px; width: 180px; background-color: #C4EFA3"
value="Programadas por pagar"  
onClick="fBuscar('ges_facturas_rpt_prog_x_pagar.php');" />


<input type="button" name="CmdRpt1" id="CmdRpt1"  
style="position: absolute; left: 691px; top: 567px; width: 176px; background-color: #C4EFA3"
value="Programadas vencidas"  
onClick="fBuscar('ges_facturas_cuo_ven.php');" />


<input type="button" name="CmdRpt1" id="CmdRpt1"  
style="position: absolute; left: 873px; top: 567px; width: 77px; background-color: #C4EFA3"
value="Pagadas"  
onClick="fBuscar('ges_facturas_rpt_pagados.php');" />

<input type="button" name="CmdRpt1" id="CmdRpt1"  
style="position: absolute; left: 960px; top: 567px; width: 249px; background-color: #C4EFA3"
value="Retenciones pendientes por pagar"  
onClick="fBuscar('ges_facturas_rpt_retenciones.php');" />









<!--BOTONES-------------------------------->
<div class="s1" style="left: 35px; top: 85px; width: 500px; height: 26px;">
<input name="CmdB" type="button" id="CmdG" class="btm"
onclick="fGuardar();" 
<?php
if(strlen($StrId)==0){
	echo "value=\"Guardar\"";
}else{			
	echo "value=\"Modificar\"";

	$StrAnu="N";//gs("anulado","compras","id_compra=$StrId");
	if($StrAnu=="S"){
	echo " disabled=\"disabled\"";
	}
}
?>
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdC"  class="btm"
value="Nuevo" onClick="fCancelarPHP();"  
tabindex="<?php echo ++$TI;?>" />


<input name="CmdB" type="button" id="CmdE" class="btm"
value="Eliminar" onClick="fLEliminar();"
<?php
if(strlen($StrId)==0){
	echo ' disabled="disabled" ';
}
?>
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdB" class="btm"
value="Buscar" onClick="fBuscar('ges_facturas_b.php');"  
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdB" class="btm" style="width:120px"
value="Buscar detallado" onClick="fBuscar('ges_facturas_det_b.php');"  
tabindex="<?php echo ++$TI;?>" />




</div>
<!--BOTONES-------------------------------->
<!--INI_OCULTOS-------------------------------->
<?php include("ocultos.php");?>
<div>
<input name="TxtHora" type="hidden" id="TxtHora" value="0" />
<input name="TxtRuc_" type="hidden" id="TxtRuc_"  />       
</div>
<!--FIN_OCULTOS-------------------------------->
<input name="HW" id="HW" type="hidden"  value="<?php echo $HW;?>">
<input name="CUO_KEY" id="CUO_KEY" type="hidden"  value="">

<input name="SYS_MSG" type="hidden" id="SYS_MSG" value="<?php echo $SYS_MSG;?>"/>
<input name="SYS_FOC" type="hidden" id="SYS_FOC" value="<?php echo $SYS_FOC;?>"/>

<input name="ES_XML" type="hidden" id="ES_XML" value="<?php echo $ES_XML;?>"/>

<input name="ACC_INV_ELI" type="hidden" id="ACC_INV_ELI" value="<?php echo $ACC_INV_ELI;?>"/>
<input name="ACC_INV_EDI" type="hidden" id="ACC_INV_EDI" value="<?php echo $ACC_INV_EDI;?>"/>

</form>
</div>
</div>
, 
</body>
</html>

