primer commit subida
This commit is contained in:
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,16 @@
|
||||
fglform gefmrp001.per
|
||||
fglform gefmrp002.per
|
||||
fglform gefmrp003.per
|
||||
fglform gefmrp004.per
|
||||
fglform gefmrp005.per
|
||||
fglform gefmrp006.per
|
||||
fglform gefmrp007.per
|
||||
fglform gefmrp008.per
|
||||
fglform gefmrp009.per
|
||||
fglform gefmrp010.per
|
||||
fglform gefmrp011.per
|
||||
fglform gefmrp012.per
|
||||
fglform gefmrp013.per
|
||||
fglform gefmrp014.per
|
||||
fglform gefmrp015.per
|
||||
fglform gefmrp016.per
|
||||
@@ -0,0 +1,22 @@
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
Fecha IniciaL [f1 ]
|
||||
Fecha Final [f2 ]
|
||||
Cantidad Limite [c2 ]
|
||||
Codigo [c][d]
|
||||
Cliente [a ][b ]
|
||||
}
|
||||
end
|
||||
tables
|
||||
vetb00003
|
||||
attributes
|
||||
a = formonly.tipo_cliente;
|
||||
b = formonly.sec_cliente;
|
||||
f1 = formonly.fecha_in type date,format = "dd/mm/yyyy";
|
||||
f2 = formonly.fecha_fi type date,format = "dd/mm/yyyy";
|
||||
c2 = formonly.cantidad1 type decimal(12,2);
|
||||
c = vetb00003.cod_n,autonext;
|
||||
d = vetb00003.cod_grupo;
|
||||
instructions delimiters " "
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
Fecha IniciaL [f1 ]
|
||||
Fecha Final [f2 ]
|
||||
Cantidad Limite [c2 ]
|
||||
Codigo [c][d]
|
||||
}
|
||||
end
|
||||
tables
|
||||
vetb00003
|
||||
attributes
|
||||
f1 = formonly.fecha1 type date,format = "dd/mm/yyyy";
|
||||
f2 = formonly.fecha2 type date,format = "dd/mm/yyyy";
|
||||
c2 = formonly.cant1 type decimal(12,2);
|
||||
c = vetb00003.cod_n,autonext;
|
||||
d = vetb00003.cod_grupo;
|
||||
instructions delimiters " "
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Fecha Inicial [f1 ]
|
||||
Fecha Final [f2 ]
|
||||
Codigo Suplidor [c1]
|
||||
Cantidad Limite [c2 ]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.fecha_in type DATE,format = "dd/mm/yyyy";
|
||||
f2 = formonly.fecha_fi type DATE,format = "dd/mm/yyyy";
|
||||
c1 = formonly.cod_sup type SMALLINT,include = (21,22,23),comments=
|
||||
" 21 = INTERCOMPANY 22 = EXTRANJERO 23 = LOCAL";
|
||||
c2 = formonly.cantidad1 type DECIMAL(12,2);
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Fecha Inicial [f1 ]
|
||||
Fecha Final [f2 ]
|
||||
Codigo Suplidor [c1]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.fecha_in type DATE,format = "dd/mm/yyyy";
|
||||
f2 = formonly.fecha_fi type DATE,format = "dd/mm/yyyy";
|
||||
c1 = formonly.cod_sup type SMALLINT,include = (21,22,23),comments=
|
||||
" 21 = INTERCOMPANY 22 = EXTRANJERO 23 = LOCAL";
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,19 @@
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Fecha Inicial [f1 ]
|
||||
Fecha Final [f2 ]
|
||||
Cantidad Limite [c2 ]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.fecha_in type DATE,format = "dd/mm/yyyy";
|
||||
f2 = formonly.fecha_fi type DATE,format = "dd/mm/yyyy";
|
||||
c2 = formonly.cantidad1 type DECIMAL(12,2);
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,17 @@
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Fecha Inicial [f1 ]
|
||||
Fecha Final [f2 ]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cctb00001
|
||||
attributes
|
||||
f1 = formonly.fecha_in type DATE,format = "dd/mm/yyyy";
|
||||
f2 = formonly.fecha_fi type DATE,format = "dd/mm/yyyy";
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Fecha Inicial [f1 ]
|
||||
Fecha Final [f2 ]
|
||||
Valor Minimo [vm ]
|
||||
Tipo Material [c]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.fecha_1 type DATE,format = "dd/mm/yyyy";
|
||||
f2 = formonly.fecha_2 type DATE,format = "dd/mm/yyyy";
|
||||
vm = formonly.cant_may,comments="Digite el Monto Minimo de Compra";
|
||||
c = formonly.tipo_rep type char,upshift,include=("M","R","H","S"),comments =
|
||||
" M = Materia Prima R = Repuesto H = Herramienta S = Suministro";
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Fecha Inicial [f1 ]
|
||||
Fecha Final [f2 ]
|
||||
Tipo Material [c]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.fecha_1 type DATE,format = "dd/mm/yyyy";
|
||||
f2 = formonly.fecha_2 type DATE,format = "dd/mm/yyyy";
|
||||
c = formonly.tipo_rep type char,upshift,include=("M","R","H","S"),comments =
|
||||
" M = Materia Prima R = Repuesto H = Herramienta S = Suministro";
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,28 @@
|
||||
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Ano [f1 ]
|
||||
Mes [f2]
|
||||
Cantidad Limite [c2 ]
|
||||
Detalle [c34 ]
|
||||
Tipo Producto [c]
|
||||
Cliente(s) [c1][c3 ]
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.ano1;
|
||||
f2 = formonly.mes1;
|
||||
c2 = formonly.cantidad1 type DECIMAL(12,2);
|
||||
c1 = formonly.tipo_cliente;
|
||||
c3 = formonly.sec_cliente;
|
||||
c = formonly.cod_cia,
|
||||
comments = "Entre Compania: 1- Productos Locales 2- Productos Importados";
|
||||
c34 = formonly.detalle,upshift,
|
||||
comments="Entre Clase De Reporte Para Que Salga En El Encabezado";
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,20 @@
|
||||
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Ano [f1 ]
|
||||
Mes [f2]
|
||||
Cantidad Limite [c2 ]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.ano1;
|
||||
f2 = formonly.mes1;
|
||||
c2 = formonly.cantidad1 type DECIMAL(12,2);
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,18 @@
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Ano [f1 ]
|
||||
Mes [f2]
|
||||
Cantidad Limite [c2 ]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.ano1;
|
||||
f2 = formonly.mes1;
|
||||
c2 = formonly.cantidad1 type DECIMAL(12,2);
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,24 @@
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
Ano [f1 ]
|
||||
Mes Inicial [f3]
|
||||
Mes [f2]
|
||||
Valor Desde [v1 ] Valor Hasta [v2 ]
|
||||
Vendedor [v ]
|
||||
Cliente [c ][d ]
|
||||
}
|
||||
end
|
||||
tables
|
||||
vetb00002
|
||||
attributes
|
||||
v1 = formonly.valor_d;
|
||||
v2 = formonly.valor_a;
|
||||
f1 = formonly.p_ano type smallint;
|
||||
f3 = formonly.p_mes_ini;
|
||||
f2 = formonly.p_mes type smallint;
|
||||
v = vetb00002.sec_vend,comments="Digite Codigo de Vendedor";
|
||||
c = vetb00002.tipo_cliente,autonext;
|
||||
d = vetb00002.sec_cliente;
|
||||
instructions delimiters " "
|
||||
end
|
||||
@@ -0,0 +1,32 @@
|
||||
schema decomarmol
|
||||
LAYOUT (TEXT="RANKING VENTAS POR PRODUCTO")
|
||||
GRID
|
||||
{
|
||||
Ano [f1 ]
|
||||
Mes [f2 ]
|
||||
Cantidad Registros [ca ]
|
||||
Raking por: [va ]
|
||||
|
||||
|
||||
Producto [n ][g ][t ][s ]
|
||||
|
||||
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
vetb00002,vetb00003
|
||||
ATTRIBUTES
|
||||
|
||||
f1 = formonly.p_ano;
|
||||
COMBOBOX f2 = formonly.p_mes,ITEMS=(("1","ENERO"),("2","FEBRERO"),("3","MARZO"),("4","ABRIL"),("5","MAYO"),("6","JUNIO"),("7","JULIO"),("8","AGOSTO"),("9","SEPTIEMBRE"),("10","OCTUBRE"),("11","NOVIEMBRE"),("12","DICIEMBRE"));
|
||||
|
||||
ca = formonly.cantidad_registros,REQUIRED;
|
||||
COMBOBOX va = formonly.tipo_ranking,INCLUDE=("CANTIDAD","VALOR"),DEFAULT="CANTIDAD";
|
||||
n = vetb00003.cod_n,autonext;
|
||||
g = vetb00003.cod_grupo;
|
||||
t = vetb00003.cod_tipo;
|
||||
s = vetb00003.cod_sec;
|
||||
|
||||
instructions delimiters " "
|
||||
end
|
||||
@@ -0,0 +1,21 @@
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
|
||||
Ano [f1 ]
|
||||
Mes [f2]
|
||||
Cantidad Limite [c2 ]
|
||||
Tipo Suplidor [ts]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
cptb00001
|
||||
attributes
|
||||
f1 = formonly.ano1;
|
||||
f2 = formonly.mes1;
|
||||
c2 = formonly.cantidad1 type DECIMAL(12,2);
|
||||
ts = formonly.cod_sp1 type smallint, include=(21,22,23),comments=
|
||||
"Tipo Suplidor: 21 = Intercompany, 22 = Internacional, 23 = Local";
|
||||
INSTRUCTIONS delimiters" "
|
||||
end
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
------------------------------------------------------------------------------
|
||||
FORMULARIO : GEFMRP015
|
||||
OBJETIVO : CAPTURAR LAS INFORMACIONES PERTENECIENTES AL REPORTE DE
|
||||
RANKING DE VENDEDORES/CLIENTES ACUMULADO
|
||||
DISENO : JUAN F. SOTO
|
||||
FECHA : MAYO 22, 1996
|
||||
-------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
Ano [f1 ]
|
||||
Mes [f2 ]
|
||||
Vendedor [v ]
|
||||
Producto [n][g][t ][s ]
|
||||
}
|
||||
end
|
||||
tables
|
||||
vetb00002,vetb00003
|
||||
attributes
|
||||
f1 = formonly.p_ano type smallint;
|
||||
f2 = formonly.p_mes type smallint;
|
||||
v = vetb00002.sec_vend,comments="Digite Codigo de Vendedor";
|
||||
n = vetb00003.cod_n,autonext;
|
||||
g = vetb00003.cod_grupo;
|
||||
t = vetb00003.cod_tipo;
|
||||
s = vetb00003.cod_sec;
|
||||
instructions delimiters " "
|
||||
end
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
------------------------------------------------------------------------------
|
||||
FORMULARIO : GEFMRP015
|
||||
OBJETIVO : CAPTURAR LAS INFORMACIONES PERTENECIENTES AL REPORTE DE
|
||||
RANKING DE VENDEDORES/CLIENTES ACUMULADO
|
||||
DISENO : JUAN F. SOTO
|
||||
FECHA : MAYO 22, 1996
|
||||
-------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
Ano [f1 ]
|
||||
Mes [f2 ]
|
||||
Ventas Mayores a[ve ]
|
||||
|
||||
Vendedor [v ]
|
||||
Cliente [n ][g ]
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
vetb00002,vetb00003
|
||||
attributes
|
||||
ve = formonly.valor;
|
||||
f1 = formonly.p_ano type smallint;
|
||||
f2 = formonly.p_mes type smallint;
|
||||
v = vetb00002.sec_vend,comments="Digite Codigo de Vendedor";
|
||||
n = vetb00002.tipo_cliente;
|
||||
g = vetb00002.sec_cliente;
|
||||
instructions delimiters " "
|
||||
end
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
------------------------------------------------------------------------------
|
||||
FORMULARIO : GEFMRP016
|
||||
OBJETIVO : CAPTURAR LAS INFORMACIONES PERTENECIENTES AL REPORTE DE
|
||||
RANKING DE VENDEDORES/PRODUCTOS ACUMULADO
|
||||
DISENO : JUAN F. SOTO
|
||||
FECHA : MAYO 22, 1996
|
||||
-------------------------------------------------------------------------------
|
||||
}
|
||||
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
Ano [f1 ]
|
||||
Mes [f2 ]
|
||||
Vendedor [v ]
|
||||
Producto [n][g][t ][s ]
|
||||
}
|
||||
end
|
||||
tables
|
||||
vetb00002,vetb00003
|
||||
attributes
|
||||
f1 = formonly.p_ano type smallint;
|
||||
f2 = formonly.p_mes type smallint;
|
||||
v = vetb00002.sec_vend,comments="Digite Codigo de Vendedor";
|
||||
n = vetb00003.cod_n,autonext;
|
||||
g = vetb00003.cod_grupo;
|
||||
t = vetb00003.cod_tipo;
|
||||
s = vetb00003.cod_sec;
|
||||
instructions delimiters " "
|
||||
end
|
||||
@@ -0,0 +1,30 @@
|
||||
database rayovac
|
||||
screen
|
||||
{
|
||||
Ano [f1 ] [e ]
|
||||
Mes [f2 ]
|
||||
Vendedor [v ]
|
||||
|
||||
Producto [n][g][t ][s ]
|
||||
Cliente [t1]-[t2 ]
|
||||
|
||||
|
||||
}
|
||||
end
|
||||
tables
|
||||
vetb00002,vetb00003
|
||||
attributes
|
||||
t1 = vetb00002.tipo_cliente;
|
||||
t2 = vetb00002.sec_cliente;
|
||||
f1 = formonly.p_ano type smallint;
|
||||
f2 = formonly.p_mes type smallint;
|
||||
v = vetb00002.sec_vend,comments="Digite Codigo de Vendedor";
|
||||
n = vetb00003.cod_n,autonext;
|
||||
g = vetb00003.cod_grupo;
|
||||
t = vetb00003.cod_tipo;
|
||||
s = vetb00003.cod_sec;
|
||||
e = formonly.elije,
|
||||
--# widget="RADIO", config="C Cliente K Vendedor", DEFAULT="C";
|
||||
|
||||
instructions delimiters " "
|
||||
end
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
------------------------------------------------------------------------------
|
||||
PROGRAMA : GEMN00000
|
||||
OBJETIVO : Menu principal del Sistema de Informacion Gerencial.
|
||||
PROGRAMADOR : Tadeo A. Ferreras
|
||||
FECHA REALIZACION : Junio 07, 1993.
|
||||
------------------------------------------------------------------------------
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
MAIN
|
||||
#WHENEVER ERROR CONTINUE
|
||||
DEFER INTERRUPT
|
||||
CALL opciones_gemn00000()
|
||||
END MAIN
|
||||
|
||||
FUNCTION opciones_gemn00000()
|
||||
DEFINE luz CHAR(5)
|
||||
|
||||
|
||||
CALL opcion_pantalla()
|
||||
|
||||
MENU "Principal: "
|
||||
COMMAND "1"
|
||||
CALL seg000(1,"gemn00000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
# CALL gemnmt000()
|
||||
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "2"
|
||||
CALL seg000(2,"gemn00000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
# CALL gemncs000()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "3"
|
||||
CALL seg000(3,"gemn00000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
RUN "fglgo /users/rova/sysinfo/4gidir/gemnrp000"
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "Retornar"
|
||||
EXIT MENU
|
||||
END MENU
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION pantalla()
|
||||
DEFINE fecha CHAR(10),
|
||||
hora char(5)
|
||||
LET fecha = today USING "dd/mm/yyyy"
|
||||
LET hora = time
|
||||
DISPLAY "R A Y . O . V A C D O M I N I C A N A, S. A." AT 4,17
|
||||
ATTRIBUTE (REVERSE,BLUE)
|
||||
DISPLAY fecha AT 4,68 ATTRIBUTE (RED)
|
||||
DISPLAY "Sistema de Informacion Gerencial" AT 5,24 ATTRIBUTE(BLACK)
|
||||
DISPLAY hora AT 6,73 ATTRIBUTE(RED)
|
||||
|
||||
CALL fgl_drawbox(5,79,3,1)
|
||||
CALL fgl_drawbox(1,79,22,1)
|
||||
END FUNCTION
|
||||
|
||||
|
||||
FUNCTION opcion_pantalla()
|
||||
|
||||
OPTIONS
|
||||
PROMPT LINE 8
|
||||
CLEAR SCREEN
|
||||
CALL pantalla()
|
||||
|
||||
DISPLAY "Menu Principal" AT 6,33 ATTRIBUTE(BLACK)
|
||||
DISPLAY "gemn00000" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "1- Mantenimientos gemnmt000" AT 10,6
|
||||
DISPLAY "2- Consultas gemncs000" AT 11,6
|
||||
DISPLAY "3- Reportes gemnrp000" AT 12,6
|
||||
#DISPLAY "S- Retorna Menu Anterior" AT 14,6 ATTRIBUTE(BLACK)
|
||||
|
||||
END FUNCTION
|
||||
@@ -0,0 +1,74 @@
|
||||
{
|
||||
------------------------------------------------------------------------------
|
||||
PROGRAMA : GEMN00000
|
||||
OBJETIVO : Menu principal del Sistema de Informacion Gerencial.
|
||||
PROGRAMADOR : Tadeo A. Ferreras
|
||||
FECHA REALIZACION : Junio 07, 1993.
|
||||
------------------------------------------------------------------------------
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
MAIN
|
||||
#WHENEVER ERROR CONTINUE
|
||||
DEFER INTERRUPT
|
||||
CALL opciones_gemn00000()
|
||||
END MAIN
|
||||
|
||||
FUNCTION opciones_gemn00000()
|
||||
|
||||
CALL pantalla()
|
||||
OPTIONS
|
||||
PROMPT LINE 8
|
||||
|
||||
DISPLAY "Menu Principal" AT 6,33 ATTRIBUTE(BLACK)
|
||||
DISPLAY "gemn00000" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "1- Mantenimientos gemnmt000" AT 10,6
|
||||
DISPLAY "2- Consultas gemncs000" AT 11,6
|
||||
DISPLAY "3- Reportes gemnrp000" AT 12,6
|
||||
DISPLAY "S- Retorna Menu Anterior" AT 14,6 ATTRIBUTE(RED)
|
||||
|
||||
LET OPT = " "
|
||||
|
||||
PROMPT "OPCION: " attribute(yellow) FOR OPT
|
||||
|
||||
|
||||
CASE
|
||||
WHEN OPT = "1"
|
||||
# CALL gemnmt000()
|
||||
CLEAR SCREEN
|
||||
CALL pantalla()
|
||||
CALL opciones_gemn00000()
|
||||
WHEN OPT = "2"
|
||||
# CALL gemncs000()
|
||||
CLEAR SCREEN
|
||||
CALL pantalla()
|
||||
CALL opciones_gemn00000()
|
||||
WHEN OPT = "3"
|
||||
RUN "fglgo /users/rova/sysinfo/4gidir/gemnrp000"
|
||||
CLEAR SCREEN
|
||||
CALL pantalla()
|
||||
CALL opciones_gemn00000()
|
||||
WHEN OPT = "S" OR OPT = "s"
|
||||
RETURN
|
||||
OTHERWISE
|
||||
CALL opciones_gemn00000()
|
||||
|
||||
END CASE
|
||||
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION pantalla()
|
||||
DEFINE fecha CHAR(8),
|
||||
hora char(5)
|
||||
LET fecha = today USING "dd/mm/yy"
|
||||
LET hora = time
|
||||
DISPLAY "R A Y . O . V A C D O M I N I C A N A, S. A." AT 4,17
|
||||
ATTRIBUTE (REVERSE,BLUE)
|
||||
DISPLAY fecha AT 4,70 ATTRIBUTE (RED)
|
||||
DISPLAY "Sistema de Informacion Gerencial" AT 5,24 ATTRIBUTE(BLACK)
|
||||
DISPLAY hora AT 6,73 ATTRIBUTE(RED)
|
||||
|
||||
CALL fgl_drawbox(5,79,3,1)
|
||||
CALL fgl_drawbox(1,79,22,1)
|
||||
END FUNCTION
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,187 @@
|
||||
{
|
||||
----------------------------------------------------------------
|
||||
PROGRAMA : GEMNRP000
|
||||
OBJETIVO : Menu de Reportes del Sistema de Informacion
|
||||
Gerencial.
|
||||
PROGRAMADOR : Tadeo A. Ferreras
|
||||
FECHA REALIZACION : Junio 07, 1993.
|
||||
----------------------------------------------------------------
|
||||
}
|
||||
|
||||
GLOBALS "geprgb000.4gl"
|
||||
|
||||
MAIN
|
||||
DEFER INTERRUPT
|
||||
CALL opciones_gemnrp000()
|
||||
END MAIN
|
||||
FUNCTION opciones_gemnrp000()
|
||||
DEFINE luz CHAR(5)
|
||||
|
||||
CALL opcion_pantalla()
|
||||
|
||||
MENU "Reportes: "
|
||||
COMMAND "1"
|
||||
CALL seg000(1,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp001()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "2"
|
||||
CALL seg000(2,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp002()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "3"
|
||||
CALL seg000(3,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp003()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "4"
|
||||
CALL seg000(4,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp004()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "5"
|
||||
CALL seg000(5,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp005()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "6"
|
||||
CALL seg000(6,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp006()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "7"
|
||||
CALL seg000(7,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp007()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "8"
|
||||
CALL seg000(8,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp008()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "9"
|
||||
CALL seg000(9,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp009()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "10"
|
||||
CALL seg000(10,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp010()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "11"
|
||||
CALL seg000(11,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp011()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "12"
|
||||
CALL seg000(12,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp012()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "13"
|
||||
CALL seg000(13,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp013()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "14"
|
||||
CALL seg000(14,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp014()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "15"
|
||||
CALL seg000(15,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp015()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "16"
|
||||
CALL seg000(16,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp016()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "20"
|
||||
CALL seg000(20,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp020()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
COMMAND "21"
|
||||
CALL seg000(21,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp021()
|
||||
CALL opcion_pantalla()
|
||||
END IF
|
||||
|
||||
COMMAND "Retornar"
|
||||
EXIT MENU
|
||||
END MENU
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION pantalla()
|
||||
DEFINE fecha CHAR(10),
|
||||
hora char(5)
|
||||
LET fecha = today USING "dd/mm/yyyy"
|
||||
LET hora = time
|
||||
DISPLAY "R A Y . O . V A C D O M I N I C A N A, S. A." AT 4,17
|
||||
ATTRIBUTE (REVERSE,BLUE)
|
||||
DISPLAY fecha AT 4,68 ATTRIBUTE (RED)
|
||||
DISPLAY "Sistema de Informacion Gerencial" AT 5,24 ATTRIBUTE(BLACK)
|
||||
DISPLAY hora AT 6,73 ATTRIBUTE(RED)
|
||||
|
||||
CALL fgl_drawbox(5,79,3,1)
|
||||
CALL fgl_drawbox(1,79,22,1)
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION opcion_pantalla()
|
||||
|
||||
OPTIONS
|
||||
PROMPT LINE 8,
|
||||
MESSAGE LINE 24
|
||||
CLEAR SCREEN
|
||||
CALL pantalla()
|
||||
LET impresor = FGL_GETENV("IMP")
|
||||
|
||||
|
||||
DISPLAY "Reportes" AT 6,36 ATTRIBUTE(BLACK)
|
||||
DISPLAY "gemnrp000" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY " 1-Ventas Mayores/Tipo Pila geprrp001" AT 09,1
|
||||
DISPLAY " 2-Venta Mayor/Tipo Pila geprrp002" AT 10,1
|
||||
DISPLAY " 3-Suplid. Compras Mayores geprrp003" AT 11,1
|
||||
DISPLAY " 4-Suplidor Mayor Compra geprrp004" AT 12,1
|
||||
DISPLAY " 5-Clientes Ventas Mayores geprrp005" AT 13,1
|
||||
DISPLAY " 6-Cliente Con Mayor Venta geprrp006" AT 14,1
|
||||
DISPLAY " 7-Compras Mayor X Cantidad geprrp007" AT 15,1
|
||||
DISPLAY " 8-Mat. Comprado Por Rango geprrp008" AT 16,1
|
||||
DISPLAY " 9-Ventas Compar. Ano Ant. geprrp009" AT 17,1
|
||||
DISPLAY "10-Ranking Ventas Por Cli. geprrp010" AT 18,1
|
||||
DISPLAY "11-Ventas Comp. Minorisas geprrp011" AT 19,1
|
||||
DISPLAY "12-Ranking Ventas/Vendedor geprrp012" AT 20,1
|
||||
DISPLAY "13-Ranking Ventas/Producto geprrp013" AT 09,40
|
||||
DISPLAY "14-Compras Comparativas geprrp014" AT 10,40
|
||||
DISPLAY "15-Ranking Ventas/Vend. Ac. geprrp015" AT 11,40
|
||||
DISPLAY "16-Ranking Ventas/Prod. Ac. geprrp016" AT 12,40
|
||||
DISPLAY "20-Ranking Ventas/Prod. Ac. geprrp020" AT 13,40
|
||||
DISPLAY "21-Ranking Ventas/Prod. Ac. geprrp021" AT 13,40
|
||||
|
||||
|
||||
#DISPLAY "S- Retorna Menu Anterior " AT 21,28
|
||||
# ATTRIBUTE (BLACK)
|
||||
|
||||
END FUNCTION
|
||||
@@ -0,0 +1,162 @@
|
||||
{
|
||||
----------------------------------------------------------------
|
||||
PROGRAMA : GEMNRP000
|
||||
OBJETIVO : Menu de Reportes del Sistema de Informacion
|
||||
Gerencial.
|
||||
PROGRAMADOR : Tadeo A. Ferreras
|
||||
FECHA REALIZACION : Junio 07, 1993.
|
||||
----------------------------------------------------------------
|
||||
}
|
||||
|
||||
GLOBALS "geprgb000.4gl"
|
||||
|
||||
MAIN
|
||||
DEFER INTERRUPT
|
||||
CALL opciones_gemnrp000()
|
||||
END MAIN
|
||||
FUNCTION opciones_gemnrp000()
|
||||
CLEAR SCREEN
|
||||
CALL pantalla()
|
||||
OPTIONS
|
||||
PROMPT LINE 8,
|
||||
MESSAGE LINE 24
|
||||
|
||||
DISPLAY "Reportes" AT 6,36 ATTRIBUTE(BLACK)
|
||||
DISPLAY "gemnrp000" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY " 1-Ventas Mayores/Tipo Pila geprrp001" AT 09,1
|
||||
DISPLAY " 2-Venta Mayor/Tipo Pila geprrp002" AT 10,1
|
||||
DISPLAY " 3-Suplid. Compras Mayores geprrp003" AT 11,1
|
||||
DISPLAY " 4-Suplidor Mayor Compra geprrp004" AT 12,1
|
||||
DISPLAY " 5-Clientes Ventas Mayores geprrp005" AT 13,1
|
||||
DISPLAY " 6-Cliente Con Mayor Venta geprrp006" AT 14,1
|
||||
DISPLAY " 7-Compras Mayor X Cantidad geprrp007" AT 15,1
|
||||
DISPLAY " 8-Mat. Comprado Por Rango geprrp008" AT 16,1
|
||||
DISPLAY " 9-Ventas Compar. Ano Ant. geprrp009" AT 17,1
|
||||
DISPLAY "10-Ventas Comp. Mayoristas geprrp010" AT 18,1
|
||||
DISPLAY "11-Ventas Comp. Minorisas geprrp011" AT 19,1
|
||||
DISPLAY "12-Ranking Ventas/Vendedor geprrp012" AT 20,1
|
||||
DISPLAY "13-Ranking Ventas/Producto geprrp013" AT 09,40
|
||||
DISPLAY "14-Compras Comparativas geprrp014" AT 10,40
|
||||
DISPLAY "15-Ranking Ventas/Vend. Ac. geprrp015" AT 11,40
|
||||
DISPLAY "16-Ranking Ventas/Prod. Ac. geprrp016" AT 12,40
|
||||
DISPLAY "S- Retorna Menu Anterior " AT 21,28
|
||||
ATTRIBUTE (BLACK)
|
||||
|
||||
MENU "Reportes: "
|
||||
COMMAND "1"
|
||||
CALL seg000(1,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp001()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "2"
|
||||
CALL seg000(2,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp002()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "3"
|
||||
CALL seg000(3,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp003()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "4"
|
||||
CALL seg000(4,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp004()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "5"
|
||||
CALL seg000(5,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp005()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "6"
|
||||
CALL seg000(6,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp006()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "7"
|
||||
CALL seg000(7,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp007()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "8"
|
||||
CALL seg000(8,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp008()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "9"
|
||||
CALL seg000(9,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp009()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "10"
|
||||
CALL seg000(10,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp010()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "11"
|
||||
CALL seg000(11,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp011()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "12"
|
||||
CALL seg000(12,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp012()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "13"
|
||||
CALL seg000(13,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp013()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "14"
|
||||
CALL seg000(14,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp014()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "15"
|
||||
CALL seg000(15,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp015()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "16"
|
||||
CALL seg000(16,"gemnrp000") RETURNING luz
|
||||
IF luz = "azul" THEN
|
||||
CALL geprrp016()
|
||||
CALL opciones_gemnrp000()
|
||||
END IF
|
||||
COMMAND "Salir"
|
||||
EXIT MENU
|
||||
END MENU
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION pantalla()
|
||||
DEFINE fecha CHAR(8),
|
||||
hora char(5)
|
||||
LET fecha = today USING "dd/mm/yy"
|
||||
LET hora = time
|
||||
DISPLAY "R A Y . O . V A C D O M I N I C A N A, S. A." AT 4,17
|
||||
ATTRIBUTE (REVERSE,BLUE)
|
||||
DISPLAY fecha AT 4,70 ATTRIBUTE (RED)
|
||||
DISPLAY "Sistema de Informacion Gerencial" AT 5,24 ATTRIBUTE(BLACK)
|
||||
DISPLAY hora AT 6,73 ATTRIBUTE(RED)
|
||||
|
||||
CALL fgl_drawbox(5,79,3,1)
|
||||
CALL fgl_drawbox(1,79,22,1)
|
||||
END FUNCTION
|
||||
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
{
|
||||
----------------------------------------------------------------
|
||||
PROGRAMA : GEMNRP000
|
||||
OBJETIVO : Menu de Reportes del Sistema de Informacion
|
||||
Gerencial.
|
||||
PROGRAMADOR : Tadeo A. Ferreras
|
||||
FECHA REALIZACION : Junio 07, 1993.
|
||||
----------------------------------------------------------------
|
||||
}
|
||||
|
||||
GLOBALS "geprgb000.4gl"
|
||||
|
||||
MAIN
|
||||
DEFER INTERRUPT
|
||||
CALL opciones_gemnrp000()
|
||||
END MAIN
|
||||
FUNCTION opciones_gemnrp000()
|
||||
CLEAR SCREEN
|
||||
CALL pantalla()
|
||||
OPTIONS
|
||||
PROMPT LINE 8,
|
||||
MESSAGE LINE 24
|
||||
|
||||
DISPLAY "Reportes" AT 6,36 ATTRIBUTE(BLACK)
|
||||
DISPLAY "gemnrp000" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY " 1-Ventas Mayores/Tipo Pila geprrp001" AT 09,1
|
||||
DISPLAY " 2-Venta Mayor/Tipo Pila geprrp002" AT 10,1
|
||||
DISPLAY " 3-Suplid. Compras Mayores geprrp003" AT 11,1
|
||||
DISPLAY " 4-Suplidor Mayor Compra geprrp004" AT 12,1
|
||||
DISPLAY " 5-Clientes Ventas Mayores geprrp005" AT 13,1
|
||||
DISPLAY " 6-Cliente Con Mayor Venta geprrp006" AT 14,1
|
||||
DISPLAY " 7-Compras Mayor X Cantidad geprrp007" AT 15,1
|
||||
DISPLAY " 8-Mat. Comprado Por Rango geprrp008" AT 16,1
|
||||
DISPLAY " 9-Ventas Compar. Ano Ant. geprrp009" AT 17,1
|
||||
DISPLAY "10-Ventas Comp. Mayoristas geprrp010" AT 18,1
|
||||
DISPLAY "11-Ventas Comp. Minorisas geprrp011" AT 19,1
|
||||
DISPLAY "12-Ranking Ventas/Vendedor geprrp012" AT 20,1
|
||||
DISPLAY "13-Ranking Ventas/Producto geprrp013" AT 09,40
|
||||
DISPLAY "14-Compras Comparativas geprrp014" AT 10,40
|
||||
DISPLAY "15-Ranking Ventas/Vend. Ac. geprrp015" AT 11,40
|
||||
DISPLAY "16-Ranking Ventas/Prod. Ac. geprrp016" AT 12,40
|
||||
DISPLAY "S- Retorna Menu Anterior " AT 21,28
|
||||
ATTRIBUTE (BLACK)
|
||||
|
||||
LET opcion = NULL
|
||||
PROMPT " OPCION: " FOR opcion HELP 2
|
||||
LET opcion = opcion clipped
|
||||
|
||||
CASE
|
||||
WHEN opcion = "1"
|
||||
CALL geprrp001()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "2"
|
||||
CALL geprrp002()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "3"
|
||||
CALL geprrp003()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "4"
|
||||
CALL geprrp004()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "5"
|
||||
CALL geprrp005()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "6"
|
||||
CALL geprrp006()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "7"
|
||||
CALL geprrp007()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "8"
|
||||
CALL geprrp008()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "9"
|
||||
CALL geprrp009()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "10"
|
||||
CALL geprrp010()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "11"
|
||||
CALL geprrp011()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "12"
|
||||
CALL geprrp012()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "13"
|
||||
CALL geprrp013()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "14"
|
||||
CALL geprrp014()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "15"
|
||||
CALL geprrp015()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "16"
|
||||
CALL geprrp016()
|
||||
CALL opciones_gemnrp000()
|
||||
WHEN opcion = "S" or opcion = "s"
|
||||
RETURN
|
||||
OTHERWISE
|
||||
CALL opciones_gemnrp000()
|
||||
END CASE
|
||||
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION pantalla()
|
||||
DEFINE fecha CHAR(8),
|
||||
hora char(5)
|
||||
LET fecha = today USING "dd/mm/yy"
|
||||
LET hora = time
|
||||
DISPLAY "R A Y . O . V A C D O M I N I C A N A, S. A." AT 4,17
|
||||
ATTRIBUTE (REVERSE,BLUE)
|
||||
DISPLAY fecha AT 4,70 ATTRIBUTE (RED)
|
||||
DISPLAY "Sistema de Informacion Gerencial" AT 5,24 ATTRIBUTE(BLACK)
|
||||
DISPLAY hora AT 6,73 ATTRIBUTE(RED)
|
||||
|
||||
CALL fgl_drawbox(5,79,3,1)
|
||||
CALL fgl_drawbox(1,79,22,1)
|
||||
END FUNCTION
|
||||
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
SCHEMA decomarmol
|
||||
GLOBALS
|
||||
|
||||
DEFINE unidad CHAR(3),
|
||||
regi SMALLINT,
|
||||
p_param CHAR(1)
|
||||
|
||||
DEFINE fecha_inicial_py,fecha_final_py,p_fechas DATE,
|
||||
p_companias RECORD LIKE companias.*
|
||||
DEFINE normal,negrilla_on,negrillas_of,comp_on,comp_off,doce,doble_on,doble_off
|
||||
CHAR(3),
|
||||
cmd,imprime,copia CHAR(150),archivo CHAR(80)
|
||||
|
||||
DEFINE cantidad_total DECIMAL(10,2),
|
||||
criterio CHAR(1000),
|
||||
selec4,selec,selec1,selec2,selec3 CHAR(1500),
|
||||
manual,p_status,decide,identifica,modifica,opc,bandera,existe,
|
||||
verdad,clasifica CHAR(1),
|
||||
|
||||
opcion,opt CHAR(2),
|
||||
descrip1,descrip2 CHAR(60),
|
||||
usuarios,clave CHAR(50),
|
||||
descrip3,descrip4,descrip_esp1,nombre_p,nom_p CHAR(30),
|
||||
tipo_papel,cuenta,p_act,idx,curr1,curr,fila,linea,scr_l,
|
||||
dia_aduana,num_req_a SMALLINT
|
||||
DEFINE numero_msg LIKE msgtable.cod_msg,
|
||||
impresor SMALLINT
|
||||
|
||||
DEFINE letras RECORD
|
||||
negrillas_on CHAR(6),
|
||||
negrillas_off CHAR(6),
|
||||
doble_on CHAR(6),
|
||||
doble_off CHAR(6),
|
||||
comp_on CHAR(6),
|
||||
comp_off CHAR(6),
|
||||
doce CHAR(6),
|
||||
normal CHAR(6)
|
||||
END RECORD
|
||||
|
||||
END GLOBALS
|
||||
@@ -0,0 +1,200 @@
|
||||
{
|
||||
#################################################################
|
||||
Programa : geprrp001.4gl
|
||||
Sistema : Sistema de Informacion Gerencial
|
||||
Proceso : Busqueda Por Rango De Fecha Ventas Superior A
|
||||
Una Cantidad Dada
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 7, 1993
|
||||
#################################################################
|
||||
}
|
||||
GLOBALS "geprgb000.4gl"
|
||||
DEFINE fecha_in,fecha_fi DATE,
|
||||
cantidad1 DECIMAL(12,2)
|
||||
|
||||
DEFINE cliente RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
descrip LIKE iptb00002.nomenclatura,
|
||||
cantidad DECIMAL(12,2)
|
||||
END RECORD
|
||||
|
||||
FUNCTION geprrp001()
|
||||
#WHENEVER ERROR CONTINUE
|
||||
CLEAR SCREEN
|
||||
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp001 FROM "gefmrp001"
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp001" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "Clientes Con Compras Mayores Por Tipo de Pila" AT 6,17
|
||||
ATTRIBUTE(BLACK)
|
||||
DISPLAY FORM gefmrp001
|
||||
LET int_flag = FALSE
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME fecha_in,fecha_fi,cantidad1
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
BEFORE FIELD fecha_in
|
||||
LET fecha_in = today
|
||||
DISPLAY BY NAME fecha_in
|
||||
|
||||
AFTER FIELD fecha_in
|
||||
IF fecha_in IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_in
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha_fi
|
||||
LET fecha_fi = today
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
AFTER FIELD fecha_fi
|
||||
IF fecha_fi IS NULL THEN
|
||||
LET fecha_fi = today
|
||||
END IF
|
||||
|
||||
IF fecha_fi < fecha_in THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_fi
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio On b.cod_n,b.cod_grupo,a.tipo_cliente,a.sec_cliente
|
||||
FROM cod_n,cod_grupo,tipo_cliente,sec_cliente
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
|
||||
LET selec = "SELECT a.tipo_cliente,a.sec_cliente,c.nomenclatura, ",
|
||||
" SUM(b.cantidad * b.precio) ",
|
||||
"FROM vetb00002 a,vetb00003 b, iptb00002 c ",
|
||||
"WHERE b.status_t is null AND b.cod_n = c.cod_n AND ",
|
||||
" b.cod_grupo=c.cod_grupo AND b.cod_tipo=c.cod_tipo AND ",
|
||||
" b.cod_sec = c.cod_sec AND a.factura = b.factura AND ",
|
||||
" a.fecha_factura BETWEEN ? AND ? AND ",criterio clipped,
|
||||
" GROUP BY 1,2,3 HAVING SUM(b.cantidad*b.precio) > ? ",
|
||||
"ORDER BY 3,4 DESC"
|
||||
|
||||
|
||||
DISPLAY "buscando Informacion... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE busco CURSOR FOR comando
|
||||
OPEN busco USING fecha_in,fecha_fi,cantidad1
|
||||
|
||||
START REPORT clientes1 TO archivo
|
||||
DISPLAY "Impresion en Proceso... Espere por Favor" AT 17,14
|
||||
|
||||
WHILE STATUS != NOTFOUND
|
||||
FETCH busco INTO cliente.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
OUTPUT TO REPORT clientes1(cliente.*)
|
||||
END WHILE
|
||||
FINISH REPORT clientes1
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT clientes1(x)
|
||||
DEFINE x RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
descrip LIKE iptb00002.nomenclatura,
|
||||
cantidad DECIMAL(12,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE descrip1 CHAR(30)
|
||||
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
|
||||
LET hora = time
|
||||
|
||||
PRINT COLUMN 1, letras.comp_on,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp001",
|
||||
COLUMN 21, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 80, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 21, " Sistema de Informacion Gerencial",
|
||||
COLUMN 80, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 20, "Clientes con Compras Mayores a ",cantidad1
|
||||
USING "###,###,##&.&&",
|
||||
COLUMN 83, hora
|
||||
PRINT COLUMN 1, "FECHA: DEL ", fecha_in USING "dd/mm/yyyy"," AL ",
|
||||
fecha_fi USING "dd/mm/yyyy"
|
||||
SKIP 1 LINES
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------------------",
|
||||
"-----------------------------------"
|
||||
|
||||
PRINT COLUMN 3, "Cliente",
|
||||
COLUMN 61, "Monto Venta"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------------------",
|
||||
"-----------------------------------"
|
||||
PRINT letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.descrip
|
||||
PRINT COLUMN 1,letras.negrillas_on,
|
||||
COLUMN 2,"Tipo de Pila:", x.descrip clipped,letras.negrillas_off
|
||||
SKIP 1 LINE
|
||||
|
||||
ON EVERY ROW
|
||||
SELECT a.nombre INTO descrip1 FROM vetb00004 a
|
||||
WHERE a.tipo_cliente = x.tipo_cliente AND a.sec_cliente = x.sec_cliente
|
||||
|
||||
PRINT COLUMN 3, x.tipo_cliente USING "&&","-",x.sec_cliente USING "&&&&",
|
||||
" ", descrip1 clipped,
|
||||
COLUMN 59,x.cantidad USING "###,###,##&.&&"
|
||||
|
||||
ON LAST ROW
|
||||
PRINT letras.comp_off
|
||||
END REPORT
|
||||
|
||||
@@ -0,0 +1,216 @@
|
||||
{
|
||||
-------------------------------------------------------------------------------
|
||||
PROGRAMA : GEPRRP002
|
||||
OBJETIVO : Clientes con mayores compras
|
||||
PROGRAMADOR : Tadeo A. Ferreras F.
|
||||
FECHA REALIZACION : Junio 7, 1993
|
||||
-------------------------------------------------------------------------------
|
||||
}
|
||||
GLOBALS "geprgb000.4gl"
|
||||
|
||||
DEFINE client RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
descrip LIKE iptb00002.nomenclatura,
|
||||
cantidad DECIMAL(12,2)
|
||||
END RECORD
|
||||
DEFINE fecha1,fecha2 DATE,
|
||||
cant1 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp002()
|
||||
|
||||
#WHENEVER ERROR CONTINUE
|
||||
LET int_flag = FALSE
|
||||
CLEAR SCREEN
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp002 FROM "gefmrp002"
|
||||
DISPLAY FORM gefmrp002
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp002" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "Clientes Con Compras Mayores Por Tipo de Pila" AT 6,17
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME fecha1,fecha2,cant1
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
BEFORE FIELD fecha1
|
||||
LET fecha1 = today
|
||||
DISPLAY BY NAME fecha1
|
||||
|
||||
AFTER FIELD fecha1
|
||||
IF fecha1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha1
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha2
|
||||
LET fecha2 = today
|
||||
DISPLAY BY NAME fecha2
|
||||
|
||||
AFTER FIELD fecha2
|
||||
IF fecha2 IS NULL THEN
|
||||
LET fecha2 = today
|
||||
END IF
|
||||
|
||||
IF fecha2 < fecha1 THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha2
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha2
|
||||
|
||||
AFTER FIELD cant1
|
||||
IF cant1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cant1
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio On b.cod_n,b.cod_grupo FROM cod_n,cod_grupo
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente,a.sec_cliente,c.nomenclatura, ",
|
||||
" SUM(b.cantidad * b.precio) ",
|
||||
"FROM vetb00002 a,vetb00003 b,iptb00002 c ",
|
||||
"WHERE b.status_t is null and b.cod_n = c.cod_n and ",
|
||||
" b.cod_grupo = c.cod_grupo and b.cod_tipo = c.cod_tipo and ",
|
||||
" b.cod_sec = c.cod_sec and a.factura = b.factura AND ",
|
||||
" a.fecha_factura BETWEEN ? AND ? AND a.sec_cliente is not null AND ",
|
||||
criterio clipped,
|
||||
" GROUP BY 1,2,3 HAVING SUM(b.cantidad*b.precio) >= ? ORDER BY 3,4 DESC"
|
||||
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 3
|
||||
CALL msg(numero_msg)
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
DISPLAY "buscando Informacion... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE busco CURSOR FOR comando
|
||||
OPEN busco USING fecha1,fecha2,cant1
|
||||
|
||||
START REPORT clientes2 TO archivo
|
||||
DISPLAY "Impresion en Proceso... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BLINK)
|
||||
|
||||
WHILE STATUS != NOTFOUND
|
||||
FETCH busco INTO client.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
FINISH REPORT clientes2
|
||||
RUN imprime
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
OUTPUT TO REPORT clientes2(client.*)
|
||||
END WHILE
|
||||
FINISH REPORT clientes2
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT clientes2(x)
|
||||
DEFINE x RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
descrip LIKE iptb00002.nomenclatura,
|
||||
cantidad DECIMAL(12,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE descrip1 CHAR(30),
|
||||
|
||||
hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
|
||||
PRINT COLUMN 1, letras.comp_on,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp002",
|
||||
COLUMN 20, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 80, "Pag. ", pageno using "<<<"
|
||||
PRINT COLUMN 20, " Sistema De Informacion Gerencial",
|
||||
COLUMN 80, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 13, "Cliente con Mayor Compra Superior a ",
|
||||
cant1 USING "###,###,##&.&&",
|
||||
COLUMN 83, hora
|
||||
SKIP 1 LINES
|
||||
PRINT COLUMN 1, "Fecha: Del ",fecha1 USING "dd/mm/yyyy",
|
||||
" Al ", fecha2 USING "dd/mm/yyyy"
|
||||
|
||||
PRINT COLUMN 1, "--------------------------------------------",
|
||||
"-------------------------------------------"
|
||||
|
||||
PRINT COLUMN 3, "Cliente",
|
||||
COLUMN 61, "Monto Venta"
|
||||
|
||||
PRINT COLUMN 1, "--------------------------------------------",
|
||||
"-------------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.descrip
|
||||
LET idx = 1
|
||||
PRINT COLUMN 1,letras.negrillas_on,
|
||||
COLUMN 2,"Tipo de Pila:",x.descrip clipped,letras.negrillas_off
|
||||
SKIP 1 LINE
|
||||
|
||||
ON EVERY ROW
|
||||
LET descrip1 = " "
|
||||
SELECT nombre INTO descrip1 FROM vetb00004
|
||||
WHERE tipo_cliente=x.tipo_cliente and sec_cliente = x.sec_cliente
|
||||
|
||||
IF descrip1 = " " OR descrip1 IS NULL THEN
|
||||
LET descrip1 = "CLIENTE NO EXISTE"
|
||||
END IF
|
||||
|
||||
IF idx > 1 THEN
|
||||
LET x.cantidad = 0
|
||||
END IF
|
||||
|
||||
IF x.cantidad > 0 THEN
|
||||
PRINT COLUMN 3, x.tipo_cliente USING "&&","-",
|
||||
x.sec_cliente USING "&&&&"," ",
|
||||
descrip1 clipped,
|
||||
COLUMN 59, x.cantidad USING "###,###,##&.&&"
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,208 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP003
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Suplidor con Compras Mayores a X Cantidad
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp RECORD
|
||||
cod_sp SMALLINT,
|
||||
cod_sp_sec SMALLINT,
|
||||
nombre CHAR(30),
|
||||
cantidad DECIMAL(10,2),
|
||||
secuencia SMALLINT
|
||||
END RECORD,
|
||||
cod1 SMALLINT
|
||||
|
||||
DEFINE fecha_in,fecha_fi DATE,
|
||||
cod_sup SMALLINT,
|
||||
total2,cantidad1 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp003()
|
||||
LET int_flag = FALSE
|
||||
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
CALL pantalla()
|
||||
|
||||
OPEN FORM gefmrp003 FROM "gefmrp003"
|
||||
DISPLAY FORM gefmrp003
|
||||
DISPLAY "geprrp003" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "Suplidores Con Compras Mayores a X Cantidad" AT 6,18
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME fecha_in,fecha_fi,cod_sup,cantidad1
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
AFTER FIELD fecha_in
|
||||
IF fecha_in IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_in
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha_fi
|
||||
LET fecha_fi = today
|
||||
|
||||
AFTER FIELD fecha_fi
|
||||
IF fecha_fi IS NULL THEN
|
||||
LET fecha_fi = today
|
||||
END IF
|
||||
|
||||
IF fecha_fi < fecha_in THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_fi
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
AFTER FIELD cod_sup
|
||||
IF cod_sup IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_sup
|
||||
END IF
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
SELECT SUM(a.valor) INTO total2 FROM cptb00001 a
|
||||
WHERE a.status_t IS NULL AND a.fecha_orig between fecha_in AND fecha_fi
|
||||
AND a.cod_sp = cod_sup and a.tipo_doc = "FT"
|
||||
|
||||
DECLARE buscar CURSOR FOR
|
||||
SELECT a.cod_sp,a.cod_sp_sec,b.nom_sp,SUM(a.valor)
|
||||
FROM cptb00001 a, cotb00001 b
|
||||
WHERE (a.cod_sp = b.cod_sp AND a.cod_sp_sec = b.cod_sp_sec) AND
|
||||
(a.status_t IS NULL) AND a.fecha_orig between fecha_in AND fecha_fi
|
||||
AND (a.cod_sp = cod_sup) and (a.tipo_doc = "FT")
|
||||
GROUP BY 1,2,3 HAVING SUM(a.valor) > cantidad1 ORDER BY 4 DESC
|
||||
|
||||
DISPLAY "Buscando Informacion..... Espere por Favor" AT 17,14
|
||||
|
||||
START REPORT gerencia1 TO archivo
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor" AT 17,14
|
||||
|
||||
LET idx = 1
|
||||
FOREACH buscar INTO ger_comp.*
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET ger_comp.secuencia = idx
|
||||
|
||||
OUTPUT TO REPORT gerencia1(ger_comp.*,fecha_in,fecha_fi,cod_sup,
|
||||
cantidad1,total2)
|
||||
|
||||
LET idx = idx + 1
|
||||
END FOREACH
|
||||
FINISH REPORT gerencia1
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia1(x,fecha1,fecha2,cod_sup1,cant,total1)
|
||||
|
||||
DEFINE x RECORD
|
||||
cod_sp SMALLINT,
|
||||
cod_sp_sec SMALLINT,
|
||||
nombre CHAR(30),
|
||||
cantidad DECIMAL(10,2),
|
||||
secuencia SMALLINT
|
||||
END RECORD
|
||||
|
||||
DEFINE cod_sup1 SMALLINT
|
||||
DEFINE supl CHAR(15)
|
||||
DEFINE fecha1,fecha2 DATE,
|
||||
total1,proporcion,cant DECIMAL(12,2)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
|
||||
PRINT COLUMN 1, "geprrp003",
|
||||
COLUMN 17, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 73, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 17, " Sistema de Informacion Gerencial",
|
||||
COLUMN 80, today using "dd/mm/yyyy"
|
||||
|
||||
IF cod_sup1 = 21 THEN
|
||||
LET supl = " INTERCOMPANY"
|
||||
ELSE
|
||||
IF cod_sup1 = 22 THEN
|
||||
LET supl = "INTERNACIONALES"
|
||||
ELSE
|
||||
LET supl = " LOCALES"
|
||||
END IF
|
||||
END IF
|
||||
PRINT COLUMN 32,supl,
|
||||
COLUMN 73, hora
|
||||
|
||||
PRINT COLUMN 24,"Compras Mayores a ", cant USING "###,###,##&.&&"
|
||||
SKIP 1 LINES
|
||||
PRINT COLUMN 1, "FECHA: DEL ", fecha1 USING "dd/mm/yyyy",
|
||||
" AL ", fecha2 USING "dd/mm/yyyy"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------",
|
||||
"----------------------------------------"
|
||||
|
||||
PRINT COLUMN 1, "Secuencia",
|
||||
COLUMN 15, "Suplidor",
|
||||
COLUMN 62, "Cantidad",
|
||||
COLUMN 72, "Proporcion"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------",
|
||||
"----------------------------------------"
|
||||
|
||||
SKIP 1 LINE
|
||||
ON EVERY ROW
|
||||
|
||||
LET proporcion = ((x.cantidad/total1)*100)
|
||||
|
||||
PRINT COLUMN 2, x.secuencia USING "##,###",
|
||||
COLUMN 15,x.cod_sp USING "&&","-",x.cod_sp_sec USING "&&&&"," ",
|
||||
x.nombre clipped,
|
||||
COLUMN 57,x.cantidad USING "###,###,###.##";
|
||||
PRINT COLUMN 74,proporcion USING "##&.&&"
|
||||
|
||||
ON LAST ROW
|
||||
SKIP 1 LINE
|
||||
PRINT COLUMN 30,"TOTAL...."," ",
|
||||
COLUMN 57,total1 USING "###,###,###.##"
|
||||
END REPORT
|
||||
|
||||
@@ -0,0 +1,184 @@
|
||||
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP004
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Clientes con Mayores Ventas
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp RECORD
|
||||
cod_sp SMALLINT,
|
||||
cod_sp_sec SMALLINT,
|
||||
nombre CHAR(30),
|
||||
cantidad DECIMAL(10,2),
|
||||
secuencia SMALLINT
|
||||
END RECORD,
|
||||
cod1 SMALLINT
|
||||
|
||||
DEFINE fecha_in,fecha_fi DATE,
|
||||
cod_sup SMALLINT,
|
||||
total2,cantidad1 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp004()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
OPEN FORM gefmrp004 FROM "gefmrp004"
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp004" AT 4,3
|
||||
ATTRIBUTE(RED)
|
||||
DISPLAY "Suplidores Con Ventas Mayores" AT 6,24
|
||||
ATTRIBUTE(BLACK)
|
||||
DISPLAY FORM gefmrp004
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime,letras.*, archivo
|
||||
|
||||
INPUT BY NAME fecha_in,fecha_fi,cod_sup
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
|
||||
AFTER FIELD fecha_in
|
||||
IF fecha_in IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_in
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha_fi
|
||||
LET fecha_fi = today
|
||||
|
||||
AFTER FIELD fecha_fi
|
||||
IF fecha_fi IS NULL THEN
|
||||
LET fecha_fi = today
|
||||
END IF
|
||||
|
||||
IF fecha_fi < fecha_in THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_fi
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
AFTER FIELD cod_sup
|
||||
IF cod_sup IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_sup
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
DECLARE buscar CURSOR FOR
|
||||
SELECT a.cod_sp,a.cod_sp_sec,b.nom_sp,SUM(a.valor)
|
||||
FROM cptb00001 a, cotb00001 b
|
||||
WHERE (a.cod_sp = b.cod_sp AND a.cod_sp_sec = b.cod_sp_sec) AND
|
||||
(a.status_t IS NULL) AND a.fecha_orig between fecha_in AND fecha_fi
|
||||
AND a.cod_sp = cod_sup and tipo_doc = "FT"
|
||||
GROUP BY 1,2,3 HAVING SUM(a.valor) > 0 ORDER BY 4 DESC
|
||||
|
||||
DISPLAY "Buscando Informacion ... Espere por Favor" AT 17,14
|
||||
|
||||
START REPORT gerencia4 TO archivo
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor" AT 17,14
|
||||
|
||||
LET idx = 1
|
||||
FOREACH buscar INTO ger_comp.*
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET ger_comp.secuencia = idx
|
||||
|
||||
OUTPUT TO REPORT gerencia4(ger_comp.*,fecha_in,fecha_fi,cod_sup)
|
||||
|
||||
LET idx = idx + 1
|
||||
END FOREACH
|
||||
FINISH REPORT gerencia4
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia4(x,fecha1,fecha2,cod_sup1)
|
||||
|
||||
DEFINE x RECORD
|
||||
cod_sp SMALLINT,
|
||||
cod_sp_sec SMALLINT,
|
||||
nombre CHAR(30),
|
||||
cantidad DECIMAL(10,2),
|
||||
secuencia SMALLINT
|
||||
END RECORD
|
||||
|
||||
DEFINE cod_sup1 SMALLINT
|
||||
DEFINE supl CHAR(13)
|
||||
DEFINE fecha1,fecha2 DATE,
|
||||
total1,proporcion,cant DECIMAL(12,2)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, "geprrp004",
|
||||
COLUMN 17, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 73, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 17, " SISTEMA DE INFORMACION GERENCIAL",
|
||||
COLUMN 73, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 17, " Suplidor Con Compra Mayor",
|
||||
COLUMN 76, hora
|
||||
PRINT COLUMN 28, "DEL ", fecha1 USING "dd/mm/yyyy",
|
||||
" AL ", fecha2 USING "dd/mm/yyyy"
|
||||
SKIP 1 LINES
|
||||
IF cod_sup1 = 21 THEN
|
||||
LET supl = "INTERCOMPANY"
|
||||
ELSE
|
||||
IF cod_sup1 = 22 THEN
|
||||
LET supl = "INTERNACIONAL"
|
||||
ELSE
|
||||
LET supl = "LOCAL"
|
||||
END IF
|
||||
END IF
|
||||
|
||||
PRINT COLUMN 1, supl
|
||||
PRINT COLUMN 1, "-----------------------------------",
|
||||
"-----------------------------------",
|
||||
"---------------------------"
|
||||
|
||||
PRINT COLUMN 3,"Suplidor",
|
||||
COLUMN 62, "Cantidad"
|
||||
|
||||
PRINT COLUMN 1, "-----------------------------------",
|
||||
"-----------------------------------",
|
||||
"---------------------------"
|
||||
|
||||
SKIP 2 LINE
|
||||
ON EVERY ROW
|
||||
SELECT a.nom_sp INTO descrip FROM cotb00001 a
|
||||
WHERE a.cod_sp = x.cod_sp AND a.cod_sp_sec = x.cod_sp_sec
|
||||
|
||||
PRINT COLUMN 3, x.cod_sp USING "&&","-",x.cod_sp_sec USING "&&&&",
|
||||
" ",x.nombre clipped,
|
||||
COLUMN 57,x.cantidad USING "###,###,###.##"
|
||||
END REPORT
|
||||
@@ -0,0 +1,207 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP005
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Clientes con Ventas Mayores a X Cantidad
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp2 RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
limite DECIMAL(12,2),
|
||||
neto LIKE vetb00002.neto,
|
||||
secuencia SMALLINT
|
||||
END RECORD,
|
||||
cod1 SMALLINT
|
||||
|
||||
DEFINE fecha_in,fecha_fi DATE,
|
||||
total2,cantidad1 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp005()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp005 FROM "gefmrp005"
|
||||
DISPLAY FORM gefmrp005
|
||||
CALL pantalla()
|
||||
|
||||
DISPLAY "geprrp005" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "Clientes Con Ventas Mayores a X Cantidad" AT 6,20
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME fecha_in,fecha_fi,cantidad1
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
AFTER FIELD fecha_in
|
||||
IF fecha_in IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_in
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha_fi
|
||||
LET fecha_fi = today
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
AFTER FIELD fecha_fi
|
||||
IF fecha_fi IS NULL THEN
|
||||
LET fecha_fi = today
|
||||
END IF
|
||||
|
||||
IF fecha_fi < fecha_in THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_fi
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
SELECT SUM(a.neto) INTO total2 FROM vetb00002 a,vetb00004 b
|
||||
WHERE a.sec_cliente = b.sec_cliente AND a.status_t IS NULL AND
|
||||
b.status_t IS NULL AND a.fecha_factura BETWEEN fecha_in AND fecha_fi
|
||||
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente,a.sec_cliente,b.nombre,b.limite_credito,SUM(a.sub_total) ",
|
||||
"FROM vetb00002 a,vetb00004 b ",
|
||||
"WHERE a.status_t IS NULL AND a.fecha_factura between ? AND ? AND ",
|
||||
" a.tipo_cliente = b.tipo_cliente and ",
|
||||
" a.sec_cliente = b.sec_cliente AND b.status_t IS NULL ",
|
||||
" and a.ventas = '1' ",
|
||||
"GROUP BY 1,2,3,4 ORDER BY 5 DESC,1,2 "
|
||||
|
||||
DISPLAY "Buscando Informacion..... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE buscar CURSOR FOR comando
|
||||
OPEN buscar USING fecha_in,fecha_fi
|
||||
|
||||
START REPORT gerencia5 TO "clientes"
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
INITIALIZE letras.* TO NULL
|
||||
LET idx = 1
|
||||
WHILE STATUS != NOTFOUND
|
||||
FETCH buscar INTO ger_comp2.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET ger_comp2.secuencia = idx
|
||||
{
|
||||
SELECT a.neto,a.fecha_factura
|
||||
INTO ger_comp2.neto,ger_comp2.fecha
|
||||
FROM vetb00002 a
|
||||
WHERE a.factura = ger_comp2.factura
|
||||
}
|
||||
OUTPUT TO REPORT gerencia5(ger_comp2.*)
|
||||
|
||||
LET idx = idx + 1
|
||||
END WHILE
|
||||
FINISH REPORT gerencia5
|
||||
#RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia5(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
limite DECIMAL(12,2),
|
||||
neto LIKE vetb00002.neto,
|
||||
secuencia SMALLINT
|
||||
END RECORD
|
||||
|
||||
DEFINE descrip,descrip1 CHAR(30),
|
||||
hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
ORDER BY x.secuencia
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
{
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp005",
|
||||
COLUMN 17, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 73, "Pag. ", pageno USING "###"
|
||||
PRINT COLUMN 17, " Sistema de Informacion Gerencial",
|
||||
COLUMN 73, today USING "dd/mm/yyyy"
|
||||
PRINT COLUMN 18, "Clientes con Ventas Mayores a ",
|
||||
cantidad1 USING "###,###,##&.&&",
|
||||
COLUMN 76, hora
|
||||
SKIP 1 LINES
|
||||
PRINT COLUMN 1, "Fecha: Del ",fecha_in USING "MM/DD/yyyy",
|
||||
" Al ",fecha_fi USING "MM/DD/yyyy"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------",
|
||||
"----------------------------------------",
|
||||
"-----------------------"
|
||||
PRINT COLUMN 1, "Secuencia",
|
||||
COLUMN 11, "Cliente",
|
||||
COLUMN 53, "Limite Credito",
|
||||
COLUMN 70, "Factura",
|
||||
COLUMN 80, "Fecha",
|
||||
COLUMN 98, "Monto"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------",
|
||||
"----------------------------------------",
|
||||
"-----------------------"
|
||||
PRINT letras.negrillas_off
|
||||
}
|
||||
ON EVERY ROW
|
||||
|
||||
PRINT COLUMN 3, x.secuencia USING "#,###",
|
||||
COLUMN 11, x.tipo_cliente USING "&&","-",
|
||||
x.sec_cliente USING "&&&&"," ", x.nombre,
|
||||
2 SPACES, x.limite USING "###,###,###.##",
|
||||
2 SPACES, x.neto USING "###,###,###.##"
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 30, "TOTAL VENTAS...."," ",
|
||||
COLUMN 74, SUM(x.neto) USING "###,###,###.##"
|
||||
|
||||
END REPORT
|
||||
|
||||
@@ -0,0 +1,199 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP005
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Clientes con Ventas Mayores a X Cantidad
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp2 RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
cantidad DECIMAL(10,2),
|
||||
secuencia SMALLINT
|
||||
END RECORD,
|
||||
cod1 SMALLINT
|
||||
|
||||
DEFINE fecha_in,fecha_fi DATE,
|
||||
total2,cantidad1 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp005()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp005 FROM "gefmrp005"
|
||||
DISPLAY FORM gefmrp005
|
||||
CALL pantalla()
|
||||
|
||||
DISPLAY "geprrp005" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "Clientes Con Ventas Mayores a X Cantidad" AT 6,20
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME fecha_in,fecha_fi,cantidad1
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
AFTER FIELD fecha_in
|
||||
IF fecha_in IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_in
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha_fi
|
||||
LET fecha_fi = today
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
AFTER FIELD fecha_fi
|
||||
IF fecha_fi IS NULL THEN
|
||||
LET fecha_fi = today
|
||||
END IF
|
||||
|
||||
IF fecha_fi < fecha_in THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_fi
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
SELECT SUM(a.neto) INTO total2 FROM vetb00002 a,vetb00004 b
|
||||
WHERE a.sec_cliente = b.sec_cliente AND a.status_t IS NULL AND
|
||||
b.status_t IS NULL AND a.fecha_factura BETWEEN fecha_in AND fecha_fi
|
||||
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente,a.sec_cliente,b.nombre,SUM(a.neto) ",
|
||||
"FROM vetb00002 a,vetb00004 b ",
|
||||
"WHERE a.status_t IS NULL AND a.fecha_factura between ? AND ? AND ",
|
||||
" a.sec_cliente = b.sec_cliente AND b.status_t IS NULL ",
|
||||
"GROUP BY 1,2,3 HAVING SUM(a.neto) > ? ORDER BY 4 DESC,1,2 "
|
||||
|
||||
DISPLAY "Buscando Informacion..... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE buscar CURSOR FOR comando
|
||||
OPEN buscar USING fecha_in,fecha_fi,cantidad1
|
||||
|
||||
START REPORT gerencia5 TO archivo
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
|
||||
LET idx = 1
|
||||
WHILE STATUS != NOTFOUND
|
||||
FETCH buscar INTO ger_comp2.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET ger_comp2.secuencia = idx
|
||||
|
||||
OUTPUT TO REPORT gerencia5(ger_comp2.*)
|
||||
|
||||
LET idx = idx + 1
|
||||
END WHILE
|
||||
FINISH REPORT gerencia5
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia5(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
cantidad DECIMAL(10,2),
|
||||
secuencia SMALLINT
|
||||
END RECORD
|
||||
|
||||
DEFINE descrip,descrip1 CHAR(30),
|
||||
hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
ORDER BY x.secuencia
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp005",
|
||||
COLUMN 17, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 73, "Pag. ", pageno USING "###"
|
||||
PRINT COLUMN 17, " Sistema de Informacion Gerencial",
|
||||
COLUMN 73, today USING "dd/mm/yyyy"
|
||||
PRINT COLUMN 18, "Clientes con Ventas Mayores a ",
|
||||
cantidad1 USING "###,###,##&.&&",
|
||||
COLUMN 76, hora
|
||||
SKIP 1 LINES
|
||||
PRINT COLUMN 1, "Fecha: Del ",fecha_in USING "dd/mm/yyyy",
|
||||
" Al ",fecha_fi USING "dd/mm/yyyy"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------",
|
||||
"----------------------------------------"
|
||||
|
||||
PRINT COLUMN 1, "Secuencia",
|
||||
COLUMN 11, "Cliente",
|
||||
COLUMN 59, "Cantidad",
|
||||
COLUMN 71, "Proporcion"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------",
|
||||
"----------------------------------------"
|
||||
PRINT letras.negrillas_off
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
PRINT COLUMN 3, x.secuencia USING "#,###",
|
||||
COLUMN 11, x.tipo_cliente USING "&&","-",
|
||||
x.sec_cliente USING "&&&&"," ", x.nombre clipped,
|
||||
COLUMN 59, x.cantidad USING "###,###,###.##",
|
||||
COLUMN 74, (x.cantidad/total2)*100 USING "##&.&&"
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 30, "TOTAL VENTAS...."," ",
|
||||
COLUMN 57, SUM(x.cantidad) USING "###,###,###.##",
|
||||
COLUMN 74, SUM((x.cantidad/total2)*100) USING "##&.&&"
|
||||
|
||||
SKIP 1 LINE
|
||||
PRINT COLUMN 30,"TOTAL GENERAL..."," ",
|
||||
COLUMN 57,total2 USING "###,###,###.##",letras.negrillas_off
|
||||
END REPORT
|
||||
|
||||
@@ -0,0 +1,178 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP006
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Clientes con Mayores Ventas
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp6 RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
cantidad DECIMAL(10,2),
|
||||
secuencia SMALLINT
|
||||
END RECORD,
|
||||
cod2 SMALLINT
|
||||
|
||||
DEFINE fecha_in,fecha_fi DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp006()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
OPEN FORM gefmrp006 FROM "gefmrp006"
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp006" AT 4,3
|
||||
ATTRIBUTE(RED)
|
||||
DISPLAY "Clientes Con Ventas Mayores" AT 6,27
|
||||
ATTRIBUTE(BLACK)
|
||||
DISPLAY FORM gefmrp006
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME fecha_in,fecha_fi
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
AFTER FIELD fecha_in
|
||||
IF fecha_in IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_in
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha_fi
|
||||
LET fecha_fi = today
|
||||
|
||||
AFTER FIELD fecha_fi
|
||||
IF fecha_fi IS NULL THEN
|
||||
LET fecha_fi = today
|
||||
END IF
|
||||
|
||||
IF fecha_fi < fecha_in THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_fi
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha_fi
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente,a.sec_cliente,b.nombre,SUM(a.neto) ",
|
||||
"FROM vetb00002 a,vetb00004 b ",
|
||||
"WHERE (a.tipo_cliente=b.tipo_cliente AND a.sec_cliente=b.sec_cliente) ",
|
||||
" AND (a.status_t IS NULL) AND (a.fecha_factura between ? AND ?) ",
|
||||
" AND a.ventas = '2' ",
|
||||
"GROUP BY 1,2,3 HAVING SUM(a.neto) > 0 ORDER BY 4 DESC,1,2 "
|
||||
|
||||
DISPLAY "Buscando Informacion..... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando1 FROM selec
|
||||
DECLARE buscar1 CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_in,fecha_fi
|
||||
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BLINK)
|
||||
|
||||
LET idx = 1
|
||||
START REPORT gerencia6 TO "gerp6"
|
||||
|
||||
WHILE STATUS != NOTFOUND
|
||||
FETCH buscar1 INTO ger_comp6.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
{ IF idx > 1 THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
}
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
FINISH REPORT gerencia6
|
||||
RUN imprime
|
||||
END IF
|
||||
|
||||
LET ger_comp6.secuencia = idx
|
||||
|
||||
OUTPUT TO REPORT gerencia6(ger_comp6.*)
|
||||
|
||||
LET idx = idx + 1
|
||||
END WHILE
|
||||
FINISH REPORT gerencia6
|
||||
# RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia6(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
cantidad DECIMAL(10,2),
|
||||
secuencia SMALLINT
|
||||
END RECORD
|
||||
|
||||
DEFINE descrip,descrip1 CHAR(30),
|
||||
hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp006",
|
||||
COLUMN 17, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 73, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 17, " Sistema de Informacion Gerencial",
|
||||
COLUMN 80, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 17, " Cliente de Mayor Venta ",
|
||||
COLUMN 83, hora
|
||||
SKIP 1 LINE
|
||||
PRINT COLUMN 1, "Fecha: Del ",fecha_in USING "dd/mm/yyyy",
|
||||
" Al ", fecha_fi USING "dd/mm/yyyy"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------",
|
||||
"----------------------------------------"
|
||||
|
||||
PRINT COLUMN 3, "Secuencia",
|
||||
COLUMN 15, "Cliente",
|
||||
COLUMN 73, "Cantidad"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------",
|
||||
"----------------------------------------"
|
||||
PRINT letras.negrillas_off
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
PRINT COLUMN 3, x.secuencia,
|
||||
COLUMN 15, x.tipo_cliente USING "&&","-",
|
||||
x.sec_cliente USING "&&&&"," ",x.nombre clipped,
|
||||
COLUMN 67, x.cantidad USING "###,###,###.##"
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 67, "--------------"
|
||||
PRINT COLUMN 67, SUM(x.cantidad) USING "###,###,###.##"
|
||||
END REPORT
|
||||
@@ -0,0 +1,237 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP007
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Compra Mayor a x cantidad en un rango de fechas.
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Enero 03,1994
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_rep07 RECORD
|
||||
cod_sp SMALLINT,
|
||||
cod_sp_sec SMALLINT,
|
||||
nom_sp CHAR(30),
|
||||
valor DECIMAL(10,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE fecha_1,fecha_2 DATE,
|
||||
tipo_rep,salir CHAR(1),
|
||||
cod1 SMALLINT,
|
||||
cant_may DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp007()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp007 FROM "gefmrp007"
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp007" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "Compra Mayor a X Cantidad en un Rango de Fechas" AT 6,16
|
||||
ATTRIBUTE(BLACK)
|
||||
DISPLAY FORM gefmrp007
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
LET cant_may = 0
|
||||
INPUT BY NAME fecha_1,fecha_2,cant_may,tipo_rep
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
AFTER FIELD fecha_1
|
||||
IF fecha_1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_1
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha_2
|
||||
LET fecha_2 = today
|
||||
|
||||
AFTER FIELD fecha_2
|
||||
IF fecha_2 IS NULL THEN
|
||||
LET fecha_2 = today
|
||||
END IF
|
||||
|
||||
IF fecha_2 < fecha_1 THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_2
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha_2
|
||||
|
||||
AFTER FIELD tipo_rep
|
||||
IF tipo_rep IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD tipo_rep
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF cant_may IS NULL THEN
|
||||
LET cant_may = 0
|
||||
END IF
|
||||
IF tipo_rep = "M" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_sp,a.cod_sp_sec,d.nom_sp,SUM(a.cantidad_2 * (b.precio / ",
|
||||
" c.base)) ",
|
||||
"FROM intb00006 a, cotb00015 b, intb00002 c,cotb00001 d ",
|
||||
"WHERE (a.cod_sp = d.cod_sp AND a.cod_sp_sec = d.cod_sp_sec) AND ",
|
||||
" (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.cod_n = c.cod_n AND a.cod_grupo = c.cod_grupo AND ",
|
||||
" a.cod_tipo = c.cod_tipo AND a.cod_sec = c.cod_sec) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov IN (34,35)) ",
|
||||
"GROUP BY 1,2,3 HAVING SUM(a.cantidad_2*(b.precio/c.base)) > ? "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
|
||||
IF tipo_rep = "R" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_sp,a.cod_sp_sec,d.nom_sp,SUM(a.cantidad_2 * b.precio) ",
|
||||
"FROM irtb00006 a, cotb00015 b, cotb00001 d ",
|
||||
"WHERE (a.cod_sp = d.cod_sp AND a.cod_sp_sec = d.cod_sp_sec) AND ",
|
||||
" (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov IN (1,2)) AND ",
|
||||
" (a.cod_sp=5) ",
|
||||
"GROUP BY 1,2,3 HAVING SUM(a.cantidad_2*b.precio) > ? "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
|
||||
IF tipo_rep = "H" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_sp,a.cod_sp_sec,d.nom_sp,SUM(a.cantidad_2 * b.precio) ",
|
||||
"FROM ihtb00006 a, cotb00015 b, cotb00001 d ",
|
||||
"WHERE (a.cod_sp = d.cod_sp AND a.cod_sp_sec = d.cod_sp_sec) AND ",
|
||||
" (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov IN (1,2)) ",
|
||||
"GROUP BY 1,2,3 HAVING SUM(a.cantidad_2*b.precio) > ? "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
|
||||
IF tipo_rep = "S" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_sp,a.cod_sp_sec,d.nom_sp,SUM(a.cantidad_2 * b.precio) ",
|
||||
"FROM istb00006 a, cotb00015 b, cotb00001 d ",
|
||||
"WHERE (a.cod_sp = d.cod_sp AND a.cod_sp_sec = d.cod_sp_sec) AND ",
|
||||
" (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov IN (1,34)) ",
|
||||
"GROUP BY 1,2,3 HAVING SUM(a.cantidad_2*b.precio) > ? "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE busca CURSOR FOR comando
|
||||
OPEN busca USING fecha_1,fecha_2,cant_may
|
||||
|
||||
START REPORT gerencia07 TO archivo
|
||||
DISPLAY "Reporte Generandose... Espere por Favor" AT 19,14 ATTRIBUTE(BOLD)
|
||||
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH busca INTO ger_rep07.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
OUTPUT TO REPORT gerencia07(ger_rep07.*)
|
||||
END WHILE
|
||||
FINISH REPORT gerencia07
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia07(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
cod_sp SMALLINT,
|
||||
cod_sp_sec SMALLINT,
|
||||
nom_sp CHAR(30),
|
||||
valor DECIMAL(10,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE cant DECIMAL(12,2)
|
||||
DEFINE total DECIMAL(12,2)
|
||||
DEFINE descrip CHAR(11)
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.valor DESC,x.cod_sp,x.cod_sp_sec
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, "geprrp007",
|
||||
COLUMN 17, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 73,"Pag. ", pageno using "###"
|
||||
PRINT COLUMN 17, " Sistema de Informacion Gerencial ",
|
||||
COLUMN 73, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 24,"Compras Mayores a ", cant_may USING "###,###,###.##",
|
||||
COLUMN 76, hora
|
||||
IF tipo_rep = "M" THEN
|
||||
LET descrip = " MATERIAL "
|
||||
END IF
|
||||
IF tipo_rep = "R" THEN
|
||||
LET descrip = " REPUESTO "
|
||||
END IF
|
||||
IF tipo_rep = "H" THEN
|
||||
LET descrip = "HERRAMIENTA"
|
||||
END IF
|
||||
IF tipo_rep = "S" THEN
|
||||
LET descrip = "SUMINISTRO"
|
||||
END IF
|
||||
PRINT COLUMN 35, descrip
|
||||
PRINT COLUMN 1, "Fecha: Del ", fecha_1 USING "dd/mm/yyyy"," Al ",
|
||||
fecha_2 USING "dd/mm/yyyy"
|
||||
|
||||
PRINT COLUMN 1, "-----------------------------------------------",
|
||||
"----------------------------------"
|
||||
PRINT COLUMN 1, "Suplidor",
|
||||
COLUMN 73, "Valor"
|
||||
PRINT COLUMN 1, "-----------------------------------------------",
|
||||
"----------------------------------"
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
PRINT COLUMN 01, x.cod_sp USING "&&","-",x.cod_sp_sec USING "&&&&"," ",
|
||||
x.nom_sp CLIPPED,
|
||||
COLUMN 65, x.valor USING "###,###,###.##"
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 65,"______________"
|
||||
PRINT COLUMN 40,"Total General ==> ",
|
||||
COLUMN 65, SUM(x.valor) USING "###,###,###.##"
|
||||
END REPORT
|
||||
@@ -0,0 +1,354 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP008
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Cantidad de Bienes Y/O servicios Comprado en un Rango
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Enero 03,1994
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE cod1 SMALLINT
|
||||
DEFINE ger_rep08 RECORD
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
descrip_esp CHAR(30),
|
||||
unidad_med CHAR(3),
|
||||
cantidad DECIMAL(10,2),
|
||||
valor DECIMAL(10,2),
|
||||
cantidad1 DECIMAL(10,2),
|
||||
valor1 DECIMAL(10,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE fecha_1,fecha_2,fecha_3,fecha_4 DATE,
|
||||
tipo_rep,salir CHAR(1)
|
||||
|
||||
FUNCTION geprrp008()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp008 FROM "gefmrp008"
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp008" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "Cantidad de Bien/Serv. Comprado En Un Rango de Fecha" AT 6,14
|
||||
ATTRIBUTE(BLACK)
|
||||
DISPLAY FORM gefmrp008
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME fecha_1,fecha_2,tipo_rep
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
AFTER FIELD fecha_1
|
||||
IF fecha_1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_1
|
||||
END IF
|
||||
|
||||
BEFORE FIELD fecha_2
|
||||
LET fecha_2 = today
|
||||
|
||||
AFTER FIELD fecha_2
|
||||
IF fecha_2 IS NULL THEN
|
||||
LET fecha_2 = today
|
||||
END IF
|
||||
|
||||
IF fecha_2 < fecha_1 THEN
|
||||
LET numero_msg = 51
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD fecha_2
|
||||
END IF
|
||||
|
||||
DISPLAY BY NAME fecha_2
|
||||
|
||||
AFTER FIELD tipo_rep
|
||||
IF tipo_rep IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD tipo_rep
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
LET fecha_3 = fecha_1 - 365
|
||||
LET fecha_4 = fecha_2 - 365
|
||||
|
||||
IF tipo_rep = "M" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,d.descrip_esp, ",
|
||||
" d.unidad_med,SUM(a.cantidad_2),SUM(a.cantidad_2 * (b.precio / ",
|
||||
" c.base)) ",
|
||||
"FROM intb00006 a, cotb00015 b, intb00002 c,intb00001 d ",
|
||||
"WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.cod_n = c.cod_n AND a.cod_grupo = c.cod_grupo AND ",
|
||||
" a.cod_tipo = c.cod_tipo AND a.cod_sec = c.cod_sec) AND ",
|
||||
" (a.cod_n = d.cod_n AND a.cod_grupo = d.cod_grupo AND ",
|
||||
" a.cod_tipo = d.cod_tipo AND a.cod_sec = d.cod_sec) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov IN (34,35)) ",
|
||||
"GROUP BY 1,2,3,4,5,6 HAVING SUM(a.cantidad_2) > 0 ORDER BY 1,2,3,4 "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
|
||||
IF tipo_rep = "R" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,d.descrip_esp, ",
|
||||
" d.unidad_med,SUM(a.cantidad_2),SUM(a.cantidad_2*b.precio) ",
|
||||
"FROM irtb00006 a, cotb00015 b, intb00001 d ",
|
||||
"WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.cod_n = d.cod_n AND a.cod_grupo = d.cod_grupo AND ",
|
||||
" a.cod_tipo = d.cod_tipo AND a.cod_sec = d.cod_sec) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov IN (1,2)) AND ",
|
||||
" (a.cod_n=5) ",
|
||||
"GROUP BY 1,2,3,4,5,6 HAVING SUM(a.cantidad_2) > 0 ORDER BY 1,2,3,4 "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
|
||||
IF tipo_rep = "H" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,d.descrip_esp, ",
|
||||
" d.unidad_med,SUM(a.cantidad_2),SUM(a.cantidad_2*b.precio) ",
|
||||
"FROM ihtb00006 a, cotb00015 b, intb00001 d ",
|
||||
"WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.cod_n = d.cod_n AND a.cod_grupo = d.cod_grupo AND ",
|
||||
" a.cod_tipo = d.cod_tipo AND a.cod_sec = d.cod_sec) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov IN (1,2)) ",
|
||||
"GROUP BY 1,2,3,4,5,6 HAVING SUM(a.cantidad_2) > 0 ORDER BY 1,2,3,4 "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
|
||||
IF tipo_rep = "S" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,d.descrip_esp, ",
|
||||
" d.unidad_med,SUM(a.cantidad_2),SUM(a.cantidad_2*b.precio) ",
|
||||
"FROM istb00006 a, cotb00015 b, intb00001 d ",
|
||||
"WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.cod_n = d.cod_n AND a.cod_grupo = d.cod_grupo AND ",
|
||||
" a.cod_tipo = d.cod_tipo AND a.cod_sec = d.cod_sec) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov IN (34,1)) ",
|
||||
"GROUP BY 1,2,3,4,5,6 HAVING SUM(a.cantidad_2) > 0 ORDER BY 1,2,3,4 "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
|
||||
IF tipo_rep = "P" THEN
|
||||
LET selec =
|
||||
"SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,d.descrip_esp, ",
|
||||
" d.unidad_med,SUM(a.cantidad_2),SUM(a.cantidad_2*b.precio) ",
|
||||
"FROM iptb00006 a, cotb00015 b, intb00001 d ",
|
||||
"WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND ",
|
||||
" a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND ",
|
||||
" (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND ",
|
||||
" (a.cod_n = d.cod_n AND a.cod_grupo = d.cod_grupo AND ",
|
||||
" a.cod_tipo = d.cod_tipo AND a.cod_sec = d.cod_sec) AND ",
|
||||
" (a.fecha BETWEEN ? AND ?) AND (a.cod_mov = 10) ",
|
||||
"GROUP BY 1,2,3,4,5,6 HAVING SUM(a.cantidad_2) > 0 ORDER BY 1,2,3,4 "
|
||||
|
||||
DISPLAY "Buscando Compras... Espere por Favor" AT 19,14
|
||||
END IF
|
||||
PREPARE comando FROM selec
|
||||
DECLARE busca CURSOR FOR comando
|
||||
OPEN busca USING fecha_1,fecha_2
|
||||
|
||||
START REPORT gerencia08 TO archivo
|
||||
DISPLAY "Reporte Generandose... Espere por Favor" AT 19,14 ATTRIBUTE(BOLD)
|
||||
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH busca INTO ger_rep08.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
LET ger_rep08.cantidad1 = 0
|
||||
LET ger_rep08.valor1 = 0
|
||||
|
||||
CASE
|
||||
WHEN tipo_rep = "M"
|
||||
SELECT SUM(a.cantidad_2),SUM(a.cantidad_2 * (b.precio / c.base))
|
||||
INTO ger_rep08.cantidad1,ger_rep08.valor1
|
||||
FROM intb00006 a, cotb00015 b, intb00002 c
|
||||
WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND
|
||||
a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND
|
||||
(a.cod_n = c.cod_n AND a.cod_grupo = c.cod_grupo AND
|
||||
a.cod_tipo = c.cod_tipo AND a.cod_sec = c.cod_sec) AND
|
||||
(a.cod_n=ger_rep08.cod_n AND a.cod_grupo=ger_rep08.cod_grupo AND
|
||||
a.cod_tipo=ger_rep08.cod_tipo AND a.cod_sec=ger_rep08.cod_sec)
|
||||
AND (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND
|
||||
(a.fecha BETWEEN fecha_3 AND fecha_4) AND (a.cod_mov IN (34,35))
|
||||
EXIT CASE
|
||||
|
||||
WHEN tipo_rep = "H"
|
||||
SELECT SUM(a.cantidad_2),SUM(a.cantidad_2*b.precio)
|
||||
INTO ger_rep08.cantidad1,ger_rep08.valor1
|
||||
FROM ihtb00006 a, cotb00015 b
|
||||
WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND
|
||||
a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND
|
||||
(a.cod_n=ger_rep08.cod_n AND a.cod_grupo=ger_rep08.cod_grupo AND
|
||||
a.cod_tipo=ger_rep08.cod_tipo AND a.cod_sec=ger_rep08.cod_sec)
|
||||
AND (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND
|
||||
(a.fecha BETWEEN fecha_3 AND fecha_4) AND (a.cod_mov IN (1,2))
|
||||
EXIT CASE
|
||||
|
||||
WHEN tipo_rep = "R"
|
||||
SELECT SUM(a.cantidad_2),SUM(a.cantidad_2*b.precio)
|
||||
INTO ger_rep08.cantidad1,ger_rep08.valor1
|
||||
FROM irtb00006 a, cotb00015 b
|
||||
WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND
|
||||
a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND
|
||||
(a.cod_n=ger_rep08.cod_n AND a.cod_grupo=ger_rep08.cod_grupo AND
|
||||
a.cod_tipo=ger_rep08.cod_tipo AND a.cod_sec=ger_rep08.cod_sec)
|
||||
AND (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND
|
||||
(a.fecha BETWEEN fecha_3 AND fecha_4) AND (a.cod_mov IN (1,2))
|
||||
EXIT CASE
|
||||
|
||||
WHEN tipo_rep = "S"
|
||||
SELECT SUM(a.cantidad_2),SUM(a.cantidad_2*b.precio)
|
||||
INTO ger_rep08.cantidad1,ger_rep08.valor1
|
||||
FROM istb00006 a, cotb00015 b
|
||||
WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND
|
||||
a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND
|
||||
(a.cod_n=ger_rep08.cod_n AND a.cod_grupo=ger_rep08.cod_grupo AND
|
||||
a.cod_tipo=ger_rep08.cod_tipo AND a.cod_sec=ger_rep08.cod_sec)
|
||||
AND (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND
|
||||
(a.fecha BETWEEN fecha_3 AND fecha_4) AND (a.cod_mov IN (1,34))
|
||||
EXIT CASE
|
||||
|
||||
WHEN tipo_rep = "P"
|
||||
SELECT SUM(a.cantidad_2),SUM(a.cantidad_2*b.precio)
|
||||
INTO ger_rep08.cantidad1,ger_rep08.valor1
|
||||
FROM iptb00006 a, cotb00015 b
|
||||
WHERE (a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND
|
||||
a.cod_tipo = b.cod_tipo AND a.cod_sec = b.cod_sec) AND
|
||||
(a.cod_n=ger_rep08.cod_n AND a.cod_grupo=ger_rep08.cod_grupo AND
|
||||
a.cod_tipo=ger_rep08.cod_tipo AND a.cod_sec=ger_rep08.cod_sec)
|
||||
AND (a.orden_compra = b.num_oc AND a.tipo = b.tipo) AND
|
||||
(a.fecha BETWEEN fecha_3 AND fecha_4) AND (a.cod_mov = 10)
|
||||
EXIT CASE
|
||||
END CASE
|
||||
|
||||
OUTPUT TO REPORT gerencia08(ger_rep08.*)
|
||||
END WHILE
|
||||
FINISH REPORT gerencia08
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia08(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
descrip_esp CHAR(30),
|
||||
unidad_med CHAR(3),
|
||||
cantidad DECIMAL(10,2),
|
||||
valor DECIMAL(10,2),
|
||||
cantidad1 DECIMAL(10,2),
|
||||
valor1 DECIMAL(10,2)
|
||||
END RECORD
|
||||
|
||||
|
||||
DEFINE descrip CHAR(11)
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.cod_n,x.cod_grupo,x.cod_tipo,x.cod_sec
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT letras.comp_on,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp008",
|
||||
COLUMN 38, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 116, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 38, " Sistema de Informacion Gerencial ",
|
||||
COLUMN 116, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 36, "Cantidad de Bien/Serv. Comprado En Rango de Fecha",
|
||||
COLUMN 119, hora
|
||||
|
||||
IF tipo_rep = "M" THEN
|
||||
LET descrip = " MATERIAL "
|
||||
END IF
|
||||
IF tipo_rep = "R" THEN
|
||||
LET descrip = " REPUESTO "
|
||||
END IF
|
||||
IF tipo_rep = "H" THEN
|
||||
LET descrip = "HERRAMIENTA"
|
||||
END IF
|
||||
IF tipo_rep = "S" THEN
|
||||
LET descrip = "SUMINISTRO"
|
||||
END IF
|
||||
PRINT COLUMN 35, descrip
|
||||
PRINT COLUMN 1, "Fecha: Del ", fecha_1 USING "dd/mm/yyyy"," Al ",
|
||||
fecha_2 USING "dd/mm/yyyy"
|
||||
|
||||
PRINT COLUMN 1, "--------------------------------------------------",
|
||||
"--------------------------------------------------",
|
||||
"-----------------------"
|
||||
PRINT COLUMN 64, "ANO ACTUAL",
|
||||
COLUMN 104, "ANO ANTEIOR"
|
||||
PRINT COLUMN 1, "Material",
|
||||
COLUMN 56, "Cantidad",
|
||||
COLUMN 76, "Valor",
|
||||
COLUMN 96, "Cantidad",
|
||||
COLUMN 119, "Valor"
|
||||
PRINT COLUMN 1, "--------------------------------------------------",
|
||||
"--------------------------------------------------",
|
||||
"-----------------------"
|
||||
|
||||
PRINT letras.negrillas_off
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
PRINT COLUMN 1, x.cod_n USING "&","-",x.cod_grupo USING "&","-",
|
||||
x.cod_tipo USING "&&","-",x.cod_sec USING "&&&"," ",
|
||||
x.descrip_esp CLIPPED," ",x.unidad_med CLIPPED,
|
||||
COLUMN 50, x.cantidad USING "###,###,###.##",
|
||||
COLUMN 70, x.valor USING "###,###,###.##",
|
||||
COLUMN 90, x.cantidad1 USING "###,###,###.##",
|
||||
COLUMN 110, x.valor1 USING "###,###,###.##"
|
||||
|
||||
ON LAST ROW
|
||||
PRINT letras.negrillas_on
|
||||
PRINT COLUMN 76, "--------------",
|
||||
COLUMN 110, "--------------"
|
||||
PRINT COLUMN 40,"Total General ==> ",
|
||||
COLUMN 76, SUM(x.valor) USING "###,###,###.##",
|
||||
COLUMN 110, SUM(x.valor1) USING "###,###,###.##"
|
||||
PRINT letras.comp_off,letras.negrillas_off
|
||||
END REPORT
|
||||
@@ -0,0 +1,480 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP009
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ventas Comparativas Ano Anterior
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp9 RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
cantidad3 DECIMAL(14,2),
|
||||
posicion1 INTEGER,
|
||||
posicion2 INTEGER,
|
||||
posicion3 INTEGER,
|
||||
codigo CHAR(6)
|
||||
END RECORD,
|
||||
ano11,cod1,cuenta_r SMALLINT
|
||||
DEFINE selec9 CHAR(1000)
|
||||
DEFINE salir,salir9,compa CHAR(1)
|
||||
DEFINE idx9,idx1,j,m,p,s,s1 INTEGER
|
||||
DEFINE ano19 CHAR(4)
|
||||
DEFINE ano1,mes1 SMALLINT
|
||||
DEFINE nom_mes CHAR(15),
|
||||
detalle CHAR(20),
|
||||
fecha_in10,fecha_fi10 DATE
|
||||
|
||||
DEFINE fecha_in,fecha_fi,fecha_in9,fecha_fi9 DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1,cantidad2,cantidad3,cantidad4,cantidad5,cantidad6,
|
||||
cantidad7,cantidad8,cantida9 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp009()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp009 FROM "gefmrp009"
|
||||
DISPLAY FORM gefmrp009
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp009" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY "Ranking de Ventas Comparativas Al Ano Anterior" AT 6,20
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME ano1,mes1,cantidad1,detalle
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
|
||||
AFTER FIELD ano1
|
||||
IF ano1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD ano1
|
||||
END IF
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in FROM prdtable
|
||||
WHERE ano = ano1
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in9 FROM prdtable
|
||||
WHERE ano = ano1 - 1
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in10 FROM prdtable
|
||||
WHERE ano = ano1 - 2
|
||||
|
||||
LET ano19 = ano1 - 1 USING "&&&&"
|
||||
|
||||
BEFORE FIELD mes1
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
AFTER FIELD mes1
|
||||
IF mes1 IS NULL THEN
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
END IF
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi FROM prdtable
|
||||
WHERE ano = ano1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi10 FROM prdtable
|
||||
WHERE ano = ano1 - 2 AND mes = mes1
|
||||
|
||||
SELECT descrip INTO nom_mes FROM mestable
|
||||
WHERE mes = mes1
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT BY NAME criterio ON c.cod_cia,a.tipo_cliente,a.sec_cliente
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente,a.sec_cliente,a.nombre,a.status_t,SUM(c.neto) ",
|
||||
"FROM vetb00004 a, vetb00002 c ",
|
||||
"WHERE (a.tipo_cliente=c.tipo_cliente AND a.sec_cliente=c.sec_cliente) ",
|
||||
" AND (c.status_t IS NULL) AND (c.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (c.ventas = '1') AND ",criterio clipped,
|
||||
"GROUP BY 1,2,3,4 HAVING SUM(c.neto) > ? ORDER BY 5 DESC "
|
||||
|
||||
LET ano11 = ano1 - 2
|
||||
DISPLAY "Buscando Informacion Ano ",ano11 USING "&&&&",
|
||||
"... Espere por Favor" AT 17,14 ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando2 FROM selec
|
||||
DECLARE buscar2 CURSOR FOR comando2
|
||||
OPEN buscar2 USING fecha_in10,fecha_fi10,cantidad1
|
||||
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente,a.sec_cliente,a.nombre,a.status_t,SUM(c.neto) ",
|
||||
"FROM vetb00004 a, vetb00002 c ",
|
||||
"WHERE (a.tipo_cliente=c.tipo_cliente AND a.sec_cliente=c.sec_cliente) ",
|
||||
" AND (c.status_t IS NULL) AND (c.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (c.ventas = '1') AND ",criterio clipped,
|
||||
"GROUP BY 1,2,3,4 HAVING SUM(c.neto) > ? ORDER BY 5 DESC "
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Anterior... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando1 FROM selec
|
||||
DECLARE buscar1 CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_in9,fecha_fi9,cantidad1
|
||||
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente,a.sec_cliente,a.nombre,a.status_t,SUM(c.neto) ",
|
||||
"FROM vetb00004 a, vetb00002 c ",
|
||||
"WHERE (a.tipo_cliente=c.tipo_cliente AND a.sec_cliente=c.sec_cliente) ",
|
||||
" AND (c.status_t IS NULL) AND c.fecha_factura BETWEEN ? AND ? AND ",
|
||||
" (c.ventas = '1') AND ",criterio clipped,
|
||||
"GROUP BY 1,2,3,4 HAVING SUM(c.neto) > ? ORDER BY 5 DESC"
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Actual ... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE buscar CURSOR FOR comando
|
||||
OPEN buscar USING fecha_in,fecha_fi,cantidad1
|
||||
{
|
||||
LET cuenta_r = 0
|
||||
WHILE STATUS != NOTFOUND
|
||||
FETCH buscar INTO ger_comp9.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET cuenta_r = cuenta_r + 1
|
||||
END WHILE
|
||||
|
||||
WHILE STATUS != NOTFOUND
|
||||
FETCH buscar1 INTO ger_comp9.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET cuenta_r = cuenta_r + 1
|
||||
END WHILE
|
||||
|
||||
WHILE STATUS != NOTFOUND
|
||||
FETCH buscar2 INTO ger_comp9.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET cuenta_r = cuenta_r + 1
|
||||
END WHILE
|
||||
LET regi = cuenta_r
|
||||
}
|
||||
START REPORT gerencia9 TO archivo
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
|
||||
# Creacion Tabla Temporal
|
||||
CREATE TEMP TABLE geprrp009
|
||||
(tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
cantidad3 DECIMAL(14,2),
|
||||
posicion1 INTEGER,
|
||||
posicion2 INTEGER,
|
||||
posicion3 INTEGER,
|
||||
codigo CHAR(6))
|
||||
|
||||
CREATE INDEX tempo_1 ON geprrp009(tipo_cliente,sec_cliente)
|
||||
#-------------------------------------------------------------------------
|
||||
LET idx = 0
|
||||
LET idx1= 0
|
||||
LET salir = "N"
|
||||
LET p_param = "S"
|
||||
WHILE salir != "S"
|
||||
FETCH buscar INTO ger_comp9.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
CALL termometro(regi,p_param)
|
||||
LET p_param = "N"
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx = idx + 1
|
||||
LET ger_comp9.posicion2 = idx
|
||||
|
||||
IF ger_comp9.cantidad2 IS NULL THEN
|
||||
LET ger_comp9.cantidad2 = 0
|
||||
END IF
|
||||
LET ger_comp9.codigo = ger_comp9.tipo_cliente USING "&&",
|
||||
ger_comp9.sec_cliente USING "&&&&"
|
||||
INSERT INTO geprrp009 VALUES (ger_comp9.*)
|
||||
END WHILE
|
||||
|
||||
# Busqueda Ano Anterior
|
||||
LET idx = 0
|
||||
LET idx1= 0
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH buscar1 INTO ger_comp9.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
CALL termometro(regi,p_param)
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
IF ger_comp9.cantidad2 IS NOT NULL OR
|
||||
ger_comp9.cantidad2 > 0 THEN
|
||||
LET idx = idx + 1
|
||||
LET ger_comp9.posicion1 = idx
|
||||
END IF
|
||||
|
||||
LET ger_comp9.codigo = ger_comp9.tipo_cliente USING "&&",
|
||||
ger_comp9.sec_cliente USING "&&&&"
|
||||
LET ger_comp9.cantidad1 = ger_comp9.cantidad2
|
||||
LET ger_comp9.posicion2 = 0
|
||||
LET ger_comp9.cantidad2 = 0
|
||||
SELECT unique tipo_cliente FROM geprrp009
|
||||
WHERE tipo_cliente = ger_comp9.tipo_cliente AND
|
||||
sec_cliente = ger_comp9.sec_cliente
|
||||
|
||||
IF STATUS = NOTFOUND THEN
|
||||
SELECT MAX(posicion2) INTO ger_comp9.posicion2
|
||||
FROM geprrp009
|
||||
LET ger_comp9.posicion2 = ger_comp9.posicion2 + 1
|
||||
INSERT INTO geprrp009 VALUES (ger_comp9.*)
|
||||
ELSE
|
||||
UPDATE geprrp009 SET posicion1 = ger_comp9.posicion1,
|
||||
cantidad1 = ger_comp9.cantidad1
|
||||
WHERE tipo_cliente = ger_comp9.tipo_cliente AND
|
||||
sec_cliente = ger_comp9.sec_cliente
|
||||
|
||||
END IF
|
||||
|
||||
END WHILE
|
||||
# Busqueda Ano Trasanterior
|
||||
LET idx = 0
|
||||
LET idx1= 0
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH buscar2 INTO ger_comp9.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
CALL termometro(regi,p_param)
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
IF ger_comp9.cantidad2 IS NOT NULL OR
|
||||
ger_comp9.cantidad2 > 0 THEN
|
||||
LET idx = idx + 1
|
||||
LET ger_comp9.posicion3 = idx
|
||||
END IF
|
||||
|
||||
LET ger_comp9.codigo = ger_comp9.tipo_cliente USING "&&",
|
||||
ger_comp9.sec_cliente USING "&&&&"
|
||||
LET ger_comp9.cantidad3 = ger_comp9.cantidad2
|
||||
LET ger_comp9.posicion2 = 0
|
||||
LET ger_comp9.cantidad2 = 0
|
||||
LET ger_comp9.cantidad1 = 0
|
||||
LET ger_comp9.posicion1 = 0
|
||||
|
||||
SELECT unique tipo_cliente FROM geprrp009
|
||||
WHERE tipo_cliente = ger_comp9.tipo_cliente AND
|
||||
sec_cliente = ger_comp9.sec_cliente
|
||||
|
||||
IF STATUS = NOTFOUND THEN
|
||||
SELECT MAX(posicion2) INTO ger_comp9.posicion3
|
||||
FROM geprrp009
|
||||
LET ger_comp9.posicion3 = ger_comp9.posicion3 + 1
|
||||
LET STATUS = 0
|
||||
|
||||
INSERT INTO geprrp009 VALUES (ger_comp9.*)
|
||||
ELSE
|
||||
UPDATE geprrp009 SET posicion3 = ger_comp9.posicion3,
|
||||
cantidad3 = ger_comp9.cantidad3
|
||||
WHERE tipo_cliente = ger_comp9.tipo_cliente AND
|
||||
sec_cliente = ger_comp9.sec_cliente
|
||||
|
||||
END IF
|
||||
END WHILE
|
||||
# Busqueda Tabla Temporal
|
||||
DECLARE temporal9 CURSOR FOR
|
||||
SELECT * FROM geprrp009
|
||||
WHERE posicion2 != 0
|
||||
|
||||
ORDER BY posicion2
|
||||
|
||||
FOREACH temporal9 INTO ger_comp9.*
|
||||
OUTPUT TO REPORT gerencia9(ger_comp9.*)
|
||||
END FOREACH
|
||||
FINISH REPORT gerencia9
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia9(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
cantidad3 DECIMAL(14,2),
|
||||
posicion1 INTEGER,
|
||||
posicion2 INTEGER,
|
||||
posicion3 INTEGER,
|
||||
codigo CHAR(6)
|
||||
END RECORD
|
||||
|
||||
DEFINE fecha1,fecha2,fecha3,fecha4 DATE,
|
||||
diferencia,total2,total3,total1,proporcion,cant DECIMAL(12,2),
|
||||
porciento DECIMAL(8,3)
|
||||
DEFINE l,mes11 SMALLINT
|
||||
DEFINE nom_mes1 CHAR(15)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE nombre_sal CHAR(20),
|
||||
|
||||
hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.comp_on,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp009",
|
||||
COLUMN 32, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 107, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 38, "SISTEMA DE INFORMACION GERENCIAL",
|
||||
COLUMN 107, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 28, "Ranking de Ventas Comparativas Ano Anterior Mayor A ",
|
||||
cantidad1 USING "#,###,###.##",
|
||||
COLUMN 107, hora
|
||||
LET l = LENGTH(detalle)
|
||||
LET l = 100 - l
|
||||
LET l = l / 2
|
||||
PRINT COLUMN l,detalle clipped
|
||||
SKIP 1 LINES
|
||||
|
||||
PRINT COLUMN 1, "ACUMULADO AL MES DE ",nom_mes CLIPPED
|
||||
PRINT COLUMN 1, "-----------------------------------",
|
||||
"-----------------------------------",
|
||||
"------------------------------------------------"
|
||||
|
||||
PRINT COLUMN 2, "Posicion",
|
||||
COLUMN 70, "Valor",
|
||||
COLUMN 85, "Valor",
|
||||
COLUMN 113, "Valor"
|
||||
|
||||
PRINT COLUMN 1, ano1 USING "&&&&",
|
||||
COLUMN 6, ano1-1 USING "&&&&",
|
||||
COLUMN 11, ano1-2 USING "&&&&",
|
||||
COLUMN 17, "Cliente",
|
||||
COLUMN 70, ano1 USING "&&&&",
|
||||
COLUMN 85, ano1-1 USING "&&&&",
|
||||
COLUMN 92, "Variacion",
|
||||
COLUMN 113, ano1-2 USING "&&&&"
|
||||
|
||||
PRINT COLUMN 1, "-----------------------------------",
|
||||
"-----------------------------------",
|
||||
"------------------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON EVERY ROW
|
||||
LET porciento = 0
|
||||
IF x.cantidad2 IS NULL THEN
|
||||
LET x.cantidad2 = 0
|
||||
END IF
|
||||
IF x.cantidad1 IS NULL THEN
|
||||
LET x.cantidad1 = 0
|
||||
END IF
|
||||
#LET diferencia = x.cantidad2 - x.cantidad1
|
||||
IF x.cantidad1 != 0 THEN
|
||||
LET porciento = (1- (x.cantidad2/x.cantidad1)) * 100
|
||||
END IF
|
||||
IF x.cantidad1 > x.cantidad2 AND porciento > 0 THEN
|
||||
LET porciento = porciento * -1
|
||||
END IF
|
||||
IF x.cantidad2 > x.cantidad1 AND porciento < 0 THEN
|
||||
LET porciento = porciento * -1
|
||||
END IF
|
||||
PRINT COLUMN 1, x.posicion2 USING "###&",
|
||||
COLUMN 6, x.posicion1 USING "###&",
|
||||
COLUMN 11, x.posicion3 USING "###&",
|
||||
COLUMN 17, x.codigo," ",x.nombre CLIPPED,
|
||||
COLUMN 60, x.cantidad2 USING "###,###,###.##",
|
||||
COLUMN 75, x.cantidad1 USING "###,###,###.##",
|
||||
COLUMN 92, porciento USING "(#,###.##)","%",
|
||||
COLUMN 103, x.cantidad3 USING "###,###,###.##"," ",
|
||||
x.status_t
|
||||
|
||||
ON LAST ROW
|
||||
|
||||
PRINT COLUMN 60, "--------------",
|
||||
COLUMN 75, "--------------",
|
||||
COLUMN 103, "--------------"
|
||||
|
||||
PRINT COLUMN 30, "TOTAL VENTAS....",
|
||||
COLUMN 60, SUM(x.cantidad2) USING "###,###,###.##",
|
||||
COLUMN 75, SUM(x.cantidad1) USING "###,###,###.##",
|
||||
COLUMN 103, SUM(x.cantidad3) USING "###,###,###.##"
|
||||
PRINT COLUMN 1, letras.comp_off,letras.negrillas_off
|
||||
|
||||
LET idx1 = 0
|
||||
END REPORT
|
||||
@@ -0,0 +1,426 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP010
|
||||
Sistema : Sistema de Informacion Gerencia Mayoristas
|
||||
Proceso : Clientes con Ventas Mayores a X Cantidad
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp10 RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
status_t CHAR(1),
|
||||
tipo_negocio SMALLINT,
|
||||
descripcion CHAR(30),
|
||||
nombre_pro LIKE vetb00020.nombre_provincia,
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
posicion INTEGER,
|
||||
devolucion1 DECIMAL(12,2),
|
||||
devolucion2 DECIMAL(12,2),
|
||||
codigo CHAR(6)
|
||||
END RECORD,
|
||||
cod1 SMALLINT,
|
||||
ventas_dev1,ventas_dev2,ventas_totales1,ventas_totales2 DECIMAL(12,2)
|
||||
|
||||
DEFINE selec9 CHAR(1000)
|
||||
DEFINE salir,salir9,compa CHAR(1)
|
||||
DEFINE idx9,idx1,j,m,p,s,s1 INTEGER
|
||||
DEFINE ano19 CHAR(4)
|
||||
DEFINE ano1,mes1 SMALLINT
|
||||
DEFINE nom_mes CHAR(15)
|
||||
|
||||
DEFINE fecha_in,fecha_fi,fecha_in9,fecha_fi9 DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1,cantidad2,cantidad3,cantidad4,cantidad5,cantidad6,
|
||||
cantidad7,cantidad8,cantida9 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp010()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp009 FROM "gefmrp009"
|
||||
DISPLAY FORM gefmrp009
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp010" AT 4,3 ATTRIBUTE(RED)
|
||||
|
||||
DISPLAY "Ranking de Ventas Comparativas Al Ano Anterior Mayoristas" AT 6,11
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME ano1,mes1,cantidad1
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
AFTER FIELD ano1
|
||||
IF ano1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD ano1
|
||||
END IF
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in9 FROM prdtable
|
||||
WHERE ano = ano1 - 1
|
||||
|
||||
LET ano19 = ano1 - 1 USING "&&&&"
|
||||
|
||||
BEFORE FIELD mes1
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
AFTER FIELD mes1
|
||||
IF mes1 IS NULL THEN
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
END IF
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in FROM prdtable
|
||||
WHERE ano = ano1 #and mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi FROM prdtable
|
||||
WHERE ano = ano1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = mes1
|
||||
|
||||
SELECT descrip INTO nom_mes FROM mestable
|
||||
WHERE mes = mes1
|
||||
|
||||
# Busca Ventas totales
|
||||
SELECT SUM(a.sub_total-a.monto_desc) INTO ventas_totales1
|
||||
FROM vetb00002 a
|
||||
WHERE a.fecha_factura BETWEEN fecha_in AND fecha_fi AND a.ventas = 1 AND
|
||||
a.status_t IS NULL
|
||||
|
||||
SELECT SUM(a.sub_total-a.monto_desc) INTO ventas_totales2
|
||||
FROM vetb00002 a
|
||||
WHERE a.fecha_factura BETWEEN fecha_in9 AND fecha_fi9 AND a.ventas = 1 AND
|
||||
a.status_t IS NULL
|
||||
# Devoluciones
|
||||
|
||||
SELECT SUM(a.cantidad*a.precio) INTO ventas_dev1
|
||||
FROM iptb00023 a
|
||||
WHERE a.fecha BETWEEN fecha_in AND fecha_fi AND a.cod_mov = 12 AND
|
||||
a.status_t IS NULL
|
||||
|
||||
|
||||
SELECT SUM(a.cantidad*a.precio) INTO ventas_dev2
|
||||
FROM iptb00023 a
|
||||
WHERE a.fecha BETWEEN fecha_in9 AND fecha_fi9 AND a.cod_mov = 12 AND
|
||||
a.status_t IS NULL
|
||||
|
||||
LET ventas_totales1 = ventas_totales1 - ventas_dev1
|
||||
LET ventas_totales2 = ventas_totales2 - ventas_dev2
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT BY NAME criterio ON a.tipo_cliente,a.sec_cliente
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente, a.sec_cliente,c.nombre,c.status_t,",
|
||||
"d.tipo_negocio, e.descripcion,f.nombre_provincia, ",
|
||||
"SUM(a.sub_total-a.monto_desc) ",
|
||||
"FROM vetb00002 a,vetb00004 c, cctb00012 d, cctb00013 e,vetb00020 f,vetb00009 h ",
|
||||
"WHERE (a.status_t IS NULL) AND (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (a.tipo_cliente= c.tipo_cliente) AND ",
|
||||
" (a.sec_cliente = c.sec_cliente) AND ",
|
||||
" (a.sec_cliente = d.sec_cliente) AND ",
|
||||
" (a.sec_cliente != 51) AND ",
|
||||
" (d.tipo_negocio= e.tipo_negocio) ",
|
||||
" AND c.cod_zona = h.cod_zona AND c.cod_provincia = h.cod_provincia AND ",
|
||||
" c.cod_provincia = f.cod_provincia ",
|
||||
"GROUP BY 1,2,3,4,5,6,7 HAVING SUM(a.sub_total-a.monto_desc) >= ? ORDER BY 8 DESC,1,2 "
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Actual... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE buscar CURSOR FOR comando
|
||||
OPEN buscar USING fecha_in,fecha_fi,cantidad1
|
||||
|
||||
START REPORT gerencia10 TO archivo
|
||||
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
|
||||
LET idx = 0
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH buscar INTO ger_comp10.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx = idx + 1
|
||||
LET ger_comp10.posicion = idx
|
||||
LET ger_comp10.cantidad1 = 0
|
||||
|
||||
|
||||
SELECT SUM(a.sub_total-a.monto_desc) INTO ger_comp10.cantidad1
|
||||
FROM vetb00002 a
|
||||
WHERE (a.status_t IS NULL) AND
|
||||
(a.fecha_factura BETWEEN fecha_in9 AND fecha_fi9) AND
|
||||
(a.tipo_cliente = ger_comp10.tipo_cliente) AND
|
||||
(a.sec_cliente=ger_comp10.sec_cliente)
|
||||
|
||||
SELECT SUM(a.cantidad*a.precio) INTO ger_comp10.devolucion1
|
||||
FROM iptb00023 a
|
||||
WHERE a.fecha BETWEEN fecha_in9 AND fecha_fi9 AND a.cod_mov = 12 AND
|
||||
a.tipo_cliente = ger_comp10.tipo_cliente AND
|
||||
a.sec_cliente = ger_comp10.sec_cliente AND
|
||||
a.status_t IS NULL
|
||||
|
||||
SELECT SUM(a.cantidad*a.precio) INTO ger_comp10.devolucion2
|
||||
FROM iptb00023 a
|
||||
WHERE a.fecha BETWEEN fecha_in AND fecha_fi AND a.cod_mov = 12 AND
|
||||
a.tipo_cliente = ger_comp10.tipo_cliente AND
|
||||
a.sec_cliente = ger_comp10.sec_cliente AND
|
||||
a.status_t IS NULL
|
||||
|
||||
IF ger_comp10.devolucion1 IS NULL THEN
|
||||
LET ger_comp10.devolucion1 = 0
|
||||
END IF
|
||||
|
||||
IF ger_comp10.devolucion2 IS NULL THEN
|
||||
LET ger_comp10.devolucion2 = 0
|
||||
END IF
|
||||
|
||||
LET ger_comp10.cantidad1 = ger_comp10.cantidad1 - ger_comp10.devolucion1
|
||||
LET ger_comp10.cantidad2 = ger_comp10.cantidad2 - ger_comp10.devolucion2
|
||||
|
||||
IF ger_comp10.cantidad1 IS NULL THEN
|
||||
LET ger_comp10.cantidad1 = 0
|
||||
END IF
|
||||
|
||||
LET ger_comp10.codigo = ger_comp10.tipo_cliente USING "&&",
|
||||
ger_comp10.sec_cliente USING "&&&&"
|
||||
|
||||
OUTPUT TO REPORT gerencia10(ger_comp10.*)
|
||||
END WHILE
|
||||
|
||||
|
||||
LET selec =
|
||||
"SELECT a.tipo_cliente,a.sec_cliente,c.nombre,c.status_t,'1','N ','N ',SUM(b.total) ",
|
||||
"FROM cotb00057 a,vetb00004 c,cotb00056 b ",
|
||||
"WHERE (a.status_t IS NULL) AND (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" a.factura = b.factura AND ",
|
||||
" (a.tipo_cliente = c.tipo_cliente) AND ",criterio CLIPPED,
|
||||
" AND (a.sec_cliente = c.sec_cliente) ",
|
||||
"GROUP BY 1,2,3,4,5 HAVING SUM(b.total) >= ? ORDER BY 5 DESC,1,2 "
|
||||
|
||||
PREPARE comando1 FROM selec
|
||||
DECLARE buscar1 CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_in,fecha_fi,cantidad1
|
||||
|
||||
LET idx = 0
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH buscar1 INTO ger_comp10.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx = idx + 1
|
||||
LET ger_comp10.posicion = idx
|
||||
LET ger_comp10.cantidad1 = 0
|
||||
|
||||
|
||||
IF ger_comp10.cantidad1 IS NULL THEN
|
||||
LET ger_comp10.cantidad1 = 0
|
||||
END IF
|
||||
LET ger_comp10.codigo = ger_comp10.tipo_cliente USING "&&",
|
||||
ger_comp10.sec_cliente USING "&&&&"
|
||||
OUTPUT TO REPORT gerencia10(ger_comp10.*)
|
||||
END WHILE
|
||||
|
||||
FINISH REPORT gerencia10
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia10(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
status_t CHAR(1),
|
||||
tipo_negocio SMALLINT,
|
||||
descripcion CHAR(30),
|
||||
nombre_pro LIKE vetb00020.nombre_provincia,
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
posicion INTEGER,
|
||||
devolucion1 DECIMAL(12,2),
|
||||
devolucion2 DECIMAL(12,2),
|
||||
codigo CHAR(6)
|
||||
END RECORD
|
||||
|
||||
DEFINE j ARRAY[5000] OF RECORD
|
||||
codigo CHAR(7),
|
||||
nombre CHAR(30),
|
||||
provincia LIKE vetb00020.nombre_provincia,
|
||||
status_t CHAR(1),
|
||||
descripcion CHAR(30),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
posicion1 INTEGER,
|
||||
posicion2 INTEGER,
|
||||
limite LIKE vetb00004.limite_credito,
|
||||
porc1 DECIMAL(12,2),
|
||||
porc2 DECIMAL(12,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE mes11,cuenta SMALLINT
|
||||
DEFINE nom_mes1 CHAR(15)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE nombre_sal CHAR(20),
|
||||
limite LIKE vetb00004.limite_credito,
|
||||
hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.cantidad2 DESC,x.codigo
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.comp_on,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp010",
|
||||
COLUMN 22, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 83, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 22, " Sistema de Informacion Gerencial",
|
||||
COLUMN 83, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 12, "Ranking de Ventas Comparativas Ano Anterior Mayor A ",
|
||||
cantidad1 USING "#,###,###.##",
|
||||
COLUMN 86, hora
|
||||
PRINT COLUMN 22, " M A Y O R I S T A S "
|
||||
|
||||
PRINT COLUMN 1, "ACUMULADO AL MES DE ",nom_mes CLIPPED
|
||||
PRINT COLUMN 1, "----------------------------------------------------",
|
||||
"------------------------------------------------",
|
||||
"---------------------------------"
|
||||
PRINT COLUMN 2, "Posicion",
|
||||
COLUMN 68, "Monto",
|
||||
COLUMN 90, "Limite",
|
||||
COLUMN 105,"Tipo de",
|
||||
COLUMN 120, "%",
|
||||
COLUMN 130, "%"
|
||||
|
||||
PRINT COLUMN 1, ano1 USING "&&&&",
|
||||
COLUMN 6, ano1-1 USING "&&&&",
|
||||
COLUMN 12, "Cliente",
|
||||
COLUMN 63, ano1 USING "&&&&",
|
||||
COLUMN 78, ano1-1 USING "&&&&",
|
||||
COLUMN 85, "Status",
|
||||
COLUMN 90, "Credito",
|
||||
COLUMN 105, "Negocio",
|
||||
COLUMN 120, "Particip.",
|
||||
COLUMN 130, "Particip."
|
||||
PRINT COLUMN 1, "----------------------------------------------------",
|
||||
"------------------------------------------------",
|
||||
"---------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON EVERY ROW
|
||||
IF idx1 IS NULL THEN
|
||||
LET idx1 = 0
|
||||
END IF
|
||||
SELECT a.limite_credito INTO limite FROM vetb00004 a
|
||||
WHERE a.tipo_cliente = x.tipo_cliente AND
|
||||
a.sec_cliente = x.sec_cliente
|
||||
|
||||
LET idx1 = idx1 + 1
|
||||
LET idx = x.posicion
|
||||
LET j[idx].codigo = x.codigo
|
||||
LET j[idx].nombre = x.nombre
|
||||
LET j[idx].provincia = x.nombre_pro
|
||||
LET j[idx].status_t = x.status_t
|
||||
LET J[idx].descripcion= x.descripcion
|
||||
LET j[idx].cantidad1 = x.cantidad1
|
||||
LET j[idx].cantidad2 = x.cantidad2
|
||||
LET j[idx].limite = limite
|
||||
LET j[idx].porc1 = (x.cantidad2 / ventas_totales1) * 100
|
||||
LET j[idx].porc2 = (x.cantidad1 / ventas_totales2) * 100
|
||||
IF x.cantidad1 = 0 THEN
|
||||
LET j[idx].posicion1 = 0
|
||||
ELSE
|
||||
LET j[idx].posicion1 = idx1
|
||||
END IF
|
||||
LET j[idx].posicion2 = x.posicion
|
||||
|
||||
ON LAST ROW
|
||||
FOR idx = 1 TO idx1
|
||||
IF j[idx].posicion1 != 0 THEN
|
||||
LET cuenta = cuenta + 1
|
||||
END IF
|
||||
PRINT COLUMN 1, j[idx].posicion2 USING "##&",
|
||||
COLUMN 6, j[idx].posicion1 USING "##&",
|
||||
COLUMN 15, j[idx].codigo," ",j[idx].nombre CLIPPED,
|
||||
COLUMN 54, j[idx].provincia,
|
||||
COLUMN 87, j[idx].cantidad2 USING "###,###,###.##",
|
||||
COLUMN 109, j[idx].cantidad1 USING "###,###,###.##",
|
||||
COLUMN 125, j[idx].status_t,
|
||||
COLUMN 128, j[idx].limite USING "###,###,###.##",
|
||||
COLUMN 144, j[idx].descripcion CLIPPED,
|
||||
COLUMN 166, j[idx].porc1 USING "###.##",
|
||||
COLUMN 174, j[idx].porc2 USING "###.##"
|
||||
END FOR
|
||||
|
||||
PRINT COLUMN 87, "--------------",
|
||||
COLUMN 109, "--------------"
|
||||
PRINT COLUMN 30, "TOTAL VENTAS...."," ",
|
||||
COLUMN 87, SUM(x.cantidad2) USING "###,###,###.##",
|
||||
COLUMN 109, SUM(x.cantidad1) USING "###,###,###.##"
|
||||
PRINT COLUMN 1, letras.comp_off,letras.negrillas_off
|
||||
PRINT COLUMN 1, "Total Clientes =>" ,cuenta USING "##,###"
|
||||
|
||||
PRINT COLUMN 1, "--------------------------------------------"
|
||||
PRINT COLUMN 1, "Total Ventas ano ", ano1 USING "<<<<"," ",ventas_totales1 USING "###,###,###.##"
|
||||
PRINT COLUMN 1, "Total Ventas ano ", ano1-1 USING "<<<<"," ",ventas_totales2 USING "###,###,###.##"
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,296 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP011
|
||||
Sistema : Sistema de Informacion Gerencia Minoristas
|
||||
Proceso : Clientes con Ventas Mayores a X Cantidad
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp11 RECORD
|
||||
cod_cia LIKE vetb00002.cod_cia,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
posicion INTEGER,
|
||||
codigo CHAR(6)
|
||||
END RECORD,
|
||||
cod1 SMALLINT
|
||||
DEFINE selec9 CHAR(1000)
|
||||
DEFINE salir,salir9,compa CHAR(1)
|
||||
DEFINE idx9,idx1,j,m,p,s,s1 INTEGER
|
||||
DEFINE ano19 CHAR(4)
|
||||
DEFINE ano1,mes1 SMALLINT
|
||||
DEFINE nom_mes CHAR(15)
|
||||
|
||||
DEFINE fecha_in,fecha_fi,fecha_in9,fecha_fi9 DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1,cantidad2,cantidad3,cantidad4,cantidad5,cantidad6,
|
||||
cantidad7,cantidad8,cantida9 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp011()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp009 FROM "gefmrp009"
|
||||
DISPLAY FORM gefmrp009
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp011" AT 4,3 ATTRIBUTE(RED)
|
||||
|
||||
DISPLAY "Ranking de Ventas Comparativas Al Ano Anterior Minoristas" AT 6,11
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME ano1,mes1,cantidad1
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
AFTER FIELD ano1
|
||||
IF ano1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD ano1
|
||||
END IF
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in FROM prdtable
|
||||
WHERE ano = ano1
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in9 FROM prdtable
|
||||
WHERE ano = ano1 - 1
|
||||
|
||||
LET ano19 = ano1 - 1 USING "&&&&"
|
||||
|
||||
BEFORE FIELD mes1
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
AFTER FIELD mes1
|
||||
IF mes1 IS NULL THEN
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
END IF
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi FROM prdtable
|
||||
WHERE ano = ano1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = mes1
|
||||
|
||||
SELECT descrip INTO nom_mes FROM mestable
|
||||
WHERE mes = mes1
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
AFTER INPUT
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
EXIT INPUT
|
||||
END INPUT
|
||||
|
||||
CONSTRUCT BY NAME criterio ON a.cod_cia
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET selec =
|
||||
"SELECT a.cod_cia,a.tipo_cliente,a.sec_cliente,c.nombre,c.status_t,",
|
||||
"SUM(a.neto) ",
|
||||
"FROM vetb00002 a,vetb00004 c ",
|
||||
"WHERE (a.status_t IS NULL) AND (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (a.ventas = '1') AND (a.tipo_cliente = c.tipo_cliente) AND ",
|
||||
" (a.sec_cliente = c.sec_cliente) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4,5 HAVING SUM(a.neto) <= ? ORDER BY 6 DESC,1,2 "
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Actual... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE buscar CURSOR FOR comando
|
||||
OPEN buscar USING fecha_in,fecha_fi,cantidad1
|
||||
|
||||
START REPORT gerencia11 TO archivo
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
|
||||
LET idx = 0
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH buscar INTO ger_comp11.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx = idx + 1
|
||||
LET ger_comp11.posicion = idx
|
||||
LET ger_comp11.cantidad1 = 0
|
||||
|
||||
SELECT SUM(a.neto) INTO ger_comp11.cantidad1 FROM vetb00002 a
|
||||
WHERE (a.status_t IS NULL) AND (a.ventas = "1") AND
|
||||
(a.fecha_factura BETWEEN fecha_in9 AND fecha_fi9) AND
|
||||
(a.tipo_cliente = ger_comp11.tipo_cliente) AND
|
||||
(a.sec_cliente=ger_comp11.sec_cliente) AND a.cod_cia=2
|
||||
|
||||
IF ger_comp11.cantidad2 IS NULL THEN
|
||||
LET ger_comp11.cantidad2 = 0
|
||||
END IF
|
||||
IF ger_comp11.cantidad1 IS NULL THEN
|
||||
LET ger_comp11.cantidad1 = 0
|
||||
END IF
|
||||
LET ger_comp11.codigo = ger_comp11.tipo_cliente USING "&&",
|
||||
ger_comp11.sec_cliente USING "&&&&"
|
||||
OUTPUT TO REPORT gerencia11(ger_comp11.*)
|
||||
|
||||
END WHILE
|
||||
FINISH REPORT gerencia11
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia11(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
cod_cia LIKE vetb00002.cod_cia,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
posicion INTEGER,
|
||||
codigo CHAR(6)
|
||||
END RECORD
|
||||
DEFINE j ARRAY[5000] OF RECORD
|
||||
codigo CHAR(7),
|
||||
nombre CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
posicion1 INTEGER,
|
||||
posicion2 INTEGER
|
||||
END RECORD
|
||||
|
||||
DEFINE mes11 SMALLINT
|
||||
DEFINE nom_mes1 CHAR(15)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE nombre_sal CHAR(20),
|
||||
|
||||
hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
# ORDER BY x.cod_cia,x.cantidad2
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.comp_on,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp011",
|
||||
COLUMN 22, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 83, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 22, " Sistema de Informacion Gerencial",
|
||||
COLUMN 83, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 12, "Ranking de Ventas Comparativas Ano Anterior Menor A ",
|
||||
cantidad1 USING "#,###,###.##",
|
||||
COLUMN 86, hora
|
||||
PRINT COLUMN 22, " M I N O R I S T A S "
|
||||
|
||||
PRINT COLUMN 1, "ACUMULADO AL MES DE ",nom_mes CLIPPED
|
||||
PRINT COLUMN 1, "----------------------------------------------------",
|
||||
"--------------------------------------"
|
||||
|
||||
PRINT COLUMN 2, "Posicion",
|
||||
COLUMN 68, "Cantidad"
|
||||
|
||||
PRINT COLUMN 1, ano1 USING "&&&&",
|
||||
COLUMN 6, ano1-1 USING "&&&&",
|
||||
COLUMN 12, "Cliente",
|
||||
COLUMN 63, ano1 USING "&&&&",
|
||||
COLUMN 78, ano1-1 USING "&&&&",
|
||||
COLUMN 85, "Status"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------------------",
|
||||
"--------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
BEFORE GROUP OF x.cod_cia
|
||||
CASE
|
||||
WHEN x.cod_cia = 1
|
||||
PRINT COLUMN 1,letras.negrillas_on,"PRODUCTOS LOCALES"
|
||||
EXIT CASE
|
||||
WHEN x.cod_cia = 2
|
||||
PRINT COLUMN 1,letras.negrillas_on,"PRODUCTOS IMPORTADOS"
|
||||
EXIT CASE
|
||||
END CASE
|
||||
ON EVERY ROW
|
||||
IF idx1 IS NULL THEN
|
||||
LET idx1 = 0
|
||||
END IF
|
||||
LET idx1 = idx1 + 1
|
||||
LET idx = x.posicion
|
||||
LET j[idx].codigo = x.codigo
|
||||
LET j[idx].nombre = x.nombre
|
||||
LET j[idx].status_t = x.status_t
|
||||
LET j[idx].cantidad1 = x.cantidad1
|
||||
LET j[idx].cantidad2 = x.cantidad2
|
||||
IF x.cantidad1 = 0 THEN
|
||||
LET j[idx].posicion1 = 0
|
||||
ELSE
|
||||
LET j[idx].posicion1 = idx1
|
||||
END IF
|
||||
LET j[idx].posicion2 = x.posicion
|
||||
|
||||
ON LAST ROW
|
||||
|
||||
FOR idx = 1 TO idx1
|
||||
IF j[idx].posicion2 IS NOT NULL AND j[idx].posicion2 > 0 THEN
|
||||
PRINT COLUMN 1, j[idx].posicion2 USING "##&",
|
||||
COLUMN 6, j[idx].posicion1 USING "##&",
|
||||
COLUMN 15, j[idx].codigo," ",j[idx].nombre CLIPPED,
|
||||
COLUMN 55, j[idx].cantidad2 USING "###,###,###.##",
|
||||
COLUMN 70, j[idx].cantidad1 USING "###,###,###.##",
|
||||
COLUMN 87, j[idx].status_t
|
||||
END IF
|
||||
END FOR
|
||||
|
||||
PRINT COLUMN 55, "--------------",
|
||||
COLUMN 70, "--------------"
|
||||
PRINT COLUMN 30, "TOTAL VENTAS...."," ",
|
||||
COLUMN 55, SUM(x.cantidad2) USING "###,###,###.##",
|
||||
COLUMN 70, SUM(x.cantidad1) USING "###,###,###.##"
|
||||
PRINT COLUMN 1, letras.comp_off,letras.negrillas_off
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,435 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP012
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ranking de Ventas por Vendedor, Compania y Cliente
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Enero 18, 1995
|
||||
Modificado Por: Juan F. Soto
|
||||
Descripcion : Se le quito las columnas Devoluciones y neto.
|
||||
Se Agrego la columna de VENTAS DEL ANO ANTERIOR AL ACTUAL.
|
||||
Fecha : Mayo 21, 1996.
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp12 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
venta DECIMAL(14,2),
|
||||
venta_ant DECIMAL(14,2),
|
||||
venta_ant1 DECIMAL(14,2)
|
||||
END RECORD,
|
||||
cuenta,p_mes_ini SMALLINT,
|
||||
valor_d,valor_a DEC(12,2)
|
||||
|
||||
DEFINE ger_comp121 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE ger_comp122 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE ger_comp123 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE nomb,apell CHAR(15),
|
||||
nombre CHAR(30),
|
||||
mov1 SMALLINT,
|
||||
idx1,idx2 INTEGER,
|
||||
venta_ant1,venta_ant2 DECIMAL(12,4) ,
|
||||
desc_mes, desc_mes_ini CHAR(12)
|
||||
DEFINE esta,esta1,salir,salir1,salir2,salir3 CHAR(1),
|
||||
p_ano_ant1,p_ano_ant,p_ano,p_mes SMALLINT
|
||||
DEFINE fecha3,fecha4,fecha1,fecha2,fecha_inicial,fecha_final DATE
|
||||
|
||||
FUNCTION geprrp012()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
CALL pantalla()
|
||||
|
||||
OPEN FORM gefmrp012 FROM "gefmrp012"
|
||||
DISPLAY "geprrp012" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY FORM gefmrp012
|
||||
DISPLAY "Ranking de Ventas Por Vendedor, Compania y Cliente" AT 6,15
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME p_ano,p_mes_ini,p_mes,valor_d,valor_a
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
|
||||
AFTER FIELD p_ano
|
||||
IF p_ano IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
AFTER FIELD p_mes
|
||||
IF p_mes IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_mes
|
||||
END IF
|
||||
|
||||
LET p_ano_ant = p_ano - 1
|
||||
LET p_ano_ant1 = p_ano - 2
|
||||
|
||||
SELECT fecha_inicio INTO fecha_inicial
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes_ini and
|
||||
ano = p_ano
|
||||
|
||||
|
||||
SELECT fecha_corte INTO fecha_final
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano
|
||||
|
||||
|
||||
SELECT fecha_inicio INTO fecha1
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes_ini and
|
||||
ano = p_ano_ant
|
||||
|
||||
|
||||
SELECT fecha_corte INTO fecha2
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant
|
||||
|
||||
SELECT fecha_inicio INTO fecha3
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes_ini and
|
||||
ano = p_ano_ant1
|
||||
|
||||
SELECT fecha_corte INTO fecha4
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant1
|
||||
|
||||
SELECT descrip INTO desc_mes
|
||||
FROM mestable
|
||||
WHERE mes = p_mes
|
||||
|
||||
|
||||
SELECT descrip INTO desc_mes_ini
|
||||
FROM mestable
|
||||
WHERE mes = p_mes_ini
|
||||
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio ON a.sec_vend,a.tipo_cliente,a.sec_cliente
|
||||
FROM sec_vend,tipo_cliente,sec_cliente
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
# Ano Actual
|
||||
LET selec1 =
|
||||
"SELECT b.sec_vend,'1',a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.sub_total-a.monto_desc) ",
|
||||
"FROM vetb00002 a,vetb00028 b ",
|
||||
"WHERE ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" a.tipo_cliente = b.tipo_cliente and a.sec_cliente = b.sec_cliente and ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 HAVING SUM(a.sub_total-a.monto_desc) BETWEEN ? AND ? ORDER BY 1,2,3,4,5 "
|
||||
|
||||
DISPLAY "Buscando Informacion2... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando1 FROM selec1
|
||||
DECLARE buscar1 SCROLL CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_inicial,fecha_final,valor_d,valor_a
|
||||
|
||||
# Ano Anterior
|
||||
LET selec4 =
|
||||
"SELECT b.sec_vend,'1',a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.sub_total-a.monto_desc) ",
|
||||
"FROM vetb00002 a,vetb00028 b ",
|
||||
"WHERE ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) and",
|
||||
" a.tipo_cliente = b.tipo_cliente and a.sec_cliente = b.sec_cliente and ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 HAVING SUM(a.sub_total-a.monto_desc) BETWEEN ? AND ? ORDER BY 1,2,3,4,5 "
|
||||
|
||||
DISPLAY "Buscando Ano Anterior... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando2 FROM selec4
|
||||
DECLARE buscar2 SCROLL CURSOR FOR comando2
|
||||
OPEN buscar2 USING fecha1,fecha2,valor_d,valor_a
|
||||
|
||||
# Ano Anterior Anterior
|
||||
LET selec4 =
|
||||
"SELECT b.sec_vend,'1',a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.sub_total-a.monto_desc) ",
|
||||
"FROM vetb00002 a,vetb00028 b ",
|
||||
"WHERE ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" a.tipo_cliente = b.tipo_cliente and a.sec_cliente = b.sec_cliente and ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 HAVING SUM(a.sub_total-a.monto_desc) BETWEEN ? AND ? ORDER BY 1,2,3,4,5 "
|
||||
|
||||
DISPLAY "Buscando Ano Anterior 2... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando3 FROM selec4
|
||||
DECLARE buscar3 SCROLL CURSOR FOR comando3
|
||||
OPEN buscar3 USING fecha3,fecha4,valor_d,valor_a
|
||||
|
||||
START REPORT repor_12 TO archivo
|
||||
|
||||
DISPLAY "Reporte Generandose ... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
LET cuenta = 1
|
||||
LET ger_comp12.sec_vend = 0
|
||||
LET ger_comp12.compania = 0
|
||||
LET ger_comp12.tipo_cliente= 0
|
||||
LET ger_comp12.sec_cliente = 0
|
||||
LET ger_comp12.nombre = " "
|
||||
LET ger_comp12.venta = 0
|
||||
LET ger_comp12.venta_ant = 0
|
||||
LET ger_comp12.venta_ant1 = 0
|
||||
|
||||
LET idx = 1
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar1 INTO ger_comp121.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
LET cuenta = cuenta + 1
|
||||
LET ger_comp12.sec_vend = ger_comp121.sec_vend
|
||||
LET ger_comp12.compania = ger_comp121.compania
|
||||
LET ger_comp12.tipo_cliente = ger_comp121.tipo_cliente
|
||||
LET ger_comp12.sec_cliente = ger_comp121.sec_cliente
|
||||
LET ger_comp12.venta = ger_comp121.ventas
|
||||
LET ger_comp12.venta_ant = 0
|
||||
LET ger_comp12.venta_ant1 = 0
|
||||
|
||||
display ger_comp12.sec_cliente at 17,2
|
||||
|
||||
# Busca Las Informaciones del ano anterior
|
||||
LET idx = 1
|
||||
LET salir2 = "N"
|
||||
WHILE salir2 != "S"
|
||||
FETCH ABSOLUTE idx buscar2 INTO ger_comp122.*
|
||||
IF status = notfound THEN
|
||||
LET salir2 = "S"
|
||||
LET idx = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp122.sec_vend = ger_comp12.sec_vend and
|
||||
ger_comp122.compania = ger_comp12.compania and
|
||||
ger_comp122.tipo_cliente = ger_comp12.tipo_cliente and
|
||||
ger_comp122.sec_cliente = ger_comp12.sec_cliente THEN
|
||||
|
||||
LET ger_comp12.venta_ant = ger_comp122.ventas
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busca las informaciones del ano anterior anterior
|
||||
LET idx1 = 1
|
||||
LET salir3 = "N"
|
||||
WHILE salir3 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar3 INTO ger_comp123.*
|
||||
IF status = notfound THEN
|
||||
LET salir3 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx1 = idx1 + 1
|
||||
IF ger_comp123.sec_vend = ger_comp12.sec_vend and
|
||||
ger_comp123.compania = ger_comp12.compania and
|
||||
ger_comp123.tipo_cliente = ger_comp12.tipo_cliente and
|
||||
ger_comp123.sec_cliente = ger_comp12.sec_cliente THEN
|
||||
|
||||
LET ger_comp12.venta_ant1 = ger_comp123.ventas
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
END WHILE
|
||||
# IF cuenta < 16 THEN
|
||||
OUTPUT TO REPORT repor_12(ger_comp12.*)
|
||||
# ELSE
|
||||
# EXIT WHILE
|
||||
# END IF
|
||||
END WHILE
|
||||
FINISH REPORT repor_12
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT repor_12(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
venta DECIMAL(14,2),
|
||||
venta_ant DECIMAL(14,2),
|
||||
venta_ant1 DECIMAL(14,2)
|
||||
END RECORD
|
||||
|
||||
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.sec_vend,x.compania,x.venta DESC,x.tipo_cliente,x.sec_cliente
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.doce,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp012",
|
||||
COLUMN 25, " R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 91, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 25, " Sistema de Informacion Gerencial",
|
||||
COLUMN 91, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 25, "Ranking de Ventas Por Vendedor, Compania y Cliente",
|
||||
COLUMN 94, hora
|
||||
PRINT COLUMN 30, "CLIENTES VENTAS DESDE ",valor_d USING "###,###,###.##"," HASTA ",valor_a USING "###,###,###.##"
|
||||
SKIP 1 LINES
|
||||
|
||||
PRINT COLUMN 1, "MES INICIAL: ",desc_mes_ini," HASTA ",desc_mes
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------"
|
||||
|
||||
PRINT COLUMN 59, "Venta",
|
||||
COLUMN 72, "Venta",
|
||||
COLUMN 93, "Venta"
|
||||
|
||||
PRINT COLUMN 1, "Posicion y Cliente",
|
||||
COLUMN 59, p_ano using "####",
|
||||
COLUMN 72, p_ano_ant using "####",
|
||||
COLUMN 93, p_ano_ant1 using "####"
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.sec_vend
|
||||
SKIP TO TOP OF PAGE
|
||||
SELECT UNIQUE a.nom1_emp,a.apell1_emp INTO nomb,apell FROM adtb00003 a
|
||||
WHERE a.num_emp = x.sec_vend
|
||||
|
||||
LET nombre = nomb CLIPPED," ",apell CLIPPED
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "Vendedor: ",x.sec_vend USING "&&&&"," ",nombre,
|
||||
letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
IF x.compania = 1 THEN
|
||||
PRINT COLUMN 1, "Productos Locales", letras.negrillas_off
|
||||
ELSE
|
||||
PRINT COLUMN 1, "Productos Importados", letras.negrillas_off
|
||||
END IF
|
||||
LET idx2 = 0
|
||||
|
||||
ON EVERY ROW
|
||||
SELECT a.nombre INTO x.nombre FROM vetb00004 a
|
||||
WHERE a.tipo_cliente = x.tipo_cliente AND a.sec_cliente = x.sec_cliente
|
||||
|
||||
LET idx2 = idx2 + 1
|
||||
PRINT COLUMN 1, idx2 USING "&&&"," ",
|
||||
x.tipo_cliente USING "&&","-",
|
||||
x.sec_cliente USING "&&&&"," ",
|
||||
" ",x.nombre CLIPPED,
|
||||
COLUMN 51, x.venta USING "-,---,---,---.##",
|
||||
COLUMN 68, x.venta_ant USING "-,---,---,---.##",
|
||||
COLUMN 85, x.venta_ant1 USING "-,---,---,---.##"
|
||||
|
||||
AFTER GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "----------------",
|
||||
COLUMN 68, "----------------",
|
||||
COLUMN 85, "----------------"
|
||||
PRINT COLUMN 1, "Total Compania ---> ",
|
||||
COLUMN 51, GROUP SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, GROUP SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
AFTER GROUP OF x.sec_vend
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "----------------",
|
||||
COLUMN 68, "----------------",
|
||||
COLUMN 85, "----------------"
|
||||
PRINT COLUMN 1, "Total Vendedor ---> ",
|
||||
COLUMN 51, GROUP SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, GROUP SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "================",
|
||||
COLUMN 68, "================",
|
||||
COLUMN 85, "================"
|
||||
PRINT COLUMN 1, "Total General ---> ",
|
||||
COLUMN 51, SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.normal,letras.negrillas_off
|
||||
END REPORT
|
||||
@@ -0,0 +1,578 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP012
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ranking de Ventas por Vendedor, Compania y Cliente
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Enero 18, 1995
|
||||
Modificado Por: Juan F. Soto
|
||||
Descripcion : Se le quito las columnas Devoluciones y neto.
|
||||
Se Agrego la columna de VENTAS DEL ANO ANTERIOR AL ACTUAL.
|
||||
Fecha : Mayo 21, 1996.
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp12 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
venta DECIMAL(14,2),
|
||||
venta_ant DECIMAL(14,2),
|
||||
venta_ant1 DECIMAL(14,2)
|
||||
END RECORD,
|
||||
p_mes_ini SMALLINT
|
||||
|
||||
DEFINE ger_comp121 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE ger_comp122 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE ger_comp123 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE nomb,apell CHAR(15),
|
||||
nombre CHAR(30),
|
||||
mov1 SMALLINT,
|
||||
idx1,idx2 INTEGER,
|
||||
venta_ant1,venta_ant2 DECIMAL(12,4) ,
|
||||
desc_mes, desc_mes_ini CHAR(12)
|
||||
DEFINE esta,esta1,salir,salir1,salir2,salir3 CHAR(1),
|
||||
p_ano_ant1,p_ano_ant,p_ano,p_mes SMALLINT
|
||||
DEFINE fecha3,fecha4,fecha1,fecha2,fecha_inicial,fecha_final DATE
|
||||
|
||||
FUNCTION geprrp012()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
CALL pantalla()
|
||||
|
||||
OPEN FORM gefmrp012 FROM "gefmrp012"
|
||||
DISPLAY "geprrp012" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY FORM gefmrp012
|
||||
DISPLAY "Ranking de Ventas Por Vendedor, Compania y Cliente" AT 6,15
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME p_ano,p_mes_ini,p_mes
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
|
||||
AFTER FIELD p_ano
|
||||
IF p_ano IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
AFTER FIELD p_mes
|
||||
IF p_mes IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_mes
|
||||
END IF
|
||||
|
||||
LET p_ano_ant = p_ano - 1
|
||||
LET p_ano_ant1 = p_ano - 2
|
||||
|
||||
SELECT fecha_inicio INTO fecha_inicial
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes_ini and
|
||||
ano = p_ano
|
||||
|
||||
|
||||
SELECT fecha_corte INTO fecha_final
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano
|
||||
|
||||
|
||||
SELECT fecha_inicio INTO fecha1
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes_ini and
|
||||
ano = p_ano_ant
|
||||
|
||||
|
||||
SELECT fecha_corte INTO fecha2
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant
|
||||
|
||||
SELECT fecha_inicio INTO fecha3
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes_ini and
|
||||
ano = p_ano_ant1
|
||||
|
||||
SELECT fecha_corte INTO fecha4
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant1
|
||||
|
||||
SELECT descrip INTO desc_mes
|
||||
FROM mestable
|
||||
WHERE mes = p_mes
|
||||
|
||||
|
||||
SELECT descrip INTO desc_mes_ini
|
||||
FROM mestable
|
||||
WHERE mes = p_mes_ini
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio ON a.sec_vend,a.tipo_cliente,a.sec_cliente
|
||||
FROM sec_vend,tipo_cliente,sec_cliente
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
# Ano Actual
|
||||
LET selec1 =
|
||||
"SELECT a.sec_vend,a.cod_cia,a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.neto) ",
|
||||
"FROM vetb00002 a ",
|
||||
"WHERE ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 ORDER BY 1,2,3,4,5 "
|
||||
|
||||
DISPLAY "Buscando Informacion2... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando1 FROM selec1
|
||||
DECLARE buscar1 SCROLL CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_inicial,fecha_final
|
||||
|
||||
# Ano Anterior
|
||||
LET selec4 =
|
||||
"SELECT a.sec_vend,a.cod_cia,a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.neto) ",
|
||||
"FROM vetb00002 a ",
|
||||
"WHERE ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 ORDER BY 1,2,3,4,5 "
|
||||
|
||||
DISPLAY "Buscando Ano Anterior... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando2 FROM selec4
|
||||
DECLARE buscar2 SCROLL CURSOR FOR comando2
|
||||
OPEN buscar2 USING fecha1,fecha2
|
||||
|
||||
# Ano Anterior Anterior
|
||||
LET selec4 =
|
||||
"SELECT a.sec_vend,a.cod_cia,a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.neto) ",
|
||||
"FROM vetb00002 a ",
|
||||
"WHERE ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 ORDER BY 1,2,3,4,5 "
|
||||
|
||||
DISPLAY "Buscando Ano Anterior 2... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando3 FROM selec4
|
||||
DECLARE buscar3 SCROLL CURSOR FOR comando3
|
||||
OPEN buscar3 USING fecha3,fecha4
|
||||
|
||||
START REPORT repor_12 TO archivo
|
||||
|
||||
DISPLAY "Reporte Generandose ... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
LET ger_comp12.sec_vend = 0
|
||||
LET ger_comp12.compania = 0
|
||||
LET ger_comp12.tipo_cliente= 0
|
||||
LET ger_comp12.sec_cliente = 0
|
||||
LET ger_comp12.nombre = " "
|
||||
LET ger_comp12.venta = 0
|
||||
LET ger_comp12.venta_ant = 0
|
||||
LET ger_comp12.venta_ant1 = 0
|
||||
|
||||
LET idx = 1
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar1 INTO ger_comp121.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET ger_comp12.sec_vend = ger_comp121.sec_vend
|
||||
LET ger_comp12.compania = ger_comp121.compania
|
||||
LET ger_comp12.tipo_cliente = ger_comp121.tipo_cliente
|
||||
LET ger_comp12.sec_cliente = ger_comp121.sec_cliente
|
||||
LET ger_comp12.venta = ger_comp121.ventas
|
||||
LET ger_comp12.venta_ant = 0
|
||||
LET ger_comp12.venta_ant1 = 0
|
||||
display ger_comp12.sec_cliente at 17,2
|
||||
# Busca Las Informaciones del ano anterior
|
||||
LET idx = 1
|
||||
LET salir2 = "N"
|
||||
WHILE salir2 != "S"
|
||||
FETCH ABSOLUTE idx buscar2 INTO ger_comp122.*
|
||||
IF status = notfound THEN
|
||||
LET salir2 = "S"
|
||||
LET idx = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp122.sec_vend = ger_comp12.sec_vend and
|
||||
ger_comp122.compania = ger_comp12.compania and
|
||||
ger_comp122.tipo_cliente = ger_comp12.tipo_cliente and
|
||||
ger_comp122.sec_cliente = ger_comp12.sec_cliente THEN
|
||||
|
||||
LET ger_comp12.venta_ant = ger_comp122.ventas
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busca las informaciones del ano anterior anterior
|
||||
LET idx1 = 1
|
||||
LET salir3 = "N"
|
||||
WHILE salir3 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar3 INTO ger_comp123.*
|
||||
IF status = notfound THEN
|
||||
LET salir3 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx1 = idx1 + 1
|
||||
IF ger_comp123.sec_vend = ger_comp12.sec_vend and
|
||||
ger_comp123.compania = ger_comp12.compania and
|
||||
ger_comp123.tipo_cliente = ger_comp12.tipo_cliente and
|
||||
ger_comp123.sec_cliente = ger_comp12.sec_cliente THEN
|
||||
|
||||
LET ger_comp12.venta_ant1 = ger_comp123.ventas
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
END WHILE
|
||||
|
||||
OUTPUT TO REPORT repor_12(ger_comp12.*)
|
||||
|
||||
END WHILE
|
||||
|
||||
# Busca los registros que estan en el ano anterior y no estan en el ano actual
|
||||
LET idx = 1
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar2 INTO ger_comp121.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET ger_comp12.sec_vend = ger_comp121.sec_vend
|
||||
LET ger_comp12.compania = ger_comp121.compania
|
||||
LET ger_comp12.tipo_cliente = ger_comp121.tipo_cliente
|
||||
LET ger_comp12.sec_cliente = ger_comp121.sec_cliente
|
||||
LET ger_comp12.venta = 0
|
||||
LET ger_comp12.venta_ant = ger_comp121.ventas
|
||||
LET ger_comp12.venta_ant1 = 0
|
||||
|
||||
# Busca Las Informaciones del ano actual
|
||||
LET esta = "N"
|
||||
LET salir2 = "N"
|
||||
WHILE salir2 != "S"
|
||||
FETCH ABSOLUTE idx buscar1 INTO ger_comp122.*
|
||||
IF status = notfound THEN
|
||||
LET salir2 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp122.sec_vend = ger_comp12.sec_vend and
|
||||
ger_comp122.compania = ger_comp12.compania and
|
||||
ger_comp122.tipo_cliente = ger_comp12.tipo_cliente and
|
||||
ger_comp122.sec_cliente = ger_comp12.sec_cliente THEN
|
||||
|
||||
LET esta = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
IF esta = "N" THEN
|
||||
OUTPUT TO REPORT repor_12(ger_comp12.*)
|
||||
END IF
|
||||
|
||||
LET esta1 = "N"
|
||||
# Busca las informaciones del ano anterior anterior
|
||||
LET salir3 = "N"
|
||||
WHILE salir3 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar3 INTO ger_comp123.*
|
||||
IF status = notfound THEN
|
||||
LET salir3 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx1 = idx1 + 1
|
||||
IF ger_comp123.sec_vend = ger_comp12.sec_vend and
|
||||
ger_comp123.compania = ger_comp12.compania and
|
||||
ger_comp123.tipo_cliente = ger_comp12.tipo_cliente and
|
||||
ger_comp123.sec_cliente = ger_comp12.sec_cliente THEN
|
||||
|
||||
LET esta1 = "S"
|
||||
LET ger_comp12.venta_ant1 = ger_comp123.ventas
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
END WHILE
|
||||
|
||||
IF esta1 = "S" THEN
|
||||
LET ger_comp12.venta = 0
|
||||
OUTPUT TO REPORT repor_12(ger_comp12.*)
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busca los registros que estan en el ano anterior anterior
|
||||
# y no estan en el ano Anterior
|
||||
LET idx = 1
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar3 INTO ger_comp121.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET ger_comp12.sec_vend = ger_comp121.sec_vend
|
||||
LET ger_comp12.compania = ger_comp121.compania
|
||||
LET ger_comp12.tipo_cliente = ger_comp121.tipo_cliente
|
||||
LET ger_comp12.sec_cliente = ger_comp121.sec_cliente
|
||||
LET ger_comp12.venta_ant1 = ger_comp121.ventas
|
||||
LET ger_comp12.venta_ant = 0
|
||||
LET ger_comp12.venta = 0
|
||||
|
||||
# Busca Las Informaciones del ano anterior
|
||||
LET esta = "N"
|
||||
LET salir2 = "N"
|
||||
WHILE salir2 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar2 INTO ger_comp122.*
|
||||
IF status = notfound THEN
|
||||
LET salir2 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx1 = idx1 + 1
|
||||
IF ger_comp122.sec_vend = ger_comp12.sec_vend and
|
||||
ger_comp122.compania = ger_comp12.compania and
|
||||
ger_comp122.tipo_cliente = ger_comp12.tipo_cliente and
|
||||
ger_comp122.sec_cliente = ger_comp12.sec_cliente THEN
|
||||
|
||||
LET esta = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
IF esta = "N" THEN
|
||||
OUTPUT TO REPORT repor_12(ger_comp12.*)
|
||||
END IF
|
||||
|
||||
LET esta1 = "N"
|
||||
# Busca las informaciones del ano anterior anterior
|
||||
LET salir3 = "N"
|
||||
WHILE salir3 != "S"
|
||||
FETCH ABSOLUTE idx buscar1 INTO ger_comp123.*
|
||||
IF status = notfound THEN
|
||||
LET salir3 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp123.sec_vend = ger_comp12.sec_vend and
|
||||
ger_comp123.compania = ger_comp12.compania and
|
||||
ger_comp123.tipo_cliente = ger_comp12.tipo_cliente and
|
||||
ger_comp123.sec_cliente = ger_comp12.sec_cliente THEN
|
||||
|
||||
LET esta1 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
IF esta1 = "N" THEN
|
||||
OUTPUT TO REPORT repor_12(ger_comp12.*)
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
FINISH REPORT repor_12
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT repor_12(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
nombre CHAR(30),
|
||||
venta DECIMAL(14,2),
|
||||
venta_ant DECIMAL(14,2),
|
||||
venta_ant1 DECIMAL(14,2)
|
||||
END RECORD
|
||||
|
||||
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.sec_vend,x.compania,x.venta DESC,x.tipo_cliente,x.sec_cliente
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.doce,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp012",
|
||||
COLUMN 25, " R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 91, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 25, " Sistema de Informacion Gerencial",
|
||||
COLUMN 91, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 25, "Ranking de Ventas Por Vendedor, Compania y Cliente",
|
||||
COLUMN 94, hora
|
||||
SKIP 1 LINES
|
||||
|
||||
PRINT COLUMN 1, "MES INICIAL: ",desc_mes_ini," HASTA ",desc_mes
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------"
|
||||
|
||||
PRINT COLUMN 59, "Venta",
|
||||
COLUMN 72, "Venta",
|
||||
COLUMN 93, "Venta"
|
||||
|
||||
PRINT COLUMN 1, "Posicion y Cliente",
|
||||
COLUMN 59, p_ano using "####",
|
||||
COLUMN 72, p_ano_ant using "####",
|
||||
COLUMN 93, p_ano_ant1 using "####"
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.sec_vend
|
||||
SKIP TO TOP OF PAGE
|
||||
SELECT UNIQUE a.nom1_emp,a.apell1_emp INTO nomb,apell FROM adtb00003 a
|
||||
WHERE a.num_emp = x.sec_vend
|
||||
|
||||
LET nombre = nomb CLIPPED," ",apell CLIPPED
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "Vendedor: ",x.sec_vend USING "&&&&"," ",nombre,
|
||||
letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
IF x.compania = 1 THEN
|
||||
PRINT COLUMN 1, "Productos Locales", letras.negrillas_off
|
||||
ELSE
|
||||
PRINT COLUMN 1, "Productos Importados", letras.negrillas_off
|
||||
END IF
|
||||
LET idx2 = 0
|
||||
|
||||
ON EVERY ROW
|
||||
SELECT a.nombre INTO x.nombre FROM vetb00004 a
|
||||
WHERE a.tipo_cliente = x.tipo_cliente AND a.sec_cliente = x.sec_cliente
|
||||
|
||||
LET idx2 = idx2 + 1
|
||||
PRINT COLUMN 1, idx2 USING "&&&"," ",
|
||||
x.tipo_cliente USING "&&","-",
|
||||
x.sec_cliente USING "&&&&"," ",
|
||||
" ",x.nombre CLIPPED,
|
||||
COLUMN 51, x.venta USING "-,---,---,---.##",
|
||||
COLUMN 68, x.venta_ant USING "-,---,---,---.##",
|
||||
COLUMN 85, x.venta_ant1 USING "-,---,---,---.##"
|
||||
|
||||
AFTER GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "----------------",
|
||||
COLUMN 68, "----------------",
|
||||
COLUMN 85, "----------------"
|
||||
PRINT COLUMN 1, "Total Compania ---> ",
|
||||
COLUMN 51, GROUP SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, GROUP SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
AFTER GROUP OF x.sec_vend
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "----------------",
|
||||
COLUMN 68, "----------------",
|
||||
COLUMN 85, "----------------"
|
||||
PRINT COLUMN 1, "Total Vendedor ---> ",
|
||||
COLUMN 51, GROUP SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, GROUP SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "================",
|
||||
COLUMN 68, "================",
|
||||
COLUMN 85, "================"
|
||||
PRINT COLUMN 1, "Total General ---> ",
|
||||
COLUMN 51, SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.normal,letras.negrillas_off
|
||||
END REPORT
|
||||
@@ -0,0 +1,460 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP013
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ranking de Ventas por Vendedor, Compania y Producto
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Enero 18, 1995
|
||||
Modificado Por : Juan Soto
|
||||
Descripcion : Se quito las columnas devoluciones y neto. Se Agrego la
|
||||
columna VENTAS DEL ANO ANTERIOR AL ACTUAL.
|
||||
Fecha : MAyo 21, 1996.
|
||||
Modificado Por :Juan Soto
|
||||
Descripcion : Insertar el cliente
|
||||
Fecha : Febrero 28, 2001
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp131 RECORD
|
||||
sec_vend INTEGER,
|
||||
tipo_cliente LIKE vetb00002.tipo_cliente,
|
||||
sec_cliente LIKE vetb00002.sec_cliente,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
codigo CHAR(7),
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med
|
||||
END RECORD,
|
||||
desc_mes CHAR(12)
|
||||
|
||||
DEFINE ger_comp132 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE nomb,apell CHAR(15),
|
||||
nombre CHAR(30),
|
||||
p_mes,p_ano,p_ano_ant,mov1 SMALLINT,
|
||||
esta CHAR(1),
|
||||
idx1,idx2 INTEGER,
|
||||
devol1,devol2 DECIMAL(12,4)
|
||||
DEFINE salir,salir1 CHAR(1)
|
||||
DEFINE fecha1,fecha2,fecha_inicial,fecha_final DATE
|
||||
|
||||
FUNCTION geprrp013()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
CALL pantalla()
|
||||
|
||||
OPEN FORM gefmrp013 FROM "gefmrp013"
|
||||
DISPLAY "geprrp013" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY FORM gefmrp013
|
||||
DISPLAY "Ranking de Ventas Por Vendedor, Compania y Producto" AT 6,15
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME p_ano,p_mes
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
AFTER FIELD p_ano
|
||||
IF p_ano is null THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
AFTER FIELD p_mes
|
||||
IF p_ano is null THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
LET p_ano_ant = p_ano - 1
|
||||
SELECT fecha_inicio,fecha_corte INTO fecha_inicial,fecha_final
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano
|
||||
|
||||
SELECT fecha_inicio,fecha_corte INTO fecha1,fecha2
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant
|
||||
|
||||
SELECT descrip INTO desc_mes
|
||||
FROM mestable
|
||||
WHERE mes = p_mes
|
||||
|
||||
EXIT INPUT
|
||||
END INPUT
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio ON d.sec_vend,b.cod_n,b.cod_grupo,b.cod_tipo,b.cod_sec,
|
||||
d.tipo_cliente,d.sec_cliente
|
||||
FROM sec_vend,cod_n,cod_grupo,cod_tipo,cod_sec,
|
||||
tipo_cliente,sec_cliente
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET selec1 =
|
||||
"SELECT d.sec_vend,d.tipo_cliente,d.sec_cliente,b.cod_cia,b.cod_n,b.cod_grupo,",
|
||||
"b.cod_tipo,b.cod_sec, ",
|
||||
" SUM(b.cantidad) ",
|
||||
"FROM vetb00028 a,vetb00003 b,vetb00002 d ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
" (a.sec_vend = d.sec_vend AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
" a.sec_cliente = d.sec_cliente) AND (",criterio clipped,
|
||||
") AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null ",
|
||||
" GROUP BY 1,2,3,4,5,6,7,8 ORDER BY 1,2,3,4,5,6,7,8 "
|
||||
|
||||
DISPLAY "Buscando Informacion... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando1 FROM selec1
|
||||
DECLARE buscar1 SCROLL CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_inicial,fecha_final
|
||||
|
||||
LET selec2 =
|
||||
"SELECT d.sec_vend,d.tipo_cliente,d.sec_cliente,b.cod_cia,b.cod_n,b.cod_grupo,",
|
||||
"b.cod_tipo,b.cod_sec, ",
|
||||
" SUM(b.cantidad) ",
|
||||
"FROM vetb00028 a,vetb00003 b,vetb00002 d ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
" (a.sec_vend = d.sec_vend AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
" a.sec_cliente = d.sec_cliente) AND (",criterio clipped,
|
||||
") AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null ",
|
||||
" GROUP BY 1,2,3,4,5,6,7,8 ORDER BY 1,2,3,4,5,6,7,8 "
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Anterior... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando2 FROM selec2
|
||||
DECLARE buscar2 SCROLL CURSOR FOR comando2
|
||||
OPEN buscar2 USING fecha1,fecha2
|
||||
|
||||
START REPORT repor_13 TO archivo
|
||||
DISPLAY "Reporte Generandose ... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
# Busqueda de los registros que estan en el ano actual y estan en el
|
||||
# Ano anterior
|
||||
#LET idx = idx + 1
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar1 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx1 = idx1 + 1
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
|
||||
# Busqueda de las informaciones del ano anetrior
|
||||
LET ger_comp131.cantidad_ant = 0
|
||||
LET salir = "N"
|
||||
LET idx = 1
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar2 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET ger_comp131.cantidad_ant = ger_comp132.cantidad
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_13(ger_comp131.*)
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busqueda de los registros que estan en el ano anterior y no estan en el
|
||||
# ano Actual
|
||||
LET idx = 1
|
||||
LET idx1 = 1
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar2 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
LET esta = "N"
|
||||
LET idx1 = idx1 + 1
|
||||
LET idx = 1
|
||||
# Busqueda de las informaciones del ano actual
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar1 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
display
|
||||
ger_comp131.cod_n ," ",
|
||||
ger_comp131.cod_grupo ," ",
|
||||
ger_comp131.cod_tipo ," ",
|
||||
ger_comp131.cod_sec ," ",
|
||||
ger_comp131.compania ," ",
|
||||
ger_comp131.sec_vend ," " AT 12,1
|
||||
display
|
||||
ger_comp132.cod_n ," ",
|
||||
ger_comp132.cod_grupo ," ",
|
||||
ger_comp132.cod_tipo ," ",
|
||||
ger_comp132.cod_sec ," ",
|
||||
ger_comp132.compania ," ",
|
||||
ger_comp132.sec_vend ," " AT 13,1
|
||||
|
||||
display idx1," ",esta at 14,1
|
||||
#sleep 2
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET esta = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
IF esta = "N" THEN
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
display
|
||||
ger_comp131.cod_n ," ",
|
||||
ger_comp131.cod_grupo ," ",
|
||||
ger_comp131.cod_tipo ," ",
|
||||
ger_comp131.cod_sec ," ",
|
||||
ger_comp131.compania ," ",
|
||||
ger_comp131.sec_vend ," " AT 15,1
|
||||
LET ger_comp131.cantidad_ant = ger_comp131.cantidad
|
||||
LET ger_comp131.cantidad = 0
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_13(ger_comp131.*)
|
||||
END IF
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
FINISH REPORT repor_13
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT repor_13(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
sec_vend INTEGER,
|
||||
tipo_cliente LIKE vetb00002.tipo_cliente,
|
||||
sec_cliente LIKE vetb00002.sec_cliente,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
codigo CHAR(7),
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med
|
||||
END RECORD
|
||||
|
||||
DEFINE hora CHAR(5),
|
||||
nombre_cli LIKE vetb00004.nombre
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.sec_vend,x.sec_cliente,x.compania,x.cantidad
|
||||
DESC, x.codigo
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.doce,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp013",
|
||||
COLUMN 25, " R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 91, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 38, "SISTEMA DE INFORMACION GERENCIAL",
|
||||
COLUMN 91, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 25, "Ranking de Ventas Por Vendedor, Compania y Producto",
|
||||
COLUMN 94, hora
|
||||
SKIP 1 LINES
|
||||
|
||||
PRINT COLUMN 1, "MES DE ",desc_mes
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------"
|
||||
|
||||
PRINT COLUMN 59, "Ventas",
|
||||
COLUMN 77, "Ventas"
|
||||
|
||||
PRINT COLUMN 1, "Posicion y Producto",
|
||||
COLUMN 59, p_ano using "####",
|
||||
COLUMN 77, p_ano_ant using "####"
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.sec_vend
|
||||
SKIP TO TOP OF PAGE
|
||||
SELECT UNIQUE a.nom1_emp,a.apell1_emp INTO nomb,apell FROM adtb00003 a
|
||||
WHERE a.num_emp = x.sec_vend
|
||||
|
||||
LET nombre = nomb CLIPPED," ",apell CLIPPED
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "Vendedor: ",x.sec_vend USING "&&&&"," ",nombre,
|
||||
letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.sec_cliente
|
||||
SELECT a.nombre INTO nombre_cli
|
||||
FROM vetb00002 a
|
||||
WHERE a.tipo_cliente = x.tipo_cliente AND
|
||||
a.sec_cliente = x.sec_cliente
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on,
|
||||
"CLIENTE: ",x.tipo_cliente USING "<<","-",
|
||||
x.sec_cliente USING "<<<<"," ",nombre_cli,
|
||||
letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
IF x.compania = 1 THEN
|
||||
PRINT COLUMN 1, "Productos Locales", letras.negrillas_off
|
||||
ELSE
|
||||
PRINT COLUMN 1, "Productos Importados", letras.negrillas_off
|
||||
END IF
|
||||
LET idx2 = 0
|
||||
|
||||
AFTER GROUP OF x.codigo
|
||||
LET idx2 = idx2 + 1
|
||||
|
||||
SELECT UNIQUE a.descrip_esp,a.unidad_med INTO x.descrip_esp,x.unidad_med
|
||||
FROM intb00001 a
|
||||
WHERE a.cod_n = x.cod_n AND a.cod_grupo = x.cod_grupo AND
|
||||
a.cod_tipo = x.cod_tipo AND a.cod_sec = x.cod_sec
|
||||
|
||||
PRINT COLUMN 1, idx2 USING "&&&"," ",
|
||||
x.cod_n USING "&","-",x.cod_grupo USING "&","-",
|
||||
x.cod_tipo USING "&&","-",x.cod_sec USING "&&&",
|
||||
" ", x.descrip_esp," ",x.unidad_med CLIPPED,
|
||||
COLUMN 51, GROUP SUM(x.cantidad)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.cantidad_ant)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##"
|
||||
|
||||
AFTER GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "----------------",
|
||||
COLUMN 68, "----------------"
|
||||
PRINT COLUMN 1, "Total Compania ---> ",
|
||||
COLUMN 51, GROUP SUM(x.cantidad)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.cantidad_ant)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
AFTER GROUP OF x.sec_vend
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "----------------",
|
||||
COLUMN 68, "----------------"
|
||||
PRINT COLUMN 1, "Total Vendedor ---> ",
|
||||
COLUMN 51, GROUP SUM(x.cantidad)
|
||||
USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.cantidad_ant)
|
||||
USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "================",
|
||||
COLUMN 68, "================"
|
||||
PRINT COLUMN 1, "Total General ---> ",
|
||||
COLUMN 51, SUM(x.cantidad)
|
||||
USING "-,---,---,---.##",
|
||||
COLUMN 68, SUM(x.cantidad_ant)
|
||||
USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.normal,letras.negrillas_off
|
||||
END REPORT
|
||||
@@ -0,0 +1,280 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP013
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ranking de Ventas por Vendedor, Compania y Producto
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Enero 18, 1995
|
||||
Modificado Por : Juan Soto
|
||||
Descripcion : Se quito las columnas devoluciones y neto. Se Agrego la
|
||||
columna VENTAS DEL ANO ANTERIOR AL ACTUAL.
|
||||
Fecha : MAyo 21, 1996.
|
||||
Modificado Por :Juan Soto
|
||||
Descripcion : Insertar el cliente
|
||||
Fecha : Febrero 28, 2001
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp131 RECORD
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med,
|
||||
cantidad DECIMAL(16,4),
|
||||
valor DECIMAL(12,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
codigo CHAR(7)
|
||||
END RECORD,
|
||||
desc_mes CHAR(12),
|
||||
tipo_ranking CHAR(30),
|
||||
cantidad_registros SMALLINT
|
||||
|
||||
DEFINE ger_comp132 RECORD LIKE ranking.*
|
||||
|
||||
DEFINE
|
||||
p_mes,p_ano,p_ano_ant SMALLINT,
|
||||
idx2 INTEGER
|
||||
|
||||
|
||||
DEFINE fecha1,fecha2,fecha_inicial,fecha_final DATE
|
||||
MAIN
|
||||
DEFER INTERRUPT
|
||||
CALL ARG_VAL(1) RETURNING usuarios
|
||||
CALL ARG_VAL(2) RETURNING clave
|
||||
CALL ARG_VAL(3) RETURNING impresor
|
||||
|
||||
|
||||
CONNECT TO "decomarmol" USER usuarios USING clave
|
||||
SELECT nombre,rnc,direccion INTO p_companias.nombre,p_companias.rnc,p_companias.direccion FROM companias
|
||||
CALL geprrp013()
|
||||
|
||||
END MAIN
|
||||
|
||||
FUNCTION geprrp013()
|
||||
|
||||
DEFINE handler om.SaxDocumentHandler, -- return value from fgl_report_commitCurrentSettings()
|
||||
r_filename STRING, -- filename of Report Design Document including .4rp extension
|
||||
r_output STRING, -- output format option
|
||||
preview INTEGER -- TRUE/FALSE, to set preview option
|
||||
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
|
||||
OPEN FORM gefmrp013 FROM "gefmrp013"
|
||||
DISPLAY "geprrp013" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY FORM gefmrp013
|
||||
DISPLAY "Ranking de Ventas Por Vendedor, Compania y Producto" AT 6,15
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
|
||||
INPUT BY NAME p_ano,p_mes,cantidad_registros,tipo_ranking
|
||||
BEFORE INPUT
|
||||
{ CALL combo_din("formonly.p_ano","select distinct a.ano from prdtable a order by a.ano")
|
||||
|
||||
CALL combo_din("formonly.p_mes","select a.descrip from mestable a order by a.mes")
|
||||
}
|
||||
LET p_ano= YEAR(TODAY)
|
||||
LET p_mes = MONTH(today)
|
||||
DISPLAY BY NAME p_ano,p_mes
|
||||
|
||||
AFTER INPUT
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET p_ano_ant = p_ano - 1
|
||||
|
||||
SELECT MIN(a.fecha_inicio)INTO fecha_inicial
|
||||
FROM prdtable a
|
||||
WHERE a.ano = p_ano
|
||||
|
||||
SELECT a.fecha_corte INTO fecha_final
|
||||
FROM prdtable a
|
||||
WHERE a.mes = p_mes and
|
||||
a.ano = p_ano
|
||||
|
||||
SELECT MIN(a.fecha_inicio) INTO fecha1
|
||||
FROM prdtable a
|
||||
WHERE a.ano = p_ano_ant
|
||||
|
||||
SELECT a.fecha_corte INTO fecha2
|
||||
FROM prdtable a
|
||||
WHERE a.mes = p_mes AND
|
||||
a.ano = p_ano_ant
|
||||
|
||||
EXIT INPUT
|
||||
END INPUT
|
||||
|
||||
CONSTRUCT criterio ON b.cod_n,b.cod_grupo,b.cod_tipo,b.cod_sec
|
||||
FROM cod_n,cod_grupo,cod_tipo,cod_sec
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
CALL seleccionarsalida() RETURNING r_output
|
||||
# CALL configureoutput(r_output) RETURNING HANDLER
|
||||
|
||||
DELETE FROM ranking
|
||||
|
||||
IF tipo_ranking = "CANTIDAD" THEN
|
||||
LET selec1 =
|
||||
" SELECT TOP ",cantidad_registros USING "<<<","a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,a.descrip_esp,a.unidad_med,",
|
||||
" SUM(b.cantidad),SUM(b.cantidad*b.precio*f.tasa) FROM iptb00002 a,vetb00003 b,vetb00002 c,prdtable d,cgtb00084 f ",
|
||||
" WHERE a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND a.cod_tipo = b.cod_tipo and ",
|
||||
" a.cod_Sec = b.cod_sec and b.factura = c.factura and c.fecha_factura between '",fecha_inicial USING "dd/mm/yyyy","' and '",fecha_final USING "mm/dd/yyyy","' and ",
|
||||
" c.fecha_factura between d.fecha_inicio and d.fecha_corte and ",
|
||||
" d.ano =f.ano and d.mes = f.mes and c.ventas = f.ventas and c.tipo_cliente = f.tipo_cliente and ",
|
||||
" c.status_t is null and ",criterio CLIPPED,
|
||||
" GROUP BY a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,a.descrip_esp,a.unidad_med",
|
||||
" ORDER BY SUM(b.cantidad) desc "
|
||||
ELSE
|
||||
LET selec1 =" SELECT TOP ",cantidad_registros USING "<<<"," a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,a.descrip_esp,a.unidad_med,",
|
||||
" SUM(b.cantidad),SUM(b.cantidad*b.precio*f.tasa) FROM iptb00002 a,vetb00003 b,vetb00002 c,prdtable d,cgtb00084 f ",
|
||||
" WHERE a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND a.cod_tipo = b.cod_tipo and ",
|
||||
" a.cod_Sec = b.cod_sec and b.factura = c.factura and c.fecha_factura between '",fecha_inicial USING "dd/mm/yyyy","' and '",fecha_final USING "mm/dd/yyyy","' and ",
|
||||
" c.fecha_factura between d.fecha_inicio and d.fecha_corte and ",
|
||||
" d.ano =f.ano and d.mes = f.mes and c.ventas = f.ventas and c.tipo_cliente = f.tipo_cliente and ",
|
||||
" c.status_t is null and ",criterio CLIPPED,
|
||||
" GROUP BY a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,a.descrip_esp,a.unidad_med",
|
||||
" ORDER BY SUM(b.cantidad*b.precio) desc "
|
||||
END IF
|
||||
|
||||
PREPARE comando1 FROM selec1
|
||||
DECLARE buscar1 CURSOR FOR comando1
|
||||
OPEN buscar1
|
||||
|
||||
LET r_filename = "geprrp013.4rp"
|
||||
LET preview = 1
|
||||
# LET r_output = "SVG"
|
||||
IF fgl_report_loadCurrentSettings(r_filename) THEN -- load the .4rp file
|
||||
CALL fgl_report_selectDevice(r_output) -- changing default
|
||||
CALL fgl_report_selectPreview(preview) -- changing default
|
||||
LET handler = fgl_report_commitCurrentSettings() -- commit changes
|
||||
|
||||
|
||||
START REPORT repor_13 TO XML HANDLER handler
|
||||
|
||||
# Busqueda de los registros que estan en el ano actual y estan en el
|
||||
# Ano anterior
|
||||
LET idx = 1
|
||||
FOREACH buscar1 INTO ger_comp131.*
|
||||
SELECT a.cod_n FROM ranking a
|
||||
WHERE a.cod_n = ger_comp131.cod_n AND
|
||||
a.cod_grupo = ger_comp131.cod_grupo AND
|
||||
a.cod_tipo = ger_comp131.cod_tipo AND
|
||||
a.cod_sec = ger_comp131.cod_sec
|
||||
|
||||
IF STATUS= NOTFOUND THEN
|
||||
INSERT INTO ranking VALUES (idx,'0',ger_comp131.cod_n,ger_comp131.cod_grupo,
|
||||
ger_comp131.cod_tipo,ger_comp131.cod_sec,
|
||||
ger_comp131.descrip_esp,ger_comp131.unidad_med,
|
||||
ger_comp131.cantidad,ger_comp131.valor,'0','0')
|
||||
END IF
|
||||
|
||||
LET idx = idx + 1
|
||||
END FOREACH
|
||||
|
||||
IF tipo_ranking = "CANTIDAD" THEN
|
||||
LET selec1 =
|
||||
" SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,a.descrip_esp,a.unidad_med,",
|
||||
" SUM(b.cantidad),SUM(b.cantidad*b.precio*f.tasa) FROM iptb00002 a,vetb00003 b,vetb00002 c,prdtable d,cgtb00084 f ",
|
||||
" WHERE a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND a.cod_tipo = b.cod_tipo and ",
|
||||
" a.cod_Sec = b.cod_sec and b.factura = c.factura and c.fecha_factura between '",fecha1 USING "dd/mm/yyyy","' and '",fecha2 USING "mm/dd/yyyy","' and ",
|
||||
" c.fecha_factura between d.fecha_inicio and d.fecha_corte and ",
|
||||
" d.ano =f.ano and d.mes = f.mes and c.ventas = f.ventas and c.tipo_cliente = f.tipo_cliente and ",
|
||||
" c.status_t is null and ",criterio CLIPPED,
|
||||
" GROUP BY a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,a.descrip_esp,a.unidad_med",
|
||||
" ORDER BY SUM(b.cantidad) desc "
|
||||
|
||||
DISPLAY "fecha ",fecha1," fecha 2 ",fecha2
|
||||
ELSE
|
||||
LET selec1 =" SELECT a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,a.descrip_esp,a.unidad_med,",
|
||||
" SUM(b.cantidad),SUM(b.cantidad*b.precio*f.tasa) FROM iptb00002 a,vetb00003 b,vetb00002 c,prdtable d,cgtb00084 f ",
|
||||
" WHERE a.cod_n = b.cod_n AND a.cod_grupo = b.cod_grupo AND a.cod_tipo = b.cod_tipo and ",
|
||||
" a.cod_Sec = b.cod_sec and b.factura = c.factura and c.fecha_factura between '",fecha1 USING "dd/mm/yyyy","' and '",fecha2 USING "mm/dd/yyyy","' and ",
|
||||
" c.fecha_factura between d.fecha_inicio and d.fecha_corte and ",
|
||||
" d.ano =f.ano and d.mes = f.mes and c.ventas = f.ventas and c.tipo_cliente = f.tipo_cliente and ",
|
||||
" c.status_t is null and ",criterio CLIPPED,
|
||||
" GROUP BY a.cod_n,a.cod_grupo,a.cod_tipo,a.cod_sec,a.descrip_esp,a.unidad_med",
|
||||
" ORDER BY SUM(b.cantidad*b.precio) desc "
|
||||
END IF
|
||||
|
||||
PREPARE comando2 FROM selec1
|
||||
DECLARE buscar2 CURSOR FOR comando2
|
||||
OPEN buscar2
|
||||
|
||||
LET idx2 = 1
|
||||
LET idx =0
|
||||
FOREACH buscar2 INTO ger_comp131.*
|
||||
SELECT a.cod_n FROM ranking a
|
||||
WHERE a.cod_n = ger_comp131.cod_n AND
|
||||
a.cod_grupo = ger_comp131.cod_grupo AND
|
||||
a.cod_tipo = ger_comp131.cod_tipo AND
|
||||
a.cod_sec = ger_comp131.cod_sec
|
||||
|
||||
IF STATUS<> NOTFOUND THEN
|
||||
UPDATE ranking SET rankingant = idx2,
|
||||
cantidad_ant = ger_comp131.cantidad,
|
||||
valor_ant = ger_comp131.valor
|
||||
|
||||
WHERE cod_n = ger_comp131.cod_n AND
|
||||
cod_Grupo = ger_comp131.cod_grupo AND
|
||||
cod_tipo = ger_comp131.cod_tipo AND
|
||||
cod_sec = ger_comp131.cod_sec
|
||||
END IF
|
||||
|
||||
LET idx2 = idx2 + 1
|
||||
END FOREACH
|
||||
|
||||
|
||||
DECLARE busca_ranking CURSOR FOR
|
||||
SELECT a.* FROM ranking a
|
||||
ORDER BY a.rankingact
|
||||
LET idx = 1
|
||||
FOREACH busca_ranking INTO ger_comp132.*
|
||||
IF idx < cantidad_registros THEN
|
||||
OUTPUT TO REPORT repor_13(ger_comp132.*)
|
||||
END IF
|
||||
END FOREACH
|
||||
FINISH REPORT repor_13
|
||||
END IF
|
||||
|
||||
END FUNCTION
|
||||
|
||||
REPORT repor_13(x)
|
||||
|
||||
DEFINE x RECORD LIKE ranking.*
|
||||
|
||||
|
||||
DEFINE hora CHAR(16)
|
||||
|
||||
|
||||
FORMAT
|
||||
|
||||
FIRST PAGE HEADER
|
||||
|
||||
LET hora = TODAY USING "dd/mm/yyyy"
|
||||
PRINTX desc_mes
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
PRINTX x.rankingact, x.rankingant,
|
||||
x.cod_n,x.cod_grupo,
|
||||
x.cod_tipo,x.cod_sec,cantidad_registros,
|
||||
x.descripcion,x.unidad_med,
|
||||
x.cantidad,x.cantidad_ant,x.valor_ant,
|
||||
x.valor,p_companias.nombre,p_ano,p_ano_ant,tipo_ranking,hora,fecha_inicial,fecha_final
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,458 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP013
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ranking de Ventas por Vendedor, Compania y Producto
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Enero 18, 1995
|
||||
Modificado Por : Juan Soto
|
||||
Descripcion : Se quito las columnas devoluciones y neto. Se Agrego la
|
||||
columna VENTAS DEL ANO ANTERIOR AL ACTUAL.
|
||||
Fecha : MAyo 21, 1996.
|
||||
Modificado Por :Juan Soto
|
||||
Descripcion : Insertar el cliente
|
||||
Fecha : Febrero 28, 2001
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp131 RECORD
|
||||
sec_vend INTEGER,
|
||||
#tipo_cliente LIKE vetb00002.tipo_cliente,
|
||||
#sec_cliente LIKE vetb00002.sec_cliente,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
codigo CHAR(7),
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med
|
||||
END RECORD,
|
||||
desc_mes CHAR(12)
|
||||
|
||||
DEFINE ger_comp132 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE nomb,apell CHAR(15),
|
||||
nombre CHAR(30),
|
||||
p_mes,p_ano,p_ano_ant,mov1 SMALLINT,
|
||||
esta CHAR(1),
|
||||
idx1,idx2 INTEGER,
|
||||
devol1,devol2 DECIMAL(12,4)
|
||||
DEFINE salir,salir1 CHAR(1)
|
||||
DEFINE fecha1,fecha2,fecha_inicial,fecha_final DATE
|
||||
|
||||
FUNCTION geprrp013()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
CALL pantalla()
|
||||
|
||||
OPEN FORM gefmrp013 FROM "gefmrp013"
|
||||
DISPLAY "geprrp013" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY FORM gefmrp013
|
||||
DISPLAY "Ranking de Ventas Por Vendedor, Compania y Producto" AT 6,15
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME p_ano,p_mes
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
AFTER FIELD p_ano
|
||||
IF p_ano is null THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
AFTER FIELD p_mes
|
||||
IF p_ano is null THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
LET p_ano_ant = p_ano - 1
|
||||
SELECT MIN(fecha_inicio)INTO fecha_inicial
|
||||
FROM prdtable
|
||||
WHERE ano = p_ano
|
||||
|
||||
SELECT fecha_corte INTO fecha_final
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano
|
||||
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha1
|
||||
FROM prdtable
|
||||
WHERE ano = p_ano_ant
|
||||
|
||||
SELECT fecha_corte INTO fecha2
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant
|
||||
|
||||
SELECT descrip INTO desc_mes
|
||||
FROM mestable
|
||||
WHERE mes = p_mes
|
||||
|
||||
|
||||
EXIT INPUT
|
||||
END INPUT
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio ON d.sec_vend,b.cod_n,b.cod_grupo,b.cod_tipo,b.cod_sec
|
||||
FROM sec_vend,cod_n,cod_grupo,cod_tipo,cod_sec
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET selec1 =
|
||||
"SELECT d.sec_vend,b.cod_cia,b.cod_n,b.cod_grupo,",
|
||||
"b.cod_tipo,b.cod_sec, ",
|
||||
" SUM(b.cantidad) ",
|
||||
"FROM vetb00003 b,vetb00002 d ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
#" a.sec_vend = d.sec_vend AND ",
|
||||
#" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
#" a.sec_cliente = d.sec_cliente AND ",
|
||||
criterio clipped," AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null ",
|
||||
" GROUP BY 1,2,3,4,5,6 ORDER BY 1,2,3,4,5,6 "
|
||||
|
||||
DISPLAY "Buscando Informacion... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando1 FROM selec1
|
||||
DECLARE buscar1 SCROLL CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_inicial,fecha_final
|
||||
|
||||
LET selec2 =
|
||||
"SELECT d.sec_vend,b.cod_cia,b.cod_n,b.cod_grupo,",
|
||||
"b.cod_tipo,b.cod_sec, ",
|
||||
" SUM(b.cantidad) ",
|
||||
"FROM vetb00003 b,vetb00002 d ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
# " a.sec_vend = d.sec_vend AND ",
|
||||
# " a.tipo_cliente = d.tipo_cliente AND ",
|
||||
# " a.sec_cliente = d.sec_cliente AND ",
|
||||
criterio clipped," AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null ",
|
||||
" GROUP BY 1,2,3,4,5,6 ORDER BY 1,2,3,4,5,6 "
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Anterior... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando2 FROM selec2
|
||||
DECLARE buscar2 SCROLL CURSOR FOR comando2
|
||||
OPEN buscar2 USING fecha1,fecha2
|
||||
|
||||
START REPORT repor_13 TO archivo
|
||||
DISPLAY "Reporte Generandose ... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
# Busqueda de los registros que estan en el ano actual y estan en el
|
||||
# Ano anterior
|
||||
#LET idx = idx + 1
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar1 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx1 = idx1 + 1
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
|
||||
# Busqueda de las informaciones del ano anetrior
|
||||
LET ger_comp131.cantidad_ant = 0
|
||||
LET salir = "N"
|
||||
LET idx = 1
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar2 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET ger_comp131.cantidad_ant = ger_comp132.cantidad
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_13(ger_comp131.*)
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busqueda de los registros que estan en el ano anterior y no estan en el
|
||||
# ano Actual
|
||||
LET idx = 1
|
||||
LET idx1 = 1
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar2 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
LET esta = "N"
|
||||
LET idx1 = idx1 + 1
|
||||
LET idx = 1
|
||||
# Busqueda de las informaciones del ano actual
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar1 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
display
|
||||
ger_comp131.cod_n ," ",
|
||||
ger_comp131.cod_grupo ," ",
|
||||
ger_comp131.cod_tipo ," ",
|
||||
ger_comp131.cod_sec ," ",
|
||||
ger_comp131.compania ," ",
|
||||
ger_comp131.sec_vend ," " AT 12,1
|
||||
display
|
||||
ger_comp132.cod_n ," ",
|
||||
ger_comp132.cod_grupo ," ",
|
||||
ger_comp132.cod_tipo ," ",
|
||||
ger_comp132.cod_sec ," ",
|
||||
ger_comp132.compania ," ",
|
||||
ger_comp132.sec_vend ," " AT 13,1
|
||||
|
||||
display idx1," ",esta at 14,1
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET esta = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
IF esta = "N" THEN
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
display
|
||||
ger_comp131.cod_n ," ",
|
||||
ger_comp131.cod_grupo ," ",
|
||||
ger_comp131.cod_tipo ," ",
|
||||
ger_comp131.cod_sec ," ",
|
||||
ger_comp131.compania ," ",
|
||||
ger_comp131.sec_vend ," " AT 15,1
|
||||
LET ger_comp131.cantidad_ant = ger_comp131.cantidad
|
||||
LET ger_comp131.cantidad = 0
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_13(ger_comp131.*)
|
||||
END IF
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
FINISH REPORT repor_13
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT repor_13(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
sec_vend INTEGER,
|
||||
#tipo_cliente LIKE vetb00002.tipo_cliente,
|
||||
#sec_cliente LIKE vetb00002.sec_cliente,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
codigo CHAR(7),
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med
|
||||
END RECORD
|
||||
|
||||
DEFINE hora CHAR(5),
|
||||
nombre_cli LIKE vetb00004.nombre
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.sec_vend,x.compania,x.cantidad
|
||||
DESC, x.codigo
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.doce,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp013",
|
||||
COLUMN 25, " R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 91, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 38, "SISTEMA DE INFORMACION GERENCIAL",
|
||||
COLUMN 91, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 25, "Ranking de Ventas Por Vendedor, Compania y Producto",
|
||||
COLUMN 94, hora
|
||||
SKIP 1 LINES
|
||||
|
||||
PRINT COLUMN 1, "HASTA MES DE ",desc_mes
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------",
|
||||
"---------------"
|
||||
|
||||
|
||||
PRINT COLUMN 85, "Ventas",
|
||||
COLUMN 103, "Ventas"
|
||||
|
||||
PRINT COLUMN 1, "Posicion y Producto",
|
||||
COLUMN 85, p_ano using "####",
|
||||
COLUMN 103, p_ano_ant using "####"
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------",
|
||||
"---------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.sec_vend
|
||||
SKIP TO TOP OF PAGE
|
||||
SELECT UNIQUE a.nom1_emp,a.apell1_emp INTO nomb,apell FROM adtb00003 a
|
||||
WHERE a.num_emp = x.sec_vend
|
||||
|
||||
LET nombre = nomb CLIPPED," ",apell CLIPPED
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "Vendedor: ",x.sec_vend USING "&&&&"," ",nombre,
|
||||
letras.negrillas_off
|
||||
BEFORE GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
IF x.compania = 1 THEN
|
||||
PRINT COLUMN 1, "Productos Locales", letras.negrillas_off
|
||||
ELSE
|
||||
PRINT COLUMN 1, "Productos Importados", letras.negrillas_off
|
||||
END IF
|
||||
LET idx2 = 0
|
||||
|
||||
AFTER GROUP OF x.codigo
|
||||
LET idx2 = idx2 + 1
|
||||
|
||||
SELECT UNIQUE a.descrip_esp,a.unidad_med INTO x.descrip_esp,x.unidad_med
|
||||
FROM intb00001 a
|
||||
WHERE a.cod_n = x.cod_n AND a.cod_grupo = x.cod_grupo AND
|
||||
a.cod_tipo = x.cod_tipo AND a.cod_sec = x.cod_sec
|
||||
|
||||
PRINT COLUMN 1, idx2 USING "&&&"," ",
|
||||
x.cod_n USING "&","-",x.cod_grupo USING "&","-",
|
||||
x.cod_tipo USING "&&","-",x.cod_sec USING "&&&",
|
||||
" ", x.descrip_esp," ",x.unidad_med CLIPPED,
|
||||
COLUMN 51, GROUP SUM(x.cantidad)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "###,###,###,###",
|
||||
COLUMN 68, GROUP SUM(x.cantidad_ant)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "###,###,###,###"
|
||||
|
||||
AFTER GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 79, "----------------",
|
||||
COLUMN 96, "----------------"
|
||||
PRINT COLUMN 1, "Total Compania ---> ",
|
||||
COLUMN 79, GROUP SUM(x.cantidad)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "###,###,###,###",
|
||||
COLUMN 96, GROUP SUM(x.cantidad_ant)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "###,###,###,###"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
AFTER GROUP OF x.sec_vend
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 79, "----------------",
|
||||
COLUMN 96, "----------------"
|
||||
PRINT COLUMN 1, "Total Vendedor ---> ",
|
||||
COLUMN 79, GROUP SUM(x.cantidad)
|
||||
USING "###,###,###,###",
|
||||
COLUMN 96, GROUP SUM(x.cantidad_ant)
|
||||
USING "###,###,###,###"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 79, "================",
|
||||
COLUMN 96, "================"
|
||||
PRINT COLUMN 1, "Total General ---> ",
|
||||
COLUMN 79, SUM(x.cantidad)
|
||||
USING "###,###,###,###",
|
||||
COLUMN 96, SUM(x.cantidad_ant)
|
||||
USING "###,###,###,###"
|
||||
PRINT COLUMN 1, letras.normal,letras.negrillas_off
|
||||
END REPORT
|
||||
@@ -0,0 +1,657 @@
|
||||
S^1^0^M^geprrp013^MODULE^^
|
||||
S^2^1^R^repor_13^^^public
|
||||
F^0^C:\Users\luis_\Documents\fuentes\decomarmol\PROYECTO\gedir\geprrp013.4gl
|
||||
D^2^256^280^10^0^0
|
||||
X^2^c^251^20^0^finish
|
||||
X^2^c^248^26^0^output
|
||||
X^2^c^167^23^0^start
|
||||
X^2^D^256^10^0^
|
||||
S^3^2^P^x^RECORD^^
|
||||
D^3^258^258^12^0^0
|
||||
X^3^r^278^16^0^
|
||||
X^3^r^277^42^0^
|
||||
X^3^r^277^27^0^
|
||||
X^3^r^277^16^0^
|
||||
X^3^r^276^30^0^
|
||||
X^3^r^276^16^0^
|
||||
X^3^r^275^27^0^
|
||||
X^3^r^275^16^0^
|
||||
X^3^r^274^24^0^
|
||||
X^3^r^274^16^0^
|
||||
X^3^r^273^31^0^
|
||||
X^3^r^273^16^0^
|
||||
X^3^l^256^19^0^
|
||||
X^3^D^258^12^0^
|
||||
S^4^3^P^rankingact^SMALLINT^decomarmol.ranking.rankingact^
|
||||
D^4^0^0^0^0^0
|
||||
X^4^D^36^9^0^
|
||||
S^5^3^P^rankingant^SMALLINT^decomarmol.ranking.rankingant^
|
||||
D^5^0^0^0^0^0
|
||||
X^5^D^36^9^0^
|
||||
S^6^3^P^cod_n^SMALLINT^decomarmol.ranking.cod_n^
|
||||
D^6^0^0^0^0^0
|
||||
X^6^D^36^9^0^
|
||||
S^7^3^P^cod_grupo^SMALLINT^decomarmol.ranking.cod_grupo^
|
||||
D^7^0^0^0^0^0
|
||||
X^7^D^36^9^0^
|
||||
S^8^3^P^cod_tipo^SMALLINT^decomarmol.ranking.cod_tipo^
|
||||
D^8^0^0^0^0^0
|
||||
X^8^D^36^9^0^
|
||||
S^9^3^P^cod_sec^SMALLINT^decomarmol.ranking.cod_sec^
|
||||
D^9^0^0^0^0^0
|
||||
X^9^D^36^9^0^
|
||||
S^10^3^P^descripcion^CHAR(100)^decomarmol.ranking.descripcion^
|
||||
D^10^0^0^0^0^0
|
||||
X^10^D^36^9^0^
|
||||
S^11^3^P^unidad_med^CHAR(10)^decomarmol.ranking.unidad_med^
|
||||
D^11^0^0^0^0^0
|
||||
X^11^D^36^9^0^
|
||||
S^12^3^P^cantidad^DECIMAL(15,4)^decomarmol.ranking.cantidad^
|
||||
D^12^0^0^0^0^0
|
||||
X^12^D^36^9^0^
|
||||
S^13^3^P^valor^DECIMAL(15,2)^decomarmol.ranking.valor^
|
||||
D^13^0^0^0^0^0
|
||||
X^13^D^36^9^0^
|
||||
S^14^3^P^cantidad_ant^DECIMAL(15,4)^decomarmol.ranking.cantidad_ant^
|
||||
D^14^0^0^0^0^0
|
||||
X^14^D^36^9^0^
|
||||
S^15^3^P^valor_ant^DECIMAL(15,2)^decomarmol.ranking.valor_ant^
|
||||
D^15^0^0^0^0^0
|
||||
X^15^D^36^9^0^
|
||||
S^16^2^V^hora^CHAR(16)^^
|
||||
D^16^261^261^13^0^0
|
||||
X^16^r^278^72^0^
|
||||
X^16^l^268^11^0^
|
||||
X^16^D^261^13^0^
|
||||
S^17^2^V^reportDef^base.Report^^
|
||||
D^17^0^0^0^0^0
|
||||
S^18^1^F^geprrp013^^^public
|
||||
D^18^57^254^11^0^0
|
||||
X^18^c^53^7^0^
|
||||
X^18^D^57^11^0^
|
||||
S^19^18^V^handler^om.SaxDocumentHandler^^
|
||||
D^19^59^59^15^0^0
|
||||
X^19^r^167^48^0^
|
||||
X^19^l^164^10^0^
|
||||
X^19^D^59^15^0^
|
||||
S^20^18^V^r_filename^STRING^^
|
||||
D^20^60^60^11^0^0
|
||||
X^20^r^161^40^0^
|
||||
X^20^l^158^11^0^
|
||||
X^20^D^60^11^0^
|
||||
S^21^18^V^r_output^STRING^^
|
||||
D^21^61^61^11^0^0
|
||||
X^21^r^162^35^0^
|
||||
X^21^l^126^41^0^
|
||||
X^21^D^61^11^0^
|
||||
S^22^18^V^preview^INTEGER^^
|
||||
D^22^62^62^11^0^0
|
||||
X^22^r^163^36^0^
|
||||
X^22^l^159^11^0^
|
||||
X^22^D^62^11^0^
|
||||
S^23^1^F^main^^^public
|
||||
D^23^44^55^1^0^0
|
||||
X^23^D^44^1^0^
|
||||
S^24^1^V^ger_comp131^RECORD^^private
|
||||
D^24^20^31^9^0^0
|
||||
X^24^r^235^28^0^
|
||||
X^24^r^234^29^0^
|
||||
X^24^r^233^30^0^
|
||||
X^24^r^232^26^0^
|
||||
X^24^r^230^31^0^
|
||||
X^24^r^229^34^0^
|
||||
X^24^r^225^26^0^
|
||||
X^24^r^224^27^0^
|
||||
X^24^r^223^28^0^
|
||||
X^24^r^222^24^0^
|
||||
X^24^r^220^27^0^
|
||||
X^24^r^183^61^0^
|
||||
X^24^r^183^40^0^
|
||||
X^24^r^182^64^0^
|
||||
X^24^r^182^40^0^
|
||||
X^24^r^181^61^0^
|
||||
X^24^r^181^40^0^
|
||||
X^24^r^180^66^0^
|
||||
X^24^r^180^48^0^
|
||||
X^24^r^177^26^0^
|
||||
X^24^r^176^27^0^
|
||||
X^24^r^175^28^0^
|
||||
X^24^r^174^24^0^
|
||||
X^24^r^172^27^0^
|
||||
X^24^D^20^9^0^
|
||||
S^25^24^V^cod_n^SMALLINT^^
|
||||
D^25^21^21^9^0^0
|
||||
X^25^D^21^9^0^
|
||||
S^26^24^V^cod_grupo^SMALLINT^^
|
||||
D^26^22^22^9^0^0
|
||||
X^26^D^22^9^0^
|
||||
S^27^24^V^cod_tipo^SMALLINT^^
|
||||
D^27^23^23^9^0^0
|
||||
X^27^D^23^9^0^
|
||||
S^28^24^V^cod_sec^SMALLINT^^
|
||||
D^28^24^24^9^0^0
|
||||
X^28^D^24^9^0^
|
||||
S^29^24^V^descrip_esp^CHAR(60)^decomarmol.intb00001.descrip_esp^
|
||||
D^29^25^25^9^0^0
|
||||
X^29^D^25^9^0^
|
||||
S^30^24^V^unidad_med^CHAR(3)^decomarmol.intb00001.unidad_med^
|
||||
D^30^26^26^9^0^0
|
||||
X^30^D^26^9^0^
|
||||
S^31^24^V^cantidad^DECIMAL(16,4)^^
|
||||
D^31^27^27^9^0^0
|
||||
X^31^D^27^9^0^
|
||||
S^32^24^V^valor^DECIMAL(12,2)^^
|
||||
D^32^28^28^9^0^0
|
||||
X^32^D^28^9^0^
|
||||
S^33^24^V^cantidad_ant^DECIMAL(14,2)^^
|
||||
D^33^29^29^9^0^0
|
||||
X^33^D^29^9^0^
|
||||
S^34^24^V^codigo^CHAR(7)^^
|
||||
D^34^30^30^9^0^0
|
||||
X^34^D^30^9^0^
|
||||
S^35^1^V^desc_mes^CHAR(12)^^private
|
||||
D^35^32^32^6^0^0
|
||||
X^35^r^269^14^0^
|
||||
X^35^D^32^6^0^
|
||||
S^36^1^V^tipo_ranking^CHAR(30)^^private
|
||||
D^36^33^33^6^0^0
|
||||
X^36^r^278^59^0^
|
||||
X^36^r^189^9^0^
|
||||
X^36^r^131^9^0^
|
||||
X^36^l^76^51^0^
|
||||
X^36^D^33^6^0^
|
||||
S^37^1^V^cantidad_registros^SMALLINT^^private
|
||||
D^37^34^34^6^0^0
|
||||
X^37^r^275^37^0^
|
||||
X^37^r^247^17^0^
|
||||
X^37^r^143^33^0^
|
||||
X^37^r^133^23^0^
|
||||
X^37^l^76^32^0^
|
||||
X^37^D^34^6^0^
|
||||
S^38^1^V^ger_comp132^RECORD^^private
|
||||
D^38^36^36^9^0^0
|
||||
X^38^r^248^35^0^
|
||||
X^38^r^246^33^0^
|
||||
X^38^D^36^9^0^
|
||||
S^39^38^V^rankingact^SMALLINT^decomarmol.ranking.rankingact^
|
||||
D^39^0^0^0^0^0
|
||||
S^40^38^V^rankingant^SMALLINT^decomarmol.ranking.rankingant^
|
||||
D^40^0^0^0^0^0
|
||||
S^41^38^V^cod_n^SMALLINT^decomarmol.ranking.cod_n^
|
||||
D^41^0^0^0^0^0
|
||||
S^42^38^V^cod_grupo^SMALLINT^decomarmol.ranking.cod_grupo^
|
||||
D^42^0^0^0^0^0
|
||||
S^43^38^V^cod_tipo^SMALLINT^decomarmol.ranking.cod_tipo^
|
||||
D^43^0^0^0^0^0
|
||||
S^44^38^V^cod_sec^SMALLINT^decomarmol.ranking.cod_sec^
|
||||
D^44^0^0^0^0^0
|
||||
S^45^38^V^descripcion^CHAR(100)^decomarmol.ranking.descripcion^
|
||||
D^45^0^0^0^0^0
|
||||
S^46^38^V^unidad_med^CHAR(10)^decomarmol.ranking.unidad_med^
|
||||
D^46^0^0^0^0^0
|
||||
S^47^38^V^cantidad^DECIMAL(15,4)^decomarmol.ranking.cantidad^
|
||||
D^47^0^0^0^0^0
|
||||
S^48^38^V^valor^DECIMAL(15,2)^decomarmol.ranking.valor^
|
||||
D^48^0^0^0^0^0
|
||||
S^49^38^V^cantidad_ant^DECIMAL(15,4)^decomarmol.ranking.cantidad_ant^
|
||||
D^49^0^0^0^0^0
|
||||
S^50^38^V^valor_ant^DECIMAL(15,2)^decomarmol.ranking.valor_ant^
|
||||
D^50^0^0^0^0^0
|
||||
S^51^1^V^p_mes^SMALLINT^^private
|
||||
D^51^39^39^9^0^0
|
||||
X^51^r^111^23^0^
|
||||
X^51^r^102^23^0^
|
||||
X^51^l^84^29^0^
|
||||
X^51^l^83^11^0^
|
||||
X^51^l^76^26^0^
|
||||
X^51^D^39^9^0^
|
||||
S^52^1^V^p_ano^SMALLINT^^private
|
||||
D^52^39^39^15^0^0
|
||||
X^52^r^278^43^0^
|
||||
X^52^r^103^20^0^
|
||||
X^52^r^98^23^0^
|
||||
X^52^r^94^25^0^
|
||||
X^52^l^84^23^0^
|
||||
X^52^l^82^11^0^
|
||||
X^52^l^76^20^0^
|
||||
X^52^D^39^15^0^
|
||||
S^53^1^V^p_ano_ant^SMALLINT^^private
|
||||
D^53^39^39^21^0^0
|
||||
X^53^r^278^49^0^
|
||||
X^53^r^112^23^0^
|
||||
X^53^r^107^23^0^
|
||||
X^53^l^94^13^0^
|
||||
X^53^D^39^21^0^
|
||||
S^54^1^V^idx2^INTEGER^^private
|
||||
D^54^40^40^9^0^0
|
||||
X^54^r^238^20^0^
|
||||
X^54^l^238^13^0^
|
||||
X^54^r^228^44^0^
|
||||
X^54^l^218^10^0^
|
||||
X^54^D^40^9^0^
|
||||
S^55^1^V^fecha1^DATE^^private
|
||||
D^55^43^43^9^0^0
|
||||
X^55^r^206^88^0^
|
||||
X^55^r^201^24^0^
|
||||
X^55^r^194^88^0^
|
||||
X^55^l^105^41^0^
|
||||
X^55^D^43^9^0^
|
||||
S^56^1^V^fecha2^DATE^^private
|
||||
D^56^43^43^16^0^0
|
||||
X^56^r^206^124^0^
|
||||
X^56^r^201^43^0^
|
||||
X^56^r^194^124^0^
|
||||
X^56^l^109^35^0^
|
||||
X^56^D^43^16^0^
|
||||
S^57^1^V^fecha_inicial^DATE^^private
|
||||
D^57^43^43^23^0^0
|
||||
X^57^r^146^88^0^
|
||||
X^57^r^136^88^0^
|
||||
X^57^l^96^40^0^
|
||||
X^57^D^43^23^0^
|
||||
S^58^1^V^fecha_final^DATE^^private
|
||||
D^58^43^43^37^0^0
|
||||
X^58^r^146^131^0^
|
||||
X^58^r^136^131^0^
|
||||
X^58^l^100^35^0^
|
||||
X^58^D^43^37^0^
|
||||
S^59^1^C^comando1^base.SqlHandle^^private
|
||||
D^59^154^154^14^0^0
|
||||
X^59^u^155^34^0^
|
||||
X^59^D^154^14^0^
|
||||
S^60^1^C^buscar1^base.SqlHandle^^private
|
||||
D^60^155^155^14^0^0
|
||||
X^60^u^172^14^0^
|
||||
X^60^u^156^11^0^
|
||||
X^60^D^155^14^0^
|
||||
S^61^1^C^comando2^base.SqlHandle^^private
|
||||
D^61^214^214^14^0^0
|
||||
X^61^u^215^34^0^
|
||||
X^61^D^214^14^0^
|
||||
S^62^1^C^buscar2^base.SqlHandle^^private
|
||||
D^62^215^215^14^0^0
|
||||
X^62^u^220^14^0^
|
||||
X^62^u^216^11^0^
|
||||
X^62^D^215^14^0^
|
||||
S^63^1^C^busca_ranking^base.SqlHandle^^private
|
||||
D^63^242^242^14^0^0
|
||||
X^63^u^246^14^0^
|
||||
X^63^D^242^14^0^
|
||||
S^64^0^V^status^INTEGER^^builtin
|
||||
F^1^C:\Program Files\FourJs\Genero Studio\fgl\lib/fgl.4gl
|
||||
D^64^15^15^9^1^1
|
||||
X^64^r^227^12^0^
|
||||
X^64^r^179^12^0^
|
||||
X^64^D^15^9^1^
|
||||
S^65^0^V^int_flag^INTEGER^^builtin
|
||||
D^65^15^15^17^1^1
|
||||
X^65^l^123^13^0^
|
||||
X^65^r^120^9^0^
|
||||
X^65^l^90^15^0^
|
||||
X^65^r^87^11^0^
|
||||
X^65^l^64^10^0^
|
||||
X^65^D^15^17^1^
|
||||
S^66^0^V^unidad^CHAR(3)^^global
|
||||
F^2^geprgb000.4gl
|
||||
D^66^4^4^10^2^2
|
||||
X^66^D^4^10^2^
|
||||
S^67^0^V^regi^SMALLINT^^global
|
||||
D^67^5^5^10^2^2
|
||||
X^67^D^5^10^2^
|
||||
S^68^0^V^p_param^CHAR(1)^^global
|
||||
D^68^6^6^10^2^2
|
||||
X^68^D^6^10^2^
|
||||
S^69^0^V^fecha_inicial_py^DATE^^global
|
||||
D^69^8^8^10^2^2
|
||||
X^69^D^8^10^2^
|
||||
S^70^0^V^fecha_final_py^DATE^^global
|
||||
D^70^8^8^27^2^2
|
||||
X^70^D^8^27^2^
|
||||
S^71^0^V^p_fechas^DATE^^global
|
||||
D^71^8^8^42^2^2
|
||||
X^71^D^8^42^2^
|
||||
S^72^0^V^p_companias^RECORD^^global
|
||||
D^72^9^9^10^2^2
|
||||
X^72^r^278^24^0^
|
||||
X^72^l^52^70^0^
|
||||
X^72^l^52^54^0^
|
||||
X^72^l^52^35^0^
|
||||
X^72^D^9^10^2^
|
||||
S^73^72^V^cod_comp^CHAR(5)^decomarmol.companias.cod_comp^
|
||||
D^73^0^0^0^0^0
|
||||
X^73^D^9^10^2^
|
||||
S^74^72^V^nombre^CHAR(100)^decomarmol.companias.nombre^
|
||||
D^74^0^0^0^0^0
|
||||
X^74^D^9^10^2^
|
||||
S^75^72^V^rnc^CHAR(30)^decomarmol.companias.rnc^
|
||||
D^75^0^0^0^0^0
|
||||
X^75^D^9^10^2^
|
||||
S^76^72^V^direccion^CHAR(200)^decomarmol.companias.direccion^
|
||||
D^76^0^0^0^0^0
|
||||
X^76^D^9^10^2^
|
||||
S^77^72^V^telefono^CHAR(25)^decomarmol.companias.telefono^
|
||||
D^77^0^0^0^0^0
|
||||
X^77^D^9^10^2^
|
||||
S^78^72^V^fax^CHAR(25)^decomarmol.companias.fax^
|
||||
D^78^0^0^0^0^0
|
||||
X^78^D^9^10^2^
|
||||
S^79^72^V^administrador^CHAR(100)^decomarmol.companias.administrador^
|
||||
D^79^0^0^0^0^0
|
||||
X^79^D^9^10^2^
|
||||
S^80^72^V^status_t^CHAR(1)^decomarmol.companias.status_t^
|
||||
D^80^0^0^0^0^0
|
||||
X^80^D^9^10^2^
|
||||
S^81^72^V^us_crea^CHAR(50)^decomarmol.companias.us_crea^
|
||||
D^81^0^0^0^0^0
|
||||
X^81^D^9^10^2^
|
||||
S^82^72^V^fech_crea^DATE^decomarmol.companias.fech_crea^
|
||||
D^82^0^0^0^0^0
|
||||
X^82^D^9^10^2^
|
||||
S^83^72^V^us_mod^CHAR(50)^decomarmol.companias.us_mod^
|
||||
D^83^0^0^0^0^0
|
||||
X^83^D^9^10^2^
|
||||
S^84^72^V^fech_mod^DATE^decomarmol.companias.fech_mod^
|
||||
D^84^0^0^0^0^0
|
||||
X^84^D^9^10^2^
|
||||
S^85^72^V^tipo_db^CHAR(30)^decomarmol.companias.tipo_db^
|
||||
D^85^0^0^0^0^0
|
||||
X^85^D^9^10^2^
|
||||
S^86^72^V^usuario^CHAR(50)^decomarmol.companias.usuario^
|
||||
D^86^0^0^0^0^0
|
||||
X^86^D^9^10^2^
|
||||
S^87^72^V^facturacontrolconduce^VARCHAR(10)^decomarmol.companias.facturacontrolconduce^
|
||||
D^87^0^0^0^0^0
|
||||
X^87^D^9^10^2^
|
||||
S^88^72^V^control2factura^VARCHAR(10)^decomarmol.companias.control2factura^
|
||||
D^88^0^0^0^0^0
|
||||
X^88^D^9^10^2^
|
||||
S^89^72^V^rutalogocia^VARCHAR(100)^decomarmol.companias.rutalogocia^
|
||||
D^89^0^0^0^0^0
|
||||
X^89^D^9^10^2^
|
||||
S^90^72^V^controlordenpedidos^VARCHAR(10)^decomarmol.companias.controlordenpedidos^
|
||||
D^90^0^0^0^0^0
|
||||
X^90^D^9^10^2^
|
||||
S^91^72^V^url^VARCHAR(255)^decomarmol.companias.url^
|
||||
D^91^0^0^0^0^0
|
||||
X^91^D^9^10^2^
|
||||
S^92^0^V^normal^CHAR(3)^^global
|
||||
D^92^10^11^10^2^2
|
||||
X^92^D^10^10^2^
|
||||
S^93^0^V^negrilla_on^CHAR(3)^^global
|
||||
D^93^10^11^17^2^2
|
||||
X^93^D^10^17^2^
|
||||
S^94^0^V^negrillas_of^CHAR(3)^^global
|
||||
D^94^10^11^29^2^2
|
||||
X^94^D^10^29^2^
|
||||
S^95^0^V^comp_on^CHAR(3)^^global
|
||||
D^95^10^11^42^2^2
|
||||
X^95^D^10^42^2^
|
||||
S^96^0^V^comp_off^CHAR(3)^^global
|
||||
D^96^10^11^50^2^2
|
||||
X^96^D^10^50^2^
|
||||
S^97^0^V^doce^CHAR(3)^^global
|
||||
D^97^10^11^59^2^2
|
||||
X^97^D^10^59^2^
|
||||
S^98^0^V^doble_on^CHAR(3)^^global
|
||||
D^98^10^11^64^2^2
|
||||
X^98^D^10^64^2^
|
||||
S^99^0^V^doble_off^CHAR(3)^^global
|
||||
D^99^10^11^73^2^2
|
||||
X^99^D^10^73^2^
|
||||
S^100^0^V^cmd^CHAR(150)^^global
|
||||
D^100^12^12^9^2^2
|
||||
X^100^D^12^9^2^
|
||||
S^101^0^V^imprime^CHAR(150)^^global
|
||||
D^101^12^12^13^2^2
|
||||
X^101^D^12^13^2^
|
||||
S^102^0^V^copia^CHAR(150)^^global
|
||||
D^102^12^12^21^2^2
|
||||
X^102^D^12^21^2^
|
||||
S^103^0^V^archivo^CHAR(80)^^global
|
||||
D^103^12^12^37^2^2
|
||||
X^103^D^12^37^2^
|
||||
S^104^0^V^cantidad_total^DECIMAL(10,2)^^global
|
||||
D^104^14^14^10^2^2
|
||||
X^104^D^14^10^2^
|
||||
S^105^0^V^criterio^CHAR(1000)^^global
|
||||
D^105^15^15^10^2^2
|
||||
X^105^r^209^34^0^
|
||||
X^105^r^197^35^0^
|
||||
X^105^r^149^34^0^
|
||||
X^105^r^139^34^0^
|
||||
X^105^l^117^16^0^
|
||||
X^105^D^15^10^2^
|
||||
S^106^0^V^selec4^CHAR(1500)^^global
|
||||
D^106^16^16^10^2^2
|
||||
X^106^D^16^10^2^
|
||||
S^107^0^V^selec^CHAR(1500)^^global
|
||||
D^107^16^16^17^2^2
|
||||
X^107^D^16^17^2^
|
||||
S^108^0^V^selec1^CHAR(1500)^^global
|
||||
D^108^16^16^23^2^2
|
||||
X^108^r^214^28^0^
|
||||
X^108^l^203^10^0^
|
||||
X^108^l^190^10^0^
|
||||
X^108^r^154^28^0^
|
||||
X^108^l^143^10^0^
|
||||
X^108^l^132^10^0^
|
||||
X^108^D^16^23^2^
|
||||
S^109^0^V^selec2^CHAR(1500)^^global
|
||||
D^109^16^16^30^2^2
|
||||
X^109^D^16^30^2^
|
||||
S^110^0^V^selec3^CHAR(1500)^^global
|
||||
D^110^16^16^37^2^2
|
||||
X^110^D^16^37^2^
|
||||
S^111^0^V^manual^CHAR(1)^^global
|
||||
D^111^17^18^10^2^2
|
||||
X^111^D^17^10^2^
|
||||
S^112^0^V^p_status^CHAR(1)^^global
|
||||
D^112^17^18^17^2^2
|
||||
X^112^D^17^17^2^
|
||||
S^113^0^V^decide^CHAR(1)^^global
|
||||
D^113^17^18^26^2^2
|
||||
X^113^D^17^26^2^
|
||||
S^114^0^V^identifica^CHAR(1)^^global
|
||||
D^114^17^18^33^2^2
|
||||
X^114^D^17^33^2^
|
||||
S^115^0^V^modifica^CHAR(1)^^global
|
||||
D^115^17^18^44^2^2
|
||||
X^115^D^17^44^2^
|
||||
S^116^0^V^opc^CHAR(1)^^global
|
||||
D^116^17^18^53^2^2
|
||||
X^116^D^17^53^2^
|
||||
S^117^0^V^bandera^CHAR(1)^^global
|
||||
D^117^17^18^57^2^2
|
||||
X^117^D^17^57^2^
|
||||
S^118^0^V^existe^CHAR(1)^^global
|
||||
D^118^17^18^65^2^2
|
||||
X^118^D^17^65^2^
|
||||
S^119^0^V^verdad^CHAR(1)^^global
|
||||
D^119^18^18^10^2^2
|
||||
X^119^D^18^10^2^
|
||||
S^120^0^V^clasifica^CHAR(1)^^global
|
||||
D^120^18^18^17^2^2
|
||||
X^120^D^18^17^2^
|
||||
S^121^0^V^opcion^CHAR(2)^^global
|
||||
D^121^20^20^10^2^2
|
||||
X^121^D^20^10^2^
|
||||
S^122^0^V^opt^CHAR(2)^^global
|
||||
D^122^20^20^17^2^2
|
||||
X^122^D^20^17^2^
|
||||
S^123^0^V^descrip1^CHAR(60)^^global
|
||||
D^123^21^21^10^2^2
|
||||
X^123^D^21^10^2^
|
||||
S^124^0^V^descrip2^CHAR(60)^^global
|
||||
D^124^21^21^19^2^2
|
||||
X^124^D^21^19^2^
|
||||
S^125^0^V^usuarios^CHAR(50)^^global
|
||||
D^125^22^22^10^2^2
|
||||
X^125^r^51^30^0^
|
||||
X^125^l^46^28^0^
|
||||
X^125^D^22^10^2^
|
||||
S^126^0^V^clave^CHAR(50)^^global
|
||||
D^126^22^22^19^2^2
|
||||
X^126^r^51^45^0^
|
||||
X^126^l^47^28^0^
|
||||
X^126^D^22^19^2^
|
||||
S^127^0^V^descrip3^CHAR(30)^^global
|
||||
D^127^23^23^10^2^2
|
||||
X^127^D^23^10^2^
|
||||
S^128^0^V^descrip4^CHAR(30)^^global
|
||||
D^128^23^23^19^2^2
|
||||
X^128^D^23^19^2^
|
||||
S^129^0^V^descrip_esp1^CHAR(30)^^global
|
||||
D^129^23^23^28^2^2
|
||||
X^129^D^23^28^2^
|
||||
S^130^0^V^nombre_p^CHAR(30)^^global
|
||||
D^130^23^23^41^2^2
|
||||
X^130^D^23^41^2^
|
||||
S^131^0^V^nom_p^CHAR(30)^^global
|
||||
D^131^23^23^50^2^2
|
||||
X^131^D^23^50^2^
|
||||
S^132^0^V^tipo_papel^SMALLINT^^global
|
||||
D^132^24^25^10^2^2
|
||||
X^132^D^24^10^2^
|
||||
S^133^0^V^cuenta^SMALLINT^^global
|
||||
D^133^24^25^21^2^2
|
||||
X^133^D^24^21^2^
|
||||
S^134^0^V^p_act^SMALLINT^^global
|
||||
D^134^24^25^28^2^2
|
||||
X^134^D^24^28^2^
|
||||
S^135^0^V^idx^SMALLINT^^global
|
||||
D^135^24^25^34^2^2
|
||||
X^135^r^247^11^0^
|
||||
X^135^l^245^10^0^
|
||||
X^135^l^219^10^0^
|
||||
X^135^r^186^19^0^
|
||||
X^135^l^186^13^0^
|
||||
X^135^r^180^40^0^
|
||||
X^135^l^171^10^0^
|
||||
X^135^D^24^34^2^
|
||||
S^136^0^V^curr1^SMALLINT^^global
|
||||
D^136^24^25^38^2^2
|
||||
X^136^D^24^38^2^
|
||||
S^137^0^V^curr^SMALLINT^^global
|
||||
D^137^24^25^44^2^2
|
||||
X^137^D^24^44^2^
|
||||
S^138^0^V^fila^SMALLINT^^global
|
||||
D^138^24^25^49^2^2
|
||||
X^138^D^24^49^2^
|
||||
S^139^0^V^linea^SMALLINT^^global
|
||||
D^139^24^25^54^2^2
|
||||
X^139^D^24^54^2^
|
||||
S^140^0^V^scr_l^SMALLINT^^global
|
||||
D^140^24^25^60^2^2
|
||||
X^140^D^24^60^2^
|
||||
S^141^0^V^dia_aduana^SMALLINT^^global
|
||||
D^141^25^25^10^2^2
|
||||
X^141^D^25^10^2^
|
||||
S^142^0^V^num_req_a^SMALLINT^^global
|
||||
D^142^25^25^21^2^2
|
||||
X^142^D^25^21^2^
|
||||
S^143^0^V^numero_msg^SMALLINT^decomarmol.msgtable.cod_msg^global
|
||||
D^143^26^26^10^2^2
|
||||
X^143^r^122^18^0^
|
||||
X^143^l^121^13^0^
|
||||
X^143^r^89^20^0^
|
||||
X^143^l^88^15^0^
|
||||
X^143^D^26^10^2^
|
||||
S^144^0^V^impresor^SMALLINT^^global
|
||||
D^144^27^27^10^2^2
|
||||
X^144^l^48^28^0^
|
||||
X^144^D^27^10^2^
|
||||
S^145^0^V^letras^RECORD^^global
|
||||
D^145^29^38^8^2^2
|
||||
X^145^D^29^8^2^
|
||||
S^146^145^V^negrillas_on^CHAR(6)^^
|
||||
D^146^30^30^8^2^2
|
||||
X^146^D^30^8^2^
|
||||
S^147^145^V^negrillas_off^CHAR(6)^^
|
||||
D^147^31^31^8^2^2
|
||||
X^147^D^31^8^2^
|
||||
S^148^145^V^doble_on^CHAR(6)^^
|
||||
D^148^32^32^8^2^2
|
||||
X^148^D^32^8^2^
|
||||
S^149^145^V^doble_off^CHAR(6)^^
|
||||
D^149^33^33^8^2^2
|
||||
X^149^D^33^8^2^
|
||||
S^150^145^V^comp_on^CHAR(6)^^
|
||||
D^150^34^34^8^2^2
|
||||
X^150^D^34^8^2^
|
||||
S^151^145^V^comp_off^CHAR(6)^^
|
||||
D^151^35^35^8^2^2
|
||||
X^151^D^35^8^2^
|
||||
S^152^145^V^doce^CHAR(6)^^
|
||||
D^152^36^36^8^2^2
|
||||
X^152^D^36^8^2^
|
||||
S^153^145^V^normal^CHAR(6)^^
|
||||
D^153^37^37^8^2^2
|
||||
X^153^D^37^8^2^
|
||||
S^154^0^F^fgl_report_commitCurrentSettings^^^extern
|
||||
X^154^c^164^20^0^
|
||||
S^155^0^F^fgl_report_selectPreview^^^extern
|
||||
X^155^c^163^11^0^
|
||||
S^156^0^F^fgl_report_selectDevice^^^extern
|
||||
X^156^c^162^11^0^
|
||||
S^157^0^F^fgl_report_loadCurrentSettings^^^extern
|
||||
X^157^c^161^9^0^
|
||||
S^158^0^F^seleccionarsalida^^^extern
|
||||
X^158^c^126^11^0^
|
||||
S^159^0^F^msg^^^extern
|
||||
X^159^c^122^14^0^
|
||||
X^159^c^89^16^0^
|
||||
T^17^43^d^0^0^DEFINE
|
||||
T^20^31^d^0^0^RECORD
|
||||
T^44^55^f^0^0^MAIN
|
||||
T^57^254^f^0^0^FUNCTION
|
||||
T^59^62^d^0^0^DEFINE
|
||||
T^76^115^i^0^0^INPUT
|
||||
T^77^84^i^0^0^
|
||||
T^86^114^i^0^0^
|
||||
T^87^92^c^0^0^IF
|
||||
T^88^91^c^0^0^THEN
|
||||
T^114^114^g^0^0^EXIT INPUT
|
||||
T^120^125^c^0^0^IF
|
||||
T^121^124^c^0^0^THEN
|
||||
T^131^152^c^0^0^IF
|
||||
T^132^141^c^0^0^THEN
|
||||
T^142^151^c^0^0^ELSE
|
||||
T^161^252^c^0^0^IF
|
||||
T^162^251^c^0^0^THEN
|
||||
T^172^187^l^0^0^FOREACH
|
||||
T^179^184^c^0^0^IF
|
||||
T^180^183^c^0^0^THEN
|
||||
T^189^212^c^0^0^IF
|
||||
T^190^201^c^0^0^THEN
|
||||
T^202^211^c^0^0^ELSE
|
||||
T^220^239^l^0^0^FOREACH
|
||||
T^227^236^c^0^0^IF
|
||||
T^228^235^c^0^0^THEN
|
||||
T^246^250^l^0^0^FOREACH
|
||||
T^247^249^c^0^0^IF
|
||||
T^248^248^c^0^0^THEN
|
||||
T^256^280^f^0^0^REPORT
|
||||
T^258^261^d^0^0^DEFINE
|
||||
T^266^269^a^0^0^FIRST PAGE HEADER
|
||||
x^269^0^
|
||||
p^v^35
|
||||
T^271^278^a^0^0^ON EVERY ROW
|
||||
x^273^0^
|
||||
p^v^4
|
||||
p^v^5
|
||||
p^v^6
|
||||
p^v^7
|
||||
p^v^8
|
||||
p^v^9
|
||||
p^v^37
|
||||
p^v^10
|
||||
p^v^11
|
||||
p^v^12
|
||||
p^v^14
|
||||
p^v^15
|
||||
p^v^13
|
||||
p^v^74
|
||||
p^v^52
|
||||
p^v^53
|
||||
p^v^36
|
||||
p^v^16
|
||||
@@ -0,0 +1,285 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP014
|
||||
Sistema : Sistema de Informacion Gerencia Minoristas
|
||||
Proceso : Suplidores Con Compras Mayores a X Cantidad Comparativas
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Junio 21,1993
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp14 RECORD
|
||||
cod_sp SMALLINT,
|
||||
cod_sp_sec SMALLINT,
|
||||
nom_sp CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
posicion INTEGER,
|
||||
codigo CHAR(6)
|
||||
END RECORD,
|
||||
cod_sp1 SMALLINT
|
||||
DEFINE selec9 CHAR(1000)
|
||||
DEFINE salir,salir9,compa CHAR(1)
|
||||
DEFINE idx9,idx1,j,m,p,s,s1 INTEGER
|
||||
DEFINE ano19 CHAR(4)
|
||||
DEFINE ano1,mes1 SMALLINT
|
||||
DEFINE nom_mes CHAR(15)
|
||||
|
||||
DEFINE fecha_in,fecha_fi,fecha_in9,fecha_fi9 DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1,cantidad2,cantidad3,cantidad4,cantidad5,cantidad6,
|
||||
cantidad7,cantidad8,cantida9 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp014()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp014 FROM "gefmrp014"
|
||||
DISPLAY FORM gefmrp014
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp014" AT 4,3 ATTRIBUTE(RED)
|
||||
|
||||
DISPLAY "Ranking de Compras Comparativas Ano Anterior" AT 6,18
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME ano1,mes1,cantidad1,cod_sp1
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
AFTER FIELD ano1
|
||||
IF ano1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD ano1
|
||||
END IF
|
||||
|
||||
SELECT fecha_inicio INTO fecha_in FROM prdtable
|
||||
WHERE ano = ano1 AND mes = 1
|
||||
|
||||
SELECT fecha_inicio INTO fecha_in9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = 1
|
||||
|
||||
LET ano19 = ano1 - 1 USING "&&&&"
|
||||
|
||||
BEFORE FIELD mes1
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
AFTER FIELD mes1
|
||||
IF mes1 IS NULL THEN
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
END IF
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi FROM prdtable
|
||||
WHERE ano = ano1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = mes1
|
||||
|
||||
SELECT descrip INTO nom_mes FROM mestable
|
||||
WHERE mes = mes1
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
|
||||
AFTER FIELD cod_sp1
|
||||
IF cod_sp1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_sp1
|
||||
END IF
|
||||
|
||||
SELECT UNIQUE cod_sp FROM cotb00001 WHERE cod_sp = cod_sp1
|
||||
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET numero_msg = 3
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cod_sp1
|
||||
END IF
|
||||
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET selec =
|
||||
"SELECT a.cod_sp,a.cod_sp_sec,c.nom_sp,c.status_t,SUM(a.valor) ",
|
||||
"FROM cptb00001 a,cotb00001 c ",
|
||||
"WHERE (a.status_t IS NULL) AND (a.fecha_orig BETWEEN ? AND ?) AND ",
|
||||
" (a.cod_sp=?) AND (a.cod_sp = c.cod_sp) AND ",
|
||||
" (a.cod_sp_sec = c.cod_sp_sec) AND (a.tipo_doc = 'FT') AND ",
|
||||
" (a.status_t IS NULL) GROUP BY 1,2,3,4 HAVING SUM(a.valor) >= ? ",
|
||||
"ORDER BY 5 DESC,1,2 "
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Actual... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando FROM selec
|
||||
DECLARE buscar CURSOR FOR comando
|
||||
OPEN buscar USING fecha_in,fecha_fi,cod_sp1,cantidad1
|
||||
|
||||
START REPORT gerencia14 TO archivo
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
|
||||
LET idx1 = 0
|
||||
LET idx = 0
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH buscar INTO ger_comp14.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx = idx + 1
|
||||
LET ger_comp14.posicion = idx
|
||||
LET ger_comp14.cantidad1 = 0
|
||||
|
||||
SELECT SUM(a.valor) INTO ger_comp14.cantidad1 FROM cptb00001 a
|
||||
WHERE (a.status_t IS NULL) AND (a.tipo_doc = "FT") AND
|
||||
(a.fecha_orig BETWEEN fecha_in9 AND fecha_fi9) AND
|
||||
(a.cod_sp = ger_comp14.cod_sp) AND
|
||||
(a.cod_sp_sec=ger_comp14.cod_sp_sec)
|
||||
|
||||
IF ger_comp14.cantidad2 IS NULL THEN
|
||||
LET ger_comp14.cantidad2 = 0
|
||||
END IF
|
||||
IF ger_comp14.cantidad1 IS NULL THEN
|
||||
LET ger_comp14.cantidad1 = 0
|
||||
END IF
|
||||
LET ger_comp14.codigo = ger_comp14.cod_sp USING "&&",
|
||||
ger_comp14.cod_sp_sec USING "&&&&"
|
||||
OUTPUT TO REPORT gerencia14(ger_comp14.*)
|
||||
|
||||
END WHILE
|
||||
FINISH REPORT gerencia14
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia14(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
cod_sp SMALLINT,
|
||||
cod_sp_sec SMALLINT,
|
||||
nom_sp CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
posicion INTEGER,
|
||||
codigo CHAR(6)
|
||||
END RECORD
|
||||
DEFINE j ARRAY[5000] OF RECORD
|
||||
codigo CHAR(7),
|
||||
nom_sp CHAR(30),
|
||||
status_t CHAR(1),
|
||||
cantidad1 DECIMAL(14,2),
|
||||
cantidad2 DECIMAL(14,2),
|
||||
posicion1 INTEGER,
|
||||
posicion2 INTEGER
|
||||
END RECORD
|
||||
|
||||
DEFINE mes11 SMALLINT
|
||||
DEFINE nom_mes1 CHAR(15)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE nom_sp_sal CHAR(20)
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.cantidad1 DESC,x.codigo
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.comp_on,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp014",
|
||||
COLUMN 22, "R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 83, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 22, " Sistema de Informacion Gerencial",
|
||||
COLUMN 83, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 12, "Ranking de Compras Comparativas Ano Anterior Mayor A ",
|
||||
cantidad1 USING "#,###,###.##",
|
||||
COLUMN 86, hora
|
||||
|
||||
SKIP 1 LINE
|
||||
PRINT COLUMN 1, "ACUMULADO AL MES DE ",nom_mes CLIPPED
|
||||
PRINT COLUMN 1, "----------------------------------------------------",
|
||||
"--------------------------------------"
|
||||
|
||||
PRINT COLUMN 2, "Posicion",
|
||||
COLUMN 68, "Cantidad"
|
||||
|
||||
PRINT COLUMN 1, ano1 USING "&&&&",
|
||||
COLUMN 6, ano1-1 USING "&&&&",
|
||||
COLUMN 12, "Cliente",
|
||||
COLUMN 63, ano1 USING "&&&&",
|
||||
COLUMN 78, ano1-1 USING "&&&&",
|
||||
COLUMN 85, "Status"
|
||||
|
||||
PRINT COLUMN 1, "----------------------------------------------------",
|
||||
"--------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON EVERY ROW
|
||||
LET idx1 = idx1 + 1
|
||||
LET idx = x.posicion
|
||||
LET j[idx].codigo = x.codigo
|
||||
LET j[idx].nom_sp = x.nom_sp
|
||||
LET j[idx].status_t = x.status_t
|
||||
LET j[idx].cantidad1 = x.cantidad1
|
||||
LET j[idx].cantidad2 = x.cantidad2
|
||||
IF x.cantidad1 = 0 THEN
|
||||
LET j[idx].posicion1 = 0
|
||||
ELSE
|
||||
LET j[idx].posicion1 = idx1
|
||||
END IF
|
||||
LET j[idx].posicion2 = x.posicion
|
||||
|
||||
ON LAST ROW
|
||||
|
||||
FOR idx = 1 TO idx1
|
||||
IF j[idx].posicion2 IS NOT NULL AND j[idx].posicion2 > 0 THEN
|
||||
PRINT COLUMN 1, j[idx].posicion2 USING "##&",
|
||||
COLUMN 6, j[idx].posicion1 USING "##&",
|
||||
COLUMN 15, j[idx].codigo," ",j[idx].nom_sp CLIPPED,
|
||||
COLUMN 55, j[idx].cantidad2 USING "###,###,###.##",
|
||||
COLUMN 70, j[idx].cantidad1 USING "###,###,###.##",
|
||||
COLUMN 87, j[idx].status_t
|
||||
END IF
|
||||
END FOR
|
||||
|
||||
PRINT COLUMN 55, "--------------",
|
||||
COLUMN 70, "--------------"
|
||||
PRINT COLUMN 30, "TOTAL COMPRAS..."," ",
|
||||
COLUMN 55, SUM(x.cantidad2) USING "###,###,###.##",
|
||||
COLUMN 70, SUM(x.cantidad1) USING "###,###,###.##"
|
||||
PRINT COLUMN 1, letras.comp_off,letras.negrillas_off
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,524 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP015
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ranking de Ventas por Vendedor, Compania y Cliente Acumulado
|
||||
Autor : Juan F. Soto
|
||||
Fecha : Mayo 22, 1996.
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp12 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
venta DECIMAL(14,2),
|
||||
venta_ant DECIMAL(14,2),
|
||||
venta_ant1 DECIMAL(14,2),
|
||||
nombre_zona CHAR(20),
|
||||
nombre_prov CHAR(20),
|
||||
nombre CHAR(30)
|
||||
END RECORD,
|
||||
valor_dev DEC(12,2)
|
||||
|
||||
DEFINE ger_comp121 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE ger_comp122 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE ger_comp123 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
ventas DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE nomb,apell CHAR(15),
|
||||
nombre CHAR(30),
|
||||
mov1 SMALLINT,
|
||||
idx1,idx2 INTEGER,
|
||||
venta_ant1,venta_ant2 DECIMAL(12,4) ,
|
||||
desc_mes CHAR(12),
|
||||
valor DEC(12,2)
|
||||
|
||||
DEFINE esta,esta1,salir,salir1,salir2,salir3 CHAR(1),
|
||||
p_ano_ant1,p_ano_ant,p_ano,p_mes SMALLINT
|
||||
DEFINE fecha3,fecha4,fecha1,fecha2,fecha_inicial,fecha_final DATE
|
||||
|
||||
FUNCTION geprrp015()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
CALL pantalla()
|
||||
|
||||
OPEN FORM gefmrp015 FROM "gefmrp015"
|
||||
DISPLAY "geprrp015" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY FORM gefmrp015
|
||||
DISPLAY "Ranking de Ventas Por Vendedor, Compania y Cliente Acumulada"
|
||||
AT 6,10
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
INPUT BY NAME p_ano,p_mes,valor
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
AFTER FIELD p_ano
|
||||
IF p_ano IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
AFTER FIELD p_mes
|
||||
IF p_mes IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_mes
|
||||
END IF
|
||||
|
||||
LET p_ano_ant = p_ano - 1
|
||||
LET p_ano_ant1 = p_ano - 2
|
||||
SELECT fecha_inicio INTO fecha_inicial
|
||||
FROM prdtable
|
||||
WHERE mes = 10 and
|
||||
ano = p_ano
|
||||
SELECT fecha_corte INTO fecha_final
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano
|
||||
|
||||
SELECT fecha_inicio INTO fecha1
|
||||
FROM prdtable
|
||||
WHERE mes = 10 and
|
||||
ano = p_ano_ant
|
||||
SELECT fecha_corte INTO fecha2
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant
|
||||
|
||||
SELECT fecha_inicio INTO fecha3
|
||||
FROM prdtable
|
||||
WHERE mes = 10 and
|
||||
ano = p_ano_ant1
|
||||
|
||||
SELECT fecha_corte INTO fecha4
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant1
|
||||
SELECT descrip INTO desc_mes
|
||||
FROM mestable
|
||||
WHERE mes = p_mes
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio ON a.sec_vend,a.tipo_cliente,a.sec_cliente
|
||||
FROM sec_vend,tipo_cliente,sec_cliente
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
# Creacion Tabla Temporal Para el Reporte
|
||||
CREATE TEMP TABLE geprrp015
|
||||
( sec_vend SMALLINT,
|
||||
cod_cia SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
valor DECIMAL(12,2),
|
||||
valor_ant DECIMAL(12,2),
|
||||
valor_ant1 DECIMAL(12,2)) WITH NO LOG
|
||||
|
||||
CREATE UNIQUE INDEX temp1 ON geprrp015(sec_vend,cod_cia,tipo_cliente,
|
||||
sec_cliente)
|
||||
# Ano Actual
|
||||
LET selec1 =
|
||||
"SELECT b.sec_vend,'1',a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.sub_total -a.monto_desc) ",
|
||||
"FROM vetb00002 a,vetb00028 b,cctb00012 d ",
|
||||
"WHERE a.tipo_cliente = b.tipo_cliente AND a.sec_cliente = b.sec_cliente AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente and ",
|
||||
" a.sec_cliente = d.sec_cliente and d.tipo_negocio = 2 and ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 HAVING SUM(a.sub_total -a.monto_desc) > ? ",
|
||||
"ORDER BY 1,2,5 DESC,3,4 "
|
||||
|
||||
DISPLAY "Buscando Informacion2... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando1 FROM selec1
|
||||
DECLARE buscar1 CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_inicial,fecha_final,valor
|
||||
|
||||
# Ano Anterior
|
||||
LET selec4 =
|
||||
"SELECT b.sec_vend,a.cod_cia,a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.sub_total -a.monto_desc) ",
|
||||
"FROM vetb00002 a,vetb00028 b,cctb00012 d ",
|
||||
"WHERE a.tipo_cliente = b.tipo_cliente AND a.sec_cliente = b.sec_cliente AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente and ",
|
||||
" a.sec_cliente = d.sec_cliente and d.tipo_negocio = 2 and ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 HAVING SUM(a.sub_total -a.monto_desc) > ? ",
|
||||
"ORDER BY 1,2,5 DESC,3,4 "
|
||||
|
||||
DISPLAY "Buscando Ano Anterior... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando2 FROM selec4
|
||||
DECLARE buscar2 CURSOR FOR comando2
|
||||
OPEN buscar2 USING fecha1,fecha2,valor
|
||||
|
||||
# Ano Anterior Anterior
|
||||
LET selec4 =
|
||||
"SELECT b.sec_vend,a.cod_cia,a.tipo_cliente,a.sec_cliente, ",
|
||||
" SUM(a.sub_total -a.monto_desc) ",
|
||||
"FROM vetb00002 a,vetb00028 b,cctb00012 d ",
|
||||
"WHERE a.tipo_cliente = b.tipo_cliente AND a.sec_cliente = b.sec_cliente AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente and ",
|
||||
" a.sec_cliente = d.sec_cliente and d.tipo_negocio = 2 and ",
|
||||
" (a.fecha_factura BETWEEN ? AND ?) AND ",
|
||||
" (a.ventas = '1') AND (a.status_t IS NULL) AND ",criterio CLIPPED,
|
||||
" GROUP BY 1,2,3,4 HAVING SUM(a.sub_total -a.monto_desc) > ? ",
|
||||
"ORDER BY 1,2,5 DESC,3,4 "
|
||||
|
||||
DISPLAY "Buscando Ano Anterior 2... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando3 FROM selec4
|
||||
DECLARE buscar3 CURSOR FOR comando3
|
||||
OPEN buscar3 USING fecha3,fecha4,valor
|
||||
|
||||
START REPORT repor_15 TO archivo
|
||||
|
||||
DISPLAY "Reporte Generandose ... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
LET ger_comp12.sec_vend = 0
|
||||
LET ger_comp12.compania = 0
|
||||
LET ger_comp12.tipo_cliente= 0
|
||||
LET ger_comp12.sec_cliente = 0
|
||||
LET ger_comp12.nombre = " "
|
||||
LET ger_comp12.venta = 0
|
||||
LET ger_comp12.venta_ant = 0
|
||||
LET ger_comp12.venta_ant1 = 0
|
||||
|
||||
LET idx = 1
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar1 INTO ger_comp121.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
# Busca devoluciones por vendedor
|
||||
LET valor_Dev = 0
|
||||
SELECT SUM(a.cantidad*b.precio) INTO valor_dev
|
||||
FROM iptb00023 a,vetb00003 b
|
||||
WHERE (a.fecha BETWEEN fecha_inicial AND
|
||||
fecha_final) AND
|
||||
a.sec_vend = ger_comp121.sec_vend AND
|
||||
(a.sec_cliente = ger_comp121.sec_cliente AND
|
||||
a.cod_n = b.cod_n AND
|
||||
a.cod_grupo = b.cod_grupo AND
|
||||
a.cod_tipo = b.cod_tipo AND
|
||||
a.cod_sec = b.cod_sec) AND
|
||||
(a.factura = b.factura) AND
|
||||
(a.status_t IS NULL)
|
||||
|
||||
IF valor_Dev IS NULL THEN
|
||||
LET valor_dev = 0
|
||||
END IF
|
||||
|
||||
LET ger_comp121.ventas = ger_comp121.ventas - valor_dev
|
||||
|
||||
# Insertar en la tabla temporal
|
||||
INSERT INTO geprrp015 VALUES
|
||||
(ger_comp121.sec_vend,ger_comp121.compania,
|
||||
ger_comp121.tipo_cliente,ger_comp121.sec_cliente,
|
||||
ger_comp121.ventas,0,0)
|
||||
|
||||
END WHILE
|
||||
|
||||
# Busca Las Informaciones del ano anterior
|
||||
LET idx = 1
|
||||
LET salir2 = "N"
|
||||
WHILE salir2 != "S"
|
||||
FETCH buscar2 INTO ger_comp122.*
|
||||
IF status = notfound THEN
|
||||
LET salir2 = "S"
|
||||
LET idx = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
# Busca devoluciones por vendedor
|
||||
LET valor_Dev = 0
|
||||
SELECT SUM(a.cantidad*b.precio) INTO valor_dev
|
||||
FROM iptb00023 a,vetb00003 b
|
||||
WHERE (a.fecha BETWEEN fecha1 AND
|
||||
fecha2) AND
|
||||
a.sec_vend = ger_comp121.sec_vend AND
|
||||
(a.sec_cliente = ger_comp121.sec_cliente AND
|
||||
a.cod_n = b.cod_n AND
|
||||
a.cod_grupo = b.cod_grupo AND
|
||||
a.cod_tipo = b.cod_tipo AND
|
||||
a.cod_sec = b.cod_sec) AND
|
||||
(a.factura = b.factura) AND
|
||||
(a.status_t IS NULL)
|
||||
|
||||
IF valor_Dev IS NULL THEN
|
||||
LET valor_dev = 0
|
||||
END IF
|
||||
LET ger_comp121.ventas= ger_comp121.ventas - valor_dev
|
||||
|
||||
SELECT unique a.sec_cliente FROM geprrp015 a
|
||||
WHERE a.sec_vend = ger_comp122.sec_vend AND
|
||||
a.cod_cia = ger_comp122.compania AND
|
||||
a.tipo_cliente = ger_comp122.tipo_cliente AND
|
||||
a.sec_cliente = ger_comp122.sec_cliente
|
||||
|
||||
IF STATUS != NOTFOUND THEN
|
||||
UPDATE geprrp015 SET valor_ant = ger_comp122.ventas
|
||||
WHERE sec_vend = ger_comp122.sec_vend AND
|
||||
cod_cia = ger_comp122.compania AND
|
||||
tipo_cliente = ger_comp122.tipo_cliente AND
|
||||
sec_cliente = ger_comp122.sec_cliente
|
||||
ELSE
|
||||
INSERT INTO geprrp015 VALUES
|
||||
(ger_comp122.sec_vend,ger_comp122.compania,
|
||||
ger_comp122.tipo_cliente,ger_comp122.sec_cliente,
|
||||
0,ger_comp122.ventas,0)
|
||||
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busca las informaciones del ano anterior anterior
|
||||
LET idx1 = 1
|
||||
LET salir3 = "N"
|
||||
WHILE salir3 != "S"
|
||||
FETCH buscar3 INTO ger_comp123.*
|
||||
IF status = notfound THEN
|
||||
LET salir3 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
# Busca devoluciones por vendedor
|
||||
LET valor_Dev = 0
|
||||
SELECT SUM(a.cantidad*b.precio) INTO valor_dev
|
||||
FROM iptb00023 a,vetb00003 b
|
||||
WHERE (a.fecha BETWEEN fecha3 AND
|
||||
fecha4) AND
|
||||
a.sec_vend = ger_comp121.sec_vend AND
|
||||
(a.sec_cliente = ger_comp121.sec_cliente AND
|
||||
a.cod_n = b.cod_n AND
|
||||
a.cod_grupo = b.cod_grupo AND
|
||||
a.cod_tipo = b.cod_tipo AND
|
||||
a.cod_sec = b.cod_sec) AND
|
||||
(a.factura = b.factura) AND
|
||||
(a.status_t IS NULL)
|
||||
|
||||
IF valor_Dev IS NULL THEN
|
||||
LET valor_dev = 0
|
||||
END IF
|
||||
LET ger_comp121.ventas = ger_comp121.ventas - valor_dev
|
||||
|
||||
SELECT unique a.sec_cliente FROM geprrp015 a
|
||||
WHERE a.sec_vend = ger_comp123.sec_vend AND
|
||||
a.cod_cia = ger_comp123.compania AND
|
||||
a.tipo_cliente = ger_comp123.tipo_cliente AND
|
||||
a.sec_cliente = ger_comp123.sec_cliente
|
||||
|
||||
IF STATUS != NOTFOUND THEN
|
||||
UPDATE geprrp015 SET valor_ant1 = ger_comp123.ventas
|
||||
WHERE sec_vend = ger_comp123.sec_vend AND
|
||||
cod_cia = ger_comp123.compania AND
|
||||
tipo_cliente = ger_comp123.tipo_cliente AND
|
||||
sec_cliente = ger_comp123.sec_cliente
|
||||
ELSE
|
||||
INSERT INTO geprrp015 VALUES
|
||||
(ger_comp123.sec_vend,ger_comp123.compania,
|
||||
ger_comp123.tipo_cliente,ger_comp123.sec_cliente,
|
||||
0,0,ger_comp123.ventas)
|
||||
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
DECLARE temporal CURSOR FOR
|
||||
SELECT a.*,b.descrip,c.nombre_provincia
|
||||
FROM geprrp015 a,vetb00008 b,vetb00020 c,vetb00004 f
|
||||
WHERE a.tipo_cliente = f.tipo_cliente and
|
||||
a.sec_cliente = f.sec_cliente and
|
||||
f.cod_zona = b.cod_zona and
|
||||
f.cod_provincia = c.cod_provincia
|
||||
|
||||
ORDER BY sec_vend,cod_cia,valor DESC,tipo_cliente,sec_cliente
|
||||
|
||||
FOREACH temporal INTO ger_comp12.*
|
||||
OUTPUT TO REPORT repor_15(ger_comp12.*)
|
||||
END FOREACH
|
||||
|
||||
FINISH REPORT repor_15
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT repor_15(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
tipo_cliente SMALLINT,
|
||||
sec_cliente SMALLINT,
|
||||
venta DECIMAL(14,2),
|
||||
venta_ant DECIMAL(14,2),
|
||||
venta_ant1 DECIMAL(14,2),
|
||||
nombre_zona CHAR(20),
|
||||
nombre_prov CHAR(20),
|
||||
nombre CHAR(30)
|
||||
END RECORD
|
||||
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
|
||||
PRINT COLUMN 1, letras.doce,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp015",
|
||||
COLUMN 25, " R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 91, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 25, " Sistema de Informacion Gerencial",
|
||||
COLUMN 91, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 25, "Ranking de Ventas Por Vendedor, Compania y Cliente",
|
||||
COLUMN 94, hora
|
||||
SKIP 1 LINES
|
||||
PRINT COLUMN 25, " ACUMULADO"
|
||||
PRINT COLUMN 1, "Mes De ",desc_mes
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"---------------------------------------------------"
|
||||
|
||||
PRINT COLUMN 63, "Venta",
|
||||
COLUMN 80, "Venta",
|
||||
COLUMN 96, "Venta"
|
||||
|
||||
PRINT COLUMN 1, "Posicion y Cliente",
|
||||
COLUMN 63, p_ano using "####",
|
||||
COLUMN 80, p_ano_ant using "####",
|
||||
COLUMN 96, p_ano_ant1 using "####"
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"---------------------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.sec_vend
|
||||
SKIP TO TOP OF PAGE
|
||||
SELECT UNIQUE a.nom1_emp,a.apell1_emp INTO nomb,apell FROM adtb00003 a
|
||||
WHERE a.num_emp = x.sec_vend
|
||||
|
||||
LET nombre = nomb CLIPPED," ",apell CLIPPED
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "Vendedor: ",x.sec_vend USING "&&&&"," ",nombre,
|
||||
letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
IF x.compania = 1 THEN
|
||||
PRINT COLUMN 1, "Productos Locales", letras.negrillas_off
|
||||
ELSE
|
||||
PRINT COLUMN 1, "Productos Importados", letras.negrillas_off
|
||||
END IF
|
||||
LET idx2 = 0
|
||||
|
||||
ON EVERY ROW
|
||||
SELECT a.nombre INTO x.nombre FROM vetb00004 a
|
||||
WHERE a.tipo_cliente = x.tipo_cliente AND a.sec_cliente = x.sec_cliente
|
||||
|
||||
LET idx2 = idx2 + 1
|
||||
PRINT COLUMN 1, idx2 USING "&&&"," ",
|
||||
x.tipo_cliente USING "&&","-",
|
||||
x.sec_cliente USING "&&&&"," ",
|
||||
" ",x.nombre ," ",x.nombre_zona,x.nombre_prov," ",
|
||||
COLUMN 88, x.venta USING "-,---,---,---.##",
|
||||
COLUMN 106, x.venta_ant USING "-,---,---,---.##",
|
||||
COLUMN 121, x.venta_ant1 USING "-,---,---,---.##"
|
||||
|
||||
AFTER GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "----------------",
|
||||
COLUMN 68, "----------------",
|
||||
COLUMN 85, "----------------"
|
||||
PRINT COLUMN 1, "Total Compania ---> ",
|
||||
COLUMN 51, GROUP SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, GROUP SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
AFTER GROUP OF x.sec_vend
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "----------------",
|
||||
COLUMN 68, "----------------",
|
||||
COLUMN 85, "----------------"
|
||||
PRINT COLUMN 1, "Total Vendedor ---> ",
|
||||
COLUMN 51, GROUP SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, GROUP SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, GROUP SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 51, "================",
|
||||
COLUMN 68, "================",
|
||||
COLUMN 85, "================"
|
||||
PRINT COLUMN 1, "Total General ---> ",
|
||||
COLUMN 51, SUM(x.venta) USING "-,---,---,---.##",
|
||||
COLUMN 68, SUM(x.venta_ant) USING "-,---,---,---.##",
|
||||
COLUMN 85, SUM(x.venta_ant1) USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.normal,letras.negrillas_off
|
||||
END REPORT
|
||||
@@ -0,0 +1,670 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP016
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ranking de Ventas por Vendedor, Compania y Producto Acumulado
|
||||
Autor : Juan F. Soto
|
||||
Fecha : Mayo 22, 1996.
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp131 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
cantidad_ant1 DECIMAL(14,2),
|
||||
codigo CHAR(7),
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med
|
||||
END RECORD,
|
||||
desc_mes CHAR(12),
|
||||
regi1,regi2,regi3 INTEGER
|
||||
|
||||
DEFINE ger_comp132 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE ger_comp133 RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2)
|
||||
END RECORD
|
||||
DEFINE nomb,apell CHAR(15),
|
||||
nombre CHAR(30),
|
||||
p_ano_ant1,p_mes,p_ano,p_ano_ant,mov1 SMALLINT,
|
||||
esta CHAR(1),
|
||||
idx1,idx2 INTEGER,
|
||||
devol1,devol2 DECIMAL(12,4)
|
||||
DEFINE salir,salir1 CHAR(1)
|
||||
DEFINE fecha5,fecha6,fecha1,fecha2,fecha_inicial,fecha_final DATE
|
||||
|
||||
FUNCTION geprrp016()
|
||||
DEFINE p_param CHAR(1)
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
CALL pantalla()
|
||||
|
||||
OPEN FORM gefmrp016 FROM "gefmrp016"
|
||||
DISPLAY "geprrp016" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY FORM gefmrp016
|
||||
DISPLAY "Ranking de Ventas Por Vendedor, Compania y Producto Acumulado"
|
||||
AT 6,10
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME p_ano,p_mes
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
|
||||
|
||||
AFTER FIELD p_ano
|
||||
IF p_ano is null THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
AFTER FIELD p_mes
|
||||
IF p_ano is null THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
LET p_ano_ant = p_ano - 1
|
||||
LET p_ano_ant1 = p_ano_ant - 1
|
||||
|
||||
SELECT fecha_inicio INTO fecha_inicial
|
||||
FROM prdtable
|
||||
WHERE mes = 10 and
|
||||
ano = p_ano
|
||||
|
||||
SELECT fecha_corte INTO fecha_final
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano
|
||||
|
||||
SELECT fecha_inicio INTO fecha1
|
||||
FROM prdtable
|
||||
WHERE mes = 10 and
|
||||
ano = p_ano_ant
|
||||
|
||||
SELECT fecha_corte INTO fecha2
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant
|
||||
|
||||
SELECT fecha_inicio INTO fecha5
|
||||
FROM prdtable
|
||||
WHERE mes = 10 and
|
||||
ano = p_ano_ant1
|
||||
|
||||
SELECT fecha_corte INTO fecha6
|
||||
FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant1
|
||||
SELECT descrip INTO desc_mes
|
||||
FROM mestable
|
||||
WHERE mes = p_mes
|
||||
|
||||
EXIT INPUT
|
||||
END INPUT
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio ON d.sec_vend,b.cod_n,b.cod_grupo,b.cod_tipo,b.cod_sec
|
||||
FROM sec_vend,cod_n,cod_grupo,cod_tipo,cod_sec
|
||||
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
{
|
||||
LET selec1 =
|
||||
"SELECT COUNT(*) ",
|
||||
"FROM vetb00028 a,vetb00002 d ",
|
||||
"WHERE ",
|
||||
" (a.sec_vend = d.sec_vend AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
" a.sec_cliente = d.sec_cliente) AND (",criterio clipped,
|
||||
") AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null "
|
||||
|
||||
PREPARE comando11 FROM selec1
|
||||
DECLARE buscar11 CURSOR FOR comando11
|
||||
OPEN buscar11 USING fecha_inicial,fecha_final
|
||||
FETCH buscar11 INTO regi1
|
||||
}
|
||||
LET selec1 =
|
||||
"SELECT d.sec_vend,b.cod_cia,b.cod_n,b.cod_grupo,",
|
||||
"b.cod_tipo,b.cod_sec, ",
|
||||
" SUM(b.cantidad*b.precio) ",
|
||||
"FROM vetb00028 a,vetb00003 b,vetb00002 d ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
" (a.sec_vend = d.sec_vend AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
" a.sec_cliente = d.sec_cliente) AND (",criterio clipped,
|
||||
") AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null ",
|
||||
" GROUP BY 1,2,3,4,5,6 ORDER BY 1,2,3,4,5,6 "
|
||||
|
||||
DISPLAY "Buscando Informacion... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando1 FROM selec1
|
||||
DECLARE buscar1 SCROLL CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_inicial,fecha_final
|
||||
{
|
||||
LET selec2 =
|
||||
"SELECT COUNT(*) ",
|
||||
"FROM vetb00028 a,vetb00002 d ",
|
||||
"WHERE ",
|
||||
" (a.sec_vend = d.sec_vend AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
" a.sec_cliente = d.sec_cliente) AND (",criterio clipped,
|
||||
") AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null "
|
||||
|
||||
PREPARE comando21 FROM selec2
|
||||
DECLARE buscar21 SCROLL CURSOR FOR comando21
|
||||
OPEN buscar21 USING fecha1,fecha2
|
||||
FETCH buscar21 INTO regi2
|
||||
}
|
||||
LET selec2 =
|
||||
"SELECT d.sec_vend,b.cod_cia,b.cod_n,b.cod_grupo,",
|
||||
"b.cod_tipo,b.cod_sec, ",
|
||||
" SUM(b.cantidad*b.precio) ",
|
||||
"FROM vetb00028 a,vetb00003 b,vetb00002 d ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
" (a.sec_vend = d.sec_vend AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
" a.sec_cliente = d.sec_cliente) AND (",criterio clipped,
|
||||
") AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null ",
|
||||
" GROUP BY 1,2,3,4,5,6 ORDER BY 1,2,3,4,5,6 "
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Anterior... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando2 FROM selec2
|
||||
DECLARE buscar2 SCROLL CURSOR FOR comando2
|
||||
OPEN buscar2 USING fecha1,fecha2
|
||||
{
|
||||
LET selec2 =
|
||||
"SELECT COUNT(*) ",
|
||||
"FROM vetb00028 a,vetb00002 d ",
|
||||
"WHERE ",
|
||||
" (a.sec_vend = d.sec_vend AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
" a.sec_cliente = d.sec_cliente) AND (",criterio clipped,
|
||||
") AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null "
|
||||
|
||||
PREPARE comando31 FROM selec2
|
||||
DECLARE buscar31 SCROLL CURSOR FOR comando31
|
||||
OPEN buscar31 USING fecha5,fecha6
|
||||
FETCH buscar31 INTO regi3
|
||||
}
|
||||
LET selec2 =
|
||||
"SELECT d.sec_vend,b.cod_cia,b.cod_n,b.cod_grupo,",
|
||||
"b.cod_tipo,b.cod_sec, ",
|
||||
" SUM(b.cantidad*b.precio) ",
|
||||
"FROM vetb00028 a,vetb00003 b,vetb00002 d ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
" (a.sec_vend = d.sec_vend AND ",
|
||||
" a.tipo_cliente = d.tipo_cliente AND ",
|
||||
" a.sec_cliente = d.sec_cliente) AND (",criterio clipped,
|
||||
") AND (d.fecha_factura between ? and ?) ",
|
||||
" AND (d.ventas = '1') ",
|
||||
" AND d.status_t is null ",
|
||||
" GROUP BY 1,2,3,4,5,6 ORDER BY 1,2,3,4,5,6 "
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Anterior Anterior... Espere por Favor"
|
||||
AT 17,14 ATTRIBUTE(BOLD)
|
||||
|
||||
PREPARE comando3 FROM selec2
|
||||
DECLARE buscar3 SCROLL CURSOR FOR comando3
|
||||
OPEN buscar3 USING fecha5,fecha6
|
||||
|
||||
START REPORT repor_16 TO archivo
|
||||
|
||||
DISPLAY "Reporte Generandose ... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
# Busqueda de los registros que estan en el ano actual y estan en el
|
||||
# Ano anterior
|
||||
#LET regi = regi1 + regi2 + regi3
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
LET p_param = "S"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar1 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
{
|
||||
CALL termometro(regi,p_param)
|
||||
LET p_param = "N"
|
||||
}
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx1 = idx1 + 1
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
|
||||
# Busqueda de las informaciones del ano anetrior
|
||||
LET ger_comp131.cantidad_ant = 0
|
||||
LET salir = "N"
|
||||
LET idx = 1
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar2 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET ger_comp131.cantidad_ant = ger_comp132.cantidad
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busqueda de las informaciones del ano anetrior anterior
|
||||
LET ger_comp131.cantidad_ant1 = 0
|
||||
LET salir = "N"
|
||||
LET idx = 1
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar3 INTO ger_comp133.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp131.cod_n = ger_comp133.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp133.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp133.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp133.cod_sec and
|
||||
ger_comp131.compania = ger_comp133.compania and
|
||||
ger_comp131.sec_vend = ger_comp133.sec_vend THEN
|
||||
|
||||
LET ger_comp131.cantidad_ant1 = ger_comp133.cantidad
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_16(ger_comp131.*)
|
||||
END IF
|
||||
END WHILE
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
# Busqueda de los registros que estan en el ano anterior y no estan en el
|
||||
# ano Actual
|
||||
LET idx = 1
|
||||
LET idx1 = 1
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar2 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
LET esta = "N"
|
||||
LET idx1 = idx1 + 1
|
||||
LET idx = 1
|
||||
|
||||
# Busqueda de las informaciones del ano actual
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar1 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET esta = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
IF esta = "N" THEN
|
||||
# Busqueda de las informaciones del ano anterior anterior
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar3 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET ger_comp131.cantidad_ant1 = ger_comp132.cantidad
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
LET ger_comp131.cantidad = 0
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_16(ger_comp131.*)
|
||||
END IF
|
||||
END IF
|
||||
END WHILE
|
||||
#-----------------------------------------------------------------------------
|
||||
|
||||
# Busqueda de los registros que estan en el ano anterior anterior y
|
||||
# no estan en el ano Anterior
|
||||
LET idx = 1
|
||||
LET idx1 = 1
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar3 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
|
||||
LET esta = "N"
|
||||
LET idx1 = idx1 + 1
|
||||
LET idx = 1
|
||||
|
||||
# Busqueda de las informaciones del ano Anterior
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar2 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET esta = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busqueda de las informaciones del ano actual
|
||||
LET idx = 1
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar1 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET esta = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
IF esta = "N" THEN
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
LET ger_comp131.cantidad_ant1 = ger_comp131.cantidad
|
||||
LET ger_comp131.cantidad_ant = 0
|
||||
LET ger_comp131.cantidad = 0
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_16(ger_comp131.*)
|
||||
END IF
|
||||
END IF
|
||||
END WHILE
|
||||
FINISH REPORT repor_16
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT repor_16(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
sec_vend INTEGER,
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
cantidad_ant1 DECIMAL(14,2),
|
||||
codigo CHAR(7),
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med
|
||||
END RECORD
|
||||
|
||||
DEFINE hora CHAR(5)
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.sec_vend,x.compania,x.cantidad
|
||||
DESC, x.codigo
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.doce,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp016",
|
||||
COLUMN 25, " R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 91, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 38, "SISTEMA DE INFORMACION GERENCIAL",
|
||||
COLUMN 91, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 25, "Ranking de Ventas Por Vendedor, Compania y Producto",
|
||||
COLUMN 94, hora
|
||||
SKIP 1 LINES
|
||||
PRINT COLUMN 25, " ACUMULADO"
|
||||
PRINT COLUMN 1, "MES DE ",desc_mes
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------"
|
||||
|
||||
PRINT COLUMN 57, "Ventas",
|
||||
COLUMN 75, "Ventas",
|
||||
COLUMN 93, "Ventas"
|
||||
|
||||
PRINT COLUMN 1, "Posicion y Producto",
|
||||
COLUMN 58, p_ano using "####",
|
||||
COLUMN 76, p_ano_ant using "####",
|
||||
COLUMN 94, p_ano_ant1 using "####"
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"-------------------------------------------------"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.sec_vend
|
||||
SKIP TO TOP OF PAGE
|
||||
SELECT UNIQUE a.nom1_emp,a.apell1_emp INTO nomb,apell FROM adtb00003 a
|
||||
WHERE a.num_emp = x.sec_vend
|
||||
|
||||
LET nombre = nomb CLIPPED," ",apell CLIPPED
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "Vendedor: ",x.sec_vend USING "&&&&"," ",nombre,
|
||||
letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
IF x.compania = 1 THEN
|
||||
PRINT COLUMN 1, "Productos Locales", letras.negrillas_off
|
||||
ELSE
|
||||
PRINT COLUMN 1, "Productos Importados", letras.negrillas_off
|
||||
END IF
|
||||
LET idx2 = 0
|
||||
|
||||
AFTER GROUP OF x.codigo
|
||||
LET idx2 = idx2 + 1
|
||||
|
||||
SELECT UNIQUE a.descrip_esp,a.unidad_med INTO x.descrip_esp,x.unidad_med
|
||||
FROM intb00001 a
|
||||
WHERE a.cod_n = x.cod_n AND a.cod_grupo = x.cod_grupo AND
|
||||
a.cod_tipo = x.cod_tipo AND a.cod_sec = x.cod_sec
|
||||
|
||||
PRINT COLUMN 1, idx2 USING "&&&"," ",
|
||||
x.cod_n USING "&","-",x.cod_grupo USING "&","-",
|
||||
x.cod_tipo USING "&&","-",x.cod_sec USING "&&&",
|
||||
" ", x.descrip_esp," ",x.unidad_med CLIPPED,
|
||||
COLUMN 48, GROUP SUM(x.cantidad)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##",
|
||||
COLUMN 65, GROUP SUM(x.cantidad_ant)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##" ,
|
||||
COLUMN 82, GROUP SUM(x.cantidad_ant1)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##"
|
||||
|
||||
AFTER GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 50, "----------------",
|
||||
COLUMN 66, "----------------" ,
|
||||
COLUMN 82, "----------------"
|
||||
PRINT COLUMN 1, "Total Compania ---> ",
|
||||
COLUMN 48, GROUP SUM(x.cantidad)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##",
|
||||
COLUMN 65, GROUP SUM(x.cantidad_ant)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##" ,
|
||||
COLUMN 82, GROUP SUM(x.cantidad_ant1)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
AFTER GROUP OF x.sec_vend
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 48, "----------------",
|
||||
COLUMN 65, "----------------",
|
||||
COLUMN 82, "----------------"
|
||||
PRINT COLUMN 1, "Total Vendedor ---> ",
|
||||
COLUMN 48, GROUP SUM(x.cantidad)
|
||||
USING "-,---,---,---.##",
|
||||
COLUMN 65, GROUP SUM(x.cantidad_ant)
|
||||
USING "-,---,---,---.##" ,
|
||||
COLUMN 82, GROUP SUM(x.cantidad_ant1)
|
||||
USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 48, "================",
|
||||
COLUMN 65, "================" ,
|
||||
COLUMN 82, "================"
|
||||
PRINT COLUMN 1, "Total General ---> ",
|
||||
COLUMN 48, SUM(x.cantidad)
|
||||
USING "-,---,---,---.##",
|
||||
COLUMN 65, SUM(x.cantidad_ant)
|
||||
USING "-,---,---,---.##" ,
|
||||
COLUMN 82, SUM(x.cantidad_ant)
|
||||
USING "-,---,---,---.##"
|
||||
PRINT COLUMN 1, letras.normal,letras.negrillas_off
|
||||
END REPORT
|
||||
@@ -0,0 +1,540 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP013
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Ranking de Ventas por Vendedor, Compania y Producto
|
||||
Autor : Tadeo A. Ferreras
|
||||
Fecha : Enero 18, 1995
|
||||
Modificado Por : Juan Soto, Carlos Franco
|
||||
Descripcion : Se quito las columnas devoluciones y neto. Se Agrego la
|
||||
columna VENTAS DEL ANO ANTERIOR AL ACTUAL.
|
||||
Fecha : MAyo 21, 1996.
|
||||
Modificado Por :Juan Soto
|
||||
Descripcion : Insertar el cliente
|
||||
Fecha : Febrero 28, 2001
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp131 RECORD
|
||||
sec_vend INTEGER,
|
||||
tipo_cliente LIKE vetb00002.tipo_cliente,
|
||||
sec_cliente LIKE vetb00002.sec_cliente,
|
||||
tipo_negocio SMALLINT,
|
||||
descripcion CHAR(30),
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
valor_act DECIMAL(14,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
valor_ant DECIMAL(14,2),
|
||||
codigo CHAR(7),
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med
|
||||
END RECORD,
|
||||
desc_mes CHAR(12),
|
||||
elije CHAR(1)
|
||||
|
||||
DEFINE ger_comp132 RECORD
|
||||
sec_vend INTEGER,
|
||||
tipo_cliente LIKE vetb00002.tipo_cliente,
|
||||
sec_cliente LIKE vetb00002.sec_cliente,
|
||||
tipo_negocio SMALLINT,
|
||||
descripcion CHAR(30),
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
valor_act DECIMAL(14,2)
|
||||
END RECORD
|
||||
|
||||
DEFINE nomb,apell CHAR(15),
|
||||
nombre CHAR(30),
|
||||
p_mes,p_ano,p_ano_ant,mov1 SMALLINT,
|
||||
esta CHAR(1), idx1,idx2 INTEGER,
|
||||
devol1,devol2 DECIMAL(12,4)
|
||||
|
||||
DEFINE salir,salir1 CHAR(1)
|
||||
DEFINE fecha1,fecha2,fecha_inicial,fecha_final DATE
|
||||
|
||||
FUNCTION geprrp020()
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
CALL pantalla()
|
||||
|
||||
OPEN FORM gefmrp020 FROM "gefmrp020"
|
||||
DISPLAY "geprrp020" AT 4,3 ATTRIBUTE(RED)
|
||||
DISPLAY FORM gefmrp020
|
||||
DISPLAY "Ranking de Ventas Por Vendedor, Compania y Producto" AT 6,15
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
CALL defecto(impresor) RETURNING imprime, letras.*, archivo
|
||||
|
||||
INPUT BY NAME p_ano,p_mes, elije
|
||||
|
||||
AFTER FIELD p_ano
|
||||
IF p_ano is null THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
AFTER FIELD p_mes
|
||||
IF p_ano is null THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD p_ano
|
||||
END IF
|
||||
|
||||
LET p_ano_ant = p_ano - 1
|
||||
SELECT MIN(fecha_inicio)INTO fecha_inicial FROM prdtable
|
||||
WHERE ano = p_ano
|
||||
|
||||
SELECT fecha_corte INTO fecha_final FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha1 FROM prdtable
|
||||
WHERE ano = p_ano_ant
|
||||
|
||||
SELECT fecha_corte INTO fecha2 FROM prdtable
|
||||
WHERE mes = p_mes and
|
||||
ano = p_ano_ant
|
||||
|
||||
SELECT descrip INTO desc_mes FROM mestable
|
||||
WHERE mes = p_mes
|
||||
|
||||
AFTER FIELD elije
|
||||
EXIT INPUT
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT criterio ON d.sec_vend,b.cod_n,b.cod_grupo,b.cod_tipo,b.cod_sec
|
||||
FROM sec_vend,cod_n,cod_grupo,cod_tipo,cod_sec
|
||||
ON KEY(CONTROL-P)
|
||||
CALL busca_printer() RETURNING imprime,letras.*, archivo
|
||||
AFTER CONSTRUCT
|
||||
EXIT CONSTRUCT
|
||||
END CONSTRUCT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF elije = "C" THEN #Ordenado por Cliente
|
||||
LET selec1 =
|
||||
"SELECT d.sec_vend, d.tipo_cliente, d.sec_cliente, e.tipo_negocio,",
|
||||
"f.descripcion, b.cod_cia, b.cod_n,b.cod_grupo, b.cod_tipo,",
|
||||
"b.cod_sec, SUM(b.cantidad), SUM(b.cantidad*b.precio) ",
|
||||
"FROM vetb00003 b,vetb00002 d, cctb00012 e, cctb00013 f ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
"(d.fecha_factura between ? and ?) AND ",
|
||||
"(d.ventas = '1') AND ",
|
||||
" d.status_t is null AND ",
|
||||
"(d.sec_cliente = e.sec_cliente) AND ",
|
||||
"(e.tipo_negocio= f.tipo_negocio) AND ",
|
||||
CRITERIO CLIPPED,
|
||||
" GROUP BY 1,2,3,4,5,6,7,8,9,10 ORDER BY 2,3,6,7,8,9,10"
|
||||
|
||||
DISPLAY "Buscando .. Espere por Favor" AT 17,14 ATTRIBUTE(BOLD)
|
||||
|
||||
LET selec2 =
|
||||
"SELECT d.sec_vend, d.tipo_cliente, d.sec_cliente, e.tipo_negocio,",
|
||||
"f.descripcion, b.cod_cia, b.cod_n,b.cod_grupo, b.cod_tipo,",
|
||||
"b.cod_sec, SUM(b.cantidad), SUM(b.cantidad*b.precio) ",
|
||||
"FROM vetb00003 b,vetb00002 d, cctb00012 e, cctb00013 f ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
"(d.fecha_factura between ? and ?) AND ",
|
||||
"(d.ventas = '1') AND ",
|
||||
" d.status_t is null AND ",
|
||||
"(d.sec_cliente = e.sec_cliente) AND ",
|
||||
"(e.tipo_negocio= f.tipo_negocio) AND ",
|
||||
CRITERIO CLIPPED,
|
||||
" GROUP BY 1,2,3,4,5,6,7,8,9,10 ORDER BY 2,3,6,7,8,9,10"
|
||||
|
||||
DISPLAY "Buscando Ano Anterior... Espere " AT 17,14 ATTRIBUTE(BOLD)
|
||||
|
||||
ELSE #Ordenado por Vendedor
|
||||
LET selec1 =
|
||||
"SELECT d.sec_vend, d.tipo_cliente, d.sec_cliente, e.tipo_negocio,",
|
||||
"f.descripcion, b.cod_cia, b.cod_n,b.cod_grupo, b.cod_tipo,",
|
||||
"b.cod_sec, SUM(b.cantidad), SUM(b.cantidad*b.precio) ",
|
||||
"FROM vetb00003 b,vetb00002 d, cctb00012 e, cctb00013 f ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
"(d.fecha_factura between ? and ?) AND ",
|
||||
"(d.ventas = '1') AND ",
|
||||
" d.status_t is null AND ",
|
||||
"(d.sec_cliente = e.sec_cliente) AND ",
|
||||
"(e.tipo_negocio= f.tipo_negocio) AND ",
|
||||
CRITERIO CLIPPED,
|
||||
" GROUP BY 1,2,3,4,5,6,7,8,9,10 ORDER BY 1,6,7,8,9,10"
|
||||
DISPLAY "Buscando .. Espere por Favor" AT 17,14 ATTRIBUTE(BOLD)
|
||||
|
||||
LET selec2 =
|
||||
"SELECT d.sec_vend, d.tipo_cliente, d.sec_cliente, e.tipo_negocio,",
|
||||
"f.descripcion, b.cod_cia, b.cod_n,b.cod_grupo, b.cod_tipo,",
|
||||
"b.cod_sec, SUM(b.cantidad), SUM(b.cantidad*b.precio) ",
|
||||
"FROM vetb00003 b,vetb00002 d, cctb00012 e, cctb00013 f ",
|
||||
"WHERE (b.factura = d.factura) AND ",
|
||||
"(d.fecha_factura between ? and ?) AND ",
|
||||
"(d.ventas = '1') AND ",
|
||||
" d.status_t is null AND ",
|
||||
"(d.sec_cliente = e.sec_cliente) AND ",
|
||||
"(e.tipo_negocio= f.tipo_negocio) AND ",
|
||||
CRITERIO CLIPPED,
|
||||
" GROUP BY 1,2,3,4,5,6,7,8,9,10 ORDER BY 1,6,7,8,9,10"
|
||||
|
||||
DISPLAY "Buscando Ano Anterior... " AT 17,14 ATTRIBUTE(BOLD)
|
||||
END IF
|
||||
|
||||
PREPARE comando1 FROM selec1
|
||||
DECLARE buscar1 SCROLL CURSOR FOR comando1
|
||||
OPEN buscar1 USING fecha_inicial,fecha_final
|
||||
|
||||
PREPARE comando2 FROM selec2
|
||||
DECLARE buscar2 SCROLL CURSOR FOR comando2
|
||||
OPEN buscar2 USING fecha1,fecha2
|
||||
|
||||
START REPORT repor_20 TO archivo
|
||||
DISPLAY "Reporte Generandose ... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
# Busqueda de los registros que estan en el ano actual y en el anterior
|
||||
LET idx1 = 0
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH buscar1 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
LET idx1 = idx1 + 1
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
|
||||
IF ger_comp131.valor_act IS NULL THEN
|
||||
LET ger_comp131.valor_act = 0
|
||||
END IF
|
||||
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
LET ger_comp131.cantidad_ant = 0
|
||||
LET ger_comp131.valor_ant = 0
|
||||
|
||||
# Busqueda de las informaciones del ano anetrior
|
||||
LET salir = "N"
|
||||
LET idx = 1
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar2 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET ger_comp131.cantidad_ant = ger_comp132.cantidad
|
||||
LET ger_comp131.valor_ant = ger_comp132.valor_act
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_20(ger_comp131.*)
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
# Busqueda de los registros que estan en el ano anterior y no en ano Actual
|
||||
LET idx = 1
|
||||
LET idx1 = 1
|
||||
LET salir1 = "N"
|
||||
WHILE salir1 != "S"
|
||||
FETCH ABSOLUTE idx1 buscar2 INTO ger_comp131.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir1 = "S"
|
||||
LET idx1 = 1
|
||||
EXIT WHILE
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
IF ger_comp131.cantidad IS NULL THEN
|
||||
LET ger_comp131.cantidad = 0
|
||||
END IF
|
||||
LET esta = "N"
|
||||
LET idx1 = idx1 + 1
|
||||
LET idx = 1
|
||||
|
||||
# Busqueda de las informaciones del ano actual
|
||||
LET salir = "N"
|
||||
WHILE salir != "S"
|
||||
FETCH ABSOLUTE idx buscar1 INTO ger_comp132.*
|
||||
IF STATUS = NOTFOUND THEN
|
||||
LET salir = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
LET idx = idx + 1
|
||||
display
|
||||
ger_comp131.cod_n ," ",
|
||||
ger_comp131.cod_grupo ," ",
|
||||
ger_comp131.cod_tipo ," ",
|
||||
ger_comp131.cod_sec ," ",
|
||||
ger_comp131.compania ," ",
|
||||
ger_comp131.sec_vend ," " AT 8,50
|
||||
display
|
||||
ger_comp132.cod_n ," ",
|
||||
ger_comp132.cod_grupo ," ",
|
||||
ger_comp132.cod_tipo ," ",
|
||||
ger_comp132.cod_sec ," ",
|
||||
ger_comp132.compania ," ",
|
||||
ger_comp132.sec_vend ," " AT 9,50
|
||||
|
||||
display idx1," ",esta AT 10,50
|
||||
|
||||
IF ger_comp131.cod_n = ger_comp132.cod_n and
|
||||
ger_comp131.cod_grupo = ger_comp132.cod_grupo and
|
||||
ger_comp131.cod_tipo = ger_comp132.cod_tipo and
|
||||
ger_comp131.cod_sec = ger_comp132.cod_sec and
|
||||
ger_comp131.compania = ger_comp132.compania and
|
||||
ger_comp131.sec_vend = ger_comp132.sec_vend THEN
|
||||
|
||||
LET esta = "S"
|
||||
EXIT WHILE
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
IF esta = "N" THEN
|
||||
LET ger_comp131.codigo = ger_comp131.cod_n using "&",
|
||||
ger_comp131.cod_grupo using "&",
|
||||
ger_comp131.cod_tipo using "&&",
|
||||
ger_comp131.cod_sec using "&&&"
|
||||
display
|
||||
ger_comp131.cod_n ," ",
|
||||
ger_comp131.cod_grupo ," ",
|
||||
ger_comp131.cod_tipo ," ",
|
||||
ger_comp131.cod_sec ," ",
|
||||
ger_comp131.compania ," ",
|
||||
ger_comp131.sec_vend ," " AT 12,50
|
||||
|
||||
LET ger_comp131.cantidad_ant = ger_comp131.cantidad
|
||||
LET ger_comp131.valor_ant = ger_comp131.valor_act
|
||||
LET ger_comp131.cantidad = 0
|
||||
LET ger_comp131.valor_act= 0
|
||||
|
||||
IF ger_comp131.codigo != "0000000" THEN
|
||||
OUTPUT TO REPORT repor_20(ger_comp131.*)
|
||||
END IF
|
||||
END IF
|
||||
END WHILE
|
||||
|
||||
FINISH REPORT repor_20
|
||||
RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT repor_20(x)
|
||||
|
||||
DEFINE x RECORD
|
||||
sec_vend INTEGER,
|
||||
tipo_cliente LIKE vetb00002.tipo_cliente,
|
||||
sec_cliente LIKE vetb00002.sec_cliente,
|
||||
tipo_negocio SMALLINT,
|
||||
descripcion CHAR(30),
|
||||
compania SMALLINT,
|
||||
cod_n SMALLINT,
|
||||
cod_grupo SMALLINT,
|
||||
cod_tipo SMALLINT,
|
||||
cod_sec SMALLINT,
|
||||
cantidad DECIMAL(14,2),
|
||||
cantidad_ant DECIMAL(14,2),
|
||||
valor_act DECIMAL(14,2),
|
||||
valor_ant DECIMAL(14,2),
|
||||
codigo CHAR(7),
|
||||
descrip_esp LIKE intb00001.descrip_esp,
|
||||
unidad_med LIKE intb00001.unidad_med
|
||||
END RECORD,
|
||||
ventas,ventas_ant DECIMAL(12,2)
|
||||
|
||||
DEFINE hora CHAR(5),
|
||||
nombre_cli LIKE vetb00004.nombre
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
ORDER BY x.sec_vend,x.compania,x.cantidad
|
||||
DESC, x.codigo
|
||||
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET hora = time
|
||||
PRINT COLUMN 1, letras.comp_on,letras.negrillas_on
|
||||
PRINT COLUMN 1, "geprrp020",
|
||||
COLUMN 25, " R A Y . O . V A C D O M I N I C A N A, S. A.",
|
||||
COLUMN 91, "Pag. ", pageno using "###"
|
||||
PRINT COLUMN 38, "SISTEMA DE INFORMACION GERENCIAL",
|
||||
COLUMN 91, today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 25, "Ranking de Ventas Por Vendedor, Compania y Producto",
|
||||
COLUMN 94, hora
|
||||
SKIP 1 LINES
|
||||
|
||||
PRINT COLUMN 1, "HASTA MES DE ",desc_mes
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"------------------------------------------",
|
||||
"----------------------------------------------"
|
||||
|
||||
PRINT COLUMN 65, "Unidades",
|
||||
COLUMN 80, "Valores",
|
||||
COLUMN 95, "Unidades",
|
||||
COLUMN 110, "Valores"
|
||||
|
||||
PRINT COLUMN 65, "Vendidas",
|
||||
COLUMN 80, "Vendidos",
|
||||
COLUMN 95, "Vendidas",
|
||||
COLUMN 110, "Vendidos"
|
||||
|
||||
PRINT COLUMN 1, "Posicion y Producto",
|
||||
COLUMN 65, p_ano_ant using "####",
|
||||
COLUMN 80, p_ano_ant using "####",
|
||||
COLUMN 95, p_ano using "####",
|
||||
COLUMN 110, p_ano using "####",
|
||||
COLUMN 127, "Tipo Neg."
|
||||
|
||||
PRINT COLUMN 1, "-------------------------------------------------",
|
||||
"------------------------------------------",
|
||||
"---------------------------------------------"
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.sec_vend
|
||||
SKIP TO TOP OF PAGE
|
||||
SELECT UNIQUE a.nom1_emp,a.apell1_emp INTO nomb,apell FROM adtb00003 a
|
||||
WHERE a.num_emp = x.sec_vend
|
||||
LET nombre = nomb CLIPPED," ",apell CLIPPED
|
||||
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 1, "Vendedor: ",x.sec_vend USING "&&&&"," ",nombre,
|
||||
letras.negrillas_off
|
||||
|
||||
BEFORE GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
IF x.compania = 1 THEN
|
||||
PRINT COLUMN 1, "Productos Locales", letras.negrillas_off
|
||||
ELSE
|
||||
PRINT COLUMN 1, "Productos Importados", letras.negrillas_off
|
||||
END IF
|
||||
LET idx2 = 0
|
||||
|
||||
AFTER GROUP OF x.codigo
|
||||
LET idx2 = idx2 + 1
|
||||
|
||||
SELECT UNIQUE a.descrip_esp,a.unidad_med INTO x.descrip_esp,x.unidad_med
|
||||
FROM intb00001 a
|
||||
WHERE a.cod_n = x.cod_n AND a.cod_grupo = x.cod_grupo AND
|
||||
a.cod_tipo = x.cod_tipo AND a.cod_sec= x.cod_sec
|
||||
|
||||
LET ventas = GROUP SUM(x.cantidad)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
|
||||
LET ventas_ant = GROUP SUM(x.cantidad_ant)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
|
||||
PRINT COLUMN 1, idx2 USING "&&&"," ",
|
||||
x.cod_n USING "&","-",x.cod_grupo USING "&","-",
|
||||
x.cod_tipo USING "&&","-",x.cod_sec USING "&&&",
|
||||
" ", x.descrip_esp[1,40]," ",x.unidad_med CLIPPED,
|
||||
COLUMN 46, ventas_ant USING "###,###,###,###",
|
||||
COLUMN 61, GROUP SUM(x.valor_ant) USING "###,###,###,###",
|
||||
COLUMN 76, ventas USING "###,###,###,###",
|
||||
COLUMN 91, GROUP SUM(x.valor_act)USING "###,###,###,###",
|
||||
COLUMN 127, x.descripcion clipped
|
||||
|
||||
AFTER GROUP OF x.compania
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 61, "----------------",
|
||||
COLUMN 76, "----------------",
|
||||
COLUMN 91, "----------------",
|
||||
COLUMN 106, "----------------"
|
||||
|
||||
LET ventas = GROUP SUM(x.cantidad)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
LET ventas_ant = GROUP SUM(x.cantidad_ant)
|
||||
WHERE x.sec_vend = x.sec_vend
|
||||
|
||||
PRINT COLUMN 1, "Total Compania ---> ",
|
||||
COLUMN 61, ventas_ant USING "###,###,###,###",
|
||||
COLUMN 76, GROUP SUM(x.valor_ant) USING "###,###,###,###",
|
||||
COLUMN 91, ventas USING "###,###,###,###",
|
||||
COLUMN 106, GROUP SUM(x.valor_act)USING "###,###,###,###"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
AFTER GROUP OF x.sec_vend
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 61, "----------------",
|
||||
COLUMN 76, "----------------",
|
||||
COLUMN 91, "----------------",
|
||||
COLUMN 106,"----------------"
|
||||
|
||||
LET ventas = GROUP SUM(x.cantidad)
|
||||
LET ventas_ant = GROUP SUM(x.cantidad_ant)
|
||||
|
||||
PRINT COLUMN 1, "Total Vendedor ---> ",
|
||||
COLUMN 61, ventas_ant USING "###,###,###,###",
|
||||
COLUMN 76, GROUP SUM(x.valor_ant) USING "###,###,###,###",
|
||||
COLUMN 91, ventas USING "###,###,###,###",
|
||||
COLUMN 106, GROUP SUM(x.valor_act)USING "###,###,###,###"
|
||||
PRINT COLUMN 1, letras.negrillas_off
|
||||
|
||||
ON LAST ROW
|
||||
PRINT COLUMN 1, letras.negrillas_on
|
||||
PRINT COLUMN 61, "================",
|
||||
COLUMN 76, "================",
|
||||
COLUMN 91, "================",
|
||||
COLUMN 106, "================"
|
||||
|
||||
PRINT COLUMN 1, "Total General ---> ",
|
||||
COLUMN 61, SUM(x.cantidad_ant) USING "###,###,###,###",
|
||||
COLUMN 76, SUM(x.valor_ant) USING "###,###,###,###",
|
||||
COLUMN 91, SUM(x.cantidad) USING "###,###,###,###",
|
||||
COLUMN 106, SUM(x.valor_act)USING "###,###,###,###"
|
||||
PRINT COLUMN 1, letras.normal,letras.negrillas_off
|
||||
END REPORT
|
||||
@@ -0,0 +1,240 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP021
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Clientes con Ventas Mayores a X Cantidad X Tipo de Negocio
|
||||
Autor : Ing. Juan Francisco Soto
|
||||
Fecha : Abril 28, 2003
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp10 RECORD LIKE ranking.*,
|
||||
cod1 SMALLINT,
|
||||
ventas_dev1,ventas_dev2,ventas_totales1,ventas_totales2 DECIMAL(12,2),
|
||||
archivo,filename,sysos CHAR(120),
|
||||
cels CHAR(20),
|
||||
cnt,n,dep_ant,n_row,ppresenta SMALLINT
|
||||
|
||||
|
||||
DEFINE selec9 CHAR(1000)
|
||||
DEFINE salir,salir9,compa CHAR(1)
|
||||
DEFINE idx9,idx1,j,m,p,s,s1 INTEGER
|
||||
DEFINE ano19 CHAR(4)
|
||||
DEFINE ano1,mes1 SMALLINT
|
||||
DEFINE nom_mes CHAR(15)
|
||||
|
||||
DEFINE fecha_in,fecha_fi,fecha_in9,fecha_fi9 DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1,cantidad2,cantidad3,cantidad4,cantidad5,cantidad6,
|
||||
cantidad7,cantidad8,cantida9 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp021()
|
||||
DEFINE pceldas RECORD LIKE celdas.*
|
||||
|
||||
DEFINE anos RECORD
|
||||
|
||||
ano LIKE ranking.ano,
|
||||
negocio LIKE ventas_pilas.negocio,
|
||||
nombre LIKE ventas_pilas.nombre_cliente,
|
||||
tamano LIKE ventas_pilas.tamano,
|
||||
unidades LIKE ventas_pilas.unidades,
|
||||
celda LIKE ventas_pilas.celda
|
||||
END RECORD
|
||||
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp009 FROM "gefmrp009"
|
||||
DISPLAY FORM gefmrp009
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp010" AT 4,3 ATTRIBUTE(RED)
|
||||
|
||||
DISPLAY "Ranking de Clientes por Tipo de Negocios" AT 6,20
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
INPUT BY NAME ano1,mes1,cantidad1
|
||||
AFTER FIELD ano1
|
||||
IF ano1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD ano1
|
||||
END IF
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in9 FROM prdtable
|
||||
WHERE ano = ano1 - 1
|
||||
|
||||
LET ano19 = ano1 - 1 USING "&&&&"
|
||||
|
||||
BEFORE FIELD mes1
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
AFTER FIELD mes1
|
||||
IF mes1 IS NULL THEN
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
END IF
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in FROM prdtable
|
||||
WHERE ano = ano1 #and mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi FROM prdtable
|
||||
WHERE ano = ano1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = mes1
|
||||
|
||||
SELECT descrip INTO nom_mes FROM mestable
|
||||
WHERE mes = mes1
|
||||
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT BY NAME criterio ON a.tipo_cliente,a.sec_cliente
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
DECLARE buscar CURSOR FOR
|
||||
{ SELECT a.* FROM ranking a
|
||||
WHERE a.tipo_cliente =12
|
||||
ORDER BY a.ano,a.negocio,a.sec_cliente,a.mes,a.ano }
|
||||
|
||||
select a.ano,a.negocio,a.nombre_cliente,a.tamano,a.unidades,a.celda
|
||||
FROM ventas_pilas a
|
||||
ORDER BY 2,3,4,1
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Actual... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
|
||||
--# CALL fgl_init4js()
|
||||
|
||||
START REPORT gerencia21 TO "c:\\archivo"
|
||||
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
--# CALL fgl_init4js()
|
||||
|
||||
--# LET archivo = NULL
|
||||
--# LET filename = NULL
|
||||
--# LET filename = FGL_GETENV("USPROGRAM")
|
||||
|
||||
--# LET archivo = "h:\\\\Formularios\\\\geprrp021b.XLS"
|
||||
--# LET filename = filename CLIPPED," h:\\\\Formularios\\\\geprrp021b.XLS"
|
||||
|
||||
--# IF winexec(filename) THEN
|
||||
|
||||
--# IF DDEconnect("EXCEL",archivo) THEN
|
||||
|
||||
LET idx = 7
|
||||
|
||||
FOREACH buscar INTO anos.*
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
OUTPUT TO REPORT gerencia21(anos.*)
|
||||
END FOREACH
|
||||
|
||||
FINISH REPORT gerencia21
|
||||
END IF
|
||||
END IF
|
||||
# RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia21(x)
|
||||
|
||||
# DEFINE x RECORD LIKE ranking.*
|
||||
DEFINE x RECORD
|
||||
ano LIKE ranking.ano,
|
||||
negocio LIKE ventas_pilas.negocio,
|
||||
nombre LIKE ventas_pilas.nombre_cliente,
|
||||
tamano LIKE ventas_pilas.tamano,
|
||||
unidades LIKE ventas_pilas.unidades,
|
||||
celda LIKE ventas_pilas.celda
|
||||
END RECORD
|
||||
|
||||
DEFINE mes11,cuenta SMALLINT
|
||||
DEFINE nom_mes1 CHAR(15)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE nombre_sal CHAR(20),
|
||||
limite LIKE vetb00004.limite_credito,
|
||||
hora CHAR(5),
|
||||
J RECORD LIKE celdas.*
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
|
||||
BEFORE GROUP OF x.negocio
|
||||
LET idx = idx + 1
|
||||
LET cels = "R",idx USING "<<<<","C1"
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.negocio) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
LET idx = idx + 2
|
||||
|
||||
BEFORE GROUP OF x.nombre
|
||||
LET cels = "R",idx USING "<<<<","C1"
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.nombre) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
LET cels = "R",idx USING "<<<<","C3"
|
||||
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.tamano) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
LET cels = "R",idx USING "<<<<","C",x.celda USING "<<"
|
||||
|
||||
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.unidades) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
AFTER GROUP OF x.tamano
|
||||
LET idx = idx + 1
|
||||
|
||||
|
||||
AFTER GROUP OF x.nombre
|
||||
LET idx = idx + 1
|
||||
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,226 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP021
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Clientes con Ventas Mayores a X Cantidad X Tipo de Negocio
|
||||
Autor : Ing. Juan Francisco Soto
|
||||
Fecha : Abril 28, 2003
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp10 RECORD LIKE ranking.*,
|
||||
cod1 SMALLINT,
|
||||
ventas_dev1,ventas_dev2,ventas_totales1,ventas_totales2 DECIMAL(12,2),
|
||||
archivo,filename,sysos CHAR(120),
|
||||
cels CHAR(20),
|
||||
cnt,n,dep_ant,n_row,ppresenta SMALLINT
|
||||
|
||||
|
||||
DEFINE selec9 CHAR(1000)
|
||||
DEFINE salir,salir9,compa CHAR(1)
|
||||
DEFINE idx9,idx1,j,m,p,s,s1 INTEGER
|
||||
DEFINE ano19 CHAR(4)
|
||||
DEFINE ano1,mes1 SMALLINT
|
||||
DEFINE nom_mes CHAR(15)
|
||||
|
||||
DEFINE fecha_in,fecha_fi,fecha_in9,fecha_fi9 DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1,cantidad2,cantidad3,cantidad4,cantidad5,cantidad6,
|
||||
cantidad7,cantidad8,cantida9 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp021()
|
||||
DEFINE pceldas RECORD LIKE celdas.*
|
||||
|
||||
DEFINE anos RECORD
|
||||
ano LIKE ranking.ano,
|
||||
negocio LIKE veprrp037.negocio,
|
||||
producto LIKE veprrp037.producto,
|
||||
tamano LIKE veprrp037.tamano,
|
||||
unidades LIKE veprrp037.unidades,
|
||||
precio LIKE veprrp037.precio,
|
||||
celda LIKE ranking.celda
|
||||
END RECORD
|
||||
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp009 FROM "gefmrp009"
|
||||
DISPLAY FORM gefmrp009
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp010" AT 4,3 ATTRIBUTE(RED)
|
||||
|
||||
DISPLAY "Ranking de Clientes por Tipo de Negocios" AT 6,20
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
INPUT BY NAME ano1,mes1,cantidad1
|
||||
AFTER FIELD ano1
|
||||
IF ano1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD ano1
|
||||
END IF
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in9 FROM prdtable
|
||||
WHERE ano = ano1 - 1
|
||||
|
||||
LET ano19 = ano1 - 1 USING "&&&&"
|
||||
|
||||
BEFORE FIELD mes1
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
AFTER FIELD mes1
|
||||
IF mes1 IS NULL THEN
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
END IF
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in FROM prdtable
|
||||
WHERE ano = ano1 #and mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi FROM prdtable
|
||||
WHERE ano = ano1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = mes1
|
||||
|
||||
SELECT descrip INTO nom_mes FROM mestable
|
||||
WHERE mes = mes1
|
||||
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT BY NAME criterio ON a.tipo_cliente,a.sec_cliente
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
DECLARE buscar CURSOR FOR
|
||||
{ SELECT a.* FROM ranking a
|
||||
WHERE a.tipo_cliente =12
|
||||
ORDER BY a.ano,a.negocio,a.sec_cliente,a.mes,a.ano }
|
||||
|
||||
select ano,negocio,nombre,sum(valor),celda from ranking WHERE TIPO_CLIENTE = 12
|
||||
group by 1,2,3,5
|
||||
order by negocio,nombre,ano,4 desc
|
||||
DISPLAY "Buscando Informacion Ano Actual... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
|
||||
--# CALL fgl_init4js()
|
||||
|
||||
START REPORT gerencia21 TO "c:\\archivo"
|
||||
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
--# CALL fgl_init4js()
|
||||
|
||||
--# LET archivo = NULL
|
||||
--# LET filename = NULL
|
||||
--# LET filename = FGL_GETENV("USPROGRAM")
|
||||
|
||||
--# LET archivo = "h:\\\\Formularios\\\\geprrp021b.XLS"
|
||||
--# LET filename = filename CLIPPED," h:\\\\Formularios\\\\geprrp021b.XLS"
|
||||
|
||||
--# IF winexec(filename) THEN
|
||||
|
||||
--# IF DDEconnect("EXCEL",archivo) THEN
|
||||
|
||||
LET idx = 9
|
||||
|
||||
FOREACH buscar INTO anos.*
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
OUTPUT TO REPORT gerencia21(anos.*)
|
||||
END FOREACH
|
||||
|
||||
FINISH REPORT gerencia21
|
||||
END IF
|
||||
END IF
|
||||
# RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia21(x)
|
||||
|
||||
# DEFINE x RECORD LIKE ranking.*
|
||||
DEFINE x RECORD
|
||||
ano LIKE ranking.ano,
|
||||
negocio LIKE ranking.negocio,
|
||||
nombre LIKE ranking.nombre,
|
||||
valor LIKE ranking.valor,
|
||||
celda LIKE ranking.celda
|
||||
END RECORD
|
||||
|
||||
DEFINE mes11,cuenta SMALLINT
|
||||
DEFINE nom_mes1 CHAR(15)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE nombre_sal CHAR(20),
|
||||
limite LIKE vetb00004.limite_credito,
|
||||
hora CHAR(5),
|
||||
J RECORD LIKE celdas.*
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
|
||||
BEFORE GROUP OF x.negocio
|
||||
LET cels = "R",idx USING "<<<<","C2"
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.negocio) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
LET idx = idx + 2
|
||||
|
||||
BEFORE GROUP OF x.nombre
|
||||
LET cels = "R",idx USING "<<<<","C2"
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.nombre) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
LET cels = "R",idx USING "<<<<","C",x.celda USING "<<"
|
||||
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.valor) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
|
||||
|
||||
AFTER GROUP OF x.nombre
|
||||
LET idx = idx + 1
|
||||
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,226 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP021
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Clientes con Ventas Mayores a X Cantidad X Tipo de Negocio
|
||||
Autor : Ing. Juan Francisco Soto
|
||||
Fecha : Abril 28, 2003
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp10 RECORD LIKE ranking.*,
|
||||
cod1 SMALLINT,
|
||||
ventas_dev1,ventas_dev2,ventas_totales1,ventas_totales2 DECIMAL(12,2),
|
||||
archivo,filename,sysos CHAR(120),
|
||||
cels CHAR(20),
|
||||
cnt,n,dep_ant,n_row,ppresenta SMALLINT
|
||||
|
||||
|
||||
DEFINE selec9 CHAR(1000)
|
||||
DEFINE salir,salir9,compa CHAR(1)
|
||||
DEFINE idx9,idx1,j,m,p,s,s1 INTEGER
|
||||
DEFINE ano19 CHAR(4)
|
||||
DEFINE ano1,mes1 SMALLINT
|
||||
DEFINE nom_mes CHAR(15)
|
||||
|
||||
DEFINE fecha_in,fecha_fi,fecha_in9,fecha_fi9 DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1,cantidad2,cantidad3,cantidad4,cantidad5,cantidad6,
|
||||
cantidad7,cantidad8,cantida9 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp021()
|
||||
DEFINE pceldas RECORD LIKE celdas.*
|
||||
|
||||
DEFINE anos RECORD
|
||||
|
||||
ano LIKE ranking.ano,
|
||||
negocio LIKE ventas_pilas.negocio,
|
||||
nombre LIKE ventas_pilas.nombre_cliente,
|
||||
unidades LIKE ventas_pilas.unidades,
|
||||
celda LIKE ventas_pilas.celda
|
||||
END RECORD
|
||||
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp009 FROM "gefmrp009"
|
||||
DISPLAY FORM gefmrp009
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp010" AT 4,3 ATTRIBUTE(RED)
|
||||
|
||||
DISPLAY "Ranking de Clientes por Tipo de Negocios" AT 6,20
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
INPUT BY NAME ano1,mes1,cantidad1
|
||||
AFTER FIELD ano1
|
||||
IF ano1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD ano1
|
||||
END IF
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in9 FROM prdtable
|
||||
WHERE ano = ano1 - 1
|
||||
|
||||
LET ano19 = ano1 - 1 USING "&&&&"
|
||||
|
||||
BEFORE FIELD mes1
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
AFTER FIELD mes1
|
||||
IF mes1 IS NULL THEN
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
END IF
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in FROM prdtable
|
||||
WHERE ano = ano1 #and mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi FROM prdtable
|
||||
WHERE ano = ano1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = mes1
|
||||
|
||||
SELECT descrip INTO nom_mes FROM mestable
|
||||
WHERE mes = mes1
|
||||
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT BY NAME criterio ON a.tipo_cliente,a.sec_cliente
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
DECLARE buscar CURSOR FOR
|
||||
{ SELECT a.* FROM ranking a
|
||||
WHERE a.tipo_cliente =12
|
||||
ORDER BY a.ano,a.negocio,a.sec_cliente,a.mes,a.ano }
|
||||
|
||||
select a.ano,a.negocio,a.nombre_cliente,a.unidades,a.celda FROM ventas_pilas a
|
||||
ORDER BY 2,3
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Actual... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
|
||||
--# CALL fgl_init4js()
|
||||
|
||||
START REPORT gerencia21 TO "c:\\archivo"
|
||||
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
--# CALL fgl_init4js()
|
||||
|
||||
--# LET archivo = NULL
|
||||
--# LET filename = NULL
|
||||
--# LET filename = FGL_GETENV("USPROGRAM")
|
||||
|
||||
--# LET archivo = "h:\\\\Formularios\\\\geprrp021c.XLS"
|
||||
--# LET filename = filename CLIPPED," h:\\\\Formularios\\\\geprrp021c.XLS"
|
||||
|
||||
--# IF winexec(filename) THEN
|
||||
|
||||
--# IF DDEconnect("EXCEL",archivo) THEN
|
||||
|
||||
LET idx = 7
|
||||
|
||||
FOREACH buscar INTO anos.*
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
OUTPUT TO REPORT gerencia21(anos.*)
|
||||
END FOREACH
|
||||
|
||||
FINISH REPORT gerencia21
|
||||
END IF
|
||||
END IF
|
||||
# RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia21(x)
|
||||
|
||||
# DEFINE x RECORD LIKE ranking.*
|
||||
DEFINE x RECORD
|
||||
ano LIKE ranking.ano,
|
||||
negocio LIKE ventas_pilas.negocio,
|
||||
nombre LIKE ventas_pilas.nombre_cliente,
|
||||
unidades LIKE ventas_pilas.unidades,
|
||||
celda LIKE ventas_pilas.celda
|
||||
END RECORD
|
||||
|
||||
DEFINE mes11,cuenta SMALLINT
|
||||
DEFINE nom_mes1 CHAR(15)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE nombre_sal CHAR(20),
|
||||
limite LIKE vetb00004.limite_credito,
|
||||
hora CHAR(5),
|
||||
J RECORD LIKE celdas.*
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
|
||||
BEFORE GROUP OF x.negocio
|
||||
LET idx = idx + 1
|
||||
LET cels = "R",idx USING "<<<<","C1"
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.negocio) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
LET idx = idx + 2
|
||||
|
||||
BEFORE GROUP OF x.nombre
|
||||
LET cels = "R",idx USING "<<<<","C1"
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.nombre) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
LET cels = "R",idx USING "<<<<","C",x.celda USING "<<"
|
||||
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.unidades) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
|
||||
|
||||
AFTER GROUP OF x.nombre
|
||||
LET idx = idx + 1
|
||||
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,226 @@
|
||||
{
|
||||
=======================================================================
|
||||
Programa : GEPRRP021
|
||||
Sistema : Sistema de Informacion Gerencia
|
||||
Proceso : Clientes con Ventas Mayores a X Cantidad X Tipo de Negocio
|
||||
Autor : Ing. Juan Francisco Soto
|
||||
Fecha : Abril 28, 2003
|
||||
=======================================================================
|
||||
}
|
||||
GLOBALS
|
||||
"geprgb000.4gl"
|
||||
|
||||
DEFINE ger_comp10 RECORD LIKE ranking.*,
|
||||
cod1 SMALLINT,
|
||||
ventas_dev1,ventas_dev2,ventas_totales1,ventas_totales2 DECIMAL(12,2),
|
||||
archivo,filename,sysos CHAR(120),
|
||||
cels CHAR(20),
|
||||
cnt,n,dep_ant,n_row,ppresenta SMALLINT
|
||||
|
||||
|
||||
DEFINE selec9 CHAR(1000)
|
||||
DEFINE salir,salir9,compa CHAR(1)
|
||||
DEFINE idx9,idx1,j,m,p,s,s1 INTEGER
|
||||
DEFINE ano19 CHAR(4)
|
||||
DEFINE ano1,mes1 SMALLINT
|
||||
DEFINE nom_mes CHAR(15)
|
||||
|
||||
DEFINE fecha_in,fecha_fi,fecha_in9,fecha_fi9 DATE,
|
||||
cod_cli SMALLINT,
|
||||
total2,cantidad1,cantidad2,cantidad3,cantidad4,cantidad5,cantidad6,
|
||||
cantidad7,cantidad8,cantida9 DECIMAL(12,2)
|
||||
|
||||
FUNCTION geprrp021()
|
||||
DEFINE pceldas RECORD LIKE celdas.*
|
||||
|
||||
DEFINE anos RECORD
|
||||
|
||||
ano LIKE ranking.ano,
|
||||
negocio LIKE ventas_pilas.negocio,
|
||||
nombre LIKE ventas_pilas.nombre_cliente,
|
||||
unidades LIKE ventas_pilas.unidades,
|
||||
celda LIKE ventas_pilas.celda
|
||||
END RECORD
|
||||
|
||||
LET int_flag = FALSE
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM gefmrp009 FROM "gefmrp009"
|
||||
DISPLAY FORM gefmrp009
|
||||
CALL pantalla()
|
||||
DISPLAY "geprrp010" AT 4,3 ATTRIBUTE(RED)
|
||||
|
||||
DISPLAY "Ranking de Clientes por Tipo de Negocios" AT 6,20
|
||||
ATTRIBUTE(BLACK)
|
||||
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
INPUT BY NAME ano1,mes1,cantidad1
|
||||
AFTER FIELD ano1
|
||||
IF ano1 IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD ano1
|
||||
END IF
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in9 FROM prdtable
|
||||
WHERE ano = ano1 - 1
|
||||
|
||||
LET ano19 = ano1 - 1 USING "&&&&"
|
||||
|
||||
BEFORE FIELD mes1
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
AFTER FIELD mes1
|
||||
IF mes1 IS NULL THEN
|
||||
LET mes1 = MONTH(today) USING "&&"
|
||||
END IF
|
||||
DISPLAY BY NAME mes1
|
||||
|
||||
SELECT MIN(fecha_inicio) INTO fecha_in FROM prdtable
|
||||
WHERE ano = ano1 #and mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi FROM prdtable
|
||||
WHERE ano = ano1 AND mes = mes1
|
||||
|
||||
SELECT fecha_corte INTO fecha_fi9 FROM prdtable
|
||||
WHERE ano = ano1 - 1 AND mes = mes1
|
||||
|
||||
SELECT descrip INTO nom_mes FROM mestable
|
||||
WHERE mes = mes1
|
||||
|
||||
|
||||
AFTER FIELD cantidad1
|
||||
IF cantidad1 IS NULL OR cantidad1 < 0 THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD cantidad1
|
||||
END IF
|
||||
END INPUT
|
||||
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
CONSTRUCT BY NAME criterio ON a.tipo_cliente,a.sec_cliente
|
||||
IF int_flag tHEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
DECLARE buscar CURSOR FOR
|
||||
{ SELECT a.* FROM ranking a
|
||||
WHERE a.tipo_cliente =12
|
||||
ORDER BY a.ano,a.negocio,a.sec_cliente,a.mes,a.ano }
|
||||
|
||||
select a.ano,a.negocio,a.nombre_cliente,a.unidades,a.celda FROM ventas_pilas a
|
||||
ORDER BY 2,3
|
||||
|
||||
DISPLAY "Buscando Informacion Ano Actual... Espere por Favor" AT 17,14
|
||||
ATTRIBUTE(BOLD)
|
||||
|
||||
|
||||
--# CALL fgl_init4js()
|
||||
|
||||
START REPORT gerencia21 TO "c:\\archivo"
|
||||
|
||||
DISPLAY "Impresion en Proceso..... Espere por Favor " AT 17,14
|
||||
--# CALL fgl_init4js()
|
||||
|
||||
--# LET archivo = NULL
|
||||
--# LET filename = NULL
|
||||
--# LET filename = FGL_GETENV("USPROGRAM")
|
||||
|
||||
--# LET archivo = "h:\\\\Formularios\\\\geprrp021c.XLS"
|
||||
--# LET filename = filename CLIPPED," h:\\\\Formularios\\\\geprrp021c.XLS"
|
||||
|
||||
--# IF winexec(filename) THEN
|
||||
|
||||
--# IF DDEconnect("EXCEL",archivo) THEN
|
||||
|
||||
LET idx = 7
|
||||
|
||||
FOREACH buscar INTO anos.*
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = FALSE
|
||||
RETURN
|
||||
END IF
|
||||
OUTPUT TO REPORT gerencia21(anos.*)
|
||||
END FOREACH
|
||||
|
||||
FINISH REPORT gerencia21
|
||||
END IF
|
||||
END IF
|
||||
# RUN imprime
|
||||
END FUNCTION
|
||||
|
||||
REPORT gerencia21(x)
|
||||
|
||||
# DEFINE x RECORD LIKE ranking.*
|
||||
DEFINE x RECORD
|
||||
ano LIKE ranking.ano,
|
||||
negocio LIKE ventas_pilas.negocio,
|
||||
nombre LIKE ventas_pilas.nombre_cliente,
|
||||
unidades LIKE ventas_pilas.unidades,
|
||||
celda LIKE ventas_pilas.celda
|
||||
END RECORD
|
||||
|
||||
DEFINE mes11,cuenta SMALLINT
|
||||
DEFINE nom_mes1 CHAR(15)
|
||||
DEFINE descrip,descrip1 CHAR(30)
|
||||
DEFINE nombre_sal CHAR(20),
|
||||
limite LIKE vetb00004.limite_credito,
|
||||
hora CHAR(5),
|
||||
J RECORD LIKE celdas.*
|
||||
|
||||
OUTPUT
|
||||
LEFT MARGIN 2
|
||||
TOP MARGIN 1
|
||||
|
||||
FORMAT
|
||||
|
||||
BEFORE GROUP OF x.negocio
|
||||
LET idx = idx + 1
|
||||
LET cels = "R",idx USING "<<<<","C1"
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.negocio) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
LET idx = idx + 2
|
||||
|
||||
BEFORE GROUP OF x.nombre
|
||||
LET cels = "R",idx USING "<<<<","C1"
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.nombre) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
ON EVERY ROW
|
||||
|
||||
LET cels = "R",idx USING "<<<<","C",x.celda USING "<<"
|
||||
|
||||
--# IF DDEpoke("EXCEL",archivo,cels,x.unidades) THEN
|
||||
--# ELSE
|
||||
--# LET numero_msg =391
|
||||
--# CALL msg(numero_msg)
|
||||
--# END IF
|
||||
|
||||
|
||||
|
||||
AFTER GROUP OF x.nombre
|
||||
LET idx = idx + 1
|
||||
|
||||
|
||||
END REPORT
|
||||
@@ -0,0 +1,21 @@
|
||||
fgl2p gemnrp000.4gl
|
||||
fgl2p geprrp001.4gl
|
||||
fgl2p geprrp002.4gl
|
||||
fgl2p geprrp003.4gl
|
||||
fgl2p geprrp004.4gl
|
||||
fgl2p geprrp005.4gl
|
||||
fgl2p geprrp006.4gl
|
||||
fgl2p geprrp007.4gl
|
||||
fgl2p geprrp008.4gl
|
||||
fgl2p geprrp009.4gl
|
||||
fgl2p geprrp010.4gl
|
||||
fgl2p geprrp011.4gl
|
||||
fgl2p geprrp012.4gl
|
||||
fgl2p geprrp013.4gl
|
||||
fgl2p geprrp014.4gl
|
||||
fgl2p geprrp015.4gl
|
||||
fgl2p geprrp016.4gl
|
||||
fgl2p geprrp020.4gl
|
||||
fgl2p geprrp021.4gl
|
||||
|
||||
fgl2p -o gemnrp000.42r gemnrp000.42m geprrp001.42m geprrp002.42m geprrp003.42m geprrp004.42m geprrp005.42m geprrp006.42m geprrp007.42m geprrp008.42m geprrp009.42m geprrp010.42m geprrp011.42m geprrp012.42m geprrp013.42m geprrp014.42m geprrp015.42m geprrp016.42m geprrp020.42m seg000.42m msg.42m msgrp000.42m termo.42m geprrp021.42m
|
||||
@@ -0,0 +1,66 @@
|
||||
|
||||
E
|
||||
geprrp006 R A Y . O . V A C D O M I N I C A N A, S. A. Pag. 1
|
||||
Sistema de Informacion Gerencial 18/10/2000
|
||||
Cliente de Mayor Venta 16:12
|
||||
|
||||
Fecha: Del 01/10/1999 Al 30/09/2000
|
||||
--------------------------------------------------------------------------------
|
||||
Secuencia Cliente Cantidad
|
||||
--------------------------------------------------------------------------------
|
||||
F
|
||||
1 14-9999 COMERCIAL GEORGES SICARD 2,016,163.20
|
||||
2 15-9999 COMERCIAL GEORGES SICARD 627,225.60
|
||||
3 14-9997 ANTILLEAN TRADING COMPANY 57,772.80
|
||||
--------------
|
||||
2,701,161.60
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,20 @@
|
||||
DATABASE rayovac
|
||||
|
||||
FUNCTION msg(numero_msg)
|
||||
DEFINE numero_msg SMALLINT
|
||||
DEFINE descripcion CHAR (60)
|
||||
SELECT desc_msg INTO descripcion FROM msgtable
|
||||
WHERE cod_msg = numero_msg
|
||||
|
||||
IF status = NOTFOUND THEN
|
||||
LET numero_msg = 22
|
||||
SELECT desc_msg INTO descripcion FROM msgtable
|
||||
WHERE cod_msg = numero_msg
|
||||
ERROR descripcion ATTRIBUTE(BOLD)
|
||||
ELSE
|
||||
ERROR descripcion ATTRIBUTE(BOLD)
|
||||
LET numero_msg = 0
|
||||
END IF
|
||||
END FUNCTION
|
||||
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
{
|
||||
Esta funcion se utiliza para dsplegar mensajes de los reportes de
|
||||
los sistemas de Ray-O-Vac Dominicana.
|
||||
|
||||
Realizada por Lic. Abner Montalvo y Johnny Soto Agosto 21, 1992
|
||||
}
|
||||
DATABASE rayovac
|
||||
|
||||
FUNCTION msgrp000(tipo_papel)
|
||||
DEFINE tipo_papel SMALLINT,
|
||||
longitud CHAR(11),
|
||||
linea_papel CHAR(50)
|
||||
CASE
|
||||
WHEN tipo_papel = 1
|
||||
LET longitud = " 9 1/2 x 11"
|
||||
WHEN tipo_papel = 2
|
||||
LET longitud = "14 7/8 x 11"
|
||||
END CASE
|
||||
|
||||
LET linea_papel = "Coloque papel ",longitud," en la impresora."
|
||||
DISPLAY linea_papel
|
||||
AT 15,14
|
||||
DISPLAY
|
||||
"<Ctrl-P> Elejir Printer Asegurese de que la impresora este encendida."
|
||||
AT 16,10 ATTRIBUTE(REVERSE,YELLOW)
|
||||
DISPLAY "<Esc> Ejecuta impresion <Ctrl-C> Cancela impresion"
|
||||
AT 18,14
|
||||
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION busca_printer()
|
||||
DEFINE pcurr,impresor,idx SMALLINT,
|
||||
negrillas_on,
|
||||
negrillas_off,
|
||||
doble_on,
|
||||
doble_off,
|
||||
doce,
|
||||
comp_on,
|
||||
comp_off,
|
||||
normal CHAR(6)
|
||||
|
||||
DEFINE dspprt ARRAY[10] OF RECORD
|
||||
nombre CHAR(30),
|
||||
codigo SMALLINT,
|
||||
puerto LIKE prttb00001.puerto,
|
||||
prtcodigo LIKE prttb00001.prtcodigo
|
||||
END RECORD,
|
||||
prt RECORD LIKE prttb00001.*,
|
||||
prtcodigo LIKE prttb00001.prtcodigo
|
||||
|
||||
OPEN WINDOW impresoras AT 10,5 WITH FORM "msgfmrp" ATTRIBUTE
|
||||
(BORDER,FORM LINE FIRST + 1)
|
||||
|
||||
DECLARE busca CURSOR FOR
|
||||
SELECT * FROM prttb00001
|
||||
ORDER BY 1
|
||||
|
||||
LET idx = 1
|
||||
FOREACH busca INTO prt.*
|
||||
LET dspprt[idx].nombre = prt.nombre
|
||||
LET dspprt[idx].codigo = prt.codigo
|
||||
LET dspprt[idx].puerto = prt.puerto
|
||||
LET dspprt[idx].prtcodigo = prt.prtcodigo
|
||||
LET idx = idx + 1
|
||||
END FOREACH
|
||||
|
||||
CALL set_count(idx-1)
|
||||
DISPLAY ARRAY dspprt TO s_prt.*
|
||||
|
||||
LET pcurr = arr_curr()
|
||||
LET impresor = dspprt[pcurr].codigo
|
||||
LET prtcodigo = dspprt[pcurr].prtcodigo
|
||||
LET prt.puerto = dspprt[pcurr].puerto
|
||||
|
||||
CASE
|
||||
WHEN prtcodigo = 1
|
||||
LET doble_on = ASCII 14
|
||||
LET doble_off = ASCII 18
|
||||
LET negrillas_on = ASCII 27, ASCII 69
|
||||
LET negrillas_off = ASCII 27, ASCII 70
|
||||
LET comp_on = ASCII 15
|
||||
LET comp_off = ASCII 18
|
||||
LET doce = ASCII 27,ASCII 77
|
||||
LET normal = ASCII 27,ASCII 80
|
||||
EXIT CASE
|
||||
WHEN prtcodigo = 2
|
||||
LET doble_on = ASCII 001
|
||||
LET doble_off = ASCII 002
|
||||
LET negrillas_on = ASCII 027, ASCII 098
|
||||
LET negrillas_off = ASCII 027, ASCII 099
|
||||
LET comp_on = ASCII 031
|
||||
LET comp_off = ASCII 029
|
||||
LET doce = ASCII 030
|
||||
LET normal = ASCII 029
|
||||
EXIT CASE
|
||||
END CASE
|
||||
CLOSE WINDOW impresoras
|
||||
RETURN prt.puerto,negrillas_on,negrillas_off,doble_on,doble_off,comp_on,comp_off,doce, normal
|
||||
END FUNCTION
|
||||
|
||||
FUNCTION defecto(impresor)
|
||||
DEFINE impresor,idx SMALLINT,
|
||||
negrillas_on,
|
||||
negrillas_off,
|
||||
doble_on,
|
||||
doble_off,
|
||||
doce,
|
||||
comp_on,
|
||||
comp_off,
|
||||
normal CHAR(6),
|
||||
prt RECORD LIKE prttb00001.*
|
||||
|
||||
SELECT * INTO prt.* FROM prttb00001 a
|
||||
WHERE codigo = impresor
|
||||
|
||||
CASE
|
||||
WHEN prt.prtcodigo = 1
|
||||
LET doble_on = ASCII 14
|
||||
LET doble_off = ASCII 18
|
||||
LET negrillas_on = ASCII 27, ASCII 69
|
||||
LET negrillas_off = ASCII 27, ASCII 70
|
||||
LET comp_on = ASCII 15
|
||||
LET comp_off = ASCII 18
|
||||
LET doce = ASCII 27,ASCII 77
|
||||
LET normal = ASCII 27,ASCII 80
|
||||
EXIT CASE
|
||||
WHEN prt.prtcodigo = 2 {Printer Central. Contabilidad}
|
||||
LET doble_on = ASCII 001
|
||||
LET doble_off = ASCII 002
|
||||
LET negrillas_on = ASCII 027, ASCII 098
|
||||
LET negrillas_off = ASCII 027, ASCII 099
|
||||
LET comp_on = ASCII 031
|
||||
LET comp_off = ASCII 029
|
||||
LET doce = ASCII 030
|
||||
LET normal = ASCII 029
|
||||
EXIT CASE
|
||||
WHEN impresor = 3
|
||||
LET doble_on = ASCII 14
|
||||
LET doble_off = ASCII 18
|
||||
LET negrillas_on = ASCII 27, ASCII 69
|
||||
LET negrillas_off = ASCII 27, ASCII 70
|
||||
LET comp_on = ASCII 15
|
||||
LET comp_off = ASCII 18
|
||||
LET doce = ASCII 27,ASCII 77
|
||||
LET normal = ASCII 27,ASCII 80
|
||||
EXIT CASE
|
||||
END CASE
|
||||
RETURN prt.puerto,negrillas_on,negrillas_off,doble_on,doble_off,
|
||||
comp_on,comp_off,doce,normal
|
||||
END FUNCTION
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
-----------------------------------------------------------------------------
|
||||
PROGRAMA : SEG000
|
||||
OBJETIVO : Controlar el acceso de los usuarios a los sistemas de la
|
||||
Empresa.
|
||||
PROGRAMADOR : Ing. Juan Soto
|
||||
FECHA : Marzo 17, 1994.
|
||||
-----------------------------------------------------------------------------
|
||||
PROGRAMADOR : Lic. Abner Montalvo
|
||||
FECHA : Marzo 2, 1999
|
||||
|
||||
OBJETIVO : Optimizacion de la funcion. No es necesario recibir el parametro
|
||||
"usuarios" porque el mismo se obtiene de la funcion "user".
|
||||
Este cambio elimina el select que busca el codigo del usuario en
|
||||
todos los menues de los sistemas.
|
||||
-----------------------------------------------------------------------------
|
||||
}
|
||||
FUNCTION seg000(opt,p_menu)
|
||||
DEFINE opt CHAR(2)
|
||||
DEFINE luz CHAR(4)
|
||||
DEFINE p_menu CHAR(9)
|
||||
DEFINE usuarios CHAR(9)
|
||||
DEFINE no_reg,p_opcion,numero SMALLINT
|
||||
|
||||
WHENEVER ERROR CONTINUE
|
||||
OPTIONS
|
||||
ERROR LINE 24
|
||||
LET luz = "azul"
|
||||
LET p_opcion = opt
|
||||
|
||||
SELECT count(*) INTO no_reg FROM seg0001
|
||||
WHERE usuario = user
|
||||
|
||||
IF no_reg = 1 THEN
|
||||
SELECT opcion INTO p_opcion FROM seg0001
|
||||
WHERE usuario = user
|
||||
END IF
|
||||
|
||||
IF p_opcion != 99 THEN
|
||||
SELECT UNIQUE a.usuario FROM seg0001 a
|
||||
WHERE a.usuario = user and
|
||||
a.opcion = p_opcion and
|
||||
a.us_menu = p_menu
|
||||
|
||||
IF status = notfound THEN
|
||||
LET status = 0
|
||||
LET luz = "roja"
|
||||
END IF
|
||||
END IF
|
||||
|
||||
IF p_opcion = 99 THEN
|
||||
LET luz = "azul"
|
||||
END IF
|
||||
|
||||
IF luz = "roja" THEN
|
||||
ERROR "NO TIENE PERMISO PARA UTILIZAR OPCION"
|
||||
END IF
|
||||
|
||||
RETURN luz
|
||||
END FUNCTION
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
============================================================================
|
||||
PROGRAMA : TERMOMETRO
|
||||
OBJETIVO : DESPLEGAR TERMOMETRO PORCENTUAL PARA LOS REPORTES
|
||||
PROGRAMADOR : JUAN F. SOTO
|
||||
FECHA : MARZO 10, 1995
|
||||
============================================================================
|
||||
}
|
||||
|
||||
DATABASE rayovac
|
||||
|
||||
GLOBALS
|
||||
DEFINE cuenta1,p,cuenta SMALLINT
|
||||
END GLOBALS
|
||||
|
||||
FUNCTION termometro(registros,primera)
|
||||
DEFINE registros INTEGER
|
||||
DEFINE i,veces SMALLINT
|
||||
DEFINE porcentaje,vez DECIMAL(8,2)
|
||||
DEFINE primera CHAR(1)
|
||||
|
||||
IF primera = "S" THEN
|
||||
LET porcentaje = 0
|
||||
LET primera = "N"
|
||||
LET p = 27
|
||||
CALL fgl_drawbox(3,8,19,18)
|
||||
CALL fgl_drawbox(3,35,19,26)
|
||||
IF registros <= 33 THEN
|
||||
FOR i = 1 TO 33
|
||||
LET cuenta1 = 1
|
||||
DISPLAY " " AT 20,p ATTRIBUTE(REVERSE,BOLD)
|
||||
LET p = p + 1
|
||||
END FOR
|
||||
END IF
|
||||
END IF
|
||||
|
||||
IF registros > 33 THEN
|
||||
LET vez = registros / 33
|
||||
LET veces = vez USING "#####"
|
||||
IF cuenta >= veces THEN
|
||||
LET cuenta = 0
|
||||
IF p <= 58 THEN
|
||||
DISPLAY " " AT 20,p ATTRIBUTE(REVERSE,BOLD)
|
||||
END IF
|
||||
LET p = p + 1
|
||||
END IF
|
||||
LET porcentaje = (cuenta1/registros) * 100
|
||||
DISPLAY porcentaje using "###","%" AT 20,19 ATTRIBUTE(BOLD)
|
||||
LET cuenta = cuenta + 1
|
||||
LET cuenta1 = cuenta1 + 1
|
||||
END IF
|
||||
|
||||
END FUNCTION
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,132 @@
|
||||
|
||||
|
||||
geprrp010 R A Y . O . V A C D O M I N I C A N A, S. A. Pag. 1
|
||||
Sistema de Informacion Gerencial 11/08/2003
|
||||
Ranking de Ventas Comparativas Ano Anterior Mayor A 250,000.00 16:56
|
||||
M A Y O R I S T A S
|
||||
ACUMULADO AL MES DE JULIO
|
||||
-------------------------------------------------------------------------------------------------------------------------------------
|
||||
Posicion Monto Limite Tipo de % %
|
||||
2003 2002 Cliente 2003 2002 StatusCredito Negocio Particip. Particip.
|
||||
-------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
1 1 123471 DISASA DOMINICANA, S.A. SANTIAGO 18,519,954.19 23,641,271.15 12,400,000.00 DISTRIBUIDORES 14.19 17.52
|
||||
2 2 120060 CASA DERMALINE SANTO DOMINGO 10,847,049.60 2,743,372.80 6,000,000.00 MAYORISTAS 8.31 2.03
|
||||
3 3 121536 ALMACEN EL PARAISO SANTIAGO 9,461,548.87 11,024,009.09 5,800,000.00 MAYORISTAS 7.25 8.17
|
||||
4 4 120303 RAMON GUZMAN SANTIAGO 8,440,957.20 8,049,513.60 5,000,000.00 MAYORISTAS 6.47 5.96
|
||||
5 5 123648 FRANCISCO ORTIZ SANTO DOMINGO 6,977,145.60 1,306,368.00 1,600,000.00 MAYORISTAS 5.35 .97
|
||||
6 6 121389 PROVISIONES MARTES REYES SANTIAGO 6,316,479.55 4,098,880.52 4,600,000.00 MAYORISTAS 4.84 3.04
|
||||
7 7 123017 PLAZA MODELO SANTO DOMINGO 4,470,940.80 914,457.60 2,000,000.00 MAYORISTAS 3.43 .68
|
||||
8 8 121668 CASA EVELYN SANTO DOMINGO 3,671,476.03 3,001,209.60 1,300,000.00 MAYORISTAS 2.81 2.22
|
||||
9 9 120349 ALMACEN EL NAZARENO LAS MATA DE FARFAN 3,117,398.40 3,378,217.73 3,800,000.00 MAYORISTAS 2.39 2.50
|
||||
10 10 123408 BERNARDO VASQUEZ SANTO DOMINGO 2,695,910.86 2,036,013.72 2,800,000.00 DISTRIBUIDORES 2.07 1.51
|
||||
11 11 120011 CASA CASTILLO HERMANOS, CXA. SANTO DOMINGO 2,405,915.52 2,980,588.80 3,000,000.00 MAYORISTAS 1.84 2.21
|
||||
12 12 120067 HERMANOS CHECO, C. POR A. SANTIAGO 2,329,207.68 925,472.64 1,780,000.00 MAYORISTAS 1.78 .69
|
||||
13 13 120392 CASA ABREU NUNEZ HIGUEY 2,286,440.60 1,499,473.17 1,500,000.00 MAYORISTAS 1.75 1.11
|
||||
14 14 123622 CASA HERMANOS JEREZ SANTO DOMINGO 1,988,551.46 1,059,198.53 1,000,000.00 MAYORISTAS 1.52 .78
|
||||
15 15 121211 ALM. HNOS GUZMAN-MANUEL GUZMAN SANTIAGO 1,963,993.77 1,819,843.20 2,000,000.00 MAYORISTAS 1.51 1.35
|
||||
16 16 120106 DISTRIBUIDORA DEL NORDESTE,S.A SAN FCO. MACORIS 1,927,168.99 726,122.40 2,000,000.00 DISTRIBUIDORES 1.48 .54
|
||||
17 17 123586 CARLOS PEREZ-CASA CHEA MONTE PLATA 1,893,154.82 857,772.10 1,010,000.00 DISTRIBUIDORES 1.45 .64
|
||||
18 18 120191 ASOCODEPRU INC(ANDRES VILLAR) SANTO DOMINGO 1,746,091.30 1,791,041.28 880,000.00 MAYORISTAS 1.34 1.33
|
||||
19 24 121525 PROVISIONES DEL CIBAO, CXA SANTIAGO 1,235,722.41 716,486.40 1,000,000.00 MAYORISTAS .95 .53
|
||||
20 0 123715 SAPEVI, S.A. SANTO DOMINGO 1,673,770.83 .00 800,000.00 DISTRIBUIDORES 1.28 .00
|
||||
21 20 123606 ASOC. DE PEQ.Y MED. MAYORISTAS SANTO DOMINGO 1,555,752.48 3,392,237.76 1,400,000.00 MAYORISTAS 1.19 2.51
|
||||
22 21 120246 MAYORISTAS ASOCIADOS, C.X.A. SANTO DOMINGO 1,504,458.62 2,107,929.60 2,000,000.00 MAYORISTAS 1.15 1.56
|
||||
23 22 121359 CCN SANTO DOMINGO 1,421,822.21 1,411,864.28 1,370,000.00 KEY ACCOUNTS 1.09 1.05
|
||||
24 23 120052 ALMACENES CHECO SANTIAGO 1,308,324.00 1,817,031.36 1,500,000.00 MAYORISTAS 1.00 1.35
|
||||
25 25 120003 AMADOR PIMENTEL SANTO DOMINGO 1,226,955.93 1,640,580.48 2,000,000.00 MAYORISTAS .94 1.22
|
||||
26 28 123068 GRUPO RAMOS(MULT. W. CHRCHILL) SANTO DOMINGO 998,909.00 1,179,099.28 1,500,000.00 KEY ACCOUNTS .77 .87
|
||||
27 26 120237 COMERCIAL M. CALDERON, C.X.A. SANTO DOMINGO 1,046,981.76 734,907.84 2,000,000.00 MAYORISTAS .80 .54
|
||||
28 27 120654 ASOC. COM. MAY. S.J.M. SAN JUAN DE LA MAGUANA 1,027,535.61 869,219.23 600,000.00 MAYORISTAS .79 .64
|
||||
29 35 123300 H/M CONTINENTE (CARREFOUR) SANTO DOMINGO 704,269.58 834,365.31 1,000,000.00 KEY ACCOUNTS .54 .62
|
||||
30 29 120149 ASOC. S.M. ECONOMICOS SANTO DOMINGO 762,162.24 635,241.60 900,000.00 MAYORISTAS .58 .47
|
||||
31 30 120127 CADENA DET. DE LA ROMANA LA ROMANA 757,217.63 220,431.65 1,000,000.00 MAYORISTAS .58 .16
|
||||
32 31 120452 CENTRO COM. LOS POLANCO, CXA SANTO DOMINGO 756,153.60 165,627.84 1,000,000.00 MAYORISTAS .58 .12
|
||||
33 32 120294 CASA CHEPE SANTO DOMINGO 724,080.48 1,091,912.64 1,800,000.00 MAYORISTAS .55 .81
|
||||
34 0 120151 CASA HERMANOS DURAN SANTO DOMINGO 719,577.60 .00 1,355,000.00 MAYORISTAS .55 .00
|
||||
35 34 123257 SURTIDORA HNOS GARCIA, S.A. SANTO DOMINGO 715,923.55 934,197.12 600,000.00 MAYORISTAS .55 .69
|
||||
36 36 121511 CENTRO COM. ALFA & OMEGA,S.A. BARAHONA 682,291.11 884,925.08 715,000.00 MAYORISTAS .52 .66
|
||||
37 37 120162 CASA LOS COMPADRES HIGUEY 671,327.52 641,325.72 1,000,000.00 MAYORISTAS .51 .48
|
||||
38 38 120185 HERMANOS URENA MINIER, C.X.A. NAVARRETE 631,482.24 706,872.00 1,000,000.00 MAYORISTAS .48 .52
|
||||
39 39 120376 ASOC. MAY. DE SAN CRISTOBAL SAN CRISTOBAL 613,997.89 293,516.26 500,000.00 MAYORISTAS .47 .22
|
||||
40 40 120297 CASA FERNANDEZ SANTO DOMINGO 603,146.88 2,144,419.20 1,800,000.00 MAYORISTAS .46 1.59
|
||||
41 41 123052 DISTRIBUIDORA FERREIRA MOCA 597,376.92 413,913.84 400,000.00 MAYORISTAS .46 .31
|
||||
42 43 120012 SUED FARMACEUTICA SANTO DOMINGO 575,703.11 1,136,061.85 800,000.00 DISTRIBUIDORES .44 .84
|
||||
43 42 123140 ALMACENES LAURA SANTO DOMINGO 585,902.73 1,504,032.00 1,800,000.00 MAYORISTAS .45 1.11
|
||||
44 61 123610 COMERCIAL ORIENTAL SANTO DOMINGO 261,341.61 1,403,537.28 1,000,000.00 DISTRIBUIDORES .20 1.04
|
||||
45 44 121486 TCN DOMINICANA, S. A. SANTO DOMINGO 553,571.47 747,295.20 700,000.00 INSTITUCIONALES .42 .55
|
||||
46 45 121439 ASOCOMARIO, INC. SANTO DOMINGO 540,884.39 829,835.25 600,000.00 MAYORISTAS .41 .61
|
||||
47 0 123697 COMERCIAL SANTANA HATO MAYOR 521,071.50 .00 500,000.00 MAYORISTAS .40 .00
|
||||
48 48 123671 FERRETERIA AMERICANA(KENNEDY) SANTO DOMINGO 486,372.46 444,951.18 300,000.00 KEY ACCOUNTS .37 .33
|
||||
49 50 123579 PLAZA LAMA-AV. DUARTE SANTO DOMINGO 463,354.25 750,872.48 1,000,000.00 KEY ACCOUNTS .36 .56
|
||||
50 47 120100 ASOC./MAY.EN PROV. MOCA, INC. MOCA 497,200.42 773,514.00 1,000,000.00 MAYORISTAS .38 .57
|
||||
51 49 123134 CASA JENNY-EMETERIO RUIZ LA ROMANA 473,428.27 84,360.29 200,000.00 MAYORISTAS .36 .06
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
geprrp010 R A Y . O . V A C D O M I N I C A N A, S. A. Pag. 2
|
||||
Sistema de Informacion Gerencial 11/08/2003
|
||||
Ranking de Ventas Comparativas Ano Anterior Mayor A 250,000.00 16:56
|
||||
M A Y O R I S T A S
|
||||
ACUMULADO AL MES DE JULIO
|
||||
-------------------------------------------------------------------------------------------------------------------------------------
|
||||
Posicion Monto Limite Tipo de % %
|
||||
2003 2002 Cliente 2003 2002 StatusCredito Negocio Particip. Particip.
|
||||
-------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
52 51 120105 ASOC. COM.MAY/SAN FCO./MACORIS SAN FCO. MACORIS 460,184.64 134,550.72 850,000.00 MAYORISTAS .35 .10
|
||||
53 0 123674 COMERCIAL MOYA SANTO DOMINGO 448,488.23 .00 1,000,000.00 MAYORISTAS .34 .00
|
||||
54 53 123607 ASOC. NUEVO COM.DET. DE BANI BANI 430,668.41 260,537.09 500,000.00 MAYORISTAS .33 .19
|
||||
55 54 120035 LUIS ML. TEJEDA P & CO, CXA SANTO DOMINGO 363,651.93 164,774.40 500,000.00 MAYORISTAS .28 .12
|
||||
56 0 123501 CASA EL DIAMANTE EL SEYBO 351,411.66 .00 500,000.00 MAYORISTAS .27 .00
|
||||
57 0 123721 COMERCIAL DIST. DEL SUR BARAHONA 344,047.95 .00 350,000.00 DISTRIBUIDORES .26 .00
|
||||
58 57 120081 SILVIO HIDALGO ASTACIO, CXA SANTO DOMINGO 339,568.97 603,964.37 500,000.00 DISTRIBUIDORES .26 .45
|
||||
59 0 123731 ALM. HNOS. LEROUX SANTO DOMINGO 333,069.60 .00 500,000.00 MAYORISTAS .26 .00
|
||||
60 59 121679 MAX DISTRIBUCION, S.A. SANTO DOMINGO 327,404.16 328,298.88 700,000.00 MAYORISTAS .25 .24
|
||||
61 64 123271 GREGORIO E. URENA GONZALEZ SANTO DOMINGO 188,028.03 8,266.85 350,000.00 MINORISTAS .14 .01
|
||||
62 60 123492 CASA FRANCISCO NOVA HATO MAYOR 280,929.18 201,324.48 500,000.00 MAYORISTAS .22 .15
|
||||
63 65 122227 LENIN ROBINSON/M.J.KENNEDY SANTO DOMINGO 169,124.71 211,429.42 400,000.00 KEY ACCOUNTS .13 .16
|
||||
64 62 120550 ALMACEN EL ECONOMICO BARAHONA 236,733.12 115,918.56 320,000.00 MAYORISTAS .18 .09
|
||||
65 63 121271 FERRETERIA OCHOA SANTIAGO 219,988.05 100,534.61 450,000.00 MINORISTAS .17 .07
|
||||
-------------- --------------
|
||||
TOTAL VENTAS.... 122,450,754.18 104,492,989.33
|
||||
|
||||
Total Clientes => 58
|
||||
--------------------------------------------
|
||||
Total Ventas ano 2003 130,492,275.92
|
||||
Total Ventas ano 2002 134,947,191.07
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,66 @@
|
||||
|
||||
|
||||
geprrp010 R A Y . O . V A C D O M I N I C A N A, S. A. Pag. 1
|
||||
Sistema de Informacion Gerencial 19/01/2001
|
||||
Ranking de Ventas Comparativas Ano Anterior Mayor A 100,000.00 17:35
|
||||
M A Y O R I S T A S
|
||||
ACUMULADO AL MES DE OCTUBRE
|
||||
----------------------------------------------------------------------------------------------------
|
||||
Posicion Cantidad Limite
|
||||
2000 1999 Cliente 2000 1999 Status Credito
|
||||
----------------------------------------------------------------------------------------------------
|
||||
|
||||
1 2 120060 CASA DERMALINE 3,006,201.60 1,816,162.55 6,000,000.00
|
||||
2 6 120303 RAMON GUZMAN 1,222,553.08 781,519.10 3,803,000.00
|
||||
3 0 123017 PLAZA MODELO 1,222,553.08 .00 2,000,000.00
|
||||
4 1 120011 CASA CASTILLO HERMANOS, CXA. 953,814.53 2,012,905.72 3,000,000.00
|
||||
5 10 120047 CASA ALEXANDER 947,199.74 488,446.85 2,600,000.00
|
||||
6 8 120237 COMERCIAL M. CALDERON, C.X.A. 947,199.74 645,936.76 2,000,000.00
|
||||
7 7 120297 CASA FERNANDEZ 816,137.85 698,264.07 1,200,000.00
|
||||
8 0 120259 EPIFANIO TORRES 471,946.18 .00 1,500,000.00
|
||||
9 14 120452 CENTRO COM. LOS POLANCO, CXA 458,102.30 316,047.74 1,000,000.00
|
||||
10 3 120003 AMADOR PIMENTEL 406,415.23 1,206,845.56 2,000,000.00
|
||||
11 18 120247 CASA ARMANDO 403,107.84 255,861.50 1,500,000.00
|
||||
12 5 120294 CASA CHEPE 403,107.84 895,515.26 1,800,000.00
|
||||
13 13 120654 ASOC. COM. MAY. S.J.M. 337,576.90 348,607.82 600,000.00
|
||||
14 0 123140 COMERCIAL A&G 335,923.20 .00 1,500,000.00
|
||||
15 0 120185 HERMANOS URENA MINIER, C.X.A. 327,040.42 .00 1,000,000.00
|
||||
16 26 121359 CENTRO CUESTA NACIONAL(CCN) 278,818.74 73,115.13 1,000,000.00
|
||||
17 19 121668 CASA EVELYN 275,353.34 255,861.50 1,200,000.00
|
||||
18 0 122679 COMECIAL M&H 275,353.34 .00 500,000.00
|
||||
19 25 121390 ALMACEN EL CAMPEON(M. ABREU) 272,045.95 127,930.75 500,000.00
|
||||
20 11 120052 ALMACENES CHECO 268,738.56 437,690.31 1,500,000.00
|
||||
21 9 121534 CASA URENA, C.POR A. 268,738.56 642,795.26 1,000,000.00
|
||||
22 0 123106 FERMIN CONCEPCION 220,947.78 .00 500,000.00
|
||||
23 16 120376 ASOC. MAY. DE SAN CRISTOBAL 204,861.31 257,432.26 500,000.00
|
||||
24 0 123035 PROVISIONES VARGAS 203,207.62 .00 230,000.00
|
||||
25 20 120106 EUFEMIO VARGAS 198,762.34 189,219.73 500,000.00
|
||||
26 0 120114 ASOC. MAY. DE TENARES 198,762.34 .00 600,000.00
|
||||
27 0 121347 ALMACEN NENO 172,804.24 .00 200,000.00
|
||||
28 22 120345 HIPOLITO RODRIGUEZ 170,165.21 155,140.94 600,000.00
|
||||
29 0 121695 ALMACEN EDUARD 167,136.10 .00 500,000.00
|
||||
30 23 121332 SUPERMERCADO IVAN CARDENES 146,048.83 140,040.57 200,000.00
|
||||
31 15 120859 S/M MIGUEL ROSARIO 144,470.30 259,705.95 1,000,000.00
|
||||
32 21 120096 JUAN GRULLON 136,575.07 161,761.54 700,000.00
|
||||
33 24 120088 HERMANOS BLANCO BATISTA 134,369.28 127,930.75 700,000.00
|
||||
34 12 120104 CARDENES & BATISTA, C. POR A. 134,369.28 383,792.25 500,000.00
|
||||
35 0 120105 ASOC. COM.MAY/SAN FCO./MACORIS 134,369.28 .00 850,000.00
|
||||
36 0 120116 ASOC. MAYORISTA DE COTUI 134,369.28 .00 250,000.00
|
||||
37 0 120269 PEDRO PABLO JIMENEZ 134,369.28 .00 300,000.00
|
||||
38 17 120100 COM. ASOC. DE MOCA, C X A. 119,765.96 255,861.50 1,000,000.00
|
||||
39 0 123211 DISTRIBUIDORA FIMESA, S.A. 117,354.25 .00 250,000.00
|
||||
40 4 121211 ALM. HNOS GUZMAN-MANUEL GUZMAN 109,988.93 1,151,376.76 1,800,000.00
|
||||
-------------- --------------
|
||||
TOTAL VENTAS.... 16,880,624.70 14,085,768.13
|
||||
|
||||
Total Clientes => 26
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,8 @@
|
||||
SELECT a.tipo_cliente,a.sec_cliente,b.nombre,b.limite_credito,SUM(a.neto)
|
||||
FROM vetb00002 a,vetb00004 b
|
||||
WHERE a.status_t IS NULL AND a.fecha_factura between "01101999" AND "23022000" AND
|
||||
a.tipo_cliente = b.tipo_cliente and
|
||||
a.sec_cliente = b.sec_cliente AND b.status_t IS NULL
|
||||
and a.ventas = '1'
|
||||
GROUP BY 1,2,3,4 ORDER BY 5 DESC,1,2
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
SELECT a.tipo_cliente,a.sec_cliente,b.nombre,b.limite_credito,SUM(a.neto)
|
||||
FROM vetb00002 a,vetb00004 b
|
||||
WHERE a.status_t IS NULL AND a.fecha_factura between "01101999" AND "23022000" AND
|
||||
a.tipo_cliente = b.tipo_cliente and
|
||||
a.sec_cliente = b.sec_cliente AND b.status_t IS NULL
|
||||
and a.ventas = '1'
|
||||
GROUP BY 1,2,3,4 ORDER BY 5 DESC,1,2
|
||||
|
||||
Reference in New Issue
Block a user