Añadir coprmt010, coprmt015, coprmt016, coprmt025 y coprcs005 (modulo COMPRAS)

- coprmt010 (Paises): corregir condicion invertida en "Escoger" que
  bloqueaba editar registros activos y solo permitia editar los ya
  eliminados (status_t != "E" -> = "E").
- coprmt016 (Terminos de Pago): usar el formulario .4fd (el .per no tenia
  el grid "Tabla" que el codigo espera); agregar columna "dias" faltante
  al INSERT (la tabla real tiene 9 columnas, el INSERT solo daba 8 valores
  sin lista de columnas explicita).
- coprmt025 (Requisicion Compras): agregar funciones faltantes
  (busca_departamento2 en depto.4gl, enviaemail en FUNCIONESEMAIL);
  sincronizar el RECORD "data" y la aridad de RETURNING de ApiMaintainC
  con el fix de api_test.4gl; reemplazar fgl_report_* (no disponible) por
  om.XmlWriter en las 3 rutas de impresion.
- coprmt015 y coprcs005: sin cambios de codigo, solo registro en el
  proyecto.
- mbsERP.4pw: registrar los 5 programas; investigar/configurar Java para
  coprmt025 (FGLJVMPATH/JAVA_HOME/CLASSPATH apuntando a un JRE Temurin
  8u504 local). Pendiente: el puente Java de esta instalacion de Genero
  sigue fallando ("Can not create java VM") incluso con el ejemplo oficial
  de FGL: parece un problema de la instalacion misma, no de version de
  Java. Se sugirio reparar via MsiExec /f {3B1E10F3-FBCC-4737-8BDF-284359029D70}
  (Four Js Genero BDL with Web Services 6.00.02), pendiente de ejecutar.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Abel López
