Added Account report, renamed Product to Service List

This commit is contained in:
Deon George 2023-05-09 16:31:44 +09:00
parent f3ecc12494
commit b3539e6c7e
5 changed files with 126 additions and 10 deletions

View File

@ -6,8 +6,13 @@ use App\Http\Controllers\Controller;
class ReportController extends Controller
{
public function products()
public function accounts()
{
return view('a/product/report');
return view('account/report');
}
public function services()
{
return view('service/report');
}
}

View File

@ -0,0 +1,102 @@
@extends('adminlte::layouts.app')
@section('htmlheader_title')
Account List
@endsection
@section('page_title')
Account List
@endsection
@section('contentheader_title')
Account List
@endsection
@section('contentheader_description')
@endsection
@section('main-content')
<div class="col-md-8">
<div class="card">
<div class="card-body">
<table class="table table-sm table-striped" id="table">
<thead>
<tr>
<th>ID</th>
<th>Account</th>
<th>Active</th>
<th>Group</th>
<th class="text-right">Services</th>
<th>User</th>
</tr>
</thead>
<tbody>
@foreach (\App\Models\Account::with(['services','group','user'])->get() as $o)
<tr>
<td><a href="{{ url('u/home',[$o->user_id]) }}">{{ $o->id }}</a></td>
<td>{{ $o->name }}</td>
<td>{{ $o->active ? 'YES' : 'NO' }}</td>
<td>{{ $o->group?->name }}</td>
<td class="text-right">{{ $o->services->count() }}</td>
<td>{{ $o->user->name }}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
@endsection
@section('page-scripts')
@css(datatables,bootstrap4|fixedheader|responsive|rowgroup|select|searchpanes|searchpanes-left)
@js(datatables,bootstrap4|fixedheader|responsive|rowgroup|select|searchpanes)
<script type="text/javascript">
$(document).ready(function() {
$('#table').DataTable({
paging: true,
pageLength: 25,
lengthChange: true,
searching: true,
ordering: true,
info: true,
autoWidth: false,
fixedHeader: true,
order: [
[2,'desc'],
[1,'asc'],
],
rowGroup: {
dataSrc: [2],
},
columnDefs: [
{
targets: [2],
visible: false,
},
{
targets: [4],
searchPanes: {
show: false
}
},
],
language: {
searchPanes: {
clearMessage: 'Clear',
title: 'Filters: %d',
collapse: 'Filter',
}
},
searchPanes: {
cascadePanes: true,
viewTotal: true,
layout: 'columns-1',
dataLength: 20,
controls: false,
},
dom: '<"dtsp-verticalContainer"<"dtsp-verticalPanes"P><"dtsp-dataTable"Bfrtip>>',
});
});
</script>
@append

View File

@ -1,14 +1,14 @@
@extends('adminlte::layouts.app')
@section('htmlheader_title')
Product List
Service List
@endsection
@section('page_title')
Product List
Service List
@endsection
@section('contentheader_title')
Product List
Service List
@endsection
@section('contentheader_description')
@endsection

View File

@ -119,15 +119,23 @@
</ul>
</li>
<li class="nav-item has-treeview @if(preg_match('#^a/report/(products)#',$path))menu-open @else menu-closed @endif">
<a href="#" class="nav-link @if(preg_match('#^a/report/(products)#',$path)) active @endif">
<li class="nav-item has-treeview @if(preg_match('#^a/report/(accounts|services)#',$path))menu-open @else menu-closed @endif">
<a href="#" class="nav-link @if(preg_match('#^a/report/(accounts|services)#',$path)) active @endif">
<i class="nav-icon fas fa-list"></i> <p>REPORT<i class="fas fa-angle-left right"></i></p>
</a>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="{{ url('a/report/products') }}" class="nav-link @if(preg_match('#^a/report/products$#',$path))active @endif">
<i class="nav-icon fas fa-barcode"></i> <p>Products</p>
<a href="{{ url('a/report/accounts') }}" class="nav-link @if(preg_match('#^a/report/accounts#',$path))active @endif">
<i class="nav-icon fas fa-users"></i> <p>Accounts</p>
</a>
</li>
</ul>
<ul class="nav nav-treeview">
<li class="nav-item">
<a href="{{ url('a/report/services') }}" class="nav-link @if(preg_match('#^a/report/services#',$path))active @endif">
<i class="nav-icon fas fa-barcode"></i> <p>Services</p>
</a>
</li>
</ul>

View File

@ -102,7 +102,8 @@ Route::group(['middleware'=>['theme:adminlte-be','auth','role:wholesaler'],'pref
->whereIn('type',Supplier::offeringTypeKeys()->toArray())
->where('oo','[0-9]+');
Route::get('report/products',[ReportController::class,'products']);
Route::get('report/accounts',[ReportController::class,'accounts']);
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']);
Route::get('charge/unprocessed',[AdminController::class,'charge_unprocessed']);