! -> Note
$ -> Affected files
+12-Jun-2009 Joe Hunt
+! Code clean-up
+$ /gl/includes/db/gl_db_trans.inc
+ /gl/inquiry/gl_trial_balance.php
+ /includes/ui/ui_view.inc
+ /reporting/rep708.php
+
11-Jun-2009 Joe Hunt
! Changed balance_sheet operation in class table to class type for sign convert in Balance Sheet, Profit and Loss Statement and Monthly Breakdown
$ /gl/manage/gl_account_classes.php
/gl/includes/db/gl_db_accounts.inc
/gl/inquiry/gl_trial_balance.php
/includes/types.inc
+ /includes/ui/ui_lists.inc
/reporting/rep705.php
/reporting/rep706.php
/reporting/rep707.php
return $row[0];
}
+//----------------------------------------------------------------------------------------------------
+function get_balance($account, $dimension, $dimension2, $from, $to, $from_incl=true, $to_incl=true)
+{
+ $sql = "SELECT SUM(IF(amount >= 0, amount, 0)) as debit, SUM(IF(amount < 0, -amount, 0)) as credit, SUM(amount) as balance
+ FROM ".TB_PREF."gl_trans,".TB_PREF."chart_master,".TB_PREF."chart_types, ".TB_PREF."chart_class
+ WHERE ".TB_PREF."gl_trans.account=".TB_PREF."chart_master.account_code AND ".TB_PREF."chart_master.account_type=".TB_PREF."chart_types.id
+ AND ".TB_PREF."chart_types.class_id=".TB_PREF."chart_class.cid AND";
+
+ if ($account != null)
+ $sql .= " account='$account' AND";
+ if ($dimension > 0)
+ $sql .= " dimension_id=$dimension AND";
+ if ($dimension2 > 0)
+ $sql .= " dimension2_id=$dimension2 AND";
+ $from_date = date2sql($from);
+ if ($from_incl)
+ $sql .= " tran_date >= '$from_date' AND";
+ else
+ $sql .= " tran_date > IF(balance_sheet>0 AND balance_sheet<".CL_INCOME.", '0000-00-00', '$from_date') AND";
+ $to_date = date2sql($to);
+ if ($to_incl)
+ $sql .= " tran_date <= '$to_date' ";
+ else
+ $sql .= " tran_date < '$to_date' ";
+
+ $result = db_query($sql,"No general ledger accounts were returned");
+
+ return db_fetch($result);
+}
+
//--------------------------------------------------------------------------------
function get_budget_trans_from_to($from_date, $to_date, $account, $dimension=0, $dimension2=0)
//----------------------------------------------------------------------------------------------------
-function get_balance($account, $from, $to, $from_incl=true, $to_incl=true)
-{
- $sql = "SELECT SUM(IF(amount >= 0, amount, 0)) AS debit, SUM(IF(amount < 0, -amount, 0)) AS credit, SUM(amount) AS balance
- FROM ".TB_PREF."gl_trans,".TB_PREF."chart_master,".TB_PREF."chart_types, ".TB_PREF."chart_class
- WHERE ".TB_PREF."gl_trans.account=".TB_PREF."chart_master.account_code AND ".TB_PREF."chart_master.account_type=".TB_PREF."chart_types.id
- AND ".TB_PREF."chart_types.class_id=".TB_PREF."chart_class.cid AND";
-
- if ($account != null)
- $sql .= " account='$account' AND";
- $from_date = date2sql($from);
- if ($from_incl)
- $sql .= " tran_date >= '$from_date' AND";
- else
- $sql .= " tran_date > IF(balance_sheet>0 AND balance_sheet<".CL_INCOME.", '0000-00-00', '$from_date') AND";
- $to_date = date2sql($to);
- if ($to_incl)
- $sql .= " tran_date <= '$to_date' ";
- else
- $sql .= " tran_date < '$to_date' ";
-
- $result = db_query($sql,"No general ledger accounts were returned");
-
- return db_fetch($result);
-}
-
-//----------------------------------------------------------------------------------------------------
-
function display_trial_balance()
{
global $table_style, $path_to_root;
while ($account = db_fetch($accounts))
{
- $prev = get_balance($account["account_code"], $begin, $_POST['TransFromDate'], false, false);
- $curr = get_balance($account["account_code"], $_POST['TransFromDate'], $_POST['TransToDate'], true, true);
- $tot = get_balance($account["account_code"], $begin, $_POST['TransToDate'], false, true);
+ $prev = get_balance($account["account_code"], 0, 0, $begin, $_POST['TransFromDate'], false, false);
+ $curr = get_balance($account["account_code"], 0, 0, $_POST['TransFromDate'], $_POST['TransToDate'], true, true);
+ $tot = get_balance($account["account_code"], 0, 0, $begin, $_POST['TransToDate'], false, true);
if (check_value("NoZero") && !$prev['balance'] && !$curr['balance'] && !$tot['balance'])
continue;
alt_table_row_color($k);
function display_debit_or_credit_cells($value)
{
- if ($value > 0)
+ if ($value >= 0)
{
amount_cell($value);
label_cell("");
label_cell("");
amount_cell(abs($value));
}
- else
- {
- //label_cell("");
- amount_cell(0);
- label_cell("");
- }
}
//--------------------------------------------------------------------------------------
print_trial_balance();
-//----------------------------------------------------------------------------------------------------
-function get_balance($account, $dimension, $dimension2, $from, $to, $from_incl=true, $to_incl=true)
-{
- $sql = "SELECT SUM(IF(amount >= 0, amount, 0)) as debit, SUM(IF(amount < 0, -amount, 0)) as credit, SUM(amount) as balance
- FROM ".TB_PREF."gl_trans,".TB_PREF."chart_master,".TB_PREF."chart_types, ".TB_PREF."chart_class
- WHERE ".TB_PREF."gl_trans.account=".TB_PREF."chart_master.account_code AND ".TB_PREF."chart_master.account_type=".TB_PREF."chart_types.id
- AND ".TB_PREF."chart_types.class_id=".TB_PREF."chart_class.cid AND";
-
- if ($account != null)
- $sql .= " account='$account' AND";
- if ($dimension > 0)
- $sql .= " dimension_id=$dimension AND";
- if ($dimension2 > 0)
- $sql .= " dimension2_id=$dimension2 AND";
- $from_date = date2sql($from);
- if ($from_incl)
- $sql .= " tran_date >= '$from_date' AND";
- else
- $sql .= " tran_date > IF(balance_sheet>0 AND balance_sheet<".CL_INCOME.", '0000-00-00', '$from_date') AND";
- $to_date = date2sql($to);
- if ($to_incl)
- $sql .= " tran_date <= '$to_date' ";
- else
- $sql .= " tran_date < '$to_date' ";
-
- $result = db_query($sql,"No general ledger accounts were returned");
-
- return db_fetch($result);
-}
-
//----------------------------------------------------------------------------------------------------
function print_trial_balance()
### Data of table `0_chart_class` ###
INSERT INTO `0_chart_class` VALUES ('1', 'Assets', '1');
-INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '1');
-INSERT INTO `0_chart_class` VALUES ('3', 'Income', '0');
-INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '0');
-INSERT INTO `0_chart_class` VALUES ('5', 'Gross', '0');
+INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '2');
+INSERT INTO `0_chart_class` VALUES ('3', 'Income', '4');
+INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '6');
+INSERT INTO `0_chart_class` VALUES ('5', 'Gross', '6');
### Structure of table `0_chart_master` ###
### Data of table `0_chart_class` ###
INSERT INTO `0_chart_class` VALUES ('1', 'Assets', '1');
-INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '1');
-INSERT INTO `0_chart_class` VALUES ('3', 'Income', '0');
-INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '0');
+INSERT INTO `0_chart_class` VALUES ('2', 'Liabilities', '2');
+INSERT INTO `0_chart_class` VALUES ('3', 'Income', '4');
+INSERT INTO `0_chart_class` VALUES ('4', 'Costs', '6');
### Structure of table `0_chart_master` ###
installed languages)
</li>
<li><strong>/modules/installed_modules.php</strong> (contains information about
-installed modules<strong></strong>)</li><li>installed_extensions.php (contains information about installed extensions to the menu system)</li>
+installed modules<strong></strong>)</li><li><span style="font-weight: bold;">installed_extensions.php</span> (contains information about installed extensions to the menu system)</li>
<li>if you have made <em>changes to other files</em>, like themes or so, backup
these files too. </li>
</ol>
to the 'Setup' tab and run 'Software
Upgrade'.
Mark the checkbox 'Install' and press 'Upgrade System'. This will
-upgrade ALL your companies.</strong></li><li style="font-weight: bold;">If something goes wrong during upgrade, you can enter here again and try 'Force Upgrade', and press 'Upgrade System' again.</li><li><strong style="font-weight: bold;"></strong><strong>There are no database changes during a major and minor release. Like from 2.1 to 2.1.1 - 2.1.5 .</strong></li>
+upgrade ALL your companies.</strong></li><li style="font-weight: bold;">If something goes wrong during upgrade, you can enter here again and try 'Force Upgrade', and press 'Upgrade System' again.</li><li><strong style="font-weight: bold;"></strong><strong>There are no database changes during a major and minor release. Like from 2.1 to 2.1.1 - 2.1.5 .</strong></li><li style="font-weight: bold;">When
+updating from release 2.1.2 to 2.1.3, please go into Bank and General
+Ledger tab. Enter Account Classes. Change the Class Types to a proper
+value for all classes.</li>
</ul>
-<p> </p>
+<p style="font-weight: bold;"> </p>
</body></html>
\ No newline at end of file