Fix old products report

This commit is contained in:
Deon George 2022-08-01 21:06:57 +10:00
parent 7feec266b8
commit 360182b6bb
4 changed files with 34 additions and 36 deletions

View File

@ -47,11 +47,13 @@ final class Host extends Type implements ProductItem
public function allowance_string(): string public function allowance_string(): string
{ {
// TODO: Implement allowance_string() method. // TODO: Implement allowance_string() method.
return '';
} }
public function getCostAttribute(): float public function getCostAttribute(): float
{ {
// TODO: Implement getCostAttribute() method. // TODO: Implement getCostAttribute() method.
return 0;
} }
public function getSupplierAttribute() public function getSupplierAttribute()

View File

@ -21,9 +21,10 @@
<th>ID</th> <th>ID</th>
<th>Service</th> <th>Service</th>
<th>Product</th> <th>Product</th>
<th>Monthly</th> <th class="text-right">Monthly</th>
<th>Cost</th> <th class="text-right">Cost</th>
<th>Traffic</th> <th class="text-right">Traffic (GB)</th>
<th>Supplier</th>
</tr> </tr>
</thead> </thead>
@ -31,11 +32,12 @@
@foreach (\App\Models\Service::active()->get() as $o) @foreach (\App\Models\Service::active()->get() as $o)
<tr> <tr>
<td><a href="{{ url('u/service',[$o->id]) }}">{{ $o->id }}</a></td> <td><a href="{{ url('u/service',[$o->id]) }}">{{ $o->id }}</a></td>
<td>{{ $o->sname }}</td> <td>{{ $o->name }}</td>
<td>{{ $o->product->name }}</td> <td>{{ $o->product->name }}</td>
<td>{{ number_format($o->billing_monthly_price,2) }}</td> <td class="text-right">{{ number_format($o->billing_monthly_price,2) }}</td>
<td>{{ $o->product->type ? number_format($o->product->type->cost,2) : 'NO TYPE' }}</td> <td class="text-right">{{ number_format(\App\Models\Tax::tax_calc(($s=$o->supplied)->base_cost*\App\Models\Invoice::billing_change($s->billing_interval,1),$o->account->taxes),2) }}</td>
<td>{{ $o->product->type ? $o->product->type->allowance_string() : '-' }}</td> <td class="text-right">{{ $o->category == 'broadband' ? number_format($o->type->usage_summary(0)->sum()/1000,1) : '-' }}</td>
<td>{{ $o->product->supplier->name }}</td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>

View File

@ -1,10 +1,4 @@
<div class="card"> <div class="row">
<div class="card-header bg-gray-dark">
<h3 class="card-title">Broadband Traffic</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-3"> <div class="col-3">
<table class="table table-sm"> <table class="table table-sm">
<thead> <thead>
@ -23,11 +17,10 @@
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="col-9"> <div class="col-9">
<div id="graph"></div> <div id="graph"></div>
</div> </div>
</div>
</div>
</div> </div>
@section('page-scripts') @section('page-scripts')

View File

@ -14,7 +14,8 @@ use App\Http\Controllers\{AdminController,
SearchController, SearchController,
ServiceController, ServiceController,
SupplierController, SupplierController,
WelcomeController}; WelcomeController,
Wholesale\ReportController};
use App\Models\Supplier; use App\Models\Supplier;
/* /*
@ -94,7 +95,7 @@ Route::group(['middleware'=>['theme:adminlte-be','auth','role:wholesaler'],'pref
->whereIn('type',Supplier::offeringTypeKeys()->toArray()) ->whereIn('type',Supplier::offeringTypeKeys()->toArray())
->where('oo','[0-9]+'); ->where('oo','[0-9]+');
//Route::get('report/products','Wholesale\ReportController@products'); Route::get('report/products',[ReportController::class,'products']);
// Charges - @todo This should probably go to resellers // Charges - @todo This should probably go to resellers
Route::match(['get','post'],'charge/addedit/{o?}',[AdminController::class,'charge_addedit']); Route::match(['get','post'],'charge/addedit/{o?}',[AdminController::class,'charge_addedit']);
Route::get('charge/unprocessed',[AdminController::class,'charge_unprocessed']); Route::get('charge/unprocessed',[AdminController::class,'charge_unprocessed']);