generated from jorgechavez6816/Import_EECC_BCP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
I_Importa_BN.iss
64 lines (59 loc) · 1.86 KB
/
I_Importa_BN.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
58
59
60
61
62
63
64
'Desarrollado por Jorge M. Chávez
'Fecha: 01/03/2023
Sub Main
IgnoreWarning(True)
Call ReportReaderImport() 'D:\RUC1\DATA\Archivos fuente.ILB\2022_BN.pdf
Call AppendField() 'I_BN2022.IMD
Call Summarization() 'I_BN2022.IMD
Client.CloseAll
Dim pm As Object
Dim SourcePath As String
Dim DestinationPath As String
Set SourcePath = Client.WorkingDirectory
Set DestinationPath = "D:\RUC1\DATA\_EECC"
Client.RunAtServer False
Set pm = Client.ProjectManagement
pm.MoveDatabase SourcePath + "I_BN2022.IMD", DestinationPath
pm.MoveDatabase SourcePath + "I.1_Resumen_BN.IMD", DestinationPath
Set pm = Nothing
Client.RefreshFileExplorer
End Sub
' Archivo - Asistente de importación: Report Reader
Function ReportReaderImport
dbName = "I_BN2022.IMD"
Client.ImportPrintReportEx "D:\RUC1\DATA\Definiciones de importación.ILB\BN_CTA_CTE.jpm", "D:\RUC1\DATA\Archivos fuente.ILB\2022_BN.pdf", dbname, FALSE, FALSE
Client.OpenDatabase (dbName)
End Function
' Anexar campo
Function AppendField
Set db = Client.OpenDatabase("I_BN2022.IMD")
Set task = db.TableManagement
Set field = db.TableDef.NewField
field.Name = "PERIODO"
field.Description = ""
field.Type = WI_VIRT_CHAR
field.Equation = "@RIGHT(FECHA;4)+@MID(FECHA;4;2)"
field.Length = 6
task.AppendField field
task.PerformTask
Set task = Nothing
Set db = Nothing
Set field = Nothing
End Function
' Análisis: Resumen
Function Summarization
Set db = Client.OpenDatabase("I_BN2022.IMD")
Set task = db.Summarization
task.AddFieldToSummarize "PERIODO"
task.AddFieldToSummarize "CUENTA"
task.AddFieldToTotal "CARGOS"
task.AddFieldToTotal "ABONOS"
dbName = "I.1_Resumen_BN.IMD"
task.OutputDBName = dbName
task.CreatePercentField = FALSE
task.StatisticsToInclude = SM_SUM
task.PerformTask
Set task = Nothing
Set db = Nothing
Client.OpenDatabase (dbName)
End Function