Topic: Leap Year (Period Y-1) Not included in Profit and Loss

On finalising my February 2017 financials at year end 28/02/2017, I found that the Period Y-1 does not add up for the 2016 leap year. All transactions that was posted by means of Journals on the 29/02/2016 was not included in the Profit and Loss comparison for the Period y-1.

This means I am supplying my auditors with the wrong information. If I draw the report on any other period than 28 February 2017, for example 01/04/2016 to 31/03/2017, then the transactions is included in the Profit and Loss and the transaction that was done on the 29/02/2016 is included.

Please advice how we can fix this issue when the leap year falls in Period Y-1.

Thanks

Wynand

Wynand

Re: Leap Year (Period Y-1) Not included in Profit and Loss

@joe: serious?

Re: Leap Year (Period Y-1) Not included in Profit and Loss

If the year ends in 28.2 then it will always end in 28.2. this will always be a tricky case and I guess the Auditors will agree on that. I have never heard about a fiscal year ending on 28.2 just because of the leap year problem.

Joe

Re: Leap Year (Period Y-1) Not included in Profit and Loss

Thanks for the explanation and the edge case. Rather than use PHP to compute the last day of the financial year, it might be prudent to use the MySQL function:

SELECT DATE_SUB(DATE_ADD('2015-03-01', INTERVAL 1 YEAR), INTERVAL 1 DAY)

which will yield 2016-02-29.

Similarly

SELECT DATE_SUB(DATE_ADD('2016-03-01', INTERVAL 1 YEAR), INTERVAL 1 DAY);

will get us 2017-02-28.

Also, how did it affect the JOURNAL entries alone?

Re: Leap Year (Period Y-1) Not included in Profit and Loss

Yes, but if you want to select a period less than a month this will not work. For those who absolutely want this to work on a monthly base, then it could be done this way.

Joe

Re: Leap Year (Period Y-1) Not included in Profit and Loss

I was thinking of the default end date for the next fiscal year creation in such a situation. Periods less than a month for reporting can be manually entered.

Re: Leap Year (Period Y-1) Not included in Profit and Loss

In South Africa, most small businesses and individuals finacial and Income Tax year end is at the end of February. When you do period 01/03/yyyy to 28/02/yyyy the folliwng year, the then there is no issue. If you do the report for 01/03/yyyy to 29/02/yyyy the following year, it also shows correct.

The problem arises when you select on the report to show Period y-1 and the current finaicl year ends on 28/02 it does not include the correct figures for the previous year on the report since it will only add previous years figure up to 28/02 instead of 29/02. If the 29/02 is the current year and the period y-1 ended on 28/02 the previous year, everything is fine.

I do not know how one will be able to deal with this. Maybe period y-1 should always read 29/02 for february.

Wynand

Re: Leap Year (Period Y-1) Not included in Profit and Loss

As already stated, MySQL has DATE_SUB(DATE_ADD(date_field, INTERVAL 1 YEAR), INTERVAL 1 DAY) which will always take the right Feb 28th or 29th as needed.

Similarly, for a month, it would be DATE_SUB(DATE_ADD(date_field, INTERVAL 1 MONTH), INTERVAL 1 DAY).

If you can pin point the sqls in FA where this causes an error we will be able to fix it. In most instances, the start and end date of the fiscal year are taken from the table's fields so it should not cause any issue.

Re: Leap Year (Period Y-1) Not included in Profit and Loss

If I could submit picture of the reports then I can show the difference in the reports for Period-1 and what the problem is.

Banking and General ledger / Inquiries and reports / General Ledger Reports / Profit and Loss Statement:

Select the current financial year Start Date: 01/03/2016 - Select the Current finacial year end date: 28/02/2017; Select compare to: Period Y-1 - Display report.

The amounts on the Profit and Loss Statement for Period Y-1 [Leap Year] is wrong. 

If you compare the reports for Period Y-1 tot the 2016 Fin year report:  Draw report for Period 01/03/2015 to 29/02/2016 [Leap year] the amounts will differ to the period Y-1 [Leap year] for period 01/03/2016 to 28/02/2017 as above. The period Y-1 for the period 01/03/2014 to 28/02/2014 is calculated correctly.

They should be the same which they are not. All amounts processed on the 29th are not calcultaed in the Period Y-1

Id you do Banking and General ledger /  Inquiries and reports / Profit and Loss Drill Down and your select period Start Date: 01/03/2016 - Select the Current financial year end date: 28/02/2017; Select compare to: Period Y-1 - Display report it displays correctly.

Wynand

Re: Leap Year (Period Y-1) Not included in Profit and Loss

Hello guys,

as i see it, the only problem is the Profit and Loss report, when comparing to the same period last year if it is a leap year.

A solution would be check if the to-date is the day of the end month. If this is the case, then we could also convert the period year-1 to be the day of the  end month if year-1 is a leap year.

Should we fix it this way? Do we need this to be an option? No, probably not.

Joe

Re: Leap Year (Period Y-1) Not included in Profit and Loss

This has now been fixed.
Report rep707.php. Comparing to same period last year. If the to-date = end month to-date, then the period year-1 is also end month.

You can download the changed file here.

Joe

Re: Leap Year (Period Y-1) Not included in Profit and Loss

Thanks Joe. Not able to download

Wynand

Re: Leap Year (Period Y-1) Not included in Profit and Loss

SourceForge is temporarily in maintenance mode.
Download the whole set of post release changed files from this post.

Post's attachments

SF_Down.png 15.9 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Leap Year (Period Y-1) Not included in Profit and Loss

Joe

Report rep707.php does not render any return. Something must be wrong with it. Do not know if this report 707 is for 2.4 or 2.3?

The Balancesheet report works, but when you select Profit and Loss Statement with Period Y-1 instead of accumulated, the report does not render

Wynand

Re: Leap Year (Period Y-1) Not included in Profit and Loss

Strange. I have no problems rendering it.

Can you set the $go_debug flag in config.php to 1 or 2 to trap any errors.

Joe

Re: Leap Year (Period Y-1) Not included in Profit and Loss

I too have no problems rendering them. Attached are the outputs from the en-US-demo.sql CoA.

Post's attachments

rep707_outputs.zip 5 kb, 2 downloads since 2017-10-24 

You don't have the permssions to download the attachments of this post.