-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodeunit_0000000111.txt
68 lines (61 loc) · 1.92 KB
/
Codeunit_0000000111.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
OBJECT Codeunit 111 Vend. Entry-SetAppl.ID
{
OBJECT-PROPERTIES
{
Date=09/07/12;
Time=12:00:00 PM;
Version List=NAVW17.00;
}
PROPERTIES
{
Permissions=TableData 25=imd;
OnRun=BEGIN
END;
}
CODE
{
VAR
VendEntryApplID@1000 : Code[50];
PROCEDURE SetApplId@1(VAR VendLedgEntry@1000 : Record 25;ApplyingVendLedgEntry@1001 : Record 25;AppliesToID@1005 : Code[50]);
BEGIN
VendLedgEntry.LOCKTABLE;
IF VendLedgEntry.FIND('-') THEN BEGIN
// Make Applies-to ID
IF VendLedgEntry."Applies-to ID" <> '' THEN
VendEntryApplID := ''
ELSE BEGIN
VendEntryApplID := AppliesToID;
IF VendEntryApplID = '' THEN BEGIN
VendEntryApplID := USERID;
IF VendEntryApplID = '' THEN
VendEntryApplID := '***';
END;
END;
// Set Applies-to ID
REPEAT
VendLedgEntry.TESTFIELD(Open,TRUE);
VendLedgEntry."Applies-to ID" := VendEntryApplID;
IF VendLedgEntry."Applies-to ID" = '' THEN BEGIN
VendLedgEntry."Accepted Pmt. Disc. Tolerance" := FALSE;
VendLedgEntry."Accepted Payment Tolerance" := 0;
END;
// Set Amount to Apply
IF ((VendLedgEntry."Amount to Apply" <> 0) AND (VendEntryApplID = '')) OR
(VendEntryApplID = '')
THEN
VendLedgEntry."Amount to Apply" := 0
ELSE
IF VendLedgEntry."Amount to Apply" = 0 THEN BEGIN
VendLedgEntry.CALCFIELDS("Remaining Amount");
VendLedgEntry."Amount to Apply" := VendLedgEntry."Remaining Amount"
END;
IF VendLedgEntry."Entry No." = ApplyingVendLedgEntry."Entry No." THEN
VendLedgEntry."Applying Entry" := ApplyingVendLedgEntry."Applying Entry";
VendLedgEntry.MODIFY;
UNTIL VendLedgEntry.NEXT = 0;
END;
END;
BEGIN
END.
}
}