From e457d4a7cdc163ef24d380a37589d6c6575356a3 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 18 Nov 2009 13:08:59 +0000 Subject: [PATCH] Fixed side bug after last sql update. --- CHANGELOG.txt | 2 ++ gl/bank_account_reconcile.php | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 93fc3841..26aeb4b5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -25,6 +25,8 @@ $ -> Affected files $ config.default.php # Allow null references in trans to show up in gl_trans_view $ /gl/view/gl_trans_view.php +# Fixed side bug after last sql update. +$ /gl/bank_account_reconcile.php 17-Nov-2009 Joe Hunt/Tom Hallman ! Moved payment terms in documents for better view. Increased diff --git a/gl/bank_account_reconcile.php b/gl/bank_account_reconcile.php index 2fca2b34..c06b9d5b 100644 --- a/gl/bank_account_reconcile.php +++ b/gl/bank_account_reconcile.php @@ -108,7 +108,8 @@ function change_tpl_flag($reconcile_id) { global $Ajax; - if (!check_date()) + if (!check_date() + && check_value("rec_".$reconcile_id)) // temporary fix return false; if (get_post('bank_date')=='') // new reconciliation @@ -117,8 +118,8 @@ function change_tpl_flag($reconcile_id) $_POST['bank_date'] = date2sql(get_post('reconcile_date')); $reconcile_value = check_value("rec_".$reconcile_id) ? ("'".$_POST['bank_date'] ."'") : 'NULL'; - $sql = "UPDATE ".TB_PREF."bank_trans SET reconciled=".db_escape($reconcile_value) - ." WHERE id=".db_escape($reconcile_id); + $sql = "UPDATE ".TB_PREF."bank_trans SET reconciled=$reconcile_value" + ." WHERE id=".db_escape($reconcile_id); db_query($sql, "Can't change reconciliation status"); // save last reconcilation status (date, end balance) @@ -177,6 +178,8 @@ end_row(); end_table(); $date = date2sql(get_post('reconcile_date')); + // temporary fix to enable fix of invalid entries made in 2.2RC +if ($date == 0) $date = '0000-00-00'; $sql = "SELECT MAX(reconciled) as last_date, SUM(IF(reconciled<='$date', amount, 0)) as end_balance, @@ -267,7 +270,7 @@ display_heading($act['bank_account_name']." - ".$act['bank_curr_code']); ); $table =& new_db_pager('trans_tbl', $sql, $cols); - $table->width = "60%"; + $table->width = "80%"; display_db_pager($table); br(1); -- 2.30.2