-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtipo_cambio_sbs.iss
57 lines (45 loc) · 1.69 KB
/
tipo_cambio_sbs.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
Sub Main
IgnoreWarning(True)
'Client.RunPython "C:\Users\Intel\Documents\Mis documentos IDEA\Samples\Macros.ILB\tipo_cambio_sbs.py"
Call TextImport() 'C:\ProgramData\Anaconda3\Python_Notebooks\Tipo_cambio.csv
Call JoinDatabase() 'Ejemplo-Detalle de ventas.IMD
Call AppendField() 'Ejemplo_Detalle de ventas_Moneda.IMD
Client.RefreshFileExplorer
End Sub
' Archivo - Asistente de importación: Texto delimitado
Function TextImport
dbName = "Tipo_cambio.IMD"
Client.ImportUTF8DelimFile "C:\Users\Intel\Documents\Mis documentos IDEA\Samples\Archivos fuente.ILB\Tipo_cambio.csv", dbName, FALSE, "", "C:\Users\Intel\Documents\Mis documentos IDEA\Samples\Definiciones de importación.ILB\Tipo_cambio.RDF", TRUE
Client.OpenDatabase (dbName)
End Function
' Archivo: Unir bases de datos
Function JoinDatabase
Set db = Client.OpenDatabase("Ejemplo-Detalle de ventas.IMD")
Set task = db.JoinDatabase
task.FileToJoin "Tipo_cambio.IMD"
task.IncludeAllPFields
task.IncludeAllSFields
task.AddMatchKey "MONEDA", "MONEDA", "A"
task.CreateVirtualDatabase = False
dbName = "Ejemplo_Detalle de ventas_Moneda.IMD"
task.PerformTask dbName, "", WI_JOIN_ALL_IN_PRIM
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
End Function
' Anexar campo
Function AppendField
Set db = Client.OpenDatabase("Ejemplo_Detalle de ventas_Moneda.IMD")
Set task = db.TableManagement
Set field = db.TableDef.NewField
field.Name = "TOTAL_MONEDA"
field.Description = ""
field.Type = WI_VIRT_NUM
field.Equation = " TOTAL * VENTA "
field.Decimals = 2
task.AppendField field
task.PerformTask
Set task = Nothing
Set db = Nothing
Set field = Nothing
End Function