Añadir modulo COMPRAS (coprmt001, coprmt009, coprmt016)

- coprmt001 (Suplidores): agregar campos faltantes (tipo_doc,rnc,cuenta_no)
  al RECORD interno de ApiMaintainC() en api_test.4gl, y unificar la
  aridad de RETURNING en las 3 llamadas (POST/PATCH/DELETE) - el
  enlazador exige el mismo numero de valores de retorno en todo el modulo.
- coprmt009 (Ordenes de Compra): reemplazar fgl_report_loadCurrentSettings/
  selectDevice/selectPreview/commitCurrentSettings (no disponibles en este
  FGL) por om.XmlWriter.createFileWriter en coprorden.4gl; agregar
  verificacion defensiva en lugarentrega.4gl (ui.combobox.forname puede
  devolver NULL si el formulario actual no tiene el combo "bodega"); quitar
  "ordenes.bodega" de los INPUT BY NAME (campo oculto, no se puede enlazar).
  Pendiente: probar el flujo completo de creacion de orden (se corto por
  una caida de conexion transitoria durante la prueba).
- coprmt016 (Terminos de Pago): CRUD simple, sin cambios de codigo.
- mbsERP.4pw: crear modulo COMPRAS (estaba vacio) con librerias
  FUNCIONES_CO y FORMULARIOS_CO, y registrar los 3 programas.
- otrodir/smarmotech.sch: diccionario de esquema completo (antes faltaba
  en este directorio, causaba fallos de link en api_test.4gl).
