<?php
ini_set("session.cookie_lifetime",60*60*10);
ini_set("session.gc_maxlifetime", 60*60*10);
	session_start();	
	//-------------------------	+++
	include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
	if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
	//
if(vbval($_SESSION['SYS_USER_GI'])!=USU_GET_GI($_SESSION['SYS_USER_ID'])){
	JsDir("cerrar.php");	
	return;
}
//	
	$StrGT="";
	$LStrMsg="";
	$LStrFoc="";
	$LStrMM="";	
	$StrEmp=V($_POST['CboEmp']);
	$StrDex=V($_POST['TxtDex']);
	$StrHax=V($_POST['TxtHax']);
	$StrAG=V($_POST['CboAG']);
	if(strlen($StrAG)==0)$StrAG="SI";
	//
	if(strlen($StrEmp)==0)$StrEmp=GE("S");
	//
	if(strlen($StrDex)==0) $StrDex=date("d-m-y");
	if(strlen($StrHax)==0) $StrHax=date("d-m-y");
	include("cuadredecaja_fun.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cuadre de caja (En soles)</title>
<script src="jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="jquery.maskedinput.min.js" type="text/javascript"></script>
<script type="text/javascript" src="fe/funcionez.js"></script>
<script type="text/javascript" src="fe/cuadredecaja.js"></script>
<script language="javascript">
$(document).ready(function() {
	$(".botonExcel").click(function(event) {
		$("#datos_a_enviar").val( $("<div>").append( $("#Exportar_a_Excel").eq(0).clone()).html());
		$("#FormularioExportacion").submit();
	});
    $("#TxtDex").mask("99-99-99"); 
	$("#TxtHax").mask("99-99-99"); 
});
</script>
<style type="text/css">
<!--
#TAB_CAPTION .estilo888 {
	color: #000;
}
-->
</style><style type="text/css">
<!--
body {
	background-color: #CCC;
	background-image: url();
}
#Layer1 {
	position:absolute;
	left:345px;
	top:115px;
	width:123px;
	height:35px;
	z-index:1;
}
.centrarFrm{
	width:800px;
	height:800px;
	position:absolute;
	left:<?php echo "50%";?>;
	top:<?php echo "30%";?>;
	background-color:#646464;
	margin:<?php echo "-200px";?> 0 0 <?php echo "-400px";?>;
}
#Layer2 {
	position:absolute;
	left:409px;
	top:205px;
	width:82px;
	height:24px;
	z-index:1;
}
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #FFFFFF;
}
.f2 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; font-size: 12px; }
.Estilo3 {color: #FFFFFF; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.Estilo4 {color: #000099}
.Estilo5 {color: #000000}
#Frm center #DivFRM #layer .Estilo1 strong {
	color: #900;
}
#Frm center #DivFRM #layer3 .f2 table tr td {
	color: #000;
}
#Frm center #DivFRM #layer3 .f2 table tr td table tr td {
	color: #FFF;
}
.sFA {	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #FF3;
	font-size: 12px;
}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?>>
<div Id="DivFRM"  class="centrarFrm"  >
<form id="Frm" name="Frm" method="post" action="cuadredecaja.php">
<center> 
  
    <div id="layer4" style="position:absolute; left: 31px; top: 85px; width: 672px; height: 26px;">
      <div align="left" class="f2">
<input name="CmdB" type="button" id="CmdG" value="Procesar" 
onclick="fGuardar();" style="width:80px" tabindex="17"/>
<input name="CmdB" type="button" id="CmdZ" 
value="Menu" onclick="fBuscar('menu.php');"  tabindex="22"/>
      </div>
  </div>
    <div id="layer" style="position:absolute; left: 116px; top: 21px; width: 412px; height: 45px; z-index: 100;">
      <div align="left" class="Estilo1">
        <input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
		<input name="TxtAc" type="hidden" id="TxtAc" value="" />
		<input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
        <input name="TxtRuc_" type="hidden" id="TxtRuc_"  />        
        <input name="TxtIdCliente" type="hidden" id="TxtIdCliente" 
        value="<?php echo $StrIdCliente; ?>"   />        
      <strong style="color:#000">CUADRE DE CAJA (En soles)</strong>
      </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=""/>
      </div>
  </div>
    <div id="LblTit" style="position:absolute; left: 52px; top: 15px; width: 64px; z-index: 100;">
      <div align="left" class="Estilo1">
      <img src="img/ventas.png" width="64" height="53" / onclick="fGetProdDatos_Id('2');"></div>
</div>
    <div id="layer8" style="position:absolute; left: 0px; top: 0px; width: 800px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
      <div align="left" class="Estilo1">        
      </div>
</div>
<div id="layer6" style="position:absolute; left:32px; top: 141px; width: 109px;">
<div align="left" class="f2">EMPRESA</div>
</div>
<select name="CboEmp" id="CboEmp" 
style="position:absolute; left:30px; top:156px; width: 145px;" 
onkeydown="return SoloTextoEx(event,'TxtDex');" tabindex="1">
<?php 
	echo LE($StrEmp,"S","N"); 
?>
</select>


<div id="layer6" style="position:absolute; left: 192px; top: 122px; width: 54px;">
<div align="left" class="f2">DESDE </div>
</div>
<input name="TxtDex" type="text" id="TxtDex" style="position:absolute; left: 191px; top: 156px; width: 83px;" 
value="<?php echo $StrDex;?>"  
onkeydown="return SoloFec(this,event,'TxtHax');" 
tabindex="2" />
<div id="layer27" style="position:absolute; left: 192px; top: 137px; width: 79px;">
<div align="left" class="f2">(dd-mm-yy)</div>
  </div>
