Corrige ctprrp004 (Reporte Produccion Diaria)
- Titulo de ventana corregido (mostraba "screen") - START REPORT se ejecuta con la primera fila; si la consulta no devuelve datos avisa "NO EXISTEN REGISTROS PARA ESTOS PARAMETROS" en vez de generar un reporte en blanco Verificado con 01/01/2024 a 12/31/2024: detallado 166 paginas en pantalla, resumen 57 paginas en PDF. En la BD de pruebas (.40.250) cttb00003 no tiene produccion posterior a agosto de 2025, por eso rangos de 2026 salen vacios. Excel no probado. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ DEFINE HANDLER om.SaxDocumentHandler, -- return value from fgl_report_commitCurr
|
|||||||
DEFINE selec5 STRING
|
DEFINE selec5 STRING
|
||||||
DEFINE anos CHAR(4)
|
DEFINE anos CHAR(4)
|
||||||
DEFINE jdx INTEGER
|
DEFINE jdx INTEGER
|
||||||
|
DEFINE hay_filas SMALLINT
|
||||||
DEFINE fecha_inicio, fecha_corte, fecha1 DATE, reporte_tipo INT
|
DEFINE fecha_inicio, fecha_corte, fecha1 DATE, reporte_tipo INT
|
||||||
|
|
||||||
MAIN
|
MAIN
|
||||||
@@ -52,6 +53,7 @@ FUNCTION ctprrp004()
|
|||||||
|
|
||||||
OPEN FORM ctfmrp004 FROM "ctfmrp004"
|
OPEN FORM ctfmrp004 FROM "ctfmrp004"
|
||||||
DISPLAY FORM ctfmrp004
|
DISPLAY FORM ctfmrp004
|
||||||
|
CALL ui.Window.getCurrent().setText("Reporte Produccion Diaria")
|
||||||
|
|
||||||
CONSTRUCT criterio ON c.departamento, c.cod_prod FROM departamento, cod_prod
|
CONSTRUCT criterio ON c.departamento, c.cod_prod FROM departamento, cod_prod
|
||||||
|
|
||||||
@@ -166,35 +168,42 @@ FUNCTION ctprrp004()
|
|||||||
|
|
||||||
|
|
||||||
LET r_filename = 'ctprrp004.4rp'
|
LET r_filename = 'ctprrp004.4rp'
|
||||||
IF fgl_report_loadCurrentSettings(r_filename) THEN
|
|
||||||
LET preview=1
|
|
||||||
CALL selectoutput() RETURNING r_output
|
|
||||||
CALL fgl_report_selectDevice(r_output) -- changing default
|
|
||||||
CALL fgl_report_selectPreview(preview) -- changing default
|
|
||||||
LET handler = fgl_report_commitCurrentSettings() -- commit changes
|
|
||||||
END IF
|
|
||||||
|
|
||||||
START REPORT reporte_detallado TO XML HANDLER HANDLER
|
|
||||||
|
|
||||||
LET fecha_actual = CURRENT YEAR TO FRACTION
|
LET fecha_actual = CURRENT YEAR TO FRACTION
|
||||||
|
|
||||||
DISPLAY selec5
|
DISPLAY selec5
|
||||||
|
|
||||||
PREPARE comando4 FROM selec5
|
PREPARE comando4 FROM selec5
|
||||||
DECLARE busca4 CURSOR FOR comando4
|
DECLARE busca4 CURSOR FOR comando4
|
||||||
|
LET hay_filas = FALSE
|
||||||
|
|
||||||
FOREACH busca4 INTO prod_dia.*
|
FOREACH busca4 INTO prod_dia.*
|
||||||
|
|
||||||
IF reporte_tipo <> 1 THEN
|
IF NOT hay_filas THEN
|
||||||
|
IF fgl_report_loadCurrentSettings(r_filename) THEN
|
||||||
|
LET preview=1
|
||||||
|
CALL selectoutput() RETURNING r_output
|
||||||
|
CALL fgl_report_selectDevice(r_output)
|
||||||
|
CALL fgl_report_selectPreview(preview)
|
||||||
|
LET handler = fgl_report_commitCurrentSettings()
|
||||||
|
END IF
|
||||||
|
START REPORT reporte_detallado TO XML HANDLER HANDLER
|
||||||
|
LET hay_filas = TRUE
|
||||||
|
END IF
|
||||||
|
|
||||||
|
IF reporte_tipo <> 1 THEN
|
||||||
LET prod_dia.num_doc = 0
|
LET prod_dia.num_doc = 0
|
||||||
LET prod_dia.fecha = CURRENT
|
LET prod_dia.fecha = CURRENT
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
OUTPUT TO REPORT reporte_detallado(
|
OUTPUT TO REPORT reporte_detallado(
|
||||||
prod_dia.*, fecha_inicio, fecha_corte, fecha_actual)
|
prod_dia.*, fecha_inicio, fecha_corte, fecha_actual)
|
||||||
END FOREACH
|
END FOREACH
|
||||||
|
|
||||||
FINISH REPORT reporte_detallado
|
IF hay_filas THEN
|
||||||
|
FINISH REPORT reporte_detallado
|
||||||
|
ELSE
|
||||||
|
CALL fgl_winmessage("INFO", "NO EXISTEN REGISTROS PARA ESTOS PARAMETROS", "INFO")
|
||||||
|
END IF
|
||||||
|
|
||||||
IF abortar_reporte THEN
|
IF abortar_reporte THEN
|
||||||
RETURN
|
RETURN
|
||||||
|
|||||||
Reference in New Issue
Block a user