<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Parametros Reporte Ventas de Servicios por Cliente</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>
<?php
include "../../conn.php";
include "../../general.php";
include "../../token.php";

//$usuario = $_GET["user"];
?>
<body>

	<?php
	
//Inicio reporte de ventas de servicios por cliente

//listado de almacenes
$result3 = mysqli_query($link, "select pkyWarehouse as cod_alm, fldName as almacen
from
invWarehouse
where
sysEnabled = 1 AND sysAuthorized = 1 
order by fldName;");

//listado de clientes
$result2 = mysqli_query($link, "select pkyCompany as codigo, fldName as cliente
from agnCompany
where
fldIsClient = 1 and
sysEnabled = 1 and sysAuthorized = 1
order by cliente;");

//monedas para el reporte
$result1 = mysqli_query($link, "select pkyCurrency as codigo, fldName as moneda
from actCurrency
where
pkyCurrency <> '$cod_moneda_principal' and 
sysEnabled = 1 and sysAuthorized = 1;");

//canal
$result4 = mysqli_query($link, "select pkyChannel as codigo, fldName as canal
from agnChannel 
where 
sysEnabled = 1 and sysAuthorized = 1
order by fldName;");

?>
<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 Ventas de Servicios por Cliente</b></td></tr><tr><td>
<form id="miform" name="miform" method="post" action="report.php?rep=13&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>Almac&eacute;n:</b></td><td> <br/><!--<SELECT NAME="almacen" class="formulario">-->
<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="almacen">
	<option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result3)) {   
	?> 
	<option value="<?php echo $row['cod_alm']?>"><?php echo $row['cod_alm']?> - <?php echo $row['almacen']?></option> 
	<?php 
	}  
	mysqli_free_result($result3);
	?>
    </select>    
</td></tr><tr><td>

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

<br/><b>Canal (solo para empresas): </b></td><td><br/><!--<SELECT NAME="concepto_cobro" class="formulario">-->
	<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="canal_venta">
    <option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result4)) {   
	?> 
	<option value="<?php echo $row['codigo']?>"><?php echo $row['codigo']?> - <?php echo $row['canal']?></option> 
	<?php 
	}  
	mysqli_free_result($result4);
	?> 
    </select>
</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>Ordenado por: </b></td><td> <br/><input type="radio" name="orden" checked="checked" value="0" class="formulario"> Fecha
<br/><input type="radio" name="orden" value="1" class="formulario"> Nombre
</td></tr><tr><td>
<br/><b>Valorar tambi&eacute;n en: </b></td><td> <br/>
<input name="otra_moneda" type="radio" value="<?php echo $row['cod_moneda_principal']; ?>" checked="checked">Moneda original<br>
<?php 
while($row = mysqli_fetch_array($result1)){ 
 echo "<input name='otra_moneda' type='radio' value='".$row['codigo']."'> ".$row['moneda']."<br>";
 } 
mysqli_free_result($result1);
	
	?>
</td></tr><tr><td>
<br/><b>Participaci&oacute;n en %: </b></td><td> <br/><input type="radio" name="participacion" checked="checked" value="0" class="formulario"> No
<br/><input type="radio" name="participacion" value="1" class="formulario"> por Cliente
<br/><input type="radio" name="participacion" value="2" class="formulario"> por Canal de Cliente
<br/><input type="radio" name="participacion" value="3" class="formulario"> por Rubro de Cliente
</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>
