Fixed side bug after last sql update.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 18 Nov 2009 13:08:59 +0000 (13:08 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Wed, 18 Nov 2009 13:08:59 +0000 (13:08 +0000)
CHANGELOG.txt
gl/bank_account_reconcile.php

index 93fc3841f6fec476db5b9c2f989451ec8ca55a9d..26aeb4b57e649ddba39790f2b8836d5e4edb4f89 100644 (file)
@@ -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
index 2fca2b34c41805bf9fdd141d89d5fd74bf25811d..c06b9d5b998bbe5ad3872c208b648a28536e39ff 100644 (file)
@@ -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);