<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Parametros Reporte Libro Diario</title>
<link href="../../maincss.css" rel="stylesheet" type="text/css" />
<link href="../../chosen/chosen.css" rel="stylesheet" />
<link href="../../tcal.css" rel="stylesheet" type="text/css" />
<!--
<script language="javascript" src="js/jquery-1.3.min.js"></script>
-->
<script language="javascript" src="../../js/tcal.js" type="text/javascript"></script>
<script language="javascript" src="../../js/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../../chosen/chosen.jquery.js"></script>
<script language="javascript" src="../../js/validar.js"></script>

</head>

</head>
<?php
include "../../conn.php";
include "../../general.php";
include "../../token.php";

//$usuario = $_GET["user"];
/*
//calculo de inicio de gestion
$ano_det = substr($fecha_hoy,0,4);
$resultano = mysqli_query($link, "select codStartMonth as mes_ini
from actFiscalYear 
where
pkyFiscalYear = '$ano_det';");
while ($row = mysqli_fetch_array($resultano)) {
	$mes_ini = $row['mes_ini'];
}
mysqli_free_result($resultano);

if($mes_ini < 10) { $mes_ini = '0'.$mes_ini; }

$fechaini_gest = $ano_det.'-'.$mes_ini.'-01';
*/
?>
<body>

<?php 
//Inicio reporte Libro Diario

//listado de modulos
//cuando se hace un asiento directamente tiene NULL en el campo fldName
$result = mysqli_query($link, "select case when rtrim(fldName) = 'ComponentAccountEntry' then NULL else rtrim(fldName) end as comp, txtDescription as nom_comp, txtModuleDescription as nom_modulo 
from srvComponent 
where 
codType = 3 or 
codType = 5 and 
sysEnabled = 1 and sysAuthorized = 1
order by nom_modulo, nom_comp;");

//tipo de cc
$result2 = mysqli_query($link, "select pkyCostCenterType as codigo, fldName as nombre 
from 
actCostCenterType 
where 
sysEnabled = 1 and sysAuthorized = 1;");

//lista contexto
$result3 = mysqli_query($link, "select pkyContext as cod_contexto, fldName as contexto, codCostCenter as cod_cc 
from srvContext
where 
sysEnabled = 1 and sysAuthorized = 1;");

//tipo
$result4 = mysqli_query($link, "select pkyAccountEntryType as cod_tipo, fldName as tipo
from actAccountEntryType
where 
sysEnabled = 1 and sysAuthorized = 1;");


?>
<table border="0" align="left" width="100%" cellpadding="5">
<tr><td><b>Empresa: <?php echo $nombre_empresa; ?><br/>NIT: <?php echo $mi_nit; ?></b>
</td><td align="right"><b>Fecha: <?php echo date("Y-m-d"); ?><br/>Hora: <?php echo date("H:i:s"); ?><br/>Usuario: <?php echo $usuario; ?><br/>F</b>
</td></tr></table><br/>
<table border="0" align="center" cellpadding="5"><tr><td colspan="2" align="center">
<b>Par&aacute;metros Reporte Libro Diario</b></td></tr><tr><td>
<form id="miform" name="miform" method="post" action="report.php?rep=9&tipo=1" onsubmit="return Validar()">
<br/><b>Usuario: </b></td><td> <br/><input type="text" name="usuario" value="<?php echo $usuario; ?>" size="20" readonly="readonly" class="formulario" style="color:#999;">
<input type="hidden" name="token" value="<?php echo $token; ?>">
</td></tr><tr><td>

<br/><b>M&oacute;dulo - Componente: </b></td><td><br/><!-- <SELECT NAME="proveedor" class="formulario"> -->
	<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="modulo">
	<option value="Todos">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result)) {   
	?> 
	<option value="<?php echo $row['comp']; ?>"><?php echo $row['nom_modulo']; ?> - <?php echo $row['nom_comp']; ?></option> 
	<?php 
	}  
	mysqli_free_result($result);
	?>
    </SELECT>
</td></tr><tr><td>

<br/><b>Tipo: </b></td><td> <br/><!--<SELECT NAME="concepto_pago" class="formulario">-->
	<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="tipo_asiento">
    <option value="-1">Todos</option>
    <option value="-2">Autom&aacute;tico</option>
    <option value="-3">Manual</option>
	<?php 
	while ($row = mysqli_fetch_array($result4)) {   
	?> 
	<option value="<?php echo $row['cod_tipo']?>"><?php echo $row['cod_tipo']?> - <?php echo $row['tipo']?></option> 
	<?php 
	}  
	mysqli_free_result($result4);
	?> 
    </select>
</td></tr><tr><td>

<br/><b>Contexto: </b></td><td> <br/><!--<SELECT NAME="concepto_pago" class="formulario">-->
	<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="contexto">
    <option value="-1">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result3)) {   
	?> 
	<option value="<?php echo $row['cod_contexto']?>"><?php echo $row['cod_contexto']?> - <?php echo $row['contexto']?></option> 
	<?php 
	}  
	mysqli_free_result($result3);
	?> 
    </select>
</td></tr><tr><td>

<br/><b>Centros de Costo: </b></td><td><br/><!--<SELECT NAME="cliente" class="formulario">-->
<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="centrocosto">
	<option value="-1">Ninguno</option>
	<?php 
	while ($row = mysqli_fetch_array($result2)) {   
	?> 
	<option value="<?php echo $row['codigo']?>"><?php echo $row['codigo']?> - <?php echo $row['nombre']?></option> 
	<?php 
	}  
	mysqli_free_result($result2);
	?>
    </select>
</td></tr><tr><td>

<br/><b>Formato: </b></td><td> <br/><input type="radio" name="formato" checked="checked" value="0" class="formulario"> Libro Diario
<br/><input type="radio" name="formato" value="1" class="formulario"> Reporte

</td></tr><tr><td>
<br/><b>De Fecha: </b></td><td> <br/><div><input type="text" id="fechaini" name="fechaini" value="<?php echo $fechaini_gest; ?>" length="10" maxlength="10" class="tcal" title="aaaa-mm-dd"> </div>aaaa-mm-dd
</td></tr><tr><td>
<br/><b>A Fecha: </b></td><td> <br/><div><input type="text" id="fechafin" name="fechafin" value="<?php echo $fecha_hoy; ?>" length="10" maxlength="10" class="tcal" title="aaaa-mm-dd"> </div>aaaa-mm-dd

</td></tr><tr><td>
<br/><b>Mostrar: </b></td><td> <br/><input type="radio" name="mostrar" checked="checked" value="0" class="formulario"> Solo V&aacute;lidos
<br/><input type="radio" name="mostrar" value="1" class="formulario"> V&aacute;lidos y Anulados
<br/><input type="radio" name="mostrar" value="2" class="formulario"> Solo Anulados

</td></tr>
<tr><td colspan="2" align="center">
<br/><br/><INPUT TYPE="submit" VALUE="Generar Reporte" class="boton_generar"></td></tr>
<script type="text/javascript"> $(".chzn-select").chosen({no_results_text: "No se encontraron resultados con "}); $(".chzn-select-deselect").chosen({allow_single_deselect:true}); </script>
</form>
</table>

</body>
</html>
