Configuración – Rango Por Intervalos
1- Se crea rango en Codigos_DefinicionesRangos_Net de acuerdo a los siguientes campos
| CLAVE | INTERVAL_VENDEDORES |
| TITULO | Intervalo de Vendedores |
| TITULOETIQUETADD | Incluir |
| TITULOETIQUETAHH | Incluir |
| TIPO_DATO | 8 |
| VALORDD | |
| VALORHH | |
| TABLA | null |
| VISTA | GR-7 |
| CODIGO | CoDescriptivo |
| DESCRIPCION | Descripcion |
| DDFORMULACRYSTAL | INT_Vendedores |
| HHFORMULACRYSTAL | INT_Vendedores |
| MAXLEN | 6 |
| SELECTDATA | NULL |
2-Se altera el store procedure de acuerdo al siguiente ejemplo, agregando lo que esta en negrita
—
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[Co_VT_SP_Vt_Facturas_Cabezal]
—
@DDCoCliente int = 0,
@HHCoCliente int = 999999,
@DDFecha datetime = null,
@HHFecha datetime = null,
@DDNoComprobante INT = 0,
@HHNoComprobante INT = 999999,
@DDCoVendedor int = 0,
@HHCoVendedor int = 999999,
@INT_Vendedores IntInterval readonly as
—
if (@DDFecha is null) select @DDFecha = convert(datetime,’01/01/’ + convert(varchar(4),year(getdate())))
if (@HHFecha is null) select @HHFecha = getdate()
if (select count(*) from @INT_Vendedores) > 0
—
Begin
—
SELECT NoComprobante,
FechaComprobante,
CoCliente,
Cliente,
CoVendedor,
Vendedor,
CotizacionDolar,
CoComprobante,
LetraLugarNumero,
GeneradoHide,
_tags,
_state
FROM dbo.Co_VT_FX_Vt_Facturas_Cabezal(@DDCoCliente, @HHCoCliente, @DDFecha, @HHFecha, @DDNoComprobante, @HHNoComprobante, @DDCoVendedor, @HHCoVendedor) fVTFC
where fVTFC.CoVendedor in (select * from @INT_Vendedores)
ORDER BY fVTFC.NoComprobante desc
Return
End
—
SELECT NoComprobante,
FechaComprobante,
CoCliente,
Cliente,
CoVendedor,
Vendedor,
CotizacionDolar,
CoComprobante,
LetraLugarNumero,
GeneradoHide,
_tags,
_state
FROM dbo.Co_VT_FX_Vt_Facturas_Cabezal(@DDCoCliente, @HHCoCliente, @DDFecha, @HHFecha, @DDNoComprobante, @HHNoComprobante, @DDCoVendedor, @HHCoVendedor) fVTFC
ORDER BY fVTFC.NoComprobante desc
—
3-Se carga el rango relacionado a la vista en Codigos_Seg_Vistas_Rangos
| Modulo | COMP |
| Id | 20 |
| ClaveRango | INTERVAL_VENDEDORES |
| Orden | 90 |
4- Como final de este tema se puede configurar la seguridad del Usuario (por medio del grupo) cargándole predefinido los valores a saber en la siguiente tabla, Info_DefinicionesRangosNetGruposDefault:
| RANGO | VISTA_ID | CLAVERANGO | GRUPO_USUARIO | VALORDD | VALORHH | VISIBLE | READONLY |
| 1 | GR-68 | CLIENTES | ASISTENCIA | 1 | 99999 | True | False |
| 1 | COMP-20 | LIKE_VENDEDORES | PAT | 18 | 18 | True | True |
| 1 | COMP-20 | LIKE_VENDEDORES | CUYO | 12 | 12 | True | True |
| 1 | 52100 | LIKE_VENDEDORES | PAT | 18 | 18 | True | True |
| 1 | 52100 | LIKE_VENDEDORES | CUYO | 12 | 12 | True | True |
| 1 | COMP-20 | INTERVAL_VENDEDORES | CBA | [17,37,38,39,49,53] | [17,37,38,39,49,53] | False | True |
| 1 | 52100 | INTERVAL_VENDEDORES | CBA | [17,37,38,39,49,53] | [17,37,38,39,49,53] | True | True |
| 1 | DD-99 | LIKE_VENDEDORES | PAT | 18 | 18 | True | True |
| 1 | DD-99 | LIKE_VENDEDORES | CUYO | 12 | 12 | True | True |
| 1 | DD-99 | INTERVAL_VENDEDORES | CBA | [17,37,38,39,49,53] | [17,37,38,39,49,53] | True | True |