Release 2.2.3
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 12 Jan 2010 10:26:27 +0000 (10:26 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 12 Jan 2010 10:26:27 +0000 (10:26 +0000)
Allow using of multi level sub-types when digits are of same length in account types
Print COA also prints class id and account type id.

CHANGELOG.txt
admin/fiscalyears.php
config.default.php
gl/includes/db/gl_db_accounts.inc
reporting/rep701.php
update.html

index d826fb91a68e248371f7b46ed4c8f44e33827c9d..536fe95177eb3b6f1809ada293ad9e003542acc4 100644 (file)
@@ -19,6 +19,17 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+------------------------------- Release 2.2.3 ----------------------------------
+12-Jan-2010 Joe Hunt
+! Release 2.2.3
+! Allow using of multi level sub-types when digits are of same length in account types
+$ config.default.php
+  update.html
+  /gl/includes/db/gl_db_accounts.inc
+! Print COA also prints class id and account type id.
+$ /reporting/rep701.php
+
+
 11-Jan-2010 Janusz Dobrowolski
 # Removed invalid constraint on tax_types.
 $ /sql/en_US-new.sql
index b507abbac7a085cb0e05852f1e1c915d71766162..85792f73272f725a30aaa0ed0438cc0830fbd1aa 100644 (file)
@@ -369,6 +369,34 @@ function delete_this_fiscalyear($selected_id)
        
        $sql = "DELETE FROM ".TB_PREF."audit_trail WHERE gl_date <= '$to'";
        db_query($sql, "Could not delete audit trail");
+       
+       $sql = "SELECT type, id FROM ".TB_PREF."comments";
+       $result = db_query($sql, "Could not retrieve comments");
+       while ($row = db_fetch($result))
+       {
+               $sql = "SELECT count(*) FROM ".TB_PREF."gl_trans WHERE type = {$row['type']} AND type_no = {$row['id']}";
+               $res = db_query($sql, "Could not retrieve gl_trans");
+               $row2 = db_fetch_row($res);
+               if ($row2[0] == 0) // if no link, then delete comments
+               {
+                       $sql = "DELETE FROM ".TB_PREF."comments WHERE type = {$row['type']} AND id = {$row['id']}";
+                       db_query($sql, "Could not delete comments");
+               }
+       }       
+       $sql = "SELECT type, id FROM ".TB_PREF."refs";
+       $result = db_query($sql, "Could not retrieve refs");
+       while ($row = db_fetch($result))
+       {
+               $sql = "SELECT count(*) FROM ".TB_PREF."gl_trans WHERE type = {$row['type']} AND type_no = {$row['id']}";
+               $res = db_query($sql, "Could not retrieve gl_trans");
+               $row2 = db_fetch_row($res);
+               if ($row2[0] == 0) // if no link, then delete refs
+               {
+                       $sql = "DELETE FROM ".TB_PREF."refs WHERE type = {$row['type']} AND id = {$row['id']}";
+                       db_query($sql, "Could not delete refs");
+               }
+       }       
+               
        delete_fiscalyear($selected_id);
        commit_transaction();   
 }
