From 60c538ad8cdbc3041afa356b1e46dd5cfbc92907 Mon Sep 17 00:00:00 2001 From: CirnoT <1447794+CirnoT@users.noreply.github.com> Date: Sun, 28 Jul 2019 05:56:51 +0200 Subject: [PATCH] Don't display INF% for percentage of used transfer when billing is CDR (#10446) --- includes/html/pages/bill/transfer.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/html/pages/bill/transfer.inc.php b/includes/html/pages/bill/transfer.inc.php index f3ddb44273..c19df5e3f4 100644 --- a/includes/html/pages/bill/transfer.inc.php +++ b/includes/html/pages/bill/transfer.inc.php @@ -42,7 +42,11 @@ if ($bill_data['bill_type'] == 'quota') { $total['ave'] = format_bytes_billing(($bill_data['total_data'] / $cur_days)); $total['est'] = format_bytes_billing(($bill_data['total_data'] / $cur_days * $total_days)); -$total['per'] = round(($bill_data['total_data'] / $bill_data['bill_quota'] * 100), 2); +if ($bill_data['bill_type'] == 'quota') { + $total['per'] = round(($bill_data['total_data'] / $bill_data['bill_quota'] * 100), 2); +} else { + $total['per'] = round(($bill_data['total_data'] / ($bill_data['total_data'] / $cur_days * $total_days) * 100), 2); +} $total['bg'] = get_percentage_colours($total['per']); $in['data'] = format_bytes_billing($bill_data['total_data_in']);