PHP 7.4 Bugs in some reports.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 15 Feb 2021 16:43:59 +0000 (17:43 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Mon, 15 Feb 2021 16:43:59 +0000 (17:43 +0100)
reporting/rep101.php
reporting/rep115.php
reporting/rep201.php
reporting/rep206.php
reporting/rep306.php
reporting/rep710.php

index 900678ad7a9f6d62ad358c51a58bd43502ee0c3e..4b570d5ad5a92342526d93c6d1eae75573b5018b 100644 (file)
@@ -115,7 +115,7 @@ function print_customer_balances()
                $cust = _('All');
        else
                $cust = get_customer_name($fromcust);
-       $dec = user_price_dec();
+    $dec = user_price_dec();
 
        if ($show_balance) $sb = _('Yes');
        else $sb = _('No');
@@ -169,7 +169,11 @@ function print_customer_balances()
                $accumulate = 0;
                $rate = $convert ? get_exchange_rate_from_home_currency($myrow['curr_code'], Today()) : 1;
                $bal = get_open_balance($myrow['debtor_no'], $from);
-               $init[0] = $init[1] = 0.0;
+               $init = array();
+               $bal['charges'] = isset($bal['charges']) ? $bal['charges'] : 0;
+               $bal['credits'] = isset($bal['credits']) ? $bal['credits'] : 0;
+               $bal['Allocated'] = isset($bal['Allocated']) ? $bal['Allocated'] : 0;
+               $bal['OutStanding'] = isset($bal['OutStanding']) ? $bal['OutStanding'] : 0;
                $init[0] = round2(abs($bal['charges']*$rate), $dec);
                $init[1] = round2(Abs($bal['credits']*$rate), $dec);
                $init[2] = round2($bal['Allocated']*$rate, $dec);
index ee03bf8a8fa06dbea9ed905ae3392724ba8c369d..0ed751930cfdc56ff19e56ce681facb8599c6c1a 100644 (file)
@@ -216,7 +216,11 @@ function print_customer_balances()
         $accumulate = 0;
         $rate = $convert ? get_exchange_rate_from_home_currency($myrow['curr_code'], Today()) : 1;
         $bal = get_open_balance($myrow['debtor_no'], $from, $convert);
-        $init[0] = $init[1] = 0.0;
+        $init = array();
+               $bal['charges'] = isset($bal['charges']) ? $bal['charges'] : 0;
+               $bal['credits'] = isset($bal['credits']) ? $bal['credits'] : 0;
+               $bal['Allocated'] = isset($bal['Allocated']) ? $bal['Allocated'] : 0;
+               $bal['OutStanding'] = isset($bal['OutStanding']) ? $bal['OutStanding'] : 0;
         $init[0] = round2(abs($bal['charges'] * $rate), $dec);
         $init[1] = round2(Abs($bal['credits'] * $rate), $dec);
         $init[2] = round2($bal['Allocated'] * $rate, $dec);
index d5c5608b18dde18e543f6584f2a34e8a15324106..88db421d46639433a7f4747c08b6d6026ed9e461 100644 (file)
@@ -149,7 +149,11 @@ function print_supplier_balances()
                $accumulate = 0;
                $rate = $convert ? get_exchange_rate_from_home_currency($myrow['curr_code'], Today()) : 1;
                $bal = get_open_balance($myrow['supplier_id'], $from);
-               $init[0] = $init[1] = 0.0;
+               $init = array();
+               $bal['charges'] = isset($bal['charges']) ? $bal['charges'] : 0;
+               $bal['credits'] = isset($bal['credits']) ? $bal['credits'] : 0;
+               $bal['Allocated'] = isset($bal['Allocated']) ? $bal['Allocated'] : 0;
+               $bal['OutStanding'] = isset($bal['OutStanding']) ? $bal['OutStanding'] : 0;
                $init[0] = round2(abs($bal['charges']*$rate), $dec);
                $init[1] = round2(Abs($bal['credits']*$rate), $dec);
                $init[2] = round2($bal['Allocated']*$rate, $dec);
index 1e0685969480b3eec364126a2b1fc291795ace97..79f4f1f3b40338eeac0db6085069661037056eb7 100644 (file)
@@ -148,7 +148,11 @@ function print_supplier_balances()
         $accumulate = 0;
         $rate = $convert ? get_exchange_rate_from_home_currency($myrow['curr_code'], Today()) : 1;
         $bal = get_open_balance($myrow['supplier_id'], $from);
-        $init[0] = $init[1] = 0.0;
+               $init = array();
+               $bal['charges'] = isset($bal['charges']) ? $bal['charges'] : 0;
+               $bal['credits'] = isset($bal['credits']) ? $bal['credits'] : 0;
+               $bal['Allocated'] = isset($bal['Allocated']) ? $bal['Allocated'] : 0;
+               $bal['OutStanding'] = isset($bal['OutStanding']) ? $bal['OutStanding'] : 0;
         $init[0] = round2(abs($bal['charges']*$rate), $dec);
         $init[1] = round2(Abs($bal['credits']*$rate), $dec);
         $init[2] = round2($bal['Allocated']*$rate, $dec);
index f3d022fd29fff42f73cddf5e9f2812d125071c5d..00cddadc1f96a000cd4c3fe61ff9abd0d87a2f55 100644 (file)
@@ -266,7 +266,7 @@ function print_inventory_purchase()
                        $rep->NewLine();
                        $rep->NewLine();
                        $total_supp = $total_qty = 0.0;
-                       $supplier_name = $trans['supplier_name'];
+                       $supplier_name = isset($trans['supplier_name']) ? $trans['supplier_name'] : "";
                }       
        }
        if ($supplier_name != '')
index fdf1db846a1ea9a28f38dd89bb099cf137e6a3ae..9db53e60b46324e6c7d9fea9705f3063f2392a88 100644 (file)
@@ -80,7 +80,7 @@ function print_audit_trail()
     $aligns = array('left', 'left', 'left', 'left', 'left', 'left', 'left', 'right');
 
        $usr = get_user($user);
-       $user_id = $usr['user_id'];
+       $user_id = isset($usr['user_id']) ? $usr['user_id'] : "";
     $params =   array(         0 => $comments,
                                    1 => array('text' => _('Period'), 'from' => $from,'to' => $to),
                        2 => array('text' => _('Type'), 'from' => ($systype != -1 ? $systypes_array[$systype] : _('All')), 'to' => ''),