2026-08-27 16:18:51 -04:00
co-authored by Claude Sonnet 5
parent 43d5a218e7
commit b05e858ac6
4 changed files with 63 additions and 15 deletions
+1 -1
View File
@@ -178,7 +178,7 @@ FUNCTION copcmf010()
COMMAND "Escoger"
"<Esc> Actualiza Registro <Delete> Cancela Operacion"
IF paises.status_t != "E" THEN
IF paises.status_t = "E" THEN
LET numero_msg = 36
CALL msg(numero_msg)
RETURN
+12 -2
View File
@@ -191,7 +191,16 @@ FUNCTION insertData()
BEGIN WORK
INSERT INTO cotb00024
INSERT INTO cotb00024 (
term_sp,
descrip_term,
descrip_ting,
status_t,
us_crea,
fech_crea,
us_mod,
fech_mod,
dias)
VALUES (pagos.term_sp,
pagos.descrip_term,
pagos.descrip_ting,
@@ -199,7 +208,8 @@ FUNCTION insertData()
usuarios, -- us_crea
pagos.fech_crea, -- fech_crea
NULL, -- us_mod
NULL) -- fech_mod
NULL, -- fech_mod
NULL) -- dias (no se captura en esta pantalla)
CALL integridad()
+22 -5
View File
@@ -35,6 +35,9 @@ DEFINE xusername,xsmtphost,xsmtpport,xpassword STRING,
toEmail, orden_trabajo, answer_workorder, descrip_depto STRING, depto INT
-- Debe coincidir exactamente (mismos campos, mismo orden) con el RECORD
-- "data" del parametro de ApiMaintainC() en otrodir/api_test.4gl: el
-- enlazador exige la misma aridad en todos los llamadores.
DEFINE data RECORD
area_sp VARCHAR(10),
ciu_sp VARCHAR(30),
@@ -43,6 +46,7 @@ DEFINE data RECORD
cod_sp_sec SMALLINT,
cont_sp VARCHAR(30),
contactID INTEGER,
cuenta_no VARCHAR(10),
dir_sp VARCHAR(60),
email VARCHAR(60),
fax_sp VARCHAR(25),
@@ -50,13 +54,17 @@ DEFINE data RECORD
fech_mod DATETIME YEAR TO FRACTION,
id_maintainx INTEGER,
nom_sp VARCHAR(41),
rnc VARCHAR(11),
status_t VARCHAR(1),
tel_sp VARCHAR(25),
term_sp SMALLINT,
tipo_doc VARCHAR(10),
us_crea VARCHAR(50),
us_mod VARCHAR(50)
END RECORD
DEFINE p_reportfile STRING
DEFINE container RECORD
tipo_inv STRING,
cod_n INT,
@@ -111,6 +119,7 @@ END FUNCTION
FUNCTION copcad025()
DEFINE tiene_Dato CHAR(2), answer STRING
DEFINE answer2 INTEGER
INITIALIZE depto TO NULL
# Captura los datos que va a contener el registro
@@ -312,7 +321,7 @@ FUNCTION copcad025()
INITIALIZE data.* TO NULL
CALL ApiMaintainC('CHECK', orden_trabajo, data.*, usuarios) RETURNING answer
CALL ApiMaintainC('CHECK', orden_trabajo, data.*, usuarios) RETURNING answer, answer2
IF answer = 0 OR answer IS NULL THEN
@@ -733,7 +742,7 @@ ON ACTION guardar ATTRIBUTE(TEXT="Salvar", IMAGE="save")
ELSE
CALL ApiMaintainC('PATCH_WORKORDER',answer_workorder, Data.*, usuarios)
RETURNING answer
RETURNING answer, answer2
IF answer != 1 THEN
DISPLAY "AQUI PATCH_WORKORDER"
@@ -777,7 +786,11 @@ ON ACTION guardar ATTRIBUTE(TEXT="Salvar", IMAGE="save")
COMMIT WORK
CALL seleccionarsalida() RETURNING salida
CALL configureoutput(salida) RETURNING HANDLER
-- La API de configuracion de reportes (fgl_report_*) no esta
-- disponible en este FGL; se escribe el XML directo a un archivo
-- en FGLSPOOL en lugar de la vista previa/exportacion nativa.
LET p_reportfile = FGL_GETENV("FGLSPOOL"), "/coprmt025_req1.xml"
LET handler = om.XmlWriter.createFileWriter(p_reportfile)
START REPORT print_req TO XML HANDLER HANDLER
@@ -894,7 +907,9 @@ ON ACTION guardar ATTRIBUTE(TEXT="Salvar", IMAGE="save")
COMMIT WORK
CALL seleccionarsalida() RETURNING salida
CALL configureoutput(salida) RETURNING HANDLER
-- Ver nota sobre fgl_report_* mas arriba en este archivo.
LET p_reportfile = FGL_GETENV("FGLSPOOL"), "/coprmt025_req2.xml"
LET handler = om.XmlWriter.createFileWriter(p_reportfile)
START REPORT print_req TO XML HANDLER HANDLER
PREPARE query FROM
@@ -1177,7 +1192,9 @@ FUNCTION copcmf025()
IF salida IS NULL THEN
LET salida = 'PDF'
END IF
CALL configureoutput(salida) RETURNING HANDLER
-- Ver nota sobre fgl_report_* mas arriba en este archivo.
LET p_reportfile = FGL_GETENV("FGLSPOOL"), "/coprmt025_req3.xml"
LET handler = om.XmlWriter.createFileWriter(p_reportfile)
START REPORT print_req TO XML HANDLER HANDLER
PREPARE query FROM
+23 -2
View File
@@ -166,7 +166,7 @@
<File filePath="../scripts/README.md"/>
</Library>
</Group>
<Group environment="value:CLASSPATH=$(ProjectDir)\\classes\\javax.mail.jar;$(CLASSPATH)" id="788649802" label="MODULOS" language="Genero">
<Group environment="value:CLASSPATH=$(ProjectDir)\\classes\\javax.mail.jar;$(CLASSPATH),file:FGLJVMPATH=C:\\Users\\alopez\\Java\\jdk8u504-b01-jre\\bin\\server\\jvm.dll,dir:JAVA_HOME=C:\\Users\\alopez\\Java\\jdk8u504-b01-jre,dirlist:PATH=C:\\Users\\alopez\\Java\\jdk8u504-b01-jre\\bin;C:\\Users\\alopez\\Java\\jdk8u504-b01-jre\\bin\\server;$(PATH)" id="788649802" label="MODULOS" language="Genero">
<Group id="446189093" label="ACTIVOS FIJOS">
<Library binaryName="FORMULARIOS_AC" id="749078683" label="FORMULARIOS_AC"/>
<Library binaryName="FUNCIONES_AC" id="1581383228" label="FUNCIONES_AC"/>
@@ -177,6 +177,7 @@
<File filePath="codir/coprfu009.4gl"/>
<File filePath="codir/coprorden.4gl"/>
<File filePath="codir/entrega_parciales.4gl"/>
<File filePath="codir/depto.4gl"/>
</Library>
<Library binaryName="FORMULARIOS_CO" id="-700000016" label="FORMULARIOS_CO">
<File filePath="codir/cofmmt001.4fd"/>
@@ -185,7 +186,11 @@
<File filePath="codir/cofmwd005.per"/>
<File filePath="codir/cofmwd012.per"/>
<File filePath="codir/cofmwd014.per"/>
<File filePath="codir/cofmmt016.per"/>
<File filePath="codir/cofmmt016.4fd"/>
<File filePath="codir/cofmmt010.per"/>
<File filePath="codir/cofmwd015.per"/>
<File filePath="codir/cofmmt025.per"/>
<File filePath="codir/cofmcs005.per"/>
</Library>
<Application binaryName="coprmt001" dependencies="-1026233879,-764824792,-700000015,-700000016" id="-700000017" label="coprmt001">
<Configuration commandLineArguments="alopez Lopez2023" id="-700000018" label="Configuration"/>
@@ -199,6 +204,22 @@
<Configuration commandLineArguments="alopez Lopez2023" id="-700000022" label="Configuration"/>
<File filePath="codir/coprmt016.4gl"/>
</Application>
<Application binaryName="coprmt010" dependencies="-1026233879,-764824792,-700000015,-700000016" id="-700000023" label="coprmt010">
<Configuration commandLineArguments="alopez Lopez2023" id="-700000024" label="Configuration"/>
<File filePath="codir/coprmt010.4gl"/>
</Application>
<Application binaryName="coprmt015" dependencies="-1026233879,-764824792,-700000015,-700000016" id="-700000025" label="coprmt015">
<Configuration commandLineArguments="alopez Lopez2023" id="-700000026" label="Configuration"/>
<File filePath="codir/coprmt015.4gl"/>
</Application>
<Application binaryName="coprmt025" dependencies="-1026233879,-764824792,-700000015,-700000016,-1423229125,493047263" environment="dir:FGLSPOOL=$(ProjectDir)/spool" id="-700000027" label="coprmt025">
<Configuration commandLineArguments="alopez Lopez2023" id="-700000028" label="Configuration"/>
<File filePath="codir/coprmt025.4gl"/>
</Application>
<Application binaryName="coprcs005" dependencies="-1026233879,-764824792,-700000015,-700000016" id="-700000029" label="coprcs005">
<Configuration commandLineArguments="alopez Lopez2023" id="-700000030" label="Configuration"/>
<File filePath="codir/coprcs005.4gl"/>
</Application>
</Group>
<Group id="-1298100213" label="CONTABILIDAD GENERAL">
<Application binaryName="cgprmt001" dependencies="2055924299,-1026233879" id="-1385997751" label="cgprmt001">