ipprmt020: no permite repetir un item en la requisicion y arregla la fecha del reporte

- Guardar: si un item (clase/grupo/tipo/medida) aparece en mas de una linea,
  aunque cambie el area, muestra error y no guarda (antes solo avisaba y solo
  si coincidia el area). Evita que el impreso muestre solo la primera linea.
- Reporte: la fecha/hora sale como dd/mm/yyyy hh:mm y el titulo deja espacio
  para que no se corte en el encabezado.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 16:44:46 -04:00
co-authored by Claude Sonnet 5.5
parent b5bf9e2b26
commit 75d81bdfc7
3 changed files with 1187 additions and 1194 deletions
+2 -2
View File
@@ -24,9 +24,9 @@
<PAGENOBOX name="PageNoBox" floatingBehavior="enclosed"/> <PAGENOBOX name="PageNoBox" floatingBehavior="enclosed"/>
</LAYOUTNODE> </LAYOUTNODE>
<LAYOUTNODE name="encabezado2" width="min" length="max" layoutDirection="leftToRight" floatingBehavior="enclosed"> <LAYOUTNODE name="encabezado2" width="min" length="max" layoutDirection="leftToRight" floatingBehavior="enclosed">
<WORDBOX name="WordBox2" width="max-2cm" fontBold="true" floatingBehavior="enclosed" textAlignment="center" text="REQUISICION DOCUMENTOS"/> <WORDBOX name="WordBox2" width="max-4.5cm" fontBold="true" floatingBehavior="enclosed" textAlignment="center" text="REQUISICION DOCUMENTOS"/>
<rtl:input-variable name="hora" type="FGLString" expectedLocation="expectedAhead"/> <rtl:input-variable name="hora" type="FGLString" expectedLocation="expectedAhead"/>
<WORDBOX name="WordBox3" floatingBehavior="enclosed" text="{{hora}}"/> <WORDBOX name="WordBox3" width="4.5cm" floatingBehavior="enclosed" textAlignment="right" text="{{hora}}"/>
</LAYOUTNODE> </LAYOUTNODE>
<LAYOUTNODE name="encabezadomaster" width="min" length="min" fontSize="8" layoutDirection="leftToRight" floatingBehavior="enclosed"> <LAYOUTNODE name="encabezadomaster" width="min" length="min" fontSize="8" layoutDirection="leftToRight" floatingBehavior="enclosed">
<LAYOUTNODE name="LayoutNode1" width="3inch" length="min" floatingBehavior="enclosed" roundedCorners="true" borderWidth="1" borderStyle="solid"> <LAYOUTNODE name="LayoutNode1" width="3inch" length="min" floatingBehavior="enclosed" roundedCorners="true" borderWidth="1" borderStyle="solid">
+1 -1
View File
@@ -68,7 +68,7 @@ REPORT requiere(detalle,xdespiece,codigo)
FORMAT FORMAT
FIRST PAGE HEADER FIRST PAGE HEADER
SELECT a.nombre INTO p_companias.nombre FROM companias a SELECT a.nombre INTO p_companias.nombre FROM companias a
LET hora = CURRENT LET hora = TODAY USING "dd/mm/yyyy", " ", CURRENT HOUR TO MINUTE
PRINTX hora,p_companias.nombre PRINTX hora,p_companias.nombre
BEFORE GROUP OF codigo BEFORE GROUP OF codigo
PRINTX detalle.*,p_iptb57.*, PRINTX detalle.*,p_iptb57.*,
+9 -16
View File
@@ -494,21 +494,15 @@ FUNCTION entradas()
DISPLAY arr_iptb58[idx].cantidad TO sdetalle[scr_l].cantidad DISPLAY arr_iptb58[idx].cantidad TO sdetalle[scr_l].cantidad
END IF END IF
ON ACTION guardar ATTRIBUTE(TEXT = opcion, IMAGE = "save") ON ACTION guardar ATTRIBUTE(TEXT = opcion, IMAGE = "save")
# Aviso (no bloqueo) si un item se repite en el detalle # Un item no puede repetirse en la requisicion (aunque cambie el area)
LET descRepetido = itemRepetido() LET descRepetido = itemRepetido()
IF descRepetido IS NOT NULL THEN IF descRepetido IS NOT NULL THEN
LET respuesta = CALL fgl_winmessage(
fgl_winquestion( "ERROR",
"Item repetido", "El item " || descRepetido CLIPPED
"El item " || descRepetido CLIPPED || " esta repetido en el detalle. Deje una sola linea por item.",
|| " esta repetido en el detalle. Desea continuar?", "stop")
"NO", CONTINUE DIALOG
"YES|NO",
"QUESTION",
0)
IF respuesta != "YES" THEN
CONTINUE DIALOG
END IF
END IF END IF
IF p_iptb57.bodega IS NOT NULL THEN IF p_iptb57.bodega IS NOT NULL THEN
LET nombreBodega = LET nombreBodega =
@@ -769,8 +763,8 @@ FUNCTION entradas()
END DIALOG END DIALOG
END FUNCTION END FUNCTION
# Devuelve la descripcion del primer item repetido (misma area, clase, grupo, # Devuelve la descripcion del primer item repetido (misma clase, grupo, tipo y
# tipo y medida) entre las lineas con cantidad; NULL si no hay repetidos. # medida, sin importar el area) entre las lineas con cantidad; NULL si no hay.
FUNCTION itemRepetido() FUNCTION itemRepetido()
DEFINE i, j INT DEFINE i, j INT
DEFINE texto STRING DEFINE texto STRING
@@ -779,7 +773,6 @@ FUNCTION itemRepetido()
IF arr_iptb58[i].cantidad IS NOT NULL THEN IF arr_iptb58[i].cantidad IS NOT NULL THEN
FOR j = i + 1 TO arr_iptb58.getLength() FOR j = i + 1 TO arr_iptb58.getLength()
IF arr_iptb58[j].cantidad IS NOT NULL IF arr_iptb58[j].cantidad IS NOT NULL
AND arr_iptb58[j].area = arr_iptb58[i].area
AND arr_iptb58[j].cod_n = arr_iptb58[i].cod_n AND arr_iptb58[j].cod_n = arr_iptb58[i].cod_n
AND arr_iptb58[j].cod_grupo = arr_iptb58[i].cod_grupo AND arr_iptb58[j].cod_grupo = arr_iptb58[i].cod_grupo
AND arr_iptb58[j].cod_tipo = arr_iptb58[i].cod_tipo AND arr_iptb58[j].cod_tipo = arr_iptb58[i].cod_tipo