Corrige ctprrp014 (Reporte Produccion Mensual)
- Titulo de ventana corregido - 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 ano 2024 (la BD de pruebas no tiene produccion posterior a agosto de 2025): 1 pagina con 9 semielaborados por mes y total, en pantalla, PDF y Excel. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,8 @@ DEFINE HANDLER om.SaxDocumentHandler, -- return value from fgl_report_commitCurr
|
||||
DEFINE selec5 STRING
|
||||
DEFINE anos STRING
|
||||
|
||||
DEFINE hay_filas SMALLINT
|
||||
|
||||
MAIN
|
||||
DEFER INTERRUPT
|
||||
CALL ARG_VAL(1) RETURNING usuarios
|
||||
@@ -55,6 +57,7 @@ FUNCTION ctprrp004()
|
||||
|
||||
OPEN FORM ctfmrp004 FROM "ctfmrp014"
|
||||
DISPLAY FORM ctfmrp004
|
||||
CALL ui.Window.getCurrent().setText("Reporte Produccion Mensual")
|
||||
|
||||
CONSTRUCT criterio ON c.cod_prod FROM cod_prod
|
||||
|
||||
@@ -128,25 +131,28 @@ FUNCTION ctprrp004()
|
||||
|
||||
|
||||
LET r_filename = 'ctprrp014.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_mensual TO XML HANDLER HANDLER
|
||||
|
||||
LET fecha_actual = CURRENT YEAR TO FRACTION
|
||||
|
||||
DISPLAY selec5
|
||||
|
||||
PREPARE comando4 FROM selec5
|
||||
DECLARE busca4 CURSOR FOR comando4
|
||||
LET hay_filas = FALSE
|
||||
|
||||
FOREACH busca4 INTO prod_dia.*
|
||||
|
||||
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_mensual TO XML HANDLER HANDLER
|
||||
LET hay_filas = TRUE
|
||||
END IF
|
||||
|
||||
IF prod_dia.semielaborado IS NULL THEN
|
||||
LET abortar_reporte = TRUE;
|
||||
END IF
|
||||
@@ -154,7 +160,11 @@ FUNCTION ctprrp004()
|
||||
OUTPUT TO REPORT reporte_mensual(prod_dia.*, anos, fecha_actual);
|
||||
END FOREACH
|
||||
|
||||
FINISH REPORT reporte_mensual
|
||||
IF hay_filas THEN
|
||||
FINISH REPORT reporte_mensual
|
||||
ELSE
|
||||
CALL fgl_winmessage("INFO", "NO EXISTEN REGISTROS PARA ESTOS PARAMETROS", "INFO")
|
||||
END IF
|
||||
|
||||
IF abortar_reporte THEN
|
||||
RETURN
|
||||
|
||||
Reference in New Issue
Block a user