From bad5ff2eebd4652df1f091adea2f37dcbef571d7 Mon Sep 17 00:00:00 2001 From: Neil Lathwood Date: Tue, 20 Sep 2016 16:23:15 +0100 Subject: [PATCH] Fix quota bills showing 0/0 for in/out (#4462) --- html/includes/table/bills.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/html/includes/table/bills.inc.php b/html/includes/table/bills.inc.php index c7246c0e4e..8c0f2504ca 100644 --- a/html/includes/table/bills.inc.php +++ b/html/includes/table/bills.inc.php @@ -117,8 +117,13 @@ foreach (dbFetchRows($sql, $param) as $bill) { } elseif (strtolower($bill['bill_type']) == 'quota') { $type = 'Quota'; $allowed = format_bytes_billing($bill['bill_allowed']); - $in = format_bytes_billing($bill['traf_in']); - $out = format_bytes_billing($bill['traf_out']); + if (!empty($prev)) { + $in = format_bytes_billing($bill['traf_in']); + $out = format_bytes_billing($bill['traf_out']); + } else { + $in = format_bytes_billing($bill['total_data_in']); + $out = format_bytes_billing($bill['total_data_out']); + } if (!$prev) { $percent = round((($bill['total_data'] / ($bill['bill_allowed'])) * 100), 2); $overuse = ($bill['total_data'] - $bill['bill_allowed']);