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.
! -> 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
$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();
}
// 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"));
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
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)
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");
}
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();
</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 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 = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 = "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;"> $_SESSION['bordercolor'] = "#8cacbb";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 = "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"); // new in 2.2</span><br style="font-family: monospace;" /><span style="font-family: monospace;">define("ICON_ESCAPE", "escape.png"); // 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 should set this line in <span style="font-weight: bold;">config.php</span> about line 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 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 = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 = "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;"> $_SESSION['bordercolor'] = "#8cacbb";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style = "cellpadding=3 border=1 bordercolor='".$_SESSION['bordercolor']."' class='tablestyle'";</span><br style="font-family: monospace;" /><span style="font-family: monospace;">$table_style2 = "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"); // new in 2.2</span><br style="font-family: monospace;" /><span style="font-family: monospace;">define("ICON_ESCAPE", "escape.png"); // 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 should set this line in <span style="font-weight: bold;">config.php</span> about line 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>