<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=10170&amp;type=atom" />
	<updated>2023-02-05T10:33:52Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=10170</id>
		<entry>
			<title type="html"><![CDATA[Re: The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42042#p42042" />
			<content type="html"><![CDATA[<p>@MacKenzie <br />Did you investigate this with debug on?</p>]]></content>
			<author>
				<name><![CDATA[rafat]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41964</uri>
			</author>
			<updated>2023-02-05T10:33:52Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42042#p42042</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42038#p42038" />
			<content type="html"><![CDATA[<p>No problem. I like FA and will continue to be involved.</p>]]></content>
			<author>
				<name><![CDATA[MacKenzie]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45867</uri>
			</author>
			<updated>2023-02-05T04:38:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42038#p42038</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42029#p42029" />
			<content type="html"><![CDATA[<p>Of course your name is @MacKenzie. Sorry. Thanks for your contributions.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2023-02-02T22:12:45Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42029#p42029</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42028#p42028" />
			<content type="html"><![CDATA[<p>MacKenzie, not Mackensie.&nbsp; I appreciate it.</p>]]></content>
			<author>
				<name><![CDATA[MacKenzie]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45867</uri>
			</author>
			<updated>2023-02-02T19:42:36Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42028#p42028</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42022#p42022" />
			<content type="html"><![CDATA[<p>@MacKensie</p><p>Please avoid all these technical descriptions when reporting. It will make most users confused.</p><p>1. Set the $go_debug variable in file config.php to 2. It will then report if there are php errors in the code.</p><p>2. If you want to make entries in all non closed fiscal years, then check that you are &#039;Super administrator&#039; and set the &#039;Allow entry on non closed fiscal years&#039; in &#039;Banking &amp; GL configuration&#039;, &#039;Access Setup&#039;, &#039;Setup&#039; tab.</p><p>3. Use the &#039;Help&#039; menu if you need information and tips on your current operations. The Help is Context Sensitive.</p><p>As I told before, we can&#039;t reproduce your reported error and during the years with these operations noone has reported any errors.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2023-02-02T06:00:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42022#p42022</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42017#p42017" />
			<content type="html"><![CDATA[<p>No sir.&nbsp; Trust me when I tell you everything in FA pointed to 2021 as the active year.&nbsp; Not my first rodeo.&nbsp; Weird, I know.&nbsp; I have screen shots to back this up, but again I can&#039;t share them here.</p><p>I did a work around for this and this issue is now in my rear view mirror.&nbsp; Not exactly sure why it happened, but since it DID happen (perhaps an anomaly) I needed a quick fix.</p><p>Anybody can do this, but I would NOT recommend it unless you know what you&#039;re doing.</p><p>Before you do anything LOG OUT of FA and then copy the gl_journal.php to to a safe place in another directory! </p><p>1.&nbsp; Create a status.txt file in the gl directory.</p><p>2. Edit the status.txt file so it reads &quot;Super Super Admin is turned off&quot;. (no quotes in the file).</p><p>3. copy file gl_journal.php to reg_gl_journal.php</p><p>4. copy file gl_journal.php to ssa_gl_journal.php</p><p>5. edit ssa_gl_journal.php and comment out (not delete) 6 lines:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; //elseif (!is_date_in_fiscalyear($_POST[&#039;date_&#039;]))&nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; //{<br />&nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; display_error(_(&quot;The entered date is out of fiscal year or is closed for further data entry.&quot;));<br />&nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; set_focus(&#039;date_&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; $input_error = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; //} </p><p>5. Save the edited file as ssa_gl_journal.php (ssa = super super admin)</p><p>6.&nbsp; Create a bash script named &quot;ssa_cpa.sh&quot; (or whatever you want)&nbsp; as follows:</p><p>#!/bin/bash<br />read -p &quot;Do you wish to be in Super Admin Mode? &quot; USER_INPUT</p><p>if [[ $USER_INPUT = &quot;yes&quot; ]]; then<br />&nbsp; &nbsp; &nbsp; &nbsp; cp ssa_gl_journal.php gl_journal.php<br />&nbsp; &nbsp; &nbsp; &nbsp; sed -i &#039;s/off/on/&#039; status.txt<br />&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;status.txt file will reflect super admin status.&quot;</p><p>elif [[ $USER_INPUT = &quot;no&quot; ]]; then<br />&nbsp; &nbsp; &nbsp; &nbsp; cp reg_gl_journal.php gl_journal.php<br />&nbsp; &nbsp; &nbsp; &nbsp; sed -i &#039;s/on/off/&#039; status.txt<br />&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;status.txt file will reflect regular admin status.&quot;<br />else<br />&nbsp; &nbsp; &nbsp; &nbsp; echo &quot;Make up your mind please.&quot;</p><p>fi</p><br /><p>7.&nbsp; Save the bash script.</p><p>8.&nbsp; Change rights to your bash file as:</p><p>9.&nbsp; sudo chmod +x ssa_cpa.sh</p><p>10.&nbsp; Just use FA as needed with your regular rights.&nbsp; If you MUST have access to multi-year and can not do this through the UI, and it&#039;s an emergency then invoke the bash script.&nbsp; In linux this is done as follows:</p><p>10: sudo bash ssa_cpa.sh</p><p>11. Answer the question as &quot;yes&quot; or &quot;no&quot; (no quotes, lower case response).&nbsp; Anything else just ends it.&nbsp; &nbsp;If you answer &quot;yes&quot; then status will be : &quot;Super Admin is turned On.&quot;&nbsp; Opposite if you answer &quot;no&quot;.</p><p>12.&nbsp; LOG BACK INTO FA</p><p>13.&nbsp; When you are finished with your multi-year general journal entry, LOG OUT OF FA and immediately run the bash script again, and this time answer &quot;no&quot; to the question.&nbsp; This will put everything back as it was, and you can then LOG BACK INTO FA.</p><br /><p>If you ever forget what admin status you are in [keyboard] type:&nbsp; cat status.txt and it will report on your terminal.&nbsp; Note, all of the above requires you to be in command line in the /frontaccount/gl directory. </p><p>***DO NOT TRY THIS UNLESS YOU KNOW WHAT YOU&#039;RE DOING.&nbsp; IT&#039;S A VERY SIMPLE WORK AROUND, BUT IT&#039;S EASY TO FAT FINGER THIS FIX. DON&#039;T DO IT UNLESS YOU ARE COMFORTABLE.***</p><p>***NO WARRANTIES WHATSOEVER - - USE AT YOUR OWN RISK***</p><p>:-)</p>]]></content>
			<author>
				<name><![CDATA[MacKenzie]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45867</uri>
			</author>
			<updated>2023-02-01T19:33:22Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42017#p42017</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42015#p42015" />
			<content type="html"><![CDATA[<p>@MacKensie</p><p>Did you forget to set the current fiscal year as @rafat advised?</p><p>I cannot reproduce this error with the correct fiscal year set on the company.</p><p>Joe</p>]]></content>
			<author>
				<name><![CDATA[joe]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=3</uri>
			</author>
			<updated>2023-02-01T11:48:16Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42015#p42015</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42014#p42014" />
			<content type="html"><![CDATA[<p>setup-&gt;Company Setup-&gt;choose 2021 fiscal year. Bottom of screen press Update.<br />Now you will be able to enter data in that year.</p>]]></content>
			<author>
				<name><![CDATA[rafat]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=41964</uri>
			</author>
			<updated>2023-02-01T07:42:40Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42014#p42014</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[The entered date is out of fiscal year (oh, no sir, it's not!)]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=42012#p42012" />
			<content type="html"><![CDATA[<p>******************************************************************************************************************************************************<br />Longer Subject:&nbsp; The entered date is out of fiscal year (oh, no sir, it&#039;s not!) so you&#039;re Journal Entry ain&#039;t gonna happen (wanna bet?)<br />******************************************************************************************************************************************************<br />supportingDocs: https://imgflip.com/i/79hs43 (Images probably too small to be useful to anyone).</p><p>I hit another anomaly and&nbsp; It&#039;s a bit of an issue.&nbsp; An accountant needs to be unfettered when setting up a new company.&nbsp; That person might be working on 2021 in 2023 - trying to enter a T/B to carry forward, etc.&nbsp; Lots of reasons.&nbsp; I can&#039;t apparently provide attachments to this post, but I have a 2021 fiscal year selected, and set up in the Company as active.&nbsp; Under fiscal years it is also set up, and it should be good to go.&nbsp; Now mind you, I&#039;m doing this work in 2023, but FOR 2021.&nbsp; This is real world stuff.&nbsp; So I wanted to establish in 2021 accounts the &quot;activity&quot; - - profit and loss, with an entry to would encapsulate all activity for 2021.&nbsp; Then the plan was to close this out, and roll into 2022 and basically do the same thing.&nbsp; Even though 2021 was the ONLY active year set up, FA would not let me make the entry.&nbsp; &nbsp; The offending code is found in gl_journal.php as follows:</p><p>// Would not let me post a journal entry in 2021, even though it was all set up for that.<br />&nbsp; &nbsp; &nbsp; &nbsp; elseif (!is_date_in_fiscalyear($_POST[&#039;date_&#039;]))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display_error(_(&quot;The entered date is out of fiscal year or is closed for further data entry.&quot;));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; set_focus(&#039;date_&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $input_error = 1;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />This, as I&#039;m sure you know, calls the date_functions.inc and keys off of this code:</p><p>function is_date_in_fiscalyear($date, $convert=false)<br />{<br />&nbsp; &nbsp; &nbsp; &nbsp; global $path_to_root;<br />&nbsp; &nbsp; &nbsp; &nbsp; include_once($path_to_root . &quot;/admin/db/fiscalyears_db.inc&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if ($convert)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $date2 = sql2date($date);<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $date2 = $date;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (is_date_closed($date2))<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (user_check_access(&#039;SA_MULTIFISCALYEARS&#039;)) // allow all open years for this one<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return is_date_in_fiscalyears($date2, false);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; $myrow = get_current_fiscalyear();<br />&nbsp; &nbsp; &nbsp; &nbsp; $begin = sql2date($myrow[&#039;begin&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; $end = sql2date($myrow[&#039;end&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; if (date1_greater_date2($begin, $date2) || date1_greater_date2($date2, $end))<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; return 1;<br />}</p><p>Not being able to post a 2021 entry to basically mimic the activity, albeit in summary, would render FA useless to me.&nbsp; To get around this I simply commented out the function (last one I presented above) and ran the journal entry, and of course it worked fine once the digital hand-cuffs were removed.</p><p>My question is WHY DID THIS HAPPEN?&nbsp; Trust me when I tell you everything in FA pointed to 2021 as the active year.&nbsp; I have screen shots to back this up, but again I can&#039;t share them here.</p><p>Anyway, I just copy the original file (e.g., gl_journal.php -&gt; gl_journal_original.php) and then make modifications to the gl_journal.php file.&nbsp; Like I said, to comment out the handcuffs.&nbsp; Once completed I just copy the original php code back into the directory.&nbsp; This is a PITA so I&#039;m hoping there is a reason for this.&nbsp; If not, then it&#039;s definitely a bug.</p><p>Thanks.<br />Mac</p>]]></content>
			<author>
				<name><![CDATA[MacKenzie]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=45867</uri>
			</author>
			<updated>2023-01-31T23:50:07Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=42012#p42012</id>
		</entry>
</feed>
