Merged all main trunk bugfixes up to release 2.0.5
[fa-stable.git] / reporting / rep201.php
index 834ca6ce0c6b30e7e41fb8ec03fe209956d27970..89169ce0567eb011cdebc0a9627e00f3b8b6fa91 100644 (file)
@@ -84,7 +84,7 @@ function print_supplier_balances()
     $rep->Header();
 
        $total = array();
-       $grandtotal = array();
+       $grandtotal = array(0,0,0,0);
 
        $sql = "SELECT supplier_id, supp_name AS name, curr_code FROM ".TB_PREF."suppliers ";
        if ($fromsupp != reserved_words::get_all_numeric())
@@ -118,7 +118,8 @@ function print_supplier_balances()
                                $rep->TextCol(3, 4,     sql2date($trans['due_date']));
                        $item[0] = $item[1] = 0.0;
                        if ($convert)
-                               $rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $date);
+                               //$rate = get_exchange_rate_from_home_currency($myrow['curr_code'], $date);
+                               $rate = $trans['rate'];
                        else
                                $rate = 1.0;
                        if ($trans['TotalAmount'] > 0.0)