Commit inicial: fuentes MBS ERP (Genero 6) + .gitignore + docs/SETUP_PC_MBS.md
This commit is contained in:
@@ -0,0 +1,216 @@
|
||||
{
|
||||
------------------------------------------------------------------
|
||||
PROGRAMA : IRPRRP21
|
||||
OBJETIVO : Imprimir listado de diferencias entre las exis-
|
||||
tencias actuales y las fisicas.
|
||||
PROGRAMADOR : Tadeo A. Ferreras F.
|
||||
MODIFICADO :
|
||||
FECHA REALIZACION : Mayo 11,1993.
|
||||
------------------------------------------------------------------
|
||||
}
|
||||
globals
|
||||
"irprgb000.4gl"
|
||||
DEFINE semana RECORD
|
||||
semana_ini LIKE irtb00017.semana_del
|
||||
END RECORD
|
||||
|
||||
MAIN
|
||||
DEFER INTERRUPT
|
||||
SELECT * INTO p_companias.* FROM companias
|
||||
CALL irprrp021()
|
||||
END MAIN
|
||||
|
||||
FUNCTION irprrp021()
|
||||
DEFINE prt_difer RECORD
|
||||
cod_n LIKE irtb00017.cod_n,
|
||||
cod_grupo LIKE irtb00017.cod_grupo,
|
||||
cod_tipo LIKE irtb00017.cod_tipo,
|
||||
cod_sec LIKE irtb00017.cod_sec,
|
||||
descri_esp LIKE intb00001.descrip_esp,
|
||||
categoria LIKE irtb00016.categoria,
|
||||
semana_del LIKE irtb00017.semana_del,
|
||||
semana_al LIKE irtb00017.semana_al,
|
||||
exis_act LIKE irtb00017.exis_act,
|
||||
exis_fisica LIKE irtb00017.exis_fisica,
|
||||
diferencia DECIMAL(10,2)
|
||||
END RECORD,
|
||||
i,c,dia,cant1,cant INTEGER
|
||||
#whenever error continue
|
||||
CLEAR SCREEN
|
||||
OPTIONS
|
||||
FORM LINE 8
|
||||
|
||||
OPEN FORM irfmrp021 FROM "irfmrp021"
|
||||
DISPLAY form irfmrp021
|
||||
CALL pantalla()
|
||||
DISPLAY "irprrp021" at 4,3 attribute(blue)
|
||||
DISPLAY "Diferencia Existencia en Inventario Perpetuo" at 6,18
|
||||
LET tipo_papel = 1
|
||||
CALL msgrp000(tipo_papel)
|
||||
|
||||
INPUT BY NAME semana.semana_ini
|
||||
AFTER FIELD semana_ini
|
||||
IF semana.semana_ini IS NULL THEN
|
||||
LET numero_msg = 16
|
||||
CALL msg(numero_msg)
|
||||
NEXT FIELD semana_ini
|
||||
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_n,a.cod_grupo,a.cod_tipo,a.cod_sec,
|
||||
e.descrip_esp,m.categoria,a.semana_del,a.semana_al,
|
||||
a.exis_act,a.exis_fisica,a.exis_fisica - a.exis_act
|
||||
FROM irtb00017 a,intb00001 e ,irtb00016 m
|
||||
WHERE a.cod_n = e.cod_n AND a.cod_grupo = e.cod_grupo and
|
||||
a.cod_tipo = e.cod_tipo AND a.cod_sec = e.cod_sec AND
|
||||
a.cod_n = m.cod_n AND a.cod_grupo = m.cod_grupo AND
|
||||
a.cod_tipo = m.cod_tipo AND a.cod_sec = m.cod_sec and
|
||||
a.status_t IS NULL AND a.semana_del = semana.semana_ini
|
||||
ORDER BY 1,2,3,4
|
||||
|
||||
IF STATUS < 0 THEN
|
||||
CALL integridad()
|
||||
IF bandera = 1 THEN
|
||||
LET bandera = 0
|
||||
RETURN
|
||||
END IF
|
||||
END IF
|
||||
|
||||
IF int_flag THEN
|
||||
LET numero_msg = 2
|
||||
CALL msg(numero_msg)
|
||||
LET int_flag = false
|
||||
RETURN
|
||||
END IF
|
||||
|
||||
DISPLAY "Buscando Informacion ... Espere por favor" at 19,14
|
||||
ATTRIBUTE(REVERSE,BOLD)
|
||||
|
||||
#prepare busqueda from selec1
|
||||
#declare buscar scroll cursor for busqueda
|
||||
|
||||
START REPORT difer_mp to "C:\\archivo"
|
||||
|
||||
DISPLAY "Reporte Generandose ... Por Favor Espere" at 19,14
|
||||
ATTRIBUTE(REVERSE)
|
||||
|
||||
FOREACH buscar INTO prt_difer.*
|
||||
OUTPUT TO REPORT difer_mp(prt_dIFer.*)
|
||||
END FOREACH
|
||||
FINISH REPORT dIFer_mp
|
||||
RUN "type C:\\archivo > %USPRINT%" END FUNCTION
|
||||
|
||||
REPORT difer_mp(x)
|
||||
DEFINE x RECORD
|
||||
cod_n LIKE irtb00017.cod_n,
|
||||
cod_grupo LIKE irtb00017.cod_grupo,
|
||||
cod_tipo LIKE irtb00017.cod_tipo,
|
||||
cod_sec LIKE irtb00017.cod_sec,
|
||||
descri_esp LIKE intb00001.descrip_esp,
|
||||
categoria LIKE irtb00016.categoria,
|
||||
semana_del LIKE irtb00017.semana_del,
|
||||
semana_al LIKE irtb00017.semana_al,
|
||||
exis_act LIKE irtb00017.exis_act,
|
||||
exis_fisica LIKE irtb00017.exis_fisica,
|
||||
diferencia DECIMAL(10,2)
|
||||
END RECORD,
|
||||
fecha DATE,
|
||||
i,c INTEGER,
|
||||
difere DECIMAL(12,2)
|
||||
|
||||
DEFINE doble_on CHAR(2)
|
||||
DEFINE doble_off CHAR(2)
|
||||
DEFINE negrillas_on CHAR(3)
|
||||
DEFINE negrillas_off CHAR(3)
|
||||
DEFINE comp_on CHAR(3)
|
||||
DEFINE comp_off CHAR(3)
|
||||
DEFINE doce,normal CHAR(2)
|
||||
DEFINE hora CHAR(5)
|
||||
DEFINE l SMALLINT
|
||||
DEFINE varia CHAR(10)
|
||||
|
||||
ORDER BY x.categoria,x.cod_n,x.cod_grupo,x.cod_tipo,x.cod_sec
|
||||
FORMAT
|
||||
PAGE HEADER
|
||||
LET doble_on = ASCII 14
|
||||
LET doble_off = ASCII 20
|
||||
LET negrillas_on = ASCII 027, ASCII 098
|
||||
LET negrillas_off = ASCII 027, ASCII 099
|
||||
LET normal = ASCII 27, ASCII 80
|
||||
LET comp_on = ASCII 031
|
||||
LET comp_off = ASCII 029
|
||||
LET doce = ASCII 27, ASCII 77
|
||||
LET hora = time
|
||||
LET fecha = today
|
||||
LET hora = time
|
||||
|
||||
PRINT COLUMN 1,"irprrp021",
|
||||
COLUMN 17, " M A R M O T E C H S. A.",
|
||||
COLUMN 71,"Pag. ",pageno using "###"
|
||||
PRINT COLUMN 17, "Diferencias Existencia en Inventario Perpetuo",
|
||||
COLUMN 71,today using "dd/mm/yyyy"
|
||||
PRINT COLUMN 23,"Semana del ",x.semana_del using "dd/mm/yyyy",
|
||||
" Al ",x.semana_al using "dd/mm/yyyy",
|
||||
COLUMN 74,hora
|
||||
|
||||
SKIP 1 LINE
|
||||
PRINT COLUMN 1,comp_on,negrillas_on
|
||||
PRINT COLUMN 2, "________________________________________________________",
|
||||
"________________________________________________________",
|
||||
"______________________"
|
||||
|
||||
PRINT COLUMN 92,"Existencia"
|
||||
PRINT COLUMN 2,"Materiales",
|
||||
COLUMN 15,"Descripcion",
|
||||
#Column 60,"Del Al",
|
||||
Column 85,"Fisica Actual",
|
||||
Column 115,"DIFerencia %"
|
||||
PRINT COLUMN 2, "________________________________________________________",
|
||||
"________________________________________________________",
|
||||
"______________________",
|
||||
negrillas_off
|
||||
|
||||
SKIP 1 LINE
|
||||
|
||||
BEFORE GROUP OF x.categoria
|
||||
|
||||
LET i = 0
|
||||
PRINT COLUMN 1,negrillas_on
|
||||
PRINT COLUMN 2,"Categoria...",x.categoria,negrillas_off
|
||||
SKIP 1 LINE
|
||||
ON EVERY ROW
|
||||
LET difere = 0
|
||||
IF x.exis_act != 0 THEN
|
||||
LET difere = (x.diferencia/x.exis_act) * 100
|
||||
END IF
|
||||
PRINT COLUMN 2,x.cod_n using "&","-",x.cod_grupo using "&","-",
|
||||
x.cod_tipo using "&&","-",x.cod_sec using "&&&",
|
||||
COLUMN 15,x.descri_esp clipped,
|
||||
COLUMN 76,x.exis_fisica using "###,###,###.##",
|
||||
COLUMN 94,x.exis_act using "###,###,###.##",
|
||||
COLUMN 106,x.dIFerencia using "(((,(((,(((.##)"," ",
|
||||
difere USING "(((.##)"
|
||||
LET i = i + 1
|
||||
IF c IS NULL THEN LET c = 0 END IF
|
||||
LET c = c + 1
|
||||
|
||||
AFTER GROUP OF x.categoria
|
||||
SKIP 1 LINE
|
||||
PRINT COLUMN 2,negrillas_on,"Total registro en categoria (",
|
||||
x.categoria clipped,") ",i,negrillas_off
|
||||
SKIP 1 LINE
|
||||
ON LAST ROW
|
||||
SKIP 1 LINE
|
||||
PRINT COLUMN 2,negrillas_on,"Total registro en general ",c,
|
||||
negrillas_off
|
||||
LET c = 0
|
||||
PRINT COLUMN 1,comp_off
|
||||
END REPORT
|
||||
Reference in New Issue
Block a user