From d50d4eed08da63b4162ade291884f86f1bfa7af2 Mon Sep 17 00:00:00 2001 From: Adam Amstrong Date: Wed, 7 Dec 2011 14:48:04 +0000 Subject: [PATCH] billing cleanups git-svn-id: http://www.observium.org/svn/observer/trunk@2766 61d68cd4-352d-0410-923a-c4978735b2b8 --- html/pages/bill.inc.php | 6 +++--- html/pages/bill/actions.inc.php | 4 ++-- html/pages/bill/edit.inc.php | 4 ++-- html/pages/bill/transfer.inc.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/html/pages/bill.inc.php b/html/pages/bill.inc.php index 3d90330918..5e05167b93 100644 --- a/html/pages/bill.inc.php +++ b/html/pages/bill.inc.php @@ -155,9 +155,9 @@ if (bill_permitted($bill_id)) $percent = round(($total_data) / $bill_data['bill_quota'] * 100, 2); $unit = "MB"; $total_data = round($total_data, 2); - echo("Billing Period from " . $fromtext . " to " . $totext . " -
Transferred ".format_byes_billing($total_data)." of ".format_bytes_billing($bill_data['bill_quota'])." (".$percent."%) -
Average rate " . formatRates($rate_average)); + echo("Billing Period from " . $fromtext . " to " . $totext); + echo("
Transferred ".format_bytes_billing($total_data)." of ".format_bytes_billing($bill_data['bill_quota'])." (".$percent."%)"); + echo("
Average rate " . formatRates($rate_average)); $background = get_percentage_colours($percent); diff --git a/html/pages/bill/actions.inc.php b/html/pages/bill/actions.inc.php index 22eafcc202..70f22b9f74 100644 --- a/html/pages/bill/actions.inc.php +++ b/html/pages/bill/actions.inc.php @@ -30,8 +30,8 @@ if ($_POST['action'] == "delete_bill_port") if ($_POST['action'] == "update_bill") { - if (dbUpdate(array('bill_name' => $_POST['bill_name'], 'bill_day' => $_POST['bill_day'], 'bill_gb' => $_POST['bill_gb'], - 'bill_cdr' => $_POST['bill_cdr'], 'bill_type' => $_POST['bill_type']), 'bills', '`bill_id` = ?', array($bill_id))) + if (dbUpdate(array('bill_name' => $_POST['bill_name'], 'bill_day' => $_POST['bill_day'], 'bill_quota' => ($_POST['bill_quota'] * $config['billing']['base'] * $config['billing']['base'] * $config['billing']['base']), + 'bill_cdr' => ($_POST['bill_cdr']*1000), 'bill_type' => $_POST['bill_type']), 'bills', '`bill_id` = ?', array($bill_id))) { print_message("Bill Properties Updated"); } diff --git a/html/pages/bill/edit.inc.php b/html/pages/bill/edit.inc.php index f9db2779e9..fed8c6b988 100644 --- a/html/pages/bill/edit.inc.php +++ b/html/pages/bill/edit.inc.php @@ -22,12 +22,12 @@ echo("
Monthly Quota
- GB + GB
CDR with 95th
- Kbps + Kbps diff --git a/html/pages/bill/transfer.inc.php b/html/pages/bill/transfer.inc.php index 59af48f049..fd317393d2 100644 --- a/html/pages/bill/transfer.inc.php +++ b/html/pages/bill/transfer.inc.php @@ -70,7 +70,7 @@ $out['per'] = round(($bill_data['total_data_out'] / $bill_data['total_data'] * 100), 2); $out['bg'] = get_percentage_colours($out['per']); - $ousage['over'] = $bill_data['total_data'] - ($bill_data['bill_gb'] * $config['billing']['base']); + $ousage['over'] = $bill_data['total_data'] - ($bill_data['bill_quota']); $ousage['over'] = (($ousage['over'] < 0) ? "0" : $ousage['over']); $ousage['data'] = format_number($ousage['over'] , $config['billing']['base']); $ousage['allow'] = $total['allow'];