billing cleanups

git-svn-id: http://www.observium.org/svn/observer/trunk@2766 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-12-07 14:48:04 +00:00
parent e6988c8b98
commit d50d4eed08
4 changed files with 8 additions and 8 deletions
+3 -3
View File
@@ -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 . "
<br />Transferred ".format_byes_billing($total_data)." of ".format_bytes_billing($bill_data['bill_quota'])." (".$percent."%)
<br />Average rate " . formatRates($rate_average));
echo("Billing Period from " . $fromtext . " to " . $totext);
echo("<br />Transferred ".format_bytes_billing($total_data)." of ".format_bytes_billing($bill_data['bill_quota'])." (".$percent."%)");
echo("<br />Average rate " . formatRates($rate_average));
$background = get_percentage_colours($percent);
+2 -2
View File
@@ -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");
}
+2 -2
View File
@@ -22,12 +22,12 @@ echo("
</tr>
<tr>
<td width='300'><div align='right'>Monthly Quota</div></td>
<td colspan='3'><input name='bill_gb' size='20' value='" . $bill_data['bill_gb'] . "'></input>GB
<td colspan='3'><input name='bill_quota' size='20' value='" . $bill_data['bill_quota']/$config['billing']['base']/$config['billing']['base']/$config['billing']['base'] . "'></input>GB
</td>
</tr>
<tr>
<td width='300'><div align='right'>CDR with 95th</div></td>
<td colspan='3'><input name='bill_cdr' size='20' value='" . $bill_data['bill_cdr'] . "'></input>Kbps
<td colspan='3'><input name='bill_cdr' size='20' value='" . $bill_data['bill_cdr']/1000 . "'></input>Kbps
</td>
</tr>
<tr>
+1 -1
View File
@@ -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'];