<?php
	session_start();
	include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
	if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
	//-------------------------	
	$StrGT="";
	$VP_RegXPag=10;
	$LStrMsg="";
	$LStrFoc="";
	$LStrMM="";
	$LStrPag=V($_POST['TxtPag']);
	//$LStrTR=gn("count(*)","marcas","");
	include("proveedores_edc_fun.php");
	
$IdUsu=$_SESSION['SYS_USER_ID'];
$AT=gs("at","usuarios","id_usuario=$IdUsu");
?>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Proveedores - Estado de Cuenta</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/proveedores_edc.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"  />

<style type="text/css">
.cF {height:600px;width:1250px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

</style>
<script>
$(document).ready(function(){  
   Inicializar();
});

$(document).keydown(function(e){
	var AT=gv("TxtAT");
	
	if(e.which==71 && e.altKey){		
		if(AT=="1"){	
		document.getElementById("CmdG").click();
		return;
		}
	}
	
	if(e.which==78 && e.altKey){
		if(AT=="1"){
		document.getElementById("CmdC").click();
		return;
		}
	}
	
	if(e.which==75 && e.altKey){
		if(AT=="1"){	
		document.getElementById("CmdE").click();
		return;
		}
	}

	if(e.which==66 && e.altKey){
		if(AT=="1"){	
		document.getElementById("CmdB").click();
		return;
		}
	}

	if(e.which==77 && e.altKey){
		if(AT=="1"){
		document.getElementById("CmdZ").click();
		return;
		}
	}
  
});

function SelPro(){
	Ow("proveedores_edc_seleccionar.php",800*ZO(),600*ZO());
}

</script>
</head>

<body  <?php echo $LStrMsg;?>>
<div align="center">

<div class="mM" align="left" style="font-size:12px">
<?php
$HTM=file_get_contents("http://inversionessounduniversal.com/ventas/phpmnu.php?USER_ID=$IdUsu");
echo $HTM;
?>
</div>

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;">
<form id="Frm" name="Frm" method="post" action="proveedores_edc.php" style="margin:0px; padding:0px; display:inline;" onSubmit="return false;">

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="img/pagos.png" class="iT" />
<div class="tT">EST. DE CUENTA PROVEEDORES</div>
</div>
<!--FIN_TITULO--------------------------------->

<div class="s1" style="left: 34px; top: 117px; width: 79px;">ALMACEN</div>
<select name="CboAlm" id="CboAlm" 
class="lt" style="left: 33px; top: 134px; width: 211px" 
tabindex="<?php echo ++$TI;?>">
<?php echo ListALM($StrAlm); ?>
</select>

<div class="s1" style="left: 253px; top: 117px; width: 67px;">FECHA</div>
<input name="TxtFec" type="text" id="TxtFec" 
class="fe" style="left: 253px; top: 134px; width: 75px" 
value="<?php echo $StrFec;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 343px; top: 117px; width: 199px;">PROVEEDOR</div>
<input name="TxtPro" type="text" id="TxtPro" 
class="roi" style="left: 340px; top: 134px; width: 490px;" 
value="<?php echo $StrPro;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 841px; top: 134px; width: 69px; height: 25px;">
<input type="button" name="CmdSel" id="CmdSel" value="..." 
onclick="SelPro()" 
style="width:30px" 
<?php
if(strlen($StrId)>0){
	echo "disabled=\"disabled\"";
}
?>
tabindex="<?php echo ++$TI;?>"/>

<input type="button" 
name="CmdCls" id="CmdCls"  style="width:30px"
value="X" onClick="fCls();" 
<?php
if(strlen($StrId)>0){
	echo "disabled=\"disabled\"";
}
?>
tabindex="<?php echo ++$TI;?>" />
</div>

<div class="s1" style="left: 917px; top: 117px; width: 86px;">MONEDA</div>
<select name="CboMon" id="CboMon" 
class="lt" style="left: 916px; top: 134px; width: 90px" 
onchange="fGetSaldoDol(document.getElementById('TxtIdPro').value,this.value);"
tabindex="<?php echo ++$TI;?>" >
<?php //echo FCBO_("mon_nombre","monedas","mon_nombre IN ('SOLES','DOLARES')",$StrMon,"N","S");?>
<?php echo FCBOO_("mon_nombre","monedas","id_moneda<>'X'",$StrMon,"N","N","mon_nombre DESC")?> 

</select>

<div class="s1" style="left: 1017px; top: 117px; width: 63px;">SALDO</div>
<div id="DivSaldo" align="right" class="s1" style="border-style: solid; border-width: 1px; color: #00F; z-index: 2; position: absolute; left: 1017px; top: 134px; width: 57px; text-align: right;">
      0.00
</div>


<div class="s1" style="left: 1084px; top: 117px; width: 47px;">TOTAL</div>
<input name="TxtTot" type="text" id="TxtTot" 
class="lt" style="left: 1084px; top: 134px; width: 60px; text-align: right" 
value="<?php echo $StrTot;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 37px; top: 187px; width: 110px;">FORMA DE PAGO</div>
<select name="CboFdp" id="CboFdp" 
class="lt" style="left: 37px; top: 205px; width: 155px" 
onchange="fFormaDePago();" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("nombre","fpagos","id_fpago>0",$StrFdp,"","");?>
</select>

<div class="s1" style="left: 202px; top: 187px; width: 127px;">NUMERO DE PAGO</div>
<input name="TxtNdp" type="text" id="TxtNdp" 
class="lt" style="left: 202px; top: 205px; width: 123px" 
value="<?php echo $StrNdp;?>"  
tabindex="<?php echo ++$TI;?>"  readonly="readonly"/>

<div class="s1" style="left: 341px; top: 187px; width: 95px;">FECHA VCTO</div>
<input name="TxtFecVen" type="text" id="TxtFecVen" 
class="fe" style="left: 341px; top: 205px; width: 80px" 
value="<?php echo  $StrFecVen;?>"  
tabindex="<?php echo ++$TI;?>"  readonly="readonly"/>

<div class="s1" style="left: 485px; top: 187px; width: 135px;">REFERENCIA</div>
<div class="s1" style="left: 486px; top: 169px; width: 131px; height: 19px;">COMPROBANTE</div>
<select name="CboCom" id="CboCom" 
class="lt" style="left: 486px; top: 205px; width:135px" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("com_nombre","comprobantes","id_comprobante>0",$StrCom,"N","S");?>
</select>

<div class="s1" style="left: 631px; top: 187px; width: 47px;">SERIE</div>
<input name="TxtSer" type="text" id="TxtSer" 
class="lt" style="left: 630px; top: 205px; width:50px" 
value="<?php echo $StrSer;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 691px; top: 187px; width: 64px;">NUMERO</div>
<input name="TxtNum" type="text" id="TxtNum" 
class="lt" style="left: 688px; top: 205px; width:80px" 
value="<?php echo $StrNum;?>"  
tabindex="<?php echo ++$TI;?>" />

<!--INI_BOTONES-------------------------------->
<div id="DivBtn" align="left" style="position:absolute; left: 33px; top: 71px; width:1000px; height: 26px;">
<input name="CmdB" type="button" id="CmdG" class="btm" 
<?php GOM($StrId);?>
onclick="fGuardar();"  
tabindex="<?php echo ++$TI;?>"/>

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

<input name="CmdB" type="button" id="CmdE" class="btm" 
value="Eliminar" onClick="fEliminar();"
<?php DIS($StrId);?>
tabindex="<?php echo ++$TI;?>" />

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

<input name="CmdB" type="button" id="CmdZ" class="btm"
value="Est.Cuenta" onClick="fBuscar('pagos_historial.php');"  
tabindex="<?php echo ++$TI;?>"/>
 
</div>
<!--FIN_BOTONES-------------------------------->

    
<div id="layer21" style="position:absolute; left: 149px; top: 262px; width: 152px; height: 25px;">
<div align="left" class="Estilo2">
<?php
if(strlen($StrId)>0  && $StrFdp!="EFECTIVO"){
if(strlen($StrFecPag)==0){
echo "<input type=\"button\" name=\"CmdPagar\" ";
echo "id=\"CmdPagar\" value=\"Pagar\" onclick=\"fPagar();\"  style=\"width:150px\"/>";
}else{
echo "<input type=\"button\" name=\"CmdPagar\" ";
echo "id=\"CmdPagar\" value=\"Deshacer pago\" ";
echo "onclick=\"fDeshacer();\"  style=\"width:150px\"/>";
}
}
?>
</div>
</div>
    
<?php
if(strlen($StrId)>0  && $StrFdp!="EFECTIVO"){
echo "<div class=\"Estilo2\" align=\"left\"";
echo "style=\"position:absolute; left: 37px; top: 241px; width: 108px;\">";
echo "FECHA DE PAGO";
echo "</div>";

}
?>
    
<div id="layer23" style="position:absolute; left: 37px; top: 261px; width: 101px; height: 25px;">
<?php
if(strlen($StrId)>0 && $StrFdp!="EFECTIVO"){
if(strlen($StrFecPag)==0){
echo "<input name=\"TxtFecPag\" type=\"text\" id=\"TxtFecPag\" ";
echo "style=\"width:100px\" ";
echo "value=\"\"  ";
echo "onkeydown=\"return SoloFec(this,event,'CmdPagar');\" ";
echo "tabindex=\"1\" />";
}else{
echo "<input name=\"TxtFecPag\" type=\"text\" id=\"TxtFecPag\" ";
echo "style=\"width:100px\" ";
echo "value=\"$StrFecPag\"  ";
echo "onkeydown=\"return SoloFec(this,event,'CmdPagar');\" ";
echo "tabindex=\"1\" readonly=\"readonly\" />";
	
}
}
?>
</div>
    
    
<!--INI_OCULTOS-------------------------------->
<?php include("ocultos.php");?>
<!--FIN_OCULTOS-------------------------------->
<input type="hidden" name="TxtIdPro" id="TxtIdPro" />
    

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