Hi How can we find the Starting date of the financial year(Fiscal Year)? Regards Rajan
with accountingperiod do begin reset; setfilter("start ingdate",'>=%1',today); setrange("new fiscal year",true); find('-'); end;
Hi What Version are running. Davids answer is Ok on the earlier versions prior to Attain Ver3.xx. EndDate := Customer.GETRANGEMAX("Date Filter"); AccountingPeriod.SETRANGE("Period Type",AccountingPeriod."Period Type"::Year); AccountingPeriod.SETRANGE("Period Start",0D,EndDate); AccountingPeriod.FIND('+'); FiscalYearStartDate := AccountingPeriod."Period Start";
This is a basic way if Accounting and Calendar years are the same. Have a look at Codeunit 359 “PeriodFormManagement”
quote:
with accountingperiod do begin reset; setfilter(“start ingdate”,‘>=%1’,today); setrange(“new fiscal year”,true); find(‘-’); end;
Er, Am I mistaken or will this find the Starting Date of the next Fiscal year? WITH AccountingPeriod DO BEGIN RESET; SETFILTER("Starting Date",'<=%1', TODAY); // maybe WORKDATE is better? SETRANGE("New Fiscal Year", TRUE); FIND('+'); END;
quote:
Originally posted by Stephen Gault
EndDate := Customer.GETRANGEMAX("Date Filter"); AccountingPeriod.SETRANGE("Period Type",AccountingPeriod."Period Type"::Year); AccountingPeriod.SETRANGE("Period Start",0D,EndDate); AccountingPeriod.FIND('+'); FiscalYearStartDate := AccountingPeriod."Period Start";
Although your record variable is named AccountingPeriod, it in fact represents the Date virtual table. That is very misleading. I think SV has the right answer here.
quote:
Originally posted by Steffen Voel Er, Am I mistaken or will this find the Starting Date of the next Fiscal year?
No idea, I never tried it, didn’t even read it actually,[;)] just typed and I think that what came out is enough to get rajan started.
Thanx guys[:)] Rajan
Hi Nelson
quote:
quote: -------------------------------------------------------------------------------- Originally posted by Stephen Gault EndDate := Customer.GETRANGEMAX(“Date Filter”); AccountingPeriod.SETRANGE(“Period Type”,AccountingPeriod.“Period Type”::Year); AccountingPeriod.SETRANGE(“Period Start”,0D,EndDate); AccountingPeriod.FIND(‘+’); FiscalYearStartDate := AccountingPeriod.“Period Start”; -------------------------------------------------------------------------------- Although your record variable is named AccountingPeriod, it in fact represents the Date virtual table. That is very misleading. I think SV has the right answer here.
It is infact Table 50 “Accounting Period”, hence my reply, The structure of the “Accounting Period” table in Attain is different to what it is in Financials. Have a look at Report 9 in Finacials and Attain “G/L Account” OnPreDataItem Trigger and see the way New fiscal year is found. Regards
Hi Stephen, I don’t know where you snipped the code from, but it is in fact - as Nelson correctly pointed out - the Date virtual table the variable AccountingPeriod in your example points to. “Period Type” is a field in this table and does not exist in the table “Accounting Period”. I just had a quick look at the code in report 9 in ver. 2.60D and 3.60 and it’s exactly the same. I haven’t checked 3.70, though. You’re getting me confused here - pls. stop[;)] — Edit ---- I have now checked ver. 3.70 and Report 9 is still exactly the same and so is table 50 Accounting Period (no “Period Type” field).
Exactly, the Accounting Period table has been the same for years. I don’t understand, are you not looking at a modified system?
Hi Steffen Code from Rep 9 “G/L Account” OnPreDataItem Ver2.60 Cronus GLAcc2.COPYFILTERS("G/L Account"); AccountingPeriod.RESET; AccountingPeriod.SETRANGE("New Fiscal Year",TRUE); EndDate := GETRANGEMAX("Date Filter"); AccountingPeriod."Starting Date" := GETRANGEMIN("Date Filter"); AccountingPeriod.FIND('=<'); GLAcc2.SETRANGE("Date Filter",AccountingPeriod."Starting Date",EndDate);
Code from Rep 9 “G/L Account” OnPreDataItem Ver3.70 Cronus GLAcc2.COPYFILTERS("G/L Account"); AccountingPeriod.RESET; AccountingPeriod.SETRANGE("Period Type",AccountingPeriod."Period Type"::Year); EndDate := GETRANGEMAX("Date Filter"); AccountingPeriod.SETRANGE("Period Start",0D,EndDate); AccountingPeriod.FIND('+'); GLAcc2.SETRANGE("Date Filter",AccountingPeriod."Period Start",EndDate);
Structure of Table 50 “Accounting Period” Ver 3.70 Cronus Field No. Field Name DataType 1 “Period Type” Option 2 “Period Start” Date 3 “Period End” Date 4 “Period No.” Integer 5 “Period Name” Text 30 10500 Closed Boolean (UK Version) 10501 “Line No.” Integer (UK Version) I’m getting confused as well, I don’t really think that there would be a major difference between regional versions.
I think we need someone from the UK to post a comment about this. I have just checked the CRONUS W1 database in these versions: - 2.50; - 2.60.F; - 2.65.C; - 3.10.A; - 3.60; - 3.70; And they are all the same. Can you imagine the localization effort it would take to completely tear down the W1 Accounting Period table and build a new one (based on the Date virtual table) for the UK?
Nelson That’s whats worrying me. Will it be a case of only answer queries for your own Country/Loacaliszed database users. In the GB Versions, these tables and reports are different in attain and financials. Thanks
This is strange indeed. But then again, you brits have always insisted on being different from the rest of us; i.e. driving in the left side of the road, not adhering to the metric system to name but a few examples… now we can add this to the list [8D] — added note ------- Going back on-topic, I wonder which solution works in India (once Commonwealth) where Rajan resides? This is definitely something one should keep in mind when making international solutions where UK is involved.
I’m still having a very hard time understanding this. There is no “New Fiscal Year” field!!! [:0] Stephen, can you please post the contents of the CRONUS GB table? I mean, running the table from Object Designer and copying/pasting all the records here. And also please tell us what is the primary key. Is it “Line No.”? Thanks.
Nelson I have to agree - I find it mindboggling as well. here’s a list of the objects using table 50: ================================================================================ Text-Export of : Table 50 Accounting Period - Object Tree Time : 20:03:50 Date : 22-01-2004 ================================================================================ - Table 50 Accounting Period - * Where Used + Where Used Options + Table 50 Accounting Period + Form 100 Accounting Periods + Form 350 G/L Acc. Balance/Budget Lines + Form 408 G/L Balance by Dimension + Form 414 G/L Balance + Form 416 G/L Account Balance Lines + Form 422 G/L Balance/Budget + Form 554 Analysis by Dimensions + Report 2 General Journal - Test + Report 9 Trial Balance/Budget + Report 10 Closing Trial Balance + Report 28 Dimensions - Detail + Report 86 Adjust Add. Reporting Currency + Report 90 Import Consolidation from DB + Report 91 Export Consolidation + Report 93 Create Fiscal Year + Report 94 Close Income Statement + Report 96 Copy G/L Budget + Report 504 XBRL Export Instance - Spec. 1 + Report 505 XBRL Export Instance - Spec. 2 + Report 702 Inventory Posting - Test + Report 802 BOM Journal - Test + Report 1102 Resource Journal - Test + Report 1202 Job Journal - Test + Report 5607 Fixed Asset - Projected Value + Report 7302 Whse. Invt.-Registering - Test + Report 6016802 General Journal - Test PM + Codeunit 1 ApplicationManagement + Codeunit 6 Fiscal Year-Close + Codeunit 8 AccSchedManagement + Codeunit 11 Gen. Jnl.-Check Line + Codeunit 12 Gen. Jnl.-Post Line + Codeunit 13 Gen. Jnl.-Post Batch + Codeunit 23 Item Jnl.-Post Batch + Codeunit 33 BOM Jnl.-Post Batch + Codeunit 203 Job Jnl.-Post Batch + Codeunit 213 Res. Jnl.-Post Batch + Codeunit 333 Req. Wksh.-Make Order + Codeunit 356 DateComprMgt + Codeunit 358 DateFilter-Calc + Codeunit 359 PeriodFormManagement + Codeunit 361 MoveEntries + Codeunit 410 Update Analysis View + Codeunit 420 XBRL Management + Codeunit 424 Export Analysis View + Codeunit 5611 Calculate Normal Depreciation + Codeunit 5617 FA Date Calculation + Codeunit 5618 Table Depr. Calculation + Codeunit 5623 FA MoveEntries + Codeunit 5633 FA Jnl.-Post Batch ================================================================================ Navision Attain Developer's Toolkit
It’s quite a list! I’d really like to know the reason for this localization.
Hi Nelson, Steffen I agree with you both MINDBOGGLING. The primary key for “Accounting Period” Ver3.70 GB “Period Type”,“Period Start” Copy of a few records from this table. Period Type Period Start Period End Period No. Period Name Closed Line No. Month 01/08/01 C31/08/01 8 August No 0 Month 01/09/01 C30/09/01 9 September No 0 Month 01/10/01 C31/10/01 10 October No 0 Month 01/11/01 C30/11/01 11 November No 0 Month 01/12/01 C31/12/01 12 December No 0 Month 01/01/02 C31/01/02 1 January No 0 Month 01/02/02 2 February No 0 Year 01/01/99 C31/12/99 1999 1999 Yes 0 Year 01/01/00 C31/12/00 2000 2000 No 0 Year 01/01/01 C31/12/01 2001 2001 No 0 Year 01/01/02 2002 2002 No 0 How boring would life be if we were all the same, someone has to be different[:D].
And what happens if you create a new database and a new company, how is the table filled? Does someone have to create the records or are they already created automatically?
Hi Nelson Someone has to create the records. Either through “General Ledger”>“Setup”>“Calendar Setup” or “Periodic Activities”>“Fiscal Year”>“Accounting Periods” Quote from Help button of “P A”>“F Y”
quote:
Accounting Periods Window You use the Accounting Periods window to open new fiscal years, define accounting periods of different types (Day, Week, Month, Quarter, and Year). The window contains a line for each accounting period.
Hi Steve, can you get some confirmation from MS UK that they have made this change? And if it is planned to move it to WW.I can see the advantages it offers, but it would be a nightmare then to implement the UK as part of a global roll out.