<?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;}	
	$StrGT="";
	$LStrMsg="";
	$LStrFoc="";
	$LStrMM="";
	$StrAlm=V($_POST['CboAlm']);
	$StrDex=V($_POST['TxtDex']);
	$StrHax=V($_POST['TxtHax']);
	if($_SESSION['SYS_USER_ALM']=="%"){
		if(strlen($StrAlm)==0)$StrAlm=GetSO("alm_nombre","almacenes","id_almacen>0","alm_nombre");
	}else{
		$StrAlm=$_SESSION['SYS_USER_ALM'];
	}
	if(strlen($StrDex)==0) $StrDex=date("d-m-y");
	if(strlen($StrHax)==0) $StrHax=date("d-m-y");
	include("resumen_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>Cuadre de caja (En soles)</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/resumen.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==86 && e.altKey){
		if(AT=="1"){
		document.getElementById("CmdZ").click();
		return;
		}
	}
  
});
</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 GEN_MENU(vbval(V($_SESSION['SYS_USER_ID'])));
?>
</div>

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

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="img/ventas.png" class="iT" />
<div class="tT">CUADRE DE CAJA (En soles)</div>
</div>
<!--FIN_TITULO--------------------------------->
    
<div class="s1" style="left: 35px; top: 112px; width: 79px;">
ALMACEN</div>
<select name="CboAlm" id="CboAlm" 
class="lt" style="left: 35px; top: 131px; width: 199px" 
tabindex="<?php echo ++$TI;?>">
<?php 
	echo ListALM($StrAlm);
?>
</select>   

<div class="s1" style="left: 35px; top: 170px; width: 79px;">
(dd-mm-yy) DESDE</div>
<input name="TxtDex" type="text" id="TxtDex" 
class="fe" style="left: 35px; top: 206px; width: 90px" 
value="<?php echo $StrDex;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 144px; top: 170px; width: 64px;">
(dd-mm-yy) HASTA</div>
<input name="TxtHax" type="text" id="TxtHax" 
class="fe" style="left: 145px; top: 206px; width: 90px" 
value="<?php echo $StrHax;?>"  
tabindex="<?php echo ++$TI;?>"/>

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

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

<div class="datagrid" style="position: absolute; left: 297px; top: 72px; width: 360px; height: 510px;">
    <table width="358" border="0">
      <tr>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td colspan="2" style="background:#999; font-weight:bold;">CUADRO GENERAL</td>
        <td style="background:#999;">&nbsp;</td>
        <td style="background:#999;">&nbsp;</td>
        </tr>
      <tr>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td colspan="2" style="color:#0C0; font-weight:bold;">INGRESOS</td>
        <td width="73">&nbsp;</td>
        <td width="28">&nbsp;</td>
        </tr>
      <tr>
        <td width="30">&nbsp;</td>
        <td width="209" style="background:#999; color:#000">CAJA CHICA</td>
        <td align="right" style="background:#999; color:#000"><?php echo $_CAJ_CHI; ?></td>
        <td>&nbsp;</td>
        </tr>
       <tr>
        <td>&nbsp;</td>
        <td>VENTAS AL CONTADO</td>
        <td align="right"><?php echo $_VEN_CON;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>VENTAS AL CREDITO</td>
        <td align="right"><?php echo $_VEN_CRE;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>VENTAS CON DEPOSITO</td>
        <td align="right"><?php echo $_VEN_DEP;?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>VENTAS CON TARJETA</td>
        <td align="right"><?php echo $_VEN_TAR;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td  style="background:#999; color:#000">TOTAL VENTAS</td>
        <td align="right" style="background:#999; color:#000"><?php echo $_VEN_TOT;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="background:#999; color:#000">OTROS INGRESOS</td>
        <td align="right" style="background:#999; color:#000"><?php echo $_OTR_ING;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="background:#999; color:#000">COBROS DE VENTAS AL CREDITO</td>
        <td align="right" style="background:#999; color:#000"><?php echo $_COB_CRE;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="color:#0C0; font-weight:bold;">TOTAL INGRESOS</td>
        <td align="right" style="color:#0C0; font-weight:bold;"><?php echo $_TOT_ING;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td colspan="2" style="color:#F00; font-weight:bold;">EGRESOS</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>COMPRAS AL CONTADO</td>
        <td align="right"><?php echo $_COM_CON;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>COMPRAS AL CREDITO</td>
        <td align="right"><?php echo $_COM_CRE;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>COMPRAS CON TARJETA</td>
        <td align="right"><?php echo $_COM_TAR;?></td>
        <td>&nbsp;</td>
        </tr>
       <tr>
        <td>&nbsp;</td>
        <td  style="background:#999; color:#000">TOTAL COMPRAS</td>
        <td align="right" style="background:#999; color:#000"><?php echo $_COM_TOT;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="background:#999; color:#000">OTROS EGRESOS</td>
        <td align="right" style="background:#999; color:#000"><?php echo $_OTR_EGR;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="background:#999; color:#000">PAGOS DE COMPRAS AL CREDITO</td>
        <td align="right" style="background:#999; color:#000"><?php echo $_PAG_CRE;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="color:#F00; font-weight:bold;">TOTAL EGRESOS</td>
        <td align="right" style="color:#F00; font-weight:bold;"><?php echo $_TOT_EGR;?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>

    </table>

</div>


<div class="datagrid" style="position: absolute; left: 677px; top: 72px; width: 360px; height: 510px;">

    <table width="358" border="0">
      <tr>
        <td colspan="2">&nbsp;</td>
        <td width="73">&nbsp;</td>
        <td width="28">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2" style="background:#999; font-weight:bold;">RESUMEN GENERAL DE NETOS</td>
        <td style="background:#999;">&nbsp;</td>
        <td style="background:#999;">&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="30">&nbsp;</td>
        <td width="209" style="color:#0C0; font-weight:bold;">TOTAL INGRESOS</td>
        <td align="right" style="color:#0C0; font-weight:bold;"><?php echo $_TOT_ING;?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>(VENTAS AL CREDITO)</td>
        <td align="right">(<?php echo $_VEN_CRE;?>)</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>(VENTAS CON DEPOSITO)</td>
        <td align="right">(<?php echo $_VEN_DEP;?>)</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>(VENTAS CON TARJETA)</td>
        <td align="right">(<?php echo $_VEN_TAR;?>)</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="color:#0C0; font-weight:bold;">TOTAL INGRESOS NETO</td>
        <td  align="right" style="color:#0C0; font-weight:bold;"><?php echo $_TOT_ING_NET;?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="color:#F00; font-weight:bold;">TOTAL EGRESOS</td>
        <td align="right" style="color:#F00; font-weight:bold;"><?php echo $_TOT_EGR;?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>(COMPRAS AL CREDITO)</td>
        <td align="right">(<?php echo $_COM_CRE;?>)</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>(COMPRAS CON TARJETA)</td>
        <td align="right">(<?php echo $_COM_TAR;?>)</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td style="color:#F00; font-weight:bold;">TOTAL EGRESOS NETO</td>
        <td align="right" style="color:#F00; font-weight:bold;"><?php echo $_TOT_EGR_NET;?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td bgcolor="#999" style="color:#FF0">TOTAL INGRESOS NETO</td>
        <td align="right" bgcolor="#999" style="color:#FF0"><?php echo $_TOT_ING_NET;?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td bgcolor="#999" style="color:#FC0">(TOTAL EGRESOS NETO)</td>
        <td align="right" bgcolor="#999" style="color:#FC0">(<?php echo $_TOT_EGR_NET;?>)</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td bgcolor="#999">SALDO NETO EN EFECTIVO</td>
        <td align="right" bgcolor="#999"><?php echo $_NETO;?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>

</div>

<div id="DivDatosProd">
<input name="Pro_TxtId" type="hidden" id="Pro_TxtId" value=""/>
<input name="Pro_TxtDes" type="hidden" id="Pro_TxtDes" value=""/>
<input name="Pro_TxtPre" type="hidden" id="Pro_TxtPre" value=""/>
<input name="Pro_TxtPreM" type="hidden" id="Pro_TxtPreM" value=""/>
<input name="Pro_TxtCod" type="hidden" id="Pro_TxtCod" value=""/>
<input name="TxtRuc_" type="hidden" id="TxtRuc_"  />        
<input name="TxtIdCliente" type="hidden" id="TxtIdCliente" value="<?php echo $StrIdCliente; ?>"/>
</div>

<!--INI_OCULTOS-------------------------------->
<?php include("ocultos.php");?>
<!--FIN_OCULTOS-------------------------------->

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