- $rep->Font();\r
- $rep->NewLine(2); \r
- \r
- // Calculate Bank Balance as per reco\r
- $date = date2sql($to);\r
- $sql = "SELECT SUM(IF(reconciled<='$date' AND reconciled !='0000-00-00', amount, 0)) as reconciled,\r
- SUM(amount) as books_total\r
- FROM ".TB_PREF."bank_trans trans\r
- WHERE bank_act=".db_escape($account['id'])."\r
- AND trans_date <= '$date'"; \r
- \r
- // ." AND trans.reconciled IS NOT NULL";\r
- //display_notification($sql);\r
- $t_result = db_query($sql,"Cannot retrieve reconciliation data");\r
-\r
- if ($t_row = db_fetch($t_result)) {\r
- $books_total = $t_row['books_total'];\r
- $reconciled = $t_row['reconciled'];\r
- } \r
- $difference = $books_total - $reconciled; \r
- \r
- // Bank Balance (by Reco)\r
- $rep->Font('bold');\r
- $rep->TextCol(3, 5, _("Bank Balance"));\r
- if ($reconciled > 0.0)\r
- $rep->AmountCol(5, 6, abs($reconciled), $dec);\r
- else\r
- $rep->AmountCol(6, 7, abs($reconciled), $dec);\r
- $rep->Font();\r
- $rep->NewLine(2); \r
-\r
- // Reco Difference\r
- $rep->Font('bold');\r
- $rep->TextCol(3, 5, _("Difference"));\r
- if ($difference > 0.0)\r
- $rep->AmountCol(5, 6, abs($difference), $dec);\r
- else\r
- $rep->AmountCol(6, 7, abs($difference), $dec);\r
- $rep->Font();\r
- $rep->NewLine(2); \r
- \r
- $rep->Line($rep->row - $rep->lineHeight + 4);\r
- $rep->NewLine(2, 1); \r
- \r
+ $rep->Font();
+ $rep->NewLine(2);
+
+ // Calculate Bank Balance as per reco
+ $date = date2sql($to);
+ $sql = "SELECT SUM(IF(reconciled<='$date' AND reconciled !='0000-00-00', amount, 0)) as reconciled,
+ SUM(amount) as books_total
+ FROM ".TB_PREF."bank_trans trans
+ WHERE bank_act=".db_escape($account['id'])."
+ AND trans_date <= '$date'";
+
+ // ." AND trans.reconciled IS NOT NULL";
+ //display_notification($sql);
+ $t_result = db_query($sql,"Cannot retrieve reconciliation data");
+
+ if ($t_row = db_fetch($t_result)) {
+ $books_total = $t_row['books_total'];
+ $reconciled = $t_row['reconciled'];
+ }
+ $difference = $books_total - $reconciled;
+
+ // Bank Balance (by Reco)
+ $rep->Font('bold');
+ $rep->TextCol(3, 5, _("Bank Balance"));
+ if ($reconciled > 0.0)
+ $rep->AmountCol(5, 6, abs($reconciled), $dec);
+ else
+ $rep->AmountCol(6, 7, abs($reconciled), $dec);
+ $rep->Font();
+ $rep->NewLine(2);
+
+ // Reco Difference
+ $rep->Font('bold');
+ $rep->TextCol(3, 5, _("Difference"));
+ if ($difference > 0.0)
+ $rep->AmountCol(5, 6, abs($difference), $dec);
+ else
+ $rep->AmountCol(6, 7, abs($difference), $dec);
+ $rep->Font();
+ $rep->NewLine(2);
+
+ $rep->Line($rep->row - $rep->lineHeight + 4);
+ $rep->NewLine(2, 1);
+