CMXX - Update billing report
This commit is contained in:
@@ -40,8 +40,8 @@ $status = isset($_GET['status']) ? '&status='.$_GET['status'] : '';
|
||||
$search = isset($_GET['search']) ? '&search='.$_GET['search'] : '';
|
||||
|
||||
//SET DEFAULT VALUES
|
||||
$ye = (isset($_GET['year'])? $_GET['year'] : $curYear);
|
||||
$mo = (isset($_GET['month'])? $_GET['month'] : '');
|
||||
$ye = ((isset($_GET['year']) && $_GET['year'] !='' )? $_GET['year'] : $curYear);
|
||||
$mo = ((isset($_GET['month']) && $_GET['month'] !='')? $_GET['month'] : $curMonth_name);
|
||||
$qu = ((isset($_GET['month']) ? (int)ceil(date("n",strtotime($mo)) / 3): $curQuarter));
|
||||
|
||||
// Determine the URL
|
||||
@@ -157,10 +157,11 @@ $view .= '
|
||||
$view .= '
|
||||
<div class="content-block">
|
||||
<div class="table">
|
||||
'.$ye.' - '.$qu.' - '.$mo.'
|
||||
<table class="sortable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>'.$contract_id.'</th>
|
||||
<th>#</th>
|
||||
<th>'.$contract_status.'</th>
|
||||
<th>'.$contract_account.'</th>
|
||||
<th>'.$contract_type.'</th>
|
||||
@@ -168,8 +169,9 @@ $view .= '
|
||||
<th>'.$contract_start_date.'</th>
|
||||
<th>'.$contract_end_date.'</th>
|
||||
<th>'.$contract_reference.'</th>
|
||||
<th>BillingCount</th>
|
||||
<th>'.$contract_service.'</th>
|
||||
<th>'.$contract_billing_count.'</th>
|
||||
<th>'.$contract_service_2.'</th>
|
||||
<th>'.$contract_overrun.'</th>
|
||||
<th>'.$general_actions.'</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -247,6 +249,10 @@ $view .= '
|
||||
//GetPartnerDetails
|
||||
$partner_data = json_decode($response['accounthierarchy'],true);
|
||||
|
||||
//SHOW USAGE PERCENTAGE
|
||||
$usage_service_count = ($response['service_count'] != 0 || $response['service_count'] !='') ? $response['service_count']:1;
|
||||
$usage_percentage = ($billing_run != 0) ? round((($billing_run/$usage_service_count)*100),2) : 0;
|
||||
$usage_per_status = ($usage_percentage < 100) ? 'enabled' : 'disabled';
|
||||
$view .= '
|
||||
<tr>
|
||||
<td>'.$response['rowID'].'</td>
|
||||
@@ -258,7 +264,8 @@ $view .= '
|
||||
<td>'.$date.'</td>
|
||||
<td>'.$response['reference'].'</td>
|
||||
<td>'.$billing_run.'</td>
|
||||
<td>'.$response['service_count'].'</td>
|
||||
<td>'.$response['service_count'].' </td>
|
||||
<td><span class="status '.$usage_per_status .'">'.$usage_percentage.'</span></td>
|
||||
<td><a href="index.php?page=contract&rowID='.$response['rowID'].'" class="btn_link">'.$general_view .'</a></td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
Reference in New Issue
Block a user