index bebb6a7103db01cbff5d49fb10cad8cd31e8cc7c..d79eb8098504d6bedb4267230470a7404a4a900d 100644 (file)
@@ -56,7 +56,7 @@ if (!isset($path_to_root) || isset($_GET['path_to_root']) || isset($_POST['path_
        // Main Title
        $app_title = "FrontAccounting";
        // application version
-       $version                = "2.2.2";
+       $version                = "2.2.3";
 
        // Build for development purposes
        $build_version  = date("d.m.Y", filemtime("$path_to_root/CHANGELOG.txt"));
@@ -211,4 +211,8 @@ if (!defined('ICON_EDIT'))
        define("ICON_SUBMIT", "ok.gif");
        define("ICON_ESCAPE", "escape.png");    
 }
+
+       /* allow using of multi level sub-types when digits are of same length in account types */
+       $use_new_account_types = 0;
+
 ?>
\ No newline at end of file
index 518f577f5e0ce509b23363cc8b646c606525944e..ee4d4c73bef7ee8bf6863a38a1df19c0def7d1ab 100644 (file)
@@ -50,6 +50,8 @@ function get_gl_accounts($from=null, $to=null)
 
 function get_gl_accounts_all($balance=-1)
 {
+       global $use_new_account_types;
+       
        if ($balance == 1)
                $where ="WHERE ctype>0 AND ctype<".CL_INCOME;
        elseif ($balance == 0)  
@@ -62,8 +64,11 @@ function get_gl_accounts_all($balance=-1)
                LEFT JOIN ".TB_PREF."chart_master ON ".TB_PREF."chart_master.account_type=".TB_PREF."chart_types.id ";
        if ($balance != -1)
                $sql .= $where;                                 
-        $sql .= " ORDER BY ".TB_PREF."chart_class.cid, IF(parent > 0,parent,".TB_PREF."chart_types.id), 
-               IF(parent > 0,".TB_PREF."chart_types.id, parent), ".TB_PREF."chart_master.account_code";
+       if (isset($use_new_account_types) && $use_new_account_types == 1)
+               $sql .= " ORDER BY ".TB_PREF."chart_class.cid, ".TB_PREF."chart_types.id, parent, ".TB_PREF."chart_master.account_code";
+       else
+               $sql .= " ORDER BY ".TB_PREF."chart_class.cid, IF(parent > 0,parent,".TB_PREF."chart_types.id), 
+                       IF(parent > 0,".TB_PREF."chart_types.id, parent), ".TB_PREF."chart_master.account_code";
 
        return db_query($sql, "could not get gl accounts");
 }
index 847fb04e7371d6f1f4fe9fb35d3d263a296e3c85..fc7b8a43006f1149fb0f0b9b51abf576ef471811 100644 (file)
@@ -71,13 +71,17 @@ function print_Chart_of_Accounts()
                        if ($account['AccountClassName'] != $classname)
                        {
                                $rep->Font('bold');
-                               $rep->TextCol(0, 4, $account['AccountClassName']);
+                               //$rep->TextCol(0, 4, $account['AccountClassName']);
+                               $rep->TextCol(0, 1, $account['ClassID']);
+                               $rep->TextCol(1, 4, $account['AccountClassName']);
                                $rep->Font();
                                //$rep->row -= ($rep->lineHeight + 4);
                                $rep->NewLine();
                        }
                        $group = $account['AccountTypeName'];
-                       $rep->TextCol(0, 4, $account['AccountTypeName']);
+                       //$rep->TextCol(0, 4, $account['AccountTypeName']);
+                       $rep->TextCol(0, 1, $account['AccountType']);
+                       $rep->TextCol(1, 4, $account['AccountTypeName']);
                        //$rep->Line($rep->row - 4);
                        //$rep->row -= ($rep->lineHeight + 4);
                        $rep->NewLine();
index 2580973dac2222b8e1cdcafec1d8923506a32d76..8dc71bdb54f2b3f1ae547c4424f24864d854cfd6 100644 (file)
@@ -18,7 +18,7 @@ these files. </li></ul><ol>
         </ol>
 
       </li><li>Upload all the new files.
-      </li><li>Look into the file, <span style="font-weight: bold; font-style: italic;">config.default.php and compare with your own config.php</span> file. You should update the the following in your config.php:<br /><br /></li><ul><li><small>Change the $version in your <span style="font-weight: bold;">config.php</span> file, about line 59, from "2.X.X" to "2.2.2".</small></li><li><small>If this is an update from "2.2.X" to "2.2.2" you are <span style="font-weight: bold; font-style: italic;">done and &nbsp;should ignore the the rest of the items in this note</span>.<br /></small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> about line 80-82 into <span style="font-weight: bold;">config.php</span> about line 80:<br /><br /><span style="font-family: monospace;">/* Show users online discretetely in the footer */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$show_users_online = 0;</span><br style="font-family: monospace;" /><span style="font-family: monospace;">Change this to 1 if you want to show users online.</span><br style="font-family: monospace;" /></small></li><li><small>Replace the 2 lines about line 110-111 in <span style="font-weight: bold;">config.php</span>:<br /><br /><span style="font-family: monospace;">$table_style &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 &nbsp;&nbsp; &nbsp;= "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";</span><br style="font-family: monospace;" /></small></li><li><small>With these 4 lines from <span style="font-weight: bold;">config.default.php</span>:<br /><br /><span style="font-family: monospace;">if (!isset($_SESSION['bordercolor']))</span><br style="font-family: monospace;" /><span style="font-family: monospace;">&nbsp; &nbsp; $_SESSION['bordercolor'] = "#8cacbb";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";</span><br style="font-family: monospace;" /></small></li><li><small>Remove these 2 lines from <span style="font-weight: bold;">config.php</span> about line 176-177:<br /><br /><span style="font-family: monospace;">/* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$def_app = "orders";</span><br style="font-family: monospace;" /></small></li><li><small>Copy these 3 lines from config.default.php about line 113-115<br /><br /><span style="font-family: monospace;">// defalt dateformats and dateseps indexes used before user login</span></small><br style="font-family: monospace;" /><small style="font-family: monospace;">$dflt_date_fmt = 0;</small><br style="font-family: monospace;" /><small><span style="font-family: monospace;">$dflt_date_sep = 0;</span><br style="font-family: monospace;" /></small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> about line 211-212:<br /><br /><span style="font-family: monospace;">define("ICON_SUBMIT", "ok.gif");&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // new in 2.2</span><br style="font-family: monospace;" /><span style="font-family: monospace;">define("ICON_ESCAPE", "escape.png");&nbsp;&nbsp;&nbsp; // new in 2.2</span><br style="font-family: monospace;" /></small></li><li><small>And paste them into <span style="font-weight: bold;">config.php</span> about line 209</small></li><li><small>If you use gregorian calendar and have non-workdays on Friday and first day of week = Saturday<br />then you &nbsp;should &nbsp;set this line in <span style="font-weight: bold;">config.php</span> about line&nbsp; 95.<br /></small><pre><small>$date_system = 3;</small></pre></li><li><small>If you want to use FrontAccounting help wiki then set this line in config.php about line 85<br /></small><pre><small>$help_base_url = "http://frontaccounting.net/fawiki?n=Help.";<br /></small></pre></li></ul><li>Rename or remove the /install folder (you have already performed the install
+      </li><li>Look into the file, <span style="font-weight: bold; font-style: italic;">config.default.php and compare with your own config.php</span> file. You should update the the following in your config.php:<br /><br /></li><ul><li><small>Change the $version in your <span style="font-weight: bold;">config.php</span> file, about line 59, from "2.X.X" to "2.2.3".</small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> at the bottom into <span style="font-weight: bold;">config.php</span> at the bottom:<br /><span style="font-family: monospace;"><br />/* allow using of multi level sub-types when digits are of same length in account types */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$use_new_account_types = 0;</span><br style="font-family: monospace;" /><span style="font-family: monospace;">Change this to 1 if you want to use new multi level sup-types.</span><br style="font-family: monospace;" /></small></li><li><small>If this is an update from "2.2.X" to "2.2.3" you are<span style="font-weight: bold;"> </span><span style="font-style: italic; font-weight: bold;">done and &nbsp;should ignore the the rest of the items in this note</span>.<br /></small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> about line 80-82 into <span style="font-weight: bold;">config.php</span> about line 80:<br /><br /><span style="font-family: monospace;">/* Show users online discretetely in the footer */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$show_users_online = 0;</span><br style="font-family: monospace;" /><span style="font-family: monospace;">Change this to 1 if you want to show users online.</span><br style="font-family: monospace;" /></small></li><li><small>Replace the 2 lines about line 110-111 in <span style="font-weight: bold;">config.php</span>:<br /><br /><span style="font-family: monospace;">$table_style &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 &nbsp;&nbsp; &nbsp;= "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";</span><br style="font-family: monospace;" /></small></li><li><small>With these 4 lines from <span style="font-weight: bold;">config.default.php</span>:<br /><br /><span style="font-family: monospace;">if (!isset($_SESSION['bordercolor']))</span><br style="font-family: monospace;" /><span style="font-family: monospace;">&nbsp; &nbsp; $_SESSION['bordercolor'] = "#8cacbb";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 &nbsp;&nbsp;&nbsp; = "cellpadding=3 border=1 bordercolor='#cccccc' class='tablestyle2'";</span><br style="font-family: monospace;" /></small></li><li><small>Remove these 2 lines from <span style="font-weight: bold;">config.php</span> about line 176-177:<br /><br /><span style="font-family: monospace;">/* default start-up tab (orders/AP/stock/manuf/proj/GL/system) */</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$def_app = "orders";</span><br style="font-family: monospace;" /></small></li><li><small>Copy these 3 lines from config.default.php about line 113-115<br /><br /><span style="font-family: monospace;">// defalt dateformats and dateseps indexes used before user login</span></small><br style="font-family: monospace;" /><small style="font-family: monospace;">$dflt_date_fmt = 0;</small><br style="font-family: monospace;" /><small><span style="font-family: monospace;">$dflt_date_sep = 0;</span><br style="font-family: monospace;" /></small></li><li><small>Copy these 2 lines from <span style="font-weight: bold;">config.default.php</span> about line 211-212:<br /><br /><span style="font-family: monospace;">define("ICON_SUBMIT", "ok.gif");&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; // new in 2.2</span><br style="font-family: monospace;" /><span style="font-family: monospace;">define("ICON_ESCAPE", "escape.png");&nbsp;&nbsp;&nbsp; // new in 2.2</span><br style="font-family: monospace;" /></small></li><li><small>And paste them into <span style="font-weight: bold;">config.php</span> about line 209</small></li><li><small>If you use gregorian calendar and have non-workdays on Friday and first day of week = Saturday<br />then you &nbsp;should &nbsp;set this line in <span style="font-weight: bold;">config.php</span> about line&nbsp; 95.<br /></small><pre><small>$date_system = 3;</small></pre></li><li><small>If you want to use FrontAccounting help wiki then set this line in config.php about line 85<br /></small><pre><small>$help_base_url = "http://frontaccounting.net/fawiki?n=Help.";<br /></small></pre></li></ul><li>Rename or remove the /install folder (you have already performed the install
 process earlier).<br /></li></ul><ol>