JSOTO cgprmt022 adaptado a MARMOTECH y cgprmt037 fuera del proyecto MBS

cgprmt022 (actualizacion de tasa mensual, cgtb00084; la usa edprrp116):
- La fuente era la version de EXTERIOR, donde vetb00060/vetb00061 estan invertidas
  respecto a marmotech: el combo de moneda ahora sale de vetb00061 y los tipos de
  cliente de vetb00060.
- SELECT INTO tenia 5 columnas para 4 variables.
- Se quita la segunda escritura a marmotech.dbo.cgtb00084 (en marmotech es la misma tabla).
- cgfmmt022.4fd: formulario de EXTERIOR (campo Replicar y tabla de tipos de cliente);
  el de MARMOTECH (2022) no tenia esos campos (-1102).

mbsERP.4pw: se quita la aplicacion cgprmt037 y sus formularios cgfmmt037/cgfmwd006
(solo los usaba ese programa). Pertenece al proyecto EXTERIOR (sistema de tablas de la
BD exterior, aun no iniciado); las fuentes quedan en cgdir.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-16 17:05:01 -04:00
co-authored by Claude Opus 5.5
parent 0991743a80
commit f363390589
3 changed files with 45 additions and 54 deletions
+38 -33
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<ManagedForm fileVersion="31400" gstVersion="31408" name="ManagedForm" uid="{31f07807-66ff-4015-b438-54609b9d94d1}"> <ManagedForm fileVersion="31400" gstVersion="3140a" name="ManagedForm" uid="{31f07807-66ff-4015-b438-54609b9d94d1}">
<AGSettings> <AGSettings>
<DynamicProperties version="2"/> <DynamicProperties version="2"/>
</AGSettings> </AGSettings>
@@ -7,41 +7,46 @@
<RecordField colName="" fieldIdRef="1" name="ano" sqlTabName="" table_alias_name="" uid="{29b3c62f-3acc-4fe5-9519-691b62244513}"/> <RecordField colName="" fieldIdRef="1" name="ano" sqlTabName="" table_alias_name="" uid="{29b3c62f-3acc-4fe5-9519-691b62244513}"/>
<RecordField colName="" fieldIdRef="3" name="tasa" sqlTabName="" table_alias_name="" uid="{335a3faf-3971-46cf-8682-b2a0d26d0ce4}"/> <RecordField colName="" fieldIdRef="3" name="tasa" sqlTabName="" table_alias_name="" uid="{335a3faf-3971-46cf-8682-b2a0d26d0ce4}"/>
<RecordField colName="" fieldIdRef="4" name="ventas" sqlTabName="" table_alias_name="" uid="{0d44db9e-8bb3-4234-b3e1-a451631885b0}"/> <RecordField colName="" fieldIdRef="4" name="ventas" sqlTabName="" table_alias_name="" uid="{0d44db9e-8bb3-4234-b3e1-a451631885b0}"/>
<RecordField colName="" fieldIdRef="5" name="tipo_cliente" sqlTabName="" table_alias_name="" uid="{cc62abbe-1941-48fd-8d4f-24abf68a16f5}"/> <RecordField colName="" defaultValue="1" fieldIdRef="6" name="mes" sqlTabName="" table_alias_name="" uid="{5dd5469e-a72f-405c-8e6a-fcf39b9979ec}"/>
<RecordField colName="" fieldIdRef="6" name="mes" sqlTabName="" table_alias_name="" uid="{5dd5469e-a72f-405c-8e6a-fcf39b9979ec}"/> <RecordField defaultValue="NO" fieldIdRef="5" length="2" name="replica" uid="{3c059da6-3a31-4a3c-862c-89bcdd2a39a9}"/>
</Record> </Record>
<Record name="record1" uid="{cabacd20-e0a8-493e-be77-0cba78915dc5}"> <Record name="sclientes" uid="{18e4456d-6a83-49cb-89b4-6ddc390b0f50}">
<RecordField fieldIdRef="2" name="edit1" uid="{bd6d1cf9-069e-4b14-a608-c0150c908861}"/> <RecordField fieldIdRef="2" name="tipo_cliente1" uid="{a893fece-c46b-4a9a-b5c1-d9057eef321e}"/>
<RecordField fieldIdRef="7" name="edit2" uid="{909aebc3-d3fe-4f9d-923d-2f68fd9cd476}"/> <RecordField fieldIdRef="7" name="tasa1" uid="{1cdfd2ef-c515-4ff7-8cb6-2d8b8b7ff397}"/>
</Record> </Record>
<Form gridHeight="25" gridWidth="97" name="Form" text="ADMINISTRACION TASA"> <Form gridHeight="25" gridWidth="80" name="Form" text="ADMINISTRACION TASA">
<Folder gridHeight="18" gridWidth="64" name="folder1" posX="2" posY="2"> <Grid gridHeight="18" gridWidth="39" name="Grid1" posX="8" posY="3">
<Page name="page1" text="page1"> <Label gridHeight="1" gridWidth="26" name="Label6" posX="4" posY="1" text="ADMINISTRACION TASAS"/>
<Grid gridHeight="12" gridWidth="60" name="grid2" posX="2" posY="3"> <Label gridHeight="1" gridWidth="10" name="Label1" posX="5" posY="3" text="Ano"/>
<Table gridHeight="6" gridWidth="19" name="table1" posX="6" posY="3" totalRows="5"> <Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="1" gridHeight="1" gridWidth="10" name="ano" posX="17" posY="3" sqlTabName="" tabIndex="1" table_alias_name="" title="Edit1" widget="Edit"/>
<Edit fieldId="2" gridHeight="1" gridWidth="8" name="edit1" posX="0" posY="0" tabIndex="-1" title="edit1" widget="Edit"/> <Label gridHeight="1" gridWidth="10" name="Label2" posX="5" posY="4" text="Mes"/>
<Edit fieldId="7" gridHeight="1" gridWidth="8" name="edit2" posX="8" posY="0" tabIndex="-1" title="edit2" widget="Edit"/> <ComboBox aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" defaultValue="1" fieldId="6" gridHeight="1" gridWidth="18" items="ENERO, FEBRERO, MARZO, ABRIL, MAYO, JUNIO, JULIO, AGOSTO, SEPTIEMBRE, OCTUBRE, NOVIEMBRE, DICIEMBRE" name="mes" posX="17" posY="4" sqlTabName="" tabIndex="4" table_alias_name="" title="Edit1" widget="ComboBox">
</Table> <Item lstrtext="false" name="1" text="ENERO"/>
</Grid> <Item lstrtext="false" name="2" text="FEBRERO"/>
</Page> <Item lstrtext="false" name="3" text="MARZO"/>
<Page name="page2" text="page2"> <Item lstrtext="false" name="4" text="ABRIL"/>
<Grid gridHeight="14" gridWidth="39" name="Grid1" posX="1" posY="1"> <Item lstrtext="false" name="5" text="MAYO"/>
<Label gridHeight="1" gridWidth="26" name="Label6" posX="4" posY="1" text="ADMINISTRACION TASAS"/> <Item lstrtext="false" name="6" text="JUNIO"/>
<Label gridHeight="1" gridWidth="10" name="Label1" posX="5" posY="3" text="Ano"/> <Item lstrtext="false" name="7" text="JULIO"/>
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="1" gridHeight="1" gridWidth="10" name="ano" posX="17" posY="3" sqlTabName="" tabIndex="1" table_alias_name="" title="Edit1" widget="Edit"/> <Item lstrtext="false" name="8" text="AGOSTO"/>
<Label gridHeight="1" gridWidth="10" name="Label2" posX="5" posY="4" text="Mes"/> <Item lstrtext="false" name="9" text="SEPTIEMBRE"/>
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="6" gridHeight="1" gridWidth="10" name="mes" posX="17" posY="4" sqlTabName="" tabIndex="5" table_alias_name="" title="Edit1" widget="Edit"/> <Item lstrtext="false" name="10" text="OCTUBRE"/>
<Label gridHeight="1" gridWidth="10" name="Label3" posX="5" posY="5" text="Moneda"/> <Item lstrtext="false" name="11" text="NOVIEMBRE"/>
<ComboBox aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" comment="Digite 1- VENTAS LOCALIES" fieldId="4" gridHeight="1" gridWidth="18" items="" name="ventas" posX="17" posY="5" sqlTabName="" tabIndex="3" table_alias_name="" title="Edit1" widget="ComboBox"/> <Item lstrtext="false" name="12" text="DICIEMBRE"/>
<Label gridHeight="1" gridWidth="10" name="Label4" posX="5" posY="6" text="Tipo Cuenta"/> </ComboBox>
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="5" gridHeight="1" gridWidth="10" name="tipo_cliente" posX="17" posY="6" sqlTabName="" tabIndex="4" table_alias_name="" title="Edit1" widget="Edit"/> <Label gridHeight="1" gridWidth="10" name="Label3" posX="5" posY="5" text="Moneda"/>
<Label gridHeight="1" gridWidth="10" name="Label5" posX="5" posY="7" text="Tasa"/> <ComboBox aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" comment="Digite 1- VENTAS LOCALIES" fieldId="4" gridHeight="1" gridWidth="18" items="" name="ventas" posX="17" posY="5" sqlTabName="" tabIndex="3" table_alias_name="" title="Edit1" widget="ComboBox"/>
<Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="3" gridHeight="1" gridWidth="10" name="tasa" posX="17" posY="7" sqlTabName="" tabIndex="2" table_alias_name="" title="Edit1" widget="Edit"/> <Label gridHeight="1" gridWidth="10" name="Label5" posX="5" posY="6" text="Tasa"/>
</Grid> <Edit aggregateColName="" aggregateName="" aggregateTableAliasName="" aggregateTableName="" colName="" fieldId="3" gridHeight="1" gridWidth="10" name="tasa" posX="17" posY="6" sqlTabName="" tabIndex="2" table_alias_name="" title="Edit1" widget="Edit"/>
</Page> <Label gridHeight="1" gridWidth="10" name="label4" posX="5" posY="7" text="Replicar"/>
</Folder> <CheckBox defaultValue="NO" fieldId="5" gridHeight="1" gridWidth="9" include="SI|NO" length="2" name="replica" notNull="true" posX="17" posY="7" tabIndex="-1" title="checkbox1" valueChecked="SI" valueUnchecked="NO" widget="CheckBox"/>
<Table gridHeight="6" gridWidth="28" name="table1" posX="5" posY="8" totalRows="5">
<Edit fieldId="2" gridHeight="1" gridWidth="8" name="tipo_cliente1" posX="0" posY="0" tabIndex="-1" title="Tipo Cliente" widget="Edit"/>
<Edit fieldId="7" gridHeight="1" gridWidth="11" name="tasa1" posX="8" posY="0" tabIndex="-1" title="Tasa" widget="Edit"/>
</Table>
</Grid>
</Form> </Form>
<DiagramLayout> <DiagramLayout>
<![CDATA[AAAAAgAAAEwAewBjAGEAYgBhAGMAZAAyADAALQBlADAAYQA4AC0ANAA5ADMAZQAtAGIAZQA3ADcALQAwAGMAYgBhADcAOAA5ADEANQBkAGMANQB9QCAAAAQAAABAIAAABAAAAAAAAAAAAAAAAQAAAEwAewAyADYANwBkAGQANwBiADcALQAzAGEAOQA1AC0ANAAwADIAMAAtAGEAYgAyAGEALQBhAGIAOAAyAGQAMgA0ADQANABlADkANwB9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQ==]]> <![CDATA[AAAAAgAAAEwAewAyADYANwBkAGQANwBiADcALQAzAGEAOQA1AC0ANAAwADIAMAAtAGEAYgAyAGEALQBhAGIAOAAyAGQAMgA0ADQANABlADkANwB9AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAEwAewAxADgAZQA0ADQANQA2AGQALQA2AGEAOAAzAC0ANAA5AGMAYgAtADgAOQBiADQALQA2AGQAZABjADMAOQAwAGIAMABmADUAMAB9QCQAAAAAAABAJAAAAAAAAD9QYk3S8an8AQ==]]>
</DiagramLayout> </DiagramLayout>
</ManagedForm> </ManagedForm>
+7 -14
View File
@@ -60,7 +60,8 @@ FUNCTION cgprmt022()
ON CHANGE tasa ON CHANGE tasa
DECLARE busca_tipos CURSOR for DECLARE busca_tipos CURSOR for
SELECT DISTINCT a.tipo_cliente FROM vetb00061 a WHERE a.ventas = mtasa.ventas AND a.tipo_cliente > 14 -- En marmotech vetb00060 = tipo_cliente x moneda (en EXTERIOR es al reves: vetb00061)
SELECT DISTINCT a.tipo_cliente FROM vetb00060 a WHERE a.ventas = mtasa.ventas AND a.tipo_cliente > 14
LET i =1 LET i =1
FOREACH busca_tipos INTO clientes[i].* FOREACH busca_tipos INTO clientes[i].*
@@ -82,7 +83,7 @@ FUNCTION cgprmt022()
CALL msg(16) CALL msg(16)
NEXT FIELD tasa NEXT FIELD tasa
END IF END IF
SELECT DISTINCT a.ano,a.mes,a.ventas,a.tipo_cliente,a.tasa SELECT DISTINCT a.ano,a.mes,a.ventas,a.tipo_cliente
INTO mtasa.ano,mtasa.mes,mtasa.ventas,clientes[i].tipo_cliente1 INTO mtasa.ano,mtasa.mes,mtasa.ventas,clientes[i].tipo_cliente1
FROM cgtb00084 a WHERE a.ano = mtasa.ano AND a.mes = mtasa.mes AND FROM cgtb00084 a WHERE a.ano = mtasa.ano AND a.mes = mtasa.mes AND
a.ventas = mtasa.ventas AND a.tipo_cliente = clientes[i].tipo_cliente1 a.ventas = mtasa.ventas AND a.tipo_cliente = clientes[i].tipo_cliente1
@@ -101,17 +102,9 @@ FUNCTION cgprmt022()
END IF END IF
# PARA LA BASE DE DATOS MARMOTECH -- (la version EXTERIOR repetia aqui el INSERT/UPDATE en marmotech.dbo.cgtb00084;
EXECUTE selecciona USING mtasa.ano,mtasa.mes,mtasa.ventas,clientes[i].tipo_cliente1 -- conectado a marmotech es la misma tabla: se quito la doble escritura)
IF STATUS = NOTFOUND THEN
IF clientes[i].tipo_cliente1 IS NOT NULL THEN
EXECUTE adicionar USING mtasa.ano,mtasa.mes,clientes[i].tipo_cliente1,mtasa.ventas,mtasa.tasa
END IF
ELSE
EXECUTE actual USING mtasa.tasa,mtasa.ano,mtasa.mes,mtasa.ventas,clientes[i].tipo_cliente1
END IF
END IF END IF
END FOR END FOR
LET pano = mtasa.ano LET pano = mtasa.ano
@@ -144,7 +137,7 @@ FUNCTION cventas()
LET pventas = ui.combobox.forname("formonly.ventas") LET pventas = ui.combobox.forname("formonly.ventas")
DECLARE bventas CURSOR FOR DECLARE bventas CURSOR FOR
SELECT a.ventas,a.descripcion FROM vetb00060 a SELECT a.ventas,a.descripcion FROM vetb00061 a -- monedas en marmotech
CALL pventas.clear() CALL pventas.clear()
FOREACH bventas INTO kventas,dventas FOREACH bventas INTO kventas,dventas
-7
View File
@@ -221,11 +221,6 @@
<Configuration id="-1428622255" label="Configuration"/> <Configuration id="-1428622255" label="Configuration"/>
<File filePath="cgdir/cgprmt005.4gl"/> <File filePath="cgdir/cgprmt005.4gl"/>
</Application> </Application>
<Application binaryName="cgprmt037" dependencies="-1026233879,2055924299,-1423229125,-1298477600,-764824792" environment="dir:FGLSPOOL=$(ProjectDir)/spool" externalDependencies="libgre.42x" id="-1980983977" label="cgprmt037">
<Configuration id="-1608278775" label="Configuration"/>
<File filePath="cgdir/cgprmt037.4gl"/>
<File filePath="bin/cgprmt037.4rp"/>
</Application>
<Application binaryName="cgprrp017" dependencies="-1026233879,-764824792,2055924299,-1423229125,-1298477600" environment="dir:FGLSPOOL=$(ProjectDir)/spool" externalDependencies="libgre.42x" id="-1372432327" label="cgprrp017"> <Application binaryName="cgprrp017" dependencies="-1026233879,-764824792,2055924299,-1423229125,-1298477600" environment="dir:FGLSPOOL=$(ProjectDir)/spool" externalDependencies="libgre.42x" id="-1372432327" label="cgprrp017">
<Configuration id="-1399946799" label="Configuration"/> <Configuration id="-1399946799" label="Configuration"/>
<File filePath="cgdir/cgprrp017.4gl"/> <File filePath="cgdir/cgprrp017.4gl"/>
@@ -442,8 +437,6 @@
<File filePath="cgdir/edfmrp080.4fd"/> <File filePath="cgdir/edfmrp080.4fd"/>
<File filePath="cgdir/cgfmmt005.4fd"/> <File filePath="cgdir/cgfmmt005.4fd"/>
<File filePath="cgdir/cgfmwd007.per"/> <File filePath="cgdir/cgfmwd007.per"/>
<File filePath="cgdir/cgfmmt037.4fd"/>
<File filePath="cgdir/cgfmwd006.per"/>
<File filePath="cgdir/cgfmrp017.per"/> <File filePath="cgdir/cgfmrp017.per"/>
<File filePath="cgdir/cgfmcs026.4fd"/> <File filePath="cgdir/cgfmcs026.4fd"/>
</Library> </Library>