-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodeunit_0000000226.txt
387 lines (352 loc) · 19.5 KB
/
Codeunit_0000000226.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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
OBJECT Codeunit 226 CustEntry-Apply Posted Entries
{
OBJECT-PROPERTIES
{
Date=09/23/13;
Time=12:00:00 PM;
Version List=NAVW17.10;
}
PROPERTIES
{
TableNo=21;
Permissions=TableData 21=rimd;
OnRun=BEGIN
Apply(Rec,"Document No.",0D);
END;
}
CODE
{
VAR
PostingApplicationMsg@1000 : TextConst 'ENU=Posting application...;ESM=Registrando liquidaci¢n...;FRC=Report en cours...;ENC=Posting application...';
MustNotBeBeforeErr@1001 : TextConst 'ENU=The Posting Date entered must not be before the Posting Date on the Cust. Ledger Entry.;ESM=La fecha de registro especificada no debe ser anterior a la fecha de registro del movimiento de cliente.;FRC=La date de report entr‚e ne doit pas ˆtre ant‚rieure … la date de report figurant sur l''‚criture client.;ENC=The Posting Date entered must not be before the Posting Date on the Cust. Ledger Entry.';
NoEntriesAppliedErr@1003 : TextConst 'ENU=The application was successfully posted though no entries have been applied.;ESM=El programa fue registrado correctamente aunque los movs. no han sido aplicados.;FRC=L''affectation a ‚t‚ report‚e avec succŠs bien qu''aucune ‚criture n''ait ‚t‚ affect‚e.;ENC=The application was successfully posted though no entries have been applied.';
UnapplyPostedAfterThisEntryErr@1018 : TextConst 'ENU=Before you can unapply this entry, you must first unapply all application entries that were posted after this entry.;ESM=Para poder aplicar este movimiento antes debe desliquidar todos los movimientos de liquidaci¢n registrados despu‚s del mismo.;FRC=Avant de pouvoir annuler l''affectation de cette ‚criture, vous devez annuler toutes les ‚critures d''affectation report‚es aprŠs cette ‚criture.;ENC=Before you can unapply this entry, you must first unapply all application entries that were posted after this entry.';
NoApplicationEntryErr@1017 : TextConst 'ENU=Cust. Ledger Entry No. %1 does not have an application entry.;ESM=El n§ de movimiento de cliente %1 no tiene movimiento de liquidaci¢n.;FRC=Le Nø ‚criture client %1 n''a pas d''‚criture d''affectation.;ENC=Cust. Ledger Entry No. %1 does not have an application entry.';
UnapplyingMsg@1015 : TextConst 'ENU=Unapplying and posting...;ESM=Desliquidando y registrando...;FRC=Annulation d''affectation et report...;ENC=Unapplying and posting...';
UnapplyAllPostedAfterThisEntryErr@1019 : TextConst 'ENU=Before you can unapply this entry, you must first unapply all application entries in Cust. Ledger Entry No. %1 that were posted after this entry.;ESM=Para poder desliquidar este movimiento, antes debe desliquidar todos los movimientos de liquidaci¢n del n§ de movimiento de cliente %1 registrados despu‚s del mismo.;FRC=Avant d''annuler l''affectation de cette ‚criture, vous devez annuler l''affectation de toutes les ‚critures avec Nø ‚criture clt %1 qui ont ‚t‚ report‚es post‚rieurement.;ENC=Before you can unapply this entry, you must first unapply all application entries in Cust. Ledger Entry No. %1 that were posted after this entry.';
NotAllowedPostingDatesErr@1021 : TextConst 'ENU=Posting date is not within the range of allowed posting dates.;ESM=La fecha de registro no est comprendida en el periodo de fechas de registro permitidas.;FRC=La date de report n''est pas dans la plage de dates de report autoris‚es.;ENC=Posting date is not within the range of allowed posting dates.';
LatestEntryMustBeAnApplicationErr@1024 : TextConst 'ENU=The latest Transaction No. must be an application in Cust. Ledger Entry No. %1.;ESM=El n§ de transacci¢n m s reciente debe ser una liquidaci¢n en el n§ de movimiento de cliente %1.;FRC=Le dernier Nø transaction doit ˆtre une affectation avec Nø ‚criture clt %1.;ENC=The latest Transaction No. must be an application in Cust. Ledger Entry No. %1.';
CannotUnapplyExchRateErr@1023 : TextConst 'ENU=You cannot unapply the entry with the posting date %1, because the exchange rate for the additional reporting currency has been changed.;ESM=No puede desliquidar una entrada con fecha de registro %1, el tipo de cambio de la moneda de la divisa de informe adicional ha sido modificado.;FRC=Vous ne pouvez pas annuler l''affectation de l''‚criture dont la date de report est %1, car le taux de change de la devise de report additionnelle a chang‚.;ENC=You cannot unapply the entry with the posting date %1, because the exchange rate for the additional reporting currency has been changed.';
CannotUnapplyInReversalErr@1026 : TextConst 'ENU=You cannot unapply Cust. Ledger Entry No. %1 because the entry is part of a reversal.;ESM=No puede desliquidar el n§ de movimiento de cliente %1 porque forma parte de una retrocesi¢n.;FRC=Vous ne pouvez pas annuler l''affectation de l''‚criture clt Nø %1, car l''‚criture fait partie d''une contrepassation.;ENC=You cannot unapply Cust. Ledger Entry No. %1 because the entry is part of a reversal.';
CannotApplyClosedEntriesErr@1102601000 : TextConst 'ENU=One or more of the entries that you selected is closed. You cannot apply closed entries.;ESM=Uno o varios de los movimientos que ha seleccionado est n liquidados. No puede liquidar movimientos liquidados.;FRC=Au moins une des ‚critures s‚lectionn‚es est ferm‚e. Vous ne pouvez pas affecter des ‚critures ferm‚es.;ENC=One or more of the entries that you selected is closed. You cannot apply closed entries.';
PROCEDURE Apply@17(CustLedgEntry@1000 : Record 21;DocumentNo@1001 : Code[20];ApplicationDate@1002 : Date);
VAR
PaymentToleranceMgt@1003 : Codeunit 426;
BEGIN
WITH CustLedgEntry DO BEGIN
PaymentToleranceMgt.ApplyPostedEntriesMode;
IF NOT PaymentToleranceMgt.PmtTolCust(CustLedgEntry) THEN
EXIT;
GET("Entry No.");
IF ApplicationDate = 0D THEN
ApplicationDate := GetApplicationDate(CustLedgEntry)
ELSE
IF ApplicationDate < GetApplicationDate(CustLedgEntry) THEN
ERROR(MustNotBeBeforeErr);
IF DocumentNo = '' THEN
DocumentNo := "Document No.";
CustPostApplyCustLedgEntry(CustLedgEntry,DocumentNo,ApplicationDate);
END;
END;
PROCEDURE GetApplicationDate@14(CustLedgEntry@1000 : Record 21) ApplicationDate : Date;
VAR
ApplyToCustLedgEntry@1001 : Record 21;
BEGIN
WITH CustLedgEntry DO BEGIN
ApplicationDate := 0D;
ApplyToCustLedgEntry.SETCURRENTKEY("Customer No.","Applies-to ID");
ApplyToCustLedgEntry.SETRANGE("Customer No.","Customer No.");
ApplyToCustLedgEntry.SETRANGE("Applies-to ID","Applies-to ID");
ApplyToCustLedgEntry.FINDSET;
REPEAT
IF ApplyToCustLedgEntry."Posting Date" > ApplicationDate THEN
ApplicationDate := ApplyToCustLedgEntry."Posting Date";
UNTIL ApplyToCustLedgEntry.NEXT = 0;
END;
END;
LOCAL PROCEDURE CustPostApplyCustLedgEntry@12(CustLedgEntry@1000 : Record 21;DocumentNo@1002 : Code[20];ApplicationDate@1003 : Date);
VAR
SourceCodeSetup@1004 : Record 242;
GenJnlLine@1005 : Record 81;
UpdateAnalysisView@1001 : Codeunit 410;
GenJnlPostLine@1006 : Codeunit 12;
Window@1007 : Dialog;
EntryNoBeforeApplication@1008 : Integer;
EntryNoAfterApplication@1009 : Integer;
BEGIN
WITH CustLedgEntry DO BEGIN
Window.OPEN(PostingApplicationMsg);
SourceCodeSetup.GET;
GenJnlLine.INIT;
GenJnlLine."Document No." := DocumentNo;
GenJnlLine."Posting Date" := ApplicationDate;
GenJnlLine."Document Date" := GenJnlLine."Posting Date";
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer;
GenJnlLine."Account No." := "Customer No.";
CALCFIELDS("Debit Amount","Credit Amount","Debit Amount (LCY)","Credit Amount (LCY)");
GenJnlLine.Correction :=
("Debit Amount" < 0) OR ("Credit Amount" < 0) OR
("Debit Amount (LCY)" < 0) OR ("Credit Amount (LCY)" < 0);
GenJnlLine."Document Type" := "Document Type";
GenJnlLine.Description := Description;
GenJnlLine."Shortcut Dimension 1 Code" := "Global Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := "Global Dimension 2 Code";
GenJnlLine."Dimension Set ID" := "Dimension Set ID";
GenJnlLine."Posting Group" := "Customer Posting Group";
GenJnlLine."Source Type" := GenJnlLine."Source Type"::Customer;
GenJnlLine."Source No." := "Customer No.";
GenJnlLine."Source Code" := SourceCodeSetup."Sales Entry Application";
GenJnlLine."System-Created Entry" := TRUE;
EntryNoBeforeApplication := FindLastApplDtldCustLedgEntry;
GenJnlPostLine.CustPostApplyCustLedgEntry(GenJnlLine,CustLedgEntry);
EntryNoAfterApplication := FindLastApplDtldCustLedgEntry;
IF EntryNoAfterApplication = EntryNoBeforeApplication THEN
ERROR(NoEntriesAppliedErr);
COMMIT;
Window.CLOSE;
UpdateAnalysisView.UpdateAll(0,TRUE);
END;
END;
LOCAL PROCEDURE FindLastApplDtldCustLedgEntry@1() : Integer;
VAR
DtldCustLedgEntry@1000 : Record 379;
BEGIN
DtldCustLedgEntry.LOCKTABLE;
IF DtldCustLedgEntry.FINDLAST THEN
EXIT(DtldCustLedgEntry."Entry No.");
EXIT(0);
END;
LOCAL PROCEDURE FindLastApplEntry@2(CustLedgEntryNo@1002 : Integer) : Integer;
VAR
DtldCustLedgEntry@1001 : Record 379;
ApplicationEntryNo@1000 : Integer;
BEGIN
WITH DtldCustLedgEntry DO BEGIN
SETCURRENTKEY("Cust. Ledger Entry No.","Entry Type");
SETRANGE("Cust. Ledger Entry No.",CustLedgEntryNo);
SETRANGE("Entry Type","Entry Type"::Application);
SETRANGE(Unapplied,FALSE);
ApplicationEntryNo := 0;
IF FIND('-') THEN
REPEAT
IF "Entry No." > ApplicationEntryNo THEN
ApplicationEntryNo := "Entry No.";
UNTIL NEXT = 0;
END;
EXIT(ApplicationEntryNo);
END;
LOCAL PROCEDURE FindLastTransactionNo@6(CustLedgEntryNo@1002 : Integer) : Integer;
VAR
DtldCustLedgEntry@1001 : Record 379;
LastTransactionNo@1000 : Integer;
BEGIN
WITH DtldCustLedgEntry DO BEGIN
SETCURRENTKEY("Cust. Ledger Entry No.","Entry Type");
SETRANGE("Cust. Ledger Entry No.",CustLedgEntryNo);
SETRANGE(Unapplied,FALSE);
SETFILTER("Entry Type",'<>%1&<>%2',"Entry Type"::"Unrealized Loss","Entry Type"::"Unrealized Gain");
LastTransactionNo := 0;
IF FINDSET THEN
REPEAT
IF LastTransactionNo < "Transaction No." THEN
LastTransactionNo := "Transaction No.";
UNTIL NEXT = 0;
END;
EXIT(LastTransactionNo);
END;
PROCEDURE UnApplyDtldCustLedgEntry@3(DtldCustLedgEntry@1000 : Record 379);
VAR
ApplicationEntryNo@1001 : Integer;
BEGIN
DtldCustLedgEntry.TESTFIELD("Entry Type",DtldCustLedgEntry."Entry Type"::Application);
DtldCustLedgEntry.TESTFIELD(Unapplied,FALSE);
ApplicationEntryNo := FindLastApplEntry(DtldCustLedgEntry."Cust. Ledger Entry No.");
IF DtldCustLedgEntry."Entry No." <> ApplicationEntryNo THEN
ERROR(UnapplyPostedAfterThisEntryErr);
CheckReversal(DtldCustLedgEntry."Cust. Ledger Entry No.");
UnApplyCustomer(DtldCustLedgEntry);
END;
PROCEDURE UnApplyCustLedgEntry@7(CustLedgEntryNo@1000 : Integer);
VAR
DtldCustLedgEntry@1002 : Record 379;
ApplicationEntryNo@1001 : Integer;
BEGIN
CheckReversal(CustLedgEntryNo);
ApplicationEntryNo := FindLastApplEntry(CustLedgEntryNo);
IF ApplicationEntryNo = 0 THEN
ERROR(NoApplicationEntryErr,CustLedgEntryNo);
DtldCustLedgEntry.GET(ApplicationEntryNo);
UnApplyCustomer(DtldCustLedgEntry);
END;
LOCAL PROCEDURE UnApplyCustomer@19(DtldCustLedgEntry@1000000000 : Record 379);
VAR
UnapplyCustEntries@1000 : Page 623;
BEGIN
WITH DtldCustLedgEntry DO BEGIN
TESTFIELD("Entry Type","Entry Type"::Application);
TESTFIELD(Unapplied,FALSE);
UnapplyCustEntries.SetDtldCustLedgEntry("Entry No.");
UnapplyCustEntries.LOOKUPMODE(TRUE);
UnapplyCustEntries.RUNMODAL;
END;
END;
PROCEDURE PostUnApplyCustomer@4(DtldCustLedgEntry2@1007 : Record 379;DocNo@1000 : Code[20];PostingDate@1001 : Date);
VAR
GLEntry@1019 : Record 17;
CustLedgEntry@1018 : Record 21;
SourceCodeSetup@1017 : Record 242;
GenJnlLine@1016 : Record 81;
DtldCustLedgEntry@1014 : Record 379;
DateComprReg@1005 : Record 87;
GenJnlPostLine@1002 : Codeunit 12;
Window@1012 : Dialog;
LastTransactionNo@1003 : Integer;
AddCurrChecked@1004 : Boolean;
MaxPostingDate@1006 : Date;
BEGIN
MaxPostingDate := 0D;
GLEntry.LOCKTABLE;
DtldCustLedgEntry.LOCKTABLE;
CustLedgEntry.LOCKTABLE;
CustLedgEntry.GET(DtldCustLedgEntry2."Cust. Ledger Entry No.");
CheckPostingDate(PostingDate,MaxPostingDate);
IF PostingDate < DtldCustLedgEntry2."Posting Date" THEN
ERROR(MustNotBeBeforeErr);
IF DtldCustLedgEntry2."Transaction No." = 0 THEN BEGIN
DtldCustLedgEntry.SETCURRENTKEY("Application No.","Customer No.","Entry Type");
DtldCustLedgEntry.SETRANGE("Application No.",DtldCustLedgEntry2."Application No.");
END ELSE BEGIN
DtldCustLedgEntry.SETCURRENTKEY("Transaction No.","Customer No.","Entry Type");
DtldCustLedgEntry.SETRANGE("Transaction No.",DtldCustLedgEntry2."Transaction No.");
END;
DtldCustLedgEntry.SETRANGE("Customer No.",DtldCustLedgEntry2."Customer No.");
DtldCustLedgEntry.SETFILTER("Entry Type",'<>%1',DtldCustLedgEntry."Entry Type"::"Initial Entry");
DtldCustLedgEntry.SETRANGE(Unapplied,FALSE);
IF DtldCustLedgEntry.FIND('-') THEN
REPEAT
IF NOT AddCurrChecked THEN BEGIN
CheckAdditionalCurrency(PostingDate,DtldCustLedgEntry."Posting Date");
AddCurrChecked := TRUE;
END;
CheckReversal(DtldCustLedgEntry."Cust. Ledger Entry No.");
IF DtldCustLedgEntry."Transaction No." <> 0 THEN BEGIN
IF DtldCustLedgEntry."Entry Type" = DtldCustLedgEntry."Entry Type"::Application THEN BEGIN
LastTransactionNo :=
FindLastApplTransactionEntry(DtldCustLedgEntry."Cust. Ledger Entry No.");
IF (LastTransactionNo <> 0) AND (LastTransactionNo <> DtldCustLedgEntry."Transaction No.") THEN
ERROR(UnapplyAllPostedAfterThisEntryErr,DtldCustLedgEntry."Cust. Ledger Entry No.");
END;
LastTransactionNo := FindLastTransactionNo(DtldCustLedgEntry."Cust. Ledger Entry No.");
IF (LastTransactionNo <> 0) AND (LastTransactionNo <> DtldCustLedgEntry."Transaction No.") THEN
ERROR(LatestEntryMustBeAnApplicationErr,DtldCustLedgEntry."Cust. Ledger Entry No.");
END;
UNTIL DtldCustLedgEntry.NEXT = 0;
DateComprReg.CheckMaxDateCompressed(MaxPostingDate,0);
WITH DtldCustLedgEntry2 DO BEGIN
SourceCodeSetup.GET;
CustLedgEntry.GET("Cust. Ledger Entry No.");
GenJnlLine."Document No." := DocNo;
GenJnlLine."Posting Date" := PostingDate;
GenJnlLine."Account Type" := GenJnlLine."Account Type"::Customer;
GenJnlLine."Account No." := "Customer No.";
GenJnlLine.Correction := TRUE;
GenJnlLine."Document Type" := "Document Type";
GenJnlLine.Description := CustLedgEntry.Description;
GenJnlLine."Shortcut Dimension 1 Code" := CustLedgEntry."Global Dimension 1 Code";
GenJnlLine."Shortcut Dimension 2 Code" := CustLedgEntry."Global Dimension 2 Code";
GenJnlLine."Dimension Set ID" := CustLedgEntry."Dimension Set ID";
GenJnlLine."Posting Group" := CustLedgEntry."Customer Posting Group";
GenJnlLine."Source Type" := GenJnlLine."Source Type"::Customer;
GenJnlLine."Source No." := "Customer No.";
GenJnlLine."Source Code" := SourceCodeSetup."Unapplied Sales Entry Appln.";
GenJnlLine."Source Currency Code" := "Currency Code";
GenJnlLine."System-Created Entry" := TRUE;
Window.OPEN(UnapplyingMsg);
GenJnlPostLine.UnapplyCustLedgEntry(GenJnlLine,DtldCustLedgEntry2);
COMMIT;
Window.CLOSE;
END;
END;
LOCAL PROCEDURE CheckPostingDate@5(PostingDate@1001 : Date;VAR MaxPostingDate@1005 : Date);
VAR
GenJnlCheckLine@1000 : Codeunit 11;
BEGIN
IF GenJnlCheckLine.DateNotAllowed(PostingDate) THEN
ERROR(NotAllowedPostingDatesErr);
IF PostingDate > MaxPostingDate THEN
MaxPostingDate := PostingDate;
END;
LOCAL PROCEDURE CheckAdditionalCurrency@8(OldPostingDate@1000 : Date;NewPostingDate@1001 : Date);
VAR
GLSetup@1002 : Record 98;
CurrExchRate@1003 : Record 330;
BEGIN
IF OldPostingDate = NewPostingDate THEN
EXIT;
GLSetup.GET;
IF GLSetup."Additional Reporting Currency" <> '' THEN
IF CurrExchRate.ExchangeRate(OldPostingDate,GLSetup."Additional Reporting Currency") <>
CurrExchRate.ExchangeRate(NewPostingDate,GLSetup."Additional Reporting Currency")
THEN
ERROR(CannotUnapplyExchRateErr,NewPostingDate);
END;
PROCEDURE CheckReversal@9(CustLedgEntryNo@1000 : Integer);
VAR
CustLedgEntry@1001 : Record 21;
BEGIN
CustLedgEntry.GET(CustLedgEntryNo);
IF CustLedgEntry.Reversed THEN
ERROR(CannotUnapplyInReversalErr,CustLedgEntryNo);
END;
PROCEDURE ApplyCustEntryFormEntry@10(VAR ApplyingCustLedgEntry@1000 : Record 21);
VAR
CustLedgEntry@1002 : Record 21;
ApplyCustEntries@1001 : Page 232;
CustEntryApplID@1004 : Code[50];
BEGIN
IF NOT ApplyingCustLedgEntry.Open THEN
ERROR(CannotApplyClosedEntriesErr);
CustEntryApplID := USERID;
IF CustEntryApplID = '' THEN
CustEntryApplID := '***';
IF ApplyingCustLedgEntry."Remaining Amount" = 0 THEN
ApplyingCustLedgEntry.CALCFIELDS("Remaining Amount");
ApplyingCustLedgEntry."Applying Entry" := TRUE;
ApplyingCustLedgEntry."Applies-to ID" := CustEntryApplID;
ApplyingCustLedgEntry."Amount to Apply" := ApplyingCustLedgEntry."Remaining Amount";
CODEUNIT.RUN(CODEUNIT::"Cust. Entry-Edit",ApplyingCustLedgEntry);
COMMIT;
CustLedgEntry.SETCURRENTKEY("Customer No.",Open,Positive);
CustLedgEntry.SETRANGE("Customer No.",ApplyingCustLedgEntry."Customer No.");
CustLedgEntry.SETRANGE(Open,TRUE);
IF CustLedgEntry.FINDFIRST THEN BEGIN
ApplyCustEntries.SetCustLedgEntry(ApplyingCustLedgEntry);
ApplyCustEntries.SETRECORD(CustLedgEntry);
ApplyCustEntries.SETTABLEVIEW(CustLedgEntry);
ApplyCustEntries.RUNMODAL;
CLEAR(ApplyCustEntries);
ApplyingCustLedgEntry."Applying Entry" := FALSE;
ApplyingCustLedgEntry."Applies-to ID" := '';
ApplyingCustLedgEntry."Amount to Apply" := 0;
END;
END;
PROCEDURE FindLastApplTransactionEntry@11(CustLedgEntryNo@1000 : Integer) : Integer;
VAR
DtldCustLedgEntry@1001 : Record 379;
LastTransactionNo@1002 : Integer;
BEGIN
DtldCustLedgEntry.SETCURRENTKEY("Cust. Ledger Entry No.","Entry Type");
DtldCustLedgEntry.SETRANGE("Cust. Ledger Entry No.",CustLedgEntryNo);
DtldCustLedgEntry.SETRANGE("Entry Type",DtldCustLedgEntry."Entry Type"::Application);
LastTransactionNo := 0;
IF DtldCustLedgEntry.FIND('-') THEN
REPEAT
IF (DtldCustLedgEntry."Transaction No." > LastTransactionNo) AND NOT DtldCustLedgEntry.Unapplied THEN
LastTransactionNo := DtldCustLedgEntry."Transaction No.";
UNTIL DtldCustLedgEntry.NEXT = 0;
EXIT(LastTransactionNo);
END;
BEGIN
END.
}
}