From 4a8d31d9d03db55829d8c4d59702aecb2df493ac Mon Sep 17 00:00:00 2001 From: Jeilyn Peguero Date: Thu, 22 Oct 2026 17:01:47 -0400 Subject: [PATCH] ipprmt020: aviso de item repetido a prueba de valores nulos (el texto salia en blanco) Arma el mensaje por partes, omitiendo las vacias, y usa ASCII 10 para los saltos. Co-Authored-By: Claude Sonnet 5.5 --- PROYECTO/ipdir/ipprmt020.4gl | 43 ++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/PROYECTO/ipdir/ipprmt020.4gl b/PROYECTO/ipdir/ipprmt020.4gl index b4da779..de792cd 100644 --- a/PROYECTO/ipdir/ipprmt020.4gl +++ b/PROYECTO/ipdir/ipprmt020.4gl @@ -509,8 +509,7 @@ FUNCTION entradas() IF descRepetido IS NOT NULL THEN CALL fgl_winmessage( "Item repetido", - "No se puede repetir el item: -" || descRepetido CLIPPED, + "No se puede repetir el item:" || ASCII 10 || descRepetido CLIPPED, "stop") CONTINUE DIALOG END IF @@ -795,23 +794,33 @@ END FUNCTION # Aviso corto de item repetido (codigo y descripcion recortada). FUNCTION avisoRepetido(p) DEFINE p INT - DEFINE texto, desc STRING + DEFINE texto, descr, msj STRING - LET desc = arr_iptb58[p].descripcion CLIPPED - IF desc.getLength() > 35 THEN - LET desc = desc.subString(1, 35) + LET descr = arr_iptb58[p].descripcion CLIPPED + IF descr IS NULL THEN + LET descr = "" END IF - LET texto = arr_iptb58[p].cod_n USING "&&&&", "-", - arr_iptb58[p].cod_grupo USING "&&&&", "-", - arr_iptb58[p].cod_tipo USING "&&&&", "-", - arr_iptb58[p].cod_sec USING "&&&&&&" - CALL fgl_winmessage( - "Item repetido", - "Este item ya esta en el detalle: -" || texto || " -" - || desc, - "stop") + IF descr.getLength() > 35 THEN + LET descr = descr.subString(1, 35) + END IF + LET texto = "" + IF arr_iptb58[p].cod_n IS NOT NULL THEN + LET texto = texto || (arr_iptb58[p].cod_n USING "&&&&") + END IF + IF arr_iptb58[p].cod_grupo IS NOT NULL THEN + LET texto = texto || "-" || (arr_iptb58[p].cod_grupo USING "&&&&") + END IF + IF arr_iptb58[p].cod_tipo IS NOT NULL THEN + LET texto = texto || "-" || (arr_iptb58[p].cod_tipo USING "&&&&") + END IF + IF arr_iptb58[p].cod_sec IS NOT NULL THEN + LET texto = texto || "-" || (arr_iptb58[p].cod_sec USING "&&&&&&") + END IF + LET msj = "Este item ya esta en el detalle:" || ASCII 10 || texto + IF descr.getLength() > 0 THEN + LET msj = msj || ASCII 10 || descr + END IF + CALL fgl_winmessage("Item repetido", msj, "stop") END FUNCTION # Deja la fila p sin item para volver a escribirlo.