<div id="layer2" style="position:absolute; left: 282px; top: 122px; width: 54px;">
<div align="left" class="f2">HASTA </div>
</div>
<div id="layer3" style="position:absolute; left: 284px; top: 137px; width: 79px;">
  <div align="left" class="f2">(dd-mm-yy)</div>
</div>
<div id="layer3" style="position:absolute; left: 491px; top: 155px; width: 255px; height: 33px;">
  <div align="left" class="f2">AGRUPAR COBROS  EN VENTAS AL CREDITO QUE SEAN DEL MISMO DIA</div>
</div>

<input name="TxtHax" type="text" id="TxtHax" style="position:absolute; left: 285px; top: 156px; width: 95px;" 
value="<?php echo $StrHax;?>"  
onkeydown="return SoloFec(this,event,'CmdB');" 
tabindex="2" />

<select name="CboAG" id="CboAG" style="position:absolute; left: 396px; top: 155px; width: 80px;"
onkeydown="return SoloTextoEx(event,'CmdB');" tabindex="3"> 
<?php echo FCBO_("au_item","auxiliar","au_tab='SI_NO'",$StrAG,"N","N");?>
</select>

<div id="layer9" style="position:absolute; left: 31px; top: 188px; width: 360px; height: 600px; background-color: #666666; layer-background-color: #666666; border: 1px none #000000;">
  <div align="left" class="f2">
    <table  id="Exportar_a_Excel" width="358" border="0">
      <tr>
        <td colspan="2">CUADRO GENERAL</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td colspan="2" bgcolor="#FFFFFF" style="color:#000000">VENTAS</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">TOT. VENTA AL CONTADO</td>
        <td align="right" style="background:#999; color:#000"><?php echo NF2($TOT_VEN_CO,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>EFECTIVO</td>
        <td align="right"><?php echo NF2($TOT_VEN_CO_E,2); ?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td>DEPOSITO</td>
        <td align="right"><?php echo NF2($TOT_VEN_CO_D,2); ?></td>
        <td>&nbsp;</td>
        </tr>
      <tr>
        <td>&nbsp;</td>
        <td  style="background:#999; color:#000">TOT. VENTA AL CREDITO</td>
        <td align="right" style="background:#999; color:#000"><?php echo NF2($TOT_VEN_CR,2);?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td >ADELANTO EN EFECTIVO</td>
       <td align="right"><?php echo NF2($TOT_VEN_CR_E,2); ?></td>
        <td>&nbsp;</td>
      </tr>
       <tr>
        <td>&nbsp;</td>
        <td>ADELANTO EN DEPOSITO</td>
        <td align="right"><?php echo NF2($TOT_VEN_CR_D,2); ?></td>
        <td>&nbsp;</td>
      </tr>
       <tr>
         <td>&nbsp;</td>
         <td>&nbsp;</td>
         <td align="right">&nbsp;</td>
         <td>&nbsp;</td>
       </tr>
       <tr>
        <td colspan="2" bgcolor="#FFFFFF" style="color:#000000">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">COBROS</td>
        <td align="right" style="background:#999; color:#000"><?php echo NF2($TOT_COB,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>EFECTIVO</td>
        <td align="right"><?php echo NF2($TOT_COB_E,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>DEPOSITO</td>
        <td align="right"><?php echo NF2($TOT_COB_D,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td width="30">&nbsp;</td>
        <td width="209" style="background:#999; color:#000">CONTRATOS</td>
        <td align="right" style="background:#999; color:#000"><?php echo NF2($TOT_CON,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>EFECTIVO</td>
        <td align="right"><?php echo NF2($TOT_CON_E,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>DEPOSITO</td>
        <td align="right"><?php echo NF2($TOT_CON_D,2); ?></td>
        <td>&nbsp;</td>
      </tr>
 <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
<tr>
        <td width="30">&nbsp;</td>
        <td width="209" style="background:#999; color:#000">OTROS INGRESOS (Efectivo)</td>
        <td align="right" style="background:#999; color:#000"><?php echo NF2($TOT_OI,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#FFFFFF" style="color:#000000">EGRESOS (En efectivo)</td>
        <td width="73">&nbsp;</td>
        <td width="28">&nbsp;</td>
        </tr>
       <tr>
        <td>&nbsp;</td>
        <td>GASTOS</td>
        <td align="right"><?php echo NF2($TOT_GAS_E,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>DEVOLUCION</td>
        <td align="right"><?php echo NF2($TOT_DEV_E,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td align="right">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#FFFFFF" style="color:#000000">RESUMEN</td>
        <td width="73">&nbsp;</td>
        <td width="28">&nbsp;</td>
        </tr>
       <tr>
        <td>&nbsp;</td>
        <td>TOTAL EFECTIVO</td>
        <td align="right"><?php echo NF2($RES_EFE,2); ?></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>TOTAL DEPOSITO</td>
        <td align="right"><?php echo NF2($RES_DEP,2); ?></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>TOTAL RESUMEN (EFE + DEP)</td>
        <td align="right"><?php echo NF2($RES_DEP + $RES_EFE,2); ?></td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </div>
</div>  
</center>	
        </form>
        <form action="ficheroExcel.php" method="post" target="_blank" id="FormularioExportacion" >
<div style="position:absolute; left: 176px; top: 85px; width: 45px; height: 15px;">  
<input name="" type="button" class="botonExcel" value="Exportar" />
<input type="hidden" id="datos_a_enviar" name="datos_a_enviar" />
</div>
</form>
</div>
</body>
</html>
