diff --git a/app/Http/Controllers/Wholesale/ReportController.php b/app/Http/Controllers/Wholesale/ReportController.php index 5135100..20f8c50 100644 --- a/app/Http/Controllers/Wholesale/ReportController.php +++ b/app/Http/Controllers/Wholesale/ReportController.php @@ -11,6 +11,11 @@ class ReportController extends Controller return view('account/report'); } + public function products() + { + return view('product/report'); + } + public function services() { return view('service/report'); diff --git a/resources/views/theme/backend/adminlte/product/report.blade.php b/resources/views/theme/backend/adminlte/product/report.blade.php new file mode 100644 index 0000000..96367ef --- /dev/null +++ b/resources/views/theme/backend/adminlte/product/report.blade.php @@ -0,0 +1,92 @@ +@extends('adminlte::layouts.app') + +@section('htmlheader_title') + Product List +@endsection +@section('page_title') + Product List +@endsection + +@section('contentheader_title') + Product List +@endsection +@section('contentheader_description') +@endsection + +@section('main-content') +
+
+
+ + + + + + + + + + + + @foreach (\App\Models\Service::active()->with(['product.translate'])->get()->groupBy('product_id') as $s) + + + + + + + @endforeach + +
IDTypeProductServices
{{ $x->id }}{{ $x->category_name }}{{ $x->product->name }}{{ $s->count() }}
+
+
+
+@endsection + +@section('page-scripts') + @css(datatables,bootstrap4|fixedheader|responsive|rowgroup|buttons) + @js(datatables,bootstrap4|fixedheader|responsive|rowgroup|buttons) + + + + +@append \ No newline at end of file diff --git a/resources/views/theme/backend/adminlte/service/report.blade.php b/resources/views/theme/backend/adminlte/service/report.blade.php index 1dacc84..d4ebe90 100644 --- a/resources/views/theme/backend/adminlte/service/report.blade.php +++ b/resources/views/theme/backend/adminlte/service/report.blade.php @@ -15,34 +15,38 @@ @section('main-content')
- - - - - - - - - - - - +
+
+
IDServiceProductMonthlyCostTraffic (GB)Supplier
+ + + + + + + + + + + - - {{-- @todo This query is expensive still --}} - @foreach (\App\Models\Service::active()->with(['type','product.type.supplied.supplier_detail.supplier','product.translate'])->get() as $o) - - - - - - - - - - @endforeach - -
IDServiceProductMonthlyCostTraffic (GB)Supplier
{{ $o->id }}{{ $o->name }}{{ $o->product->name }}{{ number_format($o->billing_monthly_price,2) }}{{ number_format($o->product->cost_normalized(),2) }}{{ $o->category == 'broadband' ? number_format($o->type->usage_summary(0)->sum()/1000,1) : '-' }}{{ $o->product->supplier->name }}
+ + {{-- @todo This query is expensive still --}} + @foreach (\App\Models\Service::active()->with(['type','product.type.supplied.supplier_detail.supplier','product.translate'])->get() as $o) + + {{ $o->id }} + {{ $o->name }} + {{ $o->product->name }} + {{ number_format($o->billing_monthly_price,2) }} + {{ number_format($o->product->cost_normalized(),2) }} + {{ $o->category == 'broadband' ? number_format($o->type->usage_summary(0)->sum()/1000,1) : '-' }} + {{ $o->product->supplier->name }} + + @endforeach + + +
+ @endsection diff --git a/resources/views/vendor/adminlte/layouts/partials/sidebarmenu.blade.php b/resources/views/vendor/adminlte/layouts/partials/sidebarmenu.blade.php index e4df00b..3d6750e 100644 --- a/resources/views/vendor/adminlte/layouts/partials/sidebarmenu.blade.php +++ b/resources/views/vendor/adminlte/layouts/partials/sidebarmenu.blade.php @@ -119,8 +119,8 @@ - + + diff --git a/routes/web.php b/routes/web.php index 92e18af..ad999fa 100644 --- a/routes/web.php +++ b/routes/web.php @@ -103,6 +103,7 @@ Route::group(['middleware'=>['theme:adminlte-be','auth','role:wholesaler'],'pref ->where('oo','[0-9]+'); Route::get('report/accounts',[ReportController::class,'accounts']); + Route::get('report/products',[ReportController::class,'products']); Route::get('report/services',[ReportController::class,'services']); // Charges - @todo This should probably go to resellers Route::match(['get','post'],'charge/addedit/{o?}',[AdminController::class,'charge_addedit']);