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 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 17:01:47 -04:00
co-authored by Claude Sonnet 5.5
parent 6dac9550c1
commit 4a8d31d9d0
+26 -17
View File
@@ -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.