-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCodeunit_0000000006.txt
77 lines (65 loc) · 3.02 KB
/
Codeunit_0000000006.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
OBJECT Codeunit 6 Fiscal Year-Close
{
OBJECT-PROPERTIES
{
Date=06/08/01;
Time=12:00:00 PM;
Version List=NAVW13.00;
}
PROPERTIES
{
TableNo=50;
OnRun=BEGIN
AccountingPeriod.COPY(Rec);
Code;
Rec := AccountingPeriod;
END;
}
CODE
{
VAR
Text001@1000 : TextConst 'ENU=You must create a new fiscal year before you can close the old year.;ESM=Antes de cerrar un ejercicio hay que crear el siguiente.;FRC=Vous devez cr‚er un nouvel exercice financier avant que vous puissiez fermer l''exercice pr‚c‚dent.;ENC=You must create a new fiscal year before you can close the old year.';
Text002@1001 : TextConst 'ENU="This function closes the fiscal year from %1 to %2. ";ESM="Esta funci¢n cierra el ejercicio comprendido entre %1 y %2. ";FRC="Cette fonction ferme l''exercice financier de %1 … %2. ";ENC="This function closes the fiscal year from %1 to %2. "';
Text003@1002 : TextConst 'ENU=Once the fiscal year is closed it cannot be opened again, and the periods in the fiscal year cannot be changed.\\;ESM=Cuando se ha cerrado un ejercicio no se pueden cambiar los periodos que lo componen ni se puede volver a abrir.\\;FRC=Une fois ferm‚, l''exercice financier ne peut ˆtre rouvert et les p‚riodes de l''exercice ne peuvent ˆtre modifi‚es.\\;ENC=Once the fiscal year is closed it cannot be opened again, and the periods in the fiscal year cannot be changed.\\';
Text004@1003 : TextConst 'ENU=Do you want to close the fiscal year?;ESM=¨Confirma que desea cerrar el ejercicio?;FRC=Voulez-vous fermer l''exercice financier?;ENC=Do you want to close the fiscal year?';
AccountingPeriod@1004 : Record 50;
AccountingPeriod2@1005 : Record 50;
AccountingPeriod3@1006 : Record 50;
FiscalYearStartDate@1007 : Date;
FiscalYearEndDate@1008 : Date;
LOCAL PROCEDURE Code@1();
BEGIN
WITH AccountingPeriod DO BEGIN
AccountingPeriod2.SETRANGE(Closed,FALSE);
AccountingPeriod2.FIND('-');
FiscalYearStartDate := AccountingPeriod2."Starting Date";
AccountingPeriod := AccountingPeriod2;
TESTFIELD("New Fiscal Year",TRUE);
AccountingPeriod2.SETRANGE("New Fiscal Year",TRUE);
IF AccountingPeriod2.FIND('>') THEN BEGIN
FiscalYearEndDate := CALCDATE('<-1D>',AccountingPeriod2."Starting Date");
AccountingPeriod3 := AccountingPeriod2;
AccountingPeriod2.SETRANGE("New Fiscal Year");
AccountingPeriod2.FIND('<');
END ELSE
ERROR(Text001);
IF NOT
CONFIRM(
Text002 +
Text003 +
Text004,FALSE,
FiscalYearStartDate,FiscalYearEndDate)
THEN
EXIT;
RESET;
SETRANGE("Starting Date",FiscalYearStartDate,AccountingPeriod2."Starting Date");
MODIFYALL(Closed,TRUE);
SETRANGE("Starting Date",FiscalYearStartDate,AccountingPeriod3."Starting Date");
MODIFYALL("Date Locked",TRUE);
RESET;
END;
END;
BEGIN
END.
}
}