Period bug caused warning on no fiscal year. Had to be reduces by one.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 23 Aug 2010 08:54:16 +0000 (08:54 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 23 Aug 2010 08:54:16 +0000 (08:54 +0000)
CHANGELOG.txt
gl/accruals.php

index 3bed45e6aef450766d24eac4a4b44076a0c7f236..33375b4f228c7ab45cca8f921b8781e0447433c9 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+23-Aug-2010 Joe Hunt
+# Period bug caused warning on no fiscal year. Had to be reduces by one.
+$ /gl/accruals.php
+
 22-Aug-2010 Janusz Dobrowolski
 + Extended number formatting to allow maximum precision numbers with 'max' specifier. 
   /includes/current_user.inc
index 8636dde9fef016ff68551d7cfa28756f02e396f4..445e86574aeb43eb908c7c08806f25ba0ea1d2fd 100644 (file)
@@ -54,10 +54,11 @@ if (isset($_POST['go']) || isset($_POST['show']))
        if ($input_error == 0)
        {
                $periods = input_num('periods');
+               $per = $periods - 1;
                $date_ = get_post('date_');
                $freq = get_post('freq');
-               $lastdate = ($freq== 1?add_days($date_,7*$periods):($freq==2?add_days($date_,14*$periods):
-                       ($freq==3?add_months($date_,$periods):add_months($date_,3*$periods))));
+               $lastdate = ($freq== 1?add_days($date_,7*$per):($freq==2?add_days($date_,14*$per):
+                       ($freq==3?add_months($date_,$per):add_months($date_,3*$per))));
                if (!is_date_in_fiscalyears($lastdate, false))
                {
                        display_error(_("Some of the period dates are outside the fiscal year. Create a new fiscal year first!"));