- .gitignore: excluir logs de STARTLOG() (bin/*.TXT) y archivos .err de
  compilacion.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Abel López
2026-08-25 16:58:59 -04:00
co-authored by Claude Sonnet 5
parent 347e8139fc
commit acacf34eea
8 changed files with 8963 additions and 33 deletions
+2
View File
@@ -33,6 +33,8 @@ mydatabase.db
# ── Logs de ejecución ──
*.log
*.err
PROYECTO/bin/*.TXT
# ── Spool de reportes (salida temporal de impresión) ──
PROYECTO/spool/
+2 -2
View File
@@ -677,7 +677,7 @@ FUNCTION copcmf001()
suplidores.id_maintainx,
suplidores.*,
usuarios)
RETURNING answer
RETURNING answer, answer2
DISPLAY answer2
IF answer != 1 THEN
@@ -754,7 +754,7 @@ FUNCTION copcmf001()
suplidores.id_maintainx,
suplidores.*,
usuarios)
RETURNING answer
RETURNING answer, answer2
IF answer != 1 THEN
ROLLBACK WORK
+11 -2
View File
@@ -136,7 +136,12 @@ FUNCTION copcad009()
LABEL atras:
INPUT BY NAME ordenes.*, cod_mon, salida WITHOUT DEFAULTS
-- ordenes.bodega no se incluye: es un combo oculto (tabIndex=-1) en
-- cofmmt009 y "ordenes.*" fallaba con "Field (bodega) not found in form".
INPUT BY NAME ordenes.num_oc, ordenes.tipo, ordenes.fech_oc, ordenes.num_pr,
ordenes.cod_sp, ordenes.cod_sp_sec, ordenes.term_sp, ordenes.via,
ordenes.enviada, ordenes.fech_enviada, ordenes.pago, ordenes.fech_pago,
ordenes.cierre, ordenes.cod_pt, cod_mon, salida WITHOUT DEFAULTS
BEFORE INPUT
LET salida = "SVG"
LET ordenes.fech_oc = TODAY
@@ -1436,7 +1441,11 @@ FUNCTION copcmf009()
CONTINUE MENU
END IF
INPUT BY NAME ordenes.*, salida, cod_mon
-- ordenes.bodega excluido (ver nota en copcad009()).
INPUT BY NAME ordenes.num_oc, ordenes.tipo, ordenes.fech_oc, ordenes.num_pr,
ordenes.cod_sp, ordenes.cod_sp_sec, ordenes.term_sp, ordenes.via,
ordenes.enviada, ordenes.fech_enviada, ordenes.pago, ordenes.fech_pago,
ordenes.cierre, ordenes.cod_pt, salida, cod_mon
WITHOUT DEFAULTS
ATTRIBUTE(YELLOW)
BEFORE INPUT
+7 -15
View File
@@ -28,10 +28,11 @@ FUNCTION orden(xflete1,xarr_ordenes,xordenes,x,x1,xship_to,xmoneda,r_output,knot
total_1 DECIMAL(12,2),
descu_valor DECIMAL(12,2)
END RECORD
DEFINE handler om.SaxDocumentHandler, -- return value from fgl_report_commitCurrentSettings()
DEFINE handler om.SaxDocumentHandler,
r_filename STRING, -- filename of Report Design Document including .4rp extension
r_output VARCHAR(10), -- output format option
preview INTEGER,
p_reportfile STRING,
xvalor DEC(12,2),
x RECORD
nom_sp LIKE cotb00001.nom_sp,
@@ -78,20 +79,11 @@ FUNCTION orden(xflete1,xarr_ordenes,xordenes,x,x1,xship_to,xmoneda,r_output,knot
END RECORD, uso STRING
IF xarr_ordenes.getLength() > 0 THEN
LET r_filename ='coprmt009.4rp'
#LET r_output='SVG'
LET preview = 1
IF fgl_report_loadCurrentSettings(r_filename) THEN -- load the .4rp file
CALL fgl_report_selectDevice(r_output) -- changing default
CALL fgl_report_selectPreview(preview) -- changing default
# CALL fgl_winmessage("veprrp049",r_output,"stop")
# CALL fgl_winmessage("veprrp049",preview,"stop")
LET handler = fgl_report_commitCurrentSettings() -- commit changes
END IF
-- 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 usar la plantilla .4rp con vista previa.
LET p_reportfile = FGL_GETENV("FGLSPOOL"), "/coprmt009_orden.xml"
LET handler = om.XmlWriter.createFileWriter(p_reportfile)
--run the report
IF handler IS NOT NULL THEN -- report engine was configured ok
+30 -1
View File
@@ -117,6 +117,7 @@
<File filePath="otrodir/ircodigosMovimientos.4gl"/>
<File filePath="otrodir/localidades.4gl"/>
<File filePath="otrodir/lugarentrega.4gl"/>
<File filePath="otrodir/tipoOrden.4gl"/>
<File filePath="otrodir/mensajes.4gl"/>
<File filePath="otrodir/msg.4gl"/>
<File filePath="ccdir/numeroDepositos.4gl"/>
@@ -170,7 +171,35 @@
<Library binaryName="FORMULARIOS_AC" id="749078683" label="FORMULARIOS_AC"/>
<Library binaryName="FUNCIONES_AC" id="1581383228" label="FUNCIONES_AC"/>
</Group>
<Group id="634755826" label="COMPRAS"/>
<Group id="634755826" label="COMPRAS">
<Library binaryName="FUNCIONES_CO" id="-700000015" label="FUNCIONES_CO">
<File filePath="codir/coprgb000.4gl"/>
<File filePath="codir/coprfu009.4gl"/>
<File filePath="codir/coprorden.4gl"/>
<File filePath="codir/entrega_parciales.4gl"/>
</Library>
<Library binaryName="FORMULARIOS_CO" id="-700000016" label="FORMULARIOS_CO">
<File filePath="codir/cofmmt001.4fd"/>
<File filePath="codir/cofmwd019.per"/>
<File filePath="codir/cofmmt009.per"/>
<File filePath="codir/cofmwd005.per"/>
<File filePath="codir/cofmwd012.per"/>
<File filePath="codir/cofmwd014.per"/>
<File filePath="codir/cofmmt016.per"/>
</Library>
<Application binaryName="coprmt001" dependencies="-1026233879,-764824792,-700000015,-700000016" id="-700000017" label="coprmt001">
<Configuration commandLineArguments="alopez Lopez2023" id="-700000018" label="Configuration"/>
<File filePath="codir/coprmt001.4gl"/>
</Application>
<Application binaryName="coprmt009" dependencies="-1026233879,-764824792,-700000015,-700000016" id="-700000019" label="coprmt009">
<Configuration commandLineArguments="alopez Lopez2023 70" id="-700000020" label="Configuration"/>
<File filePath="codir/coprmt009.4gl"/>
</Application>
<Application binaryName="coprmt016" dependencies="-1026233879,-764824792,-700000015,-700000016" id="-700000021" label="coprmt016">
<Configuration commandLineArguments="alopez Lopez2023" id="-700000022" label="Configuration"/>
<File filePath="codir/coprmt016.4gl"/>
</Application>
</Group>
<Group id="-1298100213" label="CONTABILIDAD GENERAL">
<Application binaryName="cgprmt001" dependencies="2055924299,-1026233879" id="-1385997751" label="cgprmt001">
<Configuration id="-340886821" label="Configuration"/>
+7 -6
View File
@@ -1,9 +1,9 @@
{
------------------------------------------------------------------
PROGRAMA : MaintainX_API
OBJETIVO : Código que ejecuta los POST, GET Y PUT ENTRE MAINTAINX
Y GÉNERO
PROGRAMADOR : Ing. Elvis García.
OBJETIVO : Cdigo que ejecuta los POST, GET Y PUT ENTRE MAINTAINX
Y GNERO
PROGRAMADOR : Ing. Elvis Garca.
FECHA REALIZACION : Agosto 15, 2024.
------------------------------------------------------------------
}
@@ -91,6 +91,7 @@ FUNCTION ApiMaintainC(metodo, idApi, Data, usuario) --FUNCION PARA COMPRAS
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),
@@ -98,9 +99,11 @@ FUNCTION ApiMaintainC(metodo, idApi, Data, usuario) --FUNCION PARA COMPRAS
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,
@@ -447,10 +450,8 @@ FUNCTION ApiMaintainC(metodo, idApi, Data, usuario) --FUNCION PARA COMPRAS
IF answer2 IS NOT NULL THEN
DISPLAY answer2
RETURN answer, answer2
ELSE
RETURN answer
END IF
RETURN answer, answer2
END FUNCTION
+5
View File
@@ -3,6 +3,11 @@ FUNCTION lugarentregas()
DEFINE ketiquetas SMALLINT, detiquetas CHAR(30),
cbodegas ui.ComboBox
LET cbodegas = ui.combobox.forname("formonly.bodega")
IF cbodegas IS NULL THEN
-- El formulario actual no tiene un combo "bodega" visible
-- (ej. cofmmt009); no hay nada que llenar.
RETURN
END IF
DECLARE bbodegas CURSOR FOR
SELECT a.cod_bodega,a.descripcion FROM intb00009 a WHERE a.lugar_entega = 'SI'
ORDER BY a.descripcion
File diff suppressed because it is too large Load Diff