Hi,
I recently installed FA 2.4.4
I deleted the fiscal years and set the year to 01/07/2018 to 30/06/2019.
Now when I add a direct invoice with the date as 04/11/2018 (4th Nov 2018) it gives an error:
"The entered date is out of fiscal year or is closed for further data entry."
I went into the code and commented the following code in the function is_date_in_fiscalyear($date, $date):
if (is_date_closed($date2))
return 0;
The error stopped and I could enter the invoice.
This is the is_date_closed function:
function is_date_closed($date)
{
return !date1_greater_date2($date, sql2date(get_company_pref('gl_closing_date')));
}
My gl_closing_date is 30/6/2019
The date entered in the invoice is 04/11/2018
So the function date1_greater_date2 returns false as my date1 is not greater than date2. The ! before the function means it will return true, which means the function is_date_in_fiscalyear will return false, which of course is not the right result.
Also the code further in the is_date_in_fiscalyear is:
$myrow = get_current_fiscalyear();
$begin = sql2date($myrow['begin']);
$end = sql2date($myrow['end']);
if (date1_greater_date2($begin, $date2) || date1_greater_date2($date2, $end))
{
return 0;
}
return 1;
This code checks if the transaction being entered is in the fiscal year, so I don't understand why we need is_date_closed function.
Now finally my question is that if I keep that code commented will it give me any problems?
It's 5:30 am here i'm running on caffine, I might be totally wrong here, I apologize if I am.