-
Notifications
You must be signed in to change notification settings - Fork 0
/
DeletedObjectsRecord.txt
205 lines (160 loc) · 5.44 KB
/
DeletedObjectsRecord.txt
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
;; Enable Logging for deleted objects
[#Part: CMP AccFeat Right]
Add:Line:At End:DeletedObjectConfig
[Line:DeletedObjectConfig]
Space Top:0.2
Fields:MediumPrompt,LogicalField
Local:Field:MediumPrompt:Info:$$LocaleString:"Keep Tracking Deleted Vouchers and Masters?"
Local:Field:LogicalField:Set as:No
Local:Field:Logical Field:Storage:DelObjCanAct
[System:Formulae]
CanMaintainDeletionLog:$DelObjCanAct:Company:##SvCurrentCompany
;; Subscribe to Object Delete Event To Perform Logging
[System:Events]
AfterObjectDeleted:After Delete Object:Yes and @@CanMaintainDeletionLog:Call:PerformDeleteLogOperation
;;Logging Function
[Function:PerformDeleteLogOperation]
Variable:DelObjType:String
Variable:DelObjMid:String
Variable:DelObjGuid:String
Variable:DelObjVno:String
Variable:DelObjDate:String
Variable:DelObjVType:String
Variable:DelObjName:String
Variable:DelObjPerformDate:String
Variable:DelObjTime:String
Variable:DelObjUser:String
01:Set:DelObjType:$$String:($$Type:.)
02:Set:DelObjMid:$$String:($MasterId)
03:Set:DelObjGuid:$Guid
04:Set:DelObjPerformDate:$$String:($$MachineDate)
05:Set:DelObjTime:$$String:$$MachineTime
06:Set:DelObjUser:$$String:$$CmpUserName
07:Set:DelObjVno:$$String:(if ##DelObjType = "Voucher" then $VoucherNumber else "")
08:Set:DelObjDate:$$String:(if ##DelObjType = "Voucher" then ($$String:$Date) else "")
09:Set:DelObjVType:$$String:(if ##DelObjType = "Voucher" then $VoucherTypeName else "")
10:Set:DelObjName:$$String:(if ##DelObjType = "Voucher" then "" else $Name)
11:Call:DeletedObjStartLogg
12:Return
[Function:DeletedObjStartLogg]
Object:Company:##SvCurrentCompany
02:Set Object:.
03:Set Target
04:Insert Collection Object:DeletedObjLogger
05:Set Value:DeletedObjType:##DelObjType
06:Set Value:DeletedObjMid:##DelObjMid
07:Set Value:DeletedObjGuid:##DelObjGuid
08:Set Value:DeletedObjPDate:##DelObjPerformDate
09:Set Value:DeletedObjTime:##DelObjTime
10:Set Value:DeletedObjUser:##DelObjUser
11:Set Value:DeletedObjVno:##DelObjVno
12:Set Value:DeletedObjVdate:##DelObjDate
13:Set Value:DeletedObjVtype:##DelObjVType
14:Set Value:DeletedObjName:##DelObjName
15:Set Target:..
16:Save Target
17:Log:"Log Record Created.."
18:Return
;;; report for deleted objects
[#Menu:GateWayOfTally]
Add:Key Item:Deleted Items Record:m:Display:DeletedObjectsRecordRpt
[Report:DeletedObjectsRecordRpt]
Form:DeletedObjectsRecordRpt
Title:$$LocaleString:"List Of Deleted Vouchers and Masters"
[Form:DeletedObjectsRecordRpt]
Part:DeletedObjectsRecordRpt
Buttons:PrintButton,ExportButton
[Part:DeletedObjectsRecordRpt]
Lines:DeletedObjTitles,DeletedObjValues
Repeat:DeletedObjValues:DeletedObjectsLogColl
Common Border:Yes
Scrolled:Both
Width:100% page
Background:white
[Line:DeletedObjTitles]
Border:ThickTopBottom
Fields:DeletedObjPDate,DeletedObjTime,DeletedObjUser,DeletedObjType,DeletedObjMid,DeletedObjVno,DeletedObjVdate,DeletedObjVType,DeletedObjName,DeletedObjGuid
Local:Field:DeletedObjPDate:Set as:"Deleted On"
Local:Field:DeletedObjTime:Set as:"Deleted At"
Local:Field:DeletedObjUser:Set as:"Deleted By"
Local:Field:DeletedObjType:Set as:"Type"
Local:Field:DeletedObjMid:Set as:"Master Id"
Local:Field:DeletedObjGuid:Set as:"Guid"
Local:Field:DeletedObjVno:Set as:"Voucher Number"
Local:Field:DeletedObjVdate:Set as:"Voucher Date"
Local:Field:DeletedObjVtype:Set as:"Voucher Type"
Local:Field:DeletedObjName:Set as:"Master Name"
Local:Field:default:Align:Center
Local:Field:Default:Style:Normal Bold
Local:Field:Default:Border:ThinLeft
[Line:DeletedObjValues]
Fields:DeletedObjPDate,DeletedObjTime,DeletedObjUser,DeletedObjType,DeletedObjMid,DeletedObjVno,DeletedObjVdate,DeletedObjVType,DeletedObjName,DeletedObjGuid
[Field:DeletedObjPDate]
Set as:$DeletedObjPDate
Align:Center
Width:15
Border:ThinLeft
[Field:DeletedObjTime]
Set as:$DeletedObjTime
Align:Center
Width:15
Border:ThinLeft
[Field:DeletedObjUser]
Set as:$DeletedObjUser
Align:Center
Width:15
Border:ThinLeft
[Field:DeletedObjType]
Set as:$DeletedObjType
Align:Center
Width:20
Border:ThinLeft
[Field:DeletedObjMid]
Set as:$$String:$DeletedObjMid
Align:Center
Width:15
Border:ThinLeft
[Field:DeletedObjGuid]
Set as:$DeletedObjGuid
Align:Center
Width:25
Border:ThinLeft
[Field:DeletedObjVno]
Set as:$DeletedObjVno
Align:Center
Width:15
Border:ThinLeft
[Field:DeletedObjVdate]
Set as:$DeletedObjVdate
Align:Center
Width:15
Border:ThinLeft
[Field:DeletedObjVType]
Set as:$DeletedObjVType
Align:Center
Width:15
Border:ThinLeft
[Field:DeletedObjName]
Set as:$DeletedObjName
Align:Center
Width:20
Border:ThinLeft
;;Deleted Objects Info Storage
[System:UDF]
DeletedObjLogger:Aggregate:5000
DeletedObjPDate:String:5011
DeletedObjTime:String:5009
DeletedObjUser:String:5010
DeletedObjType:String:5001
DeletedObjMid:String:5002
DeletedObjGuid:String:5003
DeletedObjVno:String:5004
DeletedObjVdate:String:5006
DeletedObjVtype:String:5007
DeletedObjName:String:5008
DelObjCanAct:Logical:6156
;; Deleted Objects Collection
[Collection:DeletedObjectsLogColl]
Type:DeletedObjLogger:Company
Child Of:##SvCurrentCompany
Fetch:DeletedObjType,DeletedObjMid,DeletedObjGuid,DeletedObjVno,DeletedObjVdate,DeletedObjVtype,DeletedObjName,DeletedObjTime,DeletedObjUser,DeletedObjPDate