Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Exportfile for AOT version 1.0 or later
- Formatversion: 1
- ***Element: DBT
- ; Microsoft Business Solutions-Axapta Table : WorkHolidayTable unloaded at Fredag 15-06-2012
- ; --------------------------------------------------------------------------------
- TABLEVERSION 1
- TABLE #WorkHolidayTable
- PROPERTIES
- Name #WorkHolidayTable
- Label #@CUA1418
- FormRef #
- TitleField1 #HolyDate
- TitleField2 #Name
- Temporary #No
- TableContents #Not specified
- Systemtable #No
- ConfigurationKey #
- SecurityKey #
- MaxAccessMode #Delete
- CacheLookup #EntireTable
- CreateRecIdIndex #No
- SaveDataPerCompany #Yes
- TableGroup #Group
- PrimaryIndex #DateIdx
- ClusterIndex #DateIdx
- ModifiedDate #No
- ModifiedTime #No
- ModifiedBy #No
- ModifiedTransactionId #No
- CreatedDate #Yes
- CreatedTime #Yes
- CreatedBy #Yes
- CreatedTransactionId #No
- ENDPROPERTIES
- FIELDS
- FIELD #HolyDate
- DATE
- PROPERTIES
- Type #Date
- Name #HolyDate
- Label #@CUA1419
- HelpText #@CUA1419
- GroupPrompt #
- SaveContents #Yes
- Mandatory #Yes
- AllowEditOnCreate #Yes
- AllowEdit #No
- Visible #Yes
- ConfigurationKey #
- Table #WorkHolidayTable
- AliasFor #
- ExtendedDataType
- ARRAY
- #TransDate
- #
- ENDARRAY
- ENDPROPERTIES
- FIELD #Name
- STRING
- PROPERTIES
- Type #String
- Name #Name
- Label #
- HelpText #@CUA1419
- GroupPrompt #
- SaveContents #Yes
- Mandatory #No
- AllowEditOnCreate #Yes
- AllowEdit #Yes
- Visible #Yes
- ConfigurationKey #
- Table #WorkHolidayTable
- AliasFor #
- ExtendedDataType
- ARRAY
- #Name
- #
- ENDARRAY
- StringSize #50
- Adjustment #Left
- ENDPROPERTIES
- ENDFIELDS
- GROUPS
- GROUP #AutoReport
- PROPERTIES
- Name #AutoReport
- OldName #
- Label #
- ENDPROPERTIES
- GROUPFIELDS
- #HolyDate
- #Name
- #dayName
- #week
- ENDGROUPFIELDS
- ENDGROUP
- GROUP #AutoLookup
- PROPERTIES
- Name #AutoLookup
- OldName #
- Label #
- ENDPROPERTIES
- GROUPFIELDS
- ENDGROUPFIELDS
- ENDGROUP
- ENDGROUPS
- INDICES
- #DateIdx
- PROPERTIES
- Name #DateIdx
- AllowDuplicates #No
- Enabled #Yes
- ConfigurationKey #
- ENDPROPERTIES
- INDEXFIELDS
- #HolyDate
- ENDINDEXFIELDS
- ENDINDICES
- REFERENCES
- REFERENCE #WorkHolidayTable
- PROPERTIES
- Name #WorkHolidayTable
- Table #WorkHolidayTable
- Validate #Yes
- ENDPROPERTIES
- FIELDREFERENCES
- REFERENCETYPE NORMAL
- PROPERTIES
- Field #HolyDate
- RelatedField #HolyDate
- ENDPROPERTIES
- ENDFIELDREFERENCES
- ENDREFERENCE
- ENDREFERENCES
- DELETEACTIONS
- ENDDELETEACTIONS
- METHODS
- Version: 3
- SOURCE #dayName
- #display str 8 dayName()
- #{
- # return this.HolyDate ? dayName(dayOfWk(this.HolyDate)) : '';
- #}
- ENDSOURCE
- SOURCE #insertNotExists
- #void insertNotExists()
- #{
- # if (!WorkHolidayTable::exist(this.HolyDate))
- # this.insert();
- #}
- ENDSOURCE
- SOURCE #week
- #display Week week()
- #{
- # return this.HolyDate ? wkOfYr(this.HolyDate) : 0;
- #}
- ENDSOURCE
- SOURCE #easterDay
- #// Brugbar ved alle årstal efter gregoriansk kalender (1701 ff.).
- #// Der er taget hensyn til 1992-ændringerne i kirkeåret,
- #// men ikke til særlige helligdage før Struensees reform 1770.
- #// ® Niels Aarup 1996
- #
- #static TransDate easterDay(Yr y)
- #{
- # int a = y mod 19;
- # int b = y div 100;
- # int c = y mod 100;
- # int d = b div 4;
- # int e = b mod 4;
- # int f = (b+8) div 25;
- # int g = (b-f+1) div 3;
- # int h = (19*a+b-d-g+15) mod 30;
- # int i = c div 4;
- # int k = c mod 4;
- # int l = (32+2*e+2*i-h-k) mod 7;
- # int m = (a+11*h+22*l) div 451;
- # int n = (h+l-7*m+114) div 31;
- # int p = (h+l-7*m+114) mod 31;
- # return mkdate(p+1,n,y);
- #}
- ENDSOURCE
- SOURCE #exist
- #static boolean exist(TransDate holyDate)
- #{
- # return holyDate && (select firstonly RecId from WorkHolidayTable where WorkHolidayTable.HolyDate == holyDate).RecId != 0;
- #}
- ENDSOURCE
- SOURCE #holidayCreate
- #static void holidayCreate(Yr y)
- #{
- # WorkHolidayTable h;
- # TransDate e = WorkHolidayTable::easterDay(y);
- # h.HolyDate = mkdate(01,01,y); h.Name = "Nytårsdag"; h.insertNotExists();
- # h.HolyDate = e-3; h.Name = "Skærtorsdag"; h.insertNotExists();
- # h.HolyDate = e-2; h.Name = "Langfredag"; h.insertNotExists();
- # h.HolyDate = e; h.Name = "Påskedag"; h.insertNotExists();
- # h.HolyDate = e+1; h.Name = "2. Påskedag"; h.insertNotExists();
- # h.HolyDate = e+26; h.Name = "Bededag"; h.insertNotExists();
- # h.HolyDate = e+39; h.Name = "Kr.himmelfartsdag"; h.insertNotExists();
- # h.HolyDate = e+49; h.Name = "Pinsedag"; h.insertNotExists();
- # h.HolyDate = e+50; h.Name = "2. Pinsedag"; h.insertNotExists();
- # h.HolyDate = mkdate(01,05,y); h.Name = "1. maj"; h.insertNotExists();
- # h.HolyDate = mkdate(05,06,y); h.Name = "Grundlovsdag"; h.insertNotExists();
- # h.HolyDate = mkdate(24,12,y); h.Name = "Juleaftensdag"; h.insertNotExists();
- # h.HolyDate = mkdate(25,12,y); h.Name = "Juledag"; h.insertNotExists();
- # h.HolyDate = mkdate(26,12,y); h.Name = "2. Juledag"; h.insertNotExists();
- # h.HolyDate = mkdate(31,12,y); h.Name = "Nytårsaftensdag"; h.insertNotExists();
- #}
- ENDSOURCE
- ENDMETHODS
- ENDTABLE
- ***Element: END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement