From 0ce53780d575e7bf4eefaa1b7edc0603131cc2b3 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Mon, 15 Feb 2021 17:43:59 +0100 Subject: [PATCH] PHP 7.4 Bugs in some reports. --- reporting/rep101.php | 8 ++++++-- reporting/rep115.php | 6 +++++- reporting/rep201.php | 6 +++++- reporting/rep206.php | 6 +++++- reporting/rep306.php | 2 +- reporting/rep710.php | 2 +- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/reporting/rep101.php b/reporting/rep101.php index 900678ad..4b570d5a 100644 --- a/reporting/rep101.php +++ b/reporting/rep101.php @@ -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); diff --git a/reporting/rep115.php b/reporting/rep115.php index ee03bf8a..0ed75193 100644 --- a/reporting/rep115.php +++ b/reporting/rep115.php @@ -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); diff --git a/reporting/rep201.php b/reporting/rep201.php index d5c5608b..88db421d 100644 --- a/reporting/rep201.php +++ b/reporting/rep201.php @@ -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); diff --git a/reporting/rep206.php b/reporting/rep206.php index 1e068596..79f4f1f3 100644 --- a/reporting/rep206.php +++ b/reporting/rep206.php @@ -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); diff --git a/reporting/rep306.php b/reporting/rep306.php index f3d022fd..00cddadc 100644 --- a/reporting/rep306.php +++ b/reporting/rep306.php @@ -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 != '') diff --git a/reporting/rep710.php b/reporting/rep710.php index fdf1db84..9db53e60 100644 --- a/reporting/rep710.php +++ b/reporting/rep710.php @@ -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' => ''), -- 2.30.2