-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodeunit_0000000229.txt
339 lines (319 loc) · 12.8 KB
/
Codeunit_0000000229.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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
OBJECT Codeunit 229 Document-Print
{
OBJECT-PROPERTIES
{
Date=09/07/12;
Time=12:00:00 PM;
Version List=NAVW17.00,NAVNA7.00;
}
PROPERTIES
{
OnRun=BEGIN
END;
}
CODE
{
VAR
Text001@1001 : TextConst 'ENU=%1 is missing for %2 %3.;ESM=%1 se pierde para %2 %3.;FRC=%1 est manquant pour %2 %3.;ENC=%1 is missing for %2 %3.';
Text002@1002 : TextConst 'ENU=%1 for %2 is missing in %3.;ESM=%1 para %2 se pierde en %3.;FRC=%1 pour %2 est manquant dans %3.;ENC=%1 for %2 is missing in %3.';
SalesSetup@1003 : Record 311;
PurchSetup@1004 : Record 312;
SalesLine@1005 : Record 37;
PurchLine@1006 : Record 39;
ServLine@1010 : Record 5902;
SalesCalcDisc@1007 : Codeunit 60;
PurchCalcDisc@1008 : Codeunit 70;
ServCalcDisc@1009 : Codeunit 5950;
PROCEDURE PrintSalesHeader@1(SalesHeader@1000 : Record 36);
VAR
ReportSelection@1001 : Record 77;
BEGIN
SalesHeader.SETRANGE("No.",SalesHeader."No.");
SalesSetup.GET;
IF SalesSetup."Calc. Inv. Discount" THEN BEGIN
SalesLine.RESET;
SalesLine.SETRANGE("Document Type",SalesHeader."Document Type");
SalesLine.SETRANGE("Document No.",SalesHeader."No.");
SalesLine.FINDFIRST;
SalesCalcDisc.RUN(SalesLine);
SalesHeader.GET(SalesHeader."Document Type",SalesHeader."No.");
COMMIT;
END;
CASE SalesHeader."Document Type" OF
SalesHeader."Document Type"::Quote:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Quote");
SalesHeader."Document Type"::"Blanket Order":
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Blanket");
SalesHeader."Document Type"::Order:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Order");
SalesHeader."Document Type"::"Return Order":
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Return");
ELSE
EXIT;
END;
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",TRUE,FALSE,SalesHeader)
UNTIL ReportSelection.NEXT = 0;
END;
PROCEDURE PrintPurchHeader@5(PurchHeader@1000 : Record 38);
VAR
ReportSelection@1001 : Record 77;
BEGIN
PurchHeader.SETRANGE("No.",PurchHeader."No.");
PurchSetup.GET;
IF PurchSetup."Calc. Inv. Discount" THEN BEGIN
PurchLine.RESET;
PurchLine.SETRANGE("Document Type",PurchHeader."Document Type");
PurchLine.SETRANGE("Document No.",PurchHeader."No.");
PurchLine.FINDFIRST;
PurchCalcDisc.RUN(PurchLine);
PurchHeader.GET(PurchHeader."Document Type",PurchHeader."No.");
COMMIT;
END;
CASE PurchHeader."Document Type" OF
PurchHeader."Document Type"::Quote:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"P.Quote");
PurchHeader."Document Type"::"Blanket Order":
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"P.Blanket");
PurchHeader."Document Type"::Order:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"P.Order");
PurchHeader."Document Type"::"Return Order":
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"P.Return");
ELSE
EXIT;
END;
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",TRUE,FALSE,PurchHeader)
UNTIL ReportSelection.NEXT = 0;
END;
PROCEDURE PrintBankAccStmt@10(BankAccStmt@1000 : Record 275);
VAR
ReportSelection@1001 : Record 77;
BEGIN
BankAccStmt.SETRECFILTER;
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"B.Stmt");
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.ASCENDING := FALSE;
ReportSelection.FIND('-');
REPEAT
REPORT.RUN(ReportSelection."Report ID",TRUE,FALSE,BankAccStmt);
UNTIL ReportSelection.NEXT = 0;
END;
PROCEDURE PrintCheck@11(VAR NewGenJnlLine@1000 : Record 81);
VAR
GenJnlLine@1001 : Record 81;
ReportSelection@1002 : Record 77;
BEGIN
GenJnlLine.COPY(NewGenJnlLine);
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"B.Check");
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",TRUE,FALSE,GenJnlLine);
UNTIL ReportSelection.NEXT = 0;
END;
PROCEDURE PrintTransferHeader@2(TransHeader@1000 : Record 5740);
VAR
ReportSelection@1001 : Record 77;
BEGIN
TransHeader.SETRANGE("No.",TransHeader."No.");
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::Inv1);
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",TRUE,FALSE,TransHeader)
UNTIL ReportSelection.NEXT = 0;
END;
PROCEDURE PrintServiceContract@3(ServiceContract@1000 : Record 5965);
VAR
ReportSelection@1001 : Record 77;
BEGIN
ServiceContract.SETRANGE("Contract No.",ServiceContract."Contract No.");
CASE ServiceContract."Contract Type" OF
ServiceContract."Contract Type"::Quote:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"SM.Contract Quote");
ServiceContract."Contract Type"::Contract:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"SM.Contract");
ELSE
EXIT;
END;
ReportSelection.SETFILTER("Report ID",'<>0');
IF ReportSelection.FIND('-') THEN BEGIN
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",TRUE,FALSE,ServiceContract)
UNTIL ReportSelection.NEXT = 0;
END ELSE
ERROR(Text001,ReportSelection.TABLECAPTION,FORMAT(ServiceContract."Contract Type"),ServiceContract."Contract No.");
END;
PROCEDURE PrintServiceHeader@4(ServiceHeader@1000 : Record 5900);
VAR
ReportSelection@1001 : Record 77;
BEGIN
SalesSetup.GET;
ServiceHeader.SETRANGE("No.",ServiceHeader."No.");
IF SalesSetup."Calc. Inv. Discount" THEN BEGIN
ServLine.RESET;
ServLine.SETRANGE("Document Type",ServiceHeader."Document Type");
ServLine.SETRANGE("Document No.",ServiceHeader."No.");
ServLine.FINDFIRST;
ServCalcDisc.RUN(ServLine);
ServiceHeader.GET(ServiceHeader."Document Type",ServiceHeader."No.");
COMMIT;
END;
CASE ServiceHeader."Document Type" OF
ServiceHeader."Document Type"::Quote:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"SM.Quote");
ServiceHeader."Document Type"::Order:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"SM.Order");
ServiceHeader."Document Type"::Invoice:
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"SM.Invoice");
ServiceHeader."Document Type"::"Credit Memo":
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"SM.Credit Memo");
ELSE
EXIT;
END;
ReportSelection.SETFILTER("Report ID",'<>0');
IF ReportSelection.FIND('-') THEN BEGIN
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",TRUE,FALSE,ServiceHeader);
UNTIL ReportSelection.NEXT = 0;
END ELSE
ERROR(Text002,ReportSelection.FIELDCAPTION("Report ID"),ServiceHeader.TABLECAPTION,ReportSelection.TABLECAPTION);
END;
PROCEDURE PrintAsmHeader@9(AsmHeader@1000 : Record 900);
VAR
ReportSelections@1001 : Record 77;
BEGIN
AsmHeader.SETRANGE("No.",AsmHeader."No.");
CASE AsmHeader."Document Type" OF
AsmHeader."Document Type"::Quote,
AsmHeader."Document Type"::"Blanket Order",
AsmHeader."Document Type"::Order:
ReportSelections.SETRANGE(Usage,ReportSelections.Usage::"Asm. Order");
ELSE
EXIT;
END;
ReportSelections.SETFILTER("Report ID",'<>0');
ReportSelections.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelections."Report ID",TRUE,FALSE,AsmHeader)
UNTIL ReportSelections.NEXT = 0;
END;
PROCEDURE PrintSalesOrder@6(SalesHeader@1000 : Record 36;Usage@1001 : 'Order Confirmation,Work Order,Pick Instruction');
VAR
ReportSelection@1002 : Record 77;
BEGIN
IF SalesHeader."Document Type" <> SalesHeader."Document Type"::Order THEN
EXIT;
SalesHeader.SETRANGE("No.",SalesHeader."No.");
SalesSetup.GET;
IF SalesSetup."Calc. Inv. Discount" THEN BEGIN
SalesLine.RESET;
SalesLine.SETRANGE("Document Type",SalesHeader."Document Type");
SalesLine.SETRANGE("Document No.",SalesHeader."No.");
SalesLine.FINDFIRST;
SalesCalcDisc.RUN(SalesLine);
SalesHeader.GET(SalesHeader."Document Type",SalesHeader."No.");
COMMIT;
END;
CASE Usage OF
Usage::"Order Confirmation":
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Order");
Usage::"Work Order":
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Work Order");
Usage::"Pick Instruction":
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Order Pick Instruction");
ELSE
EXIT;
END;
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",GUIALLOWED,FALSE,SalesHeader)
UNTIL ReportSelection.NEXT = 0;
END;
PROCEDURE PrintSalesHeaderArch@7(SalesHeaderArch@1000 : Record 5107);
VAR
ReportSelection@1001 : Record 77;
BEGIN
SalesHeaderArch.SETRANGE("No.",SalesHeaderArch."No.");
SalesHeaderArch.SETRANGE("Doc. No. Occurrence",SalesHeaderArch."Doc. No. Occurrence");
SalesHeaderArch.SETRANGE("Version No.",SalesHeaderArch."Version No.");
CASE SalesHeaderArch."Document Type" OF
SalesHeaderArch."Document Type"::Quote:
BEGIN
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Arch. Quote");
SalesHeaderArch.SETRANGE("Document Type",SalesHeaderArch."Document Type"::Quote);
END;
SalesHeaderArch."Document Type"::Order:
BEGIN
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S.Arch. Order");
SalesHeaderArch.SETRANGE("Document Type",SalesHeaderArch."Document Type"::Order);
END;
SalesHeaderArch."Document Type"::"Return Order":
BEGIN
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"S. Arch. Return Order");
SalesHeaderArch.SETRANGE("Document Type",SalesHeaderArch."Document Type"::"Return Order");
END;
ELSE
EXIT;
END;
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",TRUE,FALSE,SalesHeaderArch)
UNTIL ReportSelection.NEXT = 0;
END;
PROCEDURE PrintPurchHeaderArch@8(PurchHeaderArch@1000 : Record 5109);
VAR
ReportSelection@1001 : Record 77;
BEGIN
PurchHeaderArch.SETRANGE("No.",PurchHeaderArch."No.");
PurchHeaderArch.SETRANGE("Doc. No. Occurrence",PurchHeaderArch."Doc. No. Occurrence");
PurchHeaderArch.SETRANGE("Version No.",PurchHeaderArch."Version No.");
CASE PurchHeaderArch."Document Type" OF
PurchHeaderArch."Document Type"::Quote:
BEGIN
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"P.Arch. Quote");
PurchHeaderArch.SETRANGE("Document Type",PurchHeaderArch."Document Type"::Quote);
END;
PurchHeaderArch."Document Type"::Order:
BEGIN
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"P.Arch. Order");
PurchHeaderArch.SETRANGE("Document Type",PurchHeaderArch."Document Type"::Order);
END;
PurchHeaderArch."Document Type"::"Return Order":
BEGIN
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"P. Arch. Return Order");
PurchHeaderArch.SETRANGE("Document Type",PurchHeaderArch."Document Type"::"Return Order");
END;
ELSE
EXIT;
END;
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.FIND('-');
REPEAT
REPORT.RUNMODAL(ReportSelection."Report ID",TRUE,FALSE,PurchHeaderArch)
UNTIL ReportSelection.NEXT = 0;
END;
PROCEDURE PrintBankRecStmt@1020000(PostedBankRecHdr@1000 : Record 10123);
VAR
ReportSelection@1001 : Record 77;
BEGIN
PostedBankRecHdr.SETRECFILTER;
ReportSelection.SETRANGE(Usage,ReportSelection.Usage::"B.Stmt");
ReportSelection.SETFILTER("Report ID",'<>0');
ReportSelection.ASCENDING := FALSE;
ReportSelection.FIND('-');
REPEAT
REPORT.RUN(ReportSelection."Report ID",TRUE,FALSE,PostedBankRecHdr);
UNTIL ReportSelection.NEXT = 0;
END;
BEGIN
END.
}
}