FASE 1: Análisis y diagnóstico - Problema hardcodeado identificado
- Identificado código crítico en ajax/login.php:20 con empresaId = 15 hardcodeado - Mapeados 22 archivos totales con empresaId = 15 - Analizado flujo de login actual que forza empresaId = 15 - Documentado problema principal en md/plan-accion-multi-empresa.md - Lista completa: 1 login, 13 crons, 1 ajax, 7 archivos adicionales Próximo paso: Modificar login para obtener empresaId dinámicamente del usuario
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
<?php /* Smarty version Smarty3-b7, created on 2026-01-07 01:10:27
|
||||
compiled from "/var/www/html/ventas/templates/forms/filtro-gral.tpl" */ ?>
|
||||
<?php /*%%SmartyHeaderCode:1467259720695e06e31dbca4-65586659%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
|
||||
$_smarty_tpl->decodeProperties(array (
|
||||
'file_dependency' =>
|
||||
array (
|
||||
'b15d3336a8ab4c05bbc96723cd4058fac285d14d' =>
|
||||
array (
|
||||
0 => '/var/www/html/ventas/templates/forms/filtro-gral.tpl',
|
||||
1 => 1767753171,
|
||||
),
|
||||
),
|
||||
'nocache_hash' => '1467259720695e06e31dbca4-65586659',
|
||||
'function' =>
|
||||
array (
|
||||
),
|
||||
'has_nocache_code' => false,
|
||||
)); /*/%%SmartyHeaderCode%%*/?>
|
||||
<form name="formV" id="formV" method="post" action="export/ventas-general.php">
|
||||
<input type="hidden" name="type" id="type" value="tipoGral" />
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" id="box-table-a" style="border-top:1px solid #999999">
|
||||
<thead>
|
||||
<tr>
|
||||
<th width="500" align="center" colspan="2"><div align="center">Periodo</div></th>
|
||||
<th width="400" align="center"><div align="center">Sucursal</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<div style="float:left">
|
||||
Inicial:<input type="text" style="text-align:center" name="fechaI" id="fechaI" class="smallInput" style="width:140px" maxlength="10" readonly="readonly" value="<?php echo $_smarty_tpl->getVariable('dateNow')->value;?>
|
||||
" align="middle"/>
|
||||
</div>
|
||||
<div style="float:left; padding-left:15px; padding-top:5px">
|
||||
<a href="javascript:void(0)" onclick="NewCal('fechaI','ddmmyyyy')">
|
||||
<img src="<?php echo $_smarty_tpl->getVariable('WEB_ROOT')->value;?>
|
||||
/images/icons/calendar.gif" /></a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div style="float:left">
|
||||
Final: <input type="text" style="text-align:center" name="fechaF" id="fechaF" class="smallInput" style="width:140px" maxlength="10" readonly="readonly" value="<?php echo $_smarty_tpl->getVariable('dateNow')->value;?>
|
||||
" align="middle"/>
|
||||
</div>
|
||||
<div style="float:left; padding-left:15px; padding-top:5px">
|
||||
<a href="javascript:void(0)" onclick="NewCal('fechaF','ddmmyyyy')">
|
||||
<img src="<?php echo $_smarty_tpl->getVariable('WEB_ROOT')->value;?>
|
||||
/images/icons/calendar.gif" /></a>
|
||||
</div>
|
||||
</td>
|
||||
<?php if ($_smarty_tpl->getVariable('tipo')->value=="admin"){?>
|
||||
<td align="center">
|
||||
<select name="idSucursal" id="idSucursal" class="largeInput">
|
||||
<option selected="selected" value=""> Todas</option>
|
||||
<?php $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable;
|
||||
$_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
|
||||
$_from = $_smarty_tpl->getVariable('resSuc')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
|
||||
if (count($_from) > 0){
|
||||
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
|
||||
$_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
|
||||
?>
|
||||
<option value="<?php echo $_smarty_tpl->getVariable('item')->value['sucursalId'];?>
|
||||
"> <?php echo $_smarty_tpl->getVariable('item')->value['nombre'];?>
|
||||
</option>
|
||||
<?php }} ?>
|
||||
</select>
|
||||
</td>
|
||||
<?php }elseif($_smarty_tpl->getVariable('tipo')->value=="gerente"||$_smarty_tpl->getVariable('tipo')->value=="vendedor"){?>
|
||||
<td align="center">
|
||||
<?php $_smarty_tpl->tpl_vars['item'] = new Smarty_Variable;
|
||||
$_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
|
||||
$_from = $_smarty_tpl->getVariable('resSuc')->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
|
||||
if (count($_from) > 0){
|
||||
foreach ($_from as $_smarty_tpl->tpl_vars['item']->key => $_smarty_tpl->tpl_vars['item']->value){
|
||||
$_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['item']->key;
|
||||
?>
|
||||
<input type="text" disabled="disabled" style="text-align:center" name="nomSucursal" id="nomSucursal" class="smallInput" value="<?php echo $_smarty_tpl->getVariable('item')->value['nombre'];?>
|
||||
"/>
|
||||
<input type="hidden" name="idSucursal" id="idSucursal" value="<?php echo $_smarty_tpl->getVariable('item')->value['sucursalId'];?>
|
||||
" />
|
||||
<?php }} ?>
|
||||
</td>
|
||||
<?php }?>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center" colspan="7">
|
||||
<input type="button" name="btnReporte" id="btnReporte" value="Generar" class="btnSearch" onclick="ReporteGral();"/>
|
||||
<div style="float:right; padding-right:50px"><a href="#" onclick="ExportGral(); return false;"><img src="<?php echo $_smarty_tpl->getVariable('WEB_ROOT')->value;?>
|
||||
/images/icons/excel.png" title="Exportar Reporte"/></a></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php /* Smarty version Smarty3-b7, created on 2026-01-07 01:10:23
|
||||
compiled from "/var/www/html/ventas/templates/reportes-ventas.tpl" */ ?>
|
||||
<?php /*%%SmartyHeaderCode:441191332695e06df5d21a4-76042716%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
|
||||
$_smarty_tpl->decodeProperties(array (
|
||||
'file_dependency' =>
|
||||
array (
|
||||
'ccf0b494e74a50bccde0de0cd4dd231d1bef1d24' =>
|
||||
array (
|
||||
0 => '/var/www/html/ventas/templates/reportes-ventas.tpl',
|
||||
1 => 1767753171,
|
||||
),
|
||||
),
|
||||
'nocache_hash' => '441191332695e06df5d21a4-76042716',
|
||||
'function' =>
|
||||
array (
|
||||
),
|
||||
'has_nocache_code' => false,
|
||||
)); /*/%%SmartyHeaderCode%%*/?>
|
||||
<div class="grid_16" id="content">
|
||||
|
||||
<div class="grid_9">
|
||||
<h1 class="reportes">Reportes de Ventas</h1>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
|
||||
<?php $_template = new Smarty_Internal_Template("forms/filtro-reporte-ventas.tpl", $_smarty_tpl->smarty, $_smarty_tpl, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null);
|
||||
echo $_template->getRenderedTemplate();?><?php $_template->updateParentVariables(0);?><?php unset($_template);?>
|
||||
|
||||
<div class="clear"></div>
|
||||
<div id="tipoRv"></div>
|
||||
<div class="grid_15" id="contenido">
|
||||
</div>
|
||||
<div align="center">
|
||||
<div id="loadBusqueda" style="display:none">
|
||||
<br />
|
||||
<img src="<?php echo $_smarty_tpl->getVariable('WEB_ROOT')->value;?>
|
||||
/images/loading.gif" width="16" height="16" />
|
||||
<br />Cargando...
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php /* Smarty version Smarty3-b7, created on 2026-01-07 01:10:23
|
||||
compiled from "/var/www/html/ventas/templates/forms/filtro-reporte-ventas.tpl" */ ?>
|
||||
<?php /*%%SmartyHeaderCode:500331629695e06df5dbc40-16413947%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
|
||||
$_smarty_tpl->decodeProperties(array (
|
||||
'file_dependency' =>
|
||||
array (
|
||||
'dbdfd297efb2893b027490b37993c07fa578153e' =>
|
||||
array (
|
||||
0 => '/var/www/html/ventas/templates/forms/filtro-reporte-ventas.tpl',
|
||||
1 => 1767753171,
|
||||
),
|
||||
),
|
||||
'nocache_hash' => '500331629695e06df5dbc40-16413947',
|
||||
'function' =>
|
||||
array (
|
||||
),
|
||||
'has_nocache_code' => false,
|
||||
)); /*/%%SmartyHeaderCode%%*/?>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" id="box-table-a" style="border-top:1px solid #999999">
|
||||
<thead>
|
||||
<tr>
|
||||
<th align="center"><div align="center">Selecciona el Tipo de Reporte</div></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align:center">
|
||||
<div style=" text-align:center">
|
||||
<form action="" id="formRventas" name="formRventas" method="post">
|
||||
<input type="hidden" name="type" id="type" value="tipoReporte" />
|
||||
<select class="largeInput" name="selectRventas" id="selectRventas" onchange="TipoReporte();">
|
||||
<option disabled="disabled" selected="selected">Selecciona el tipo de reporte</option>
|
||||
<option value="gral">General</option>
|
||||
<option value="fpago">Formas de Pago</option>
|
||||
|
||||
<?php if ($_smarty_tpl->getVariable('Usr')->value['type']=="admin"||$_smarty_tpl->getVariable('Usr')->value['type']=="centralizador"||$_smarty_tpl->getVariable('Usr')->value['type']=="almacen"){?>
|
||||
<option value="prodProv">Productos por Proveedor</option>
|
||||
<option value="prodProv2">Prods. Más y Menos Vendidos por Prov.</option>
|
||||
<?php }?>
|
||||
|
||||
<option value="gralDias">General por Días</option>
|
||||
<option value="vend">Por vendedor</option>
|
||||
<option value="temp">Por temporada</option>
|
||||
|
||||
<option value="proMasVend">Productos</option>
|
||||
<?php if ($_smarty_tpl->getVariable('Usr')->value['type']=="admin"){?>
|
||||
<option value="buenFinProv">Buen Fin por Proveedor</option>
|
||||
<option value="prodsTransito">Productos en Tránsito</option>
|
||||
<?php }?>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user