Ver código fonte

Merge branch 'dev' into dev-vj

Vijayakrishnan 4 anos atrás
pai
commit
6bdd5517db

+ 5 - 0
app/Http/Controllers/PracticeManagementController.php

@@ -339,4 +339,9 @@ class PracticeManagementController extends Controller
         $notes = Note::orderBy('created_at', 'desc')->paginate();
         return view('app.practice-management.billing-manager', compact('notes'));
     }
+
+    public function tickets(Request $request, $proUid = null) {
+        $tickets = Ticket::orderBy('created_at', 'desc')->paginate();
+        return view('app.practice-management.tickets', compact('tickets'));
+    }
 }

+ 1 - 0
app/Http/Kernel.php

@@ -65,5 +65,6 @@ class Kernel extends HttpKernel
         'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
         'pro.auth' => \App\Http\Middleware\ProAuthenticated::class,
         'pro.auth.redirect' => \App\Http\Middleware\RedirectAuthenticatedPro::class,
+        'pro.auth.admin' => \App\Http\Middleware\EnsureAdminPro::class,
     ];
 }

+ 29 - 0
app/Http/Middleware/EnsureAdminPro.php

@@ -0,0 +1,29 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use App\Models\AppSession;
+use Closure;
+
+class EnsureAdminPro
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        $sessionKey = $request->cookie('sessionKey');
+        $appSession = AppSession::where('session_key', $sessionKey)->where('is_active', true)->first();
+        $authenticated = $sessionKey && $appSession && $appSession->pro && $appSession->pro->pro_type == 'ADMIN';
+       
+        if (!$authenticated) {
+            return redirect('/');
+        }
+
+        return $next($request);
+    }
+}

+ 1 - 1
resources/views/app/practice-management/billing-manager.blade.php

@@ -55,7 +55,7 @@
                                     <tr>
                                         <td>{{$bill->code}}</td>
                                         @if($bill->code == 'Treatment Services')
-                                            <td>{{floor($bill->number_of_units*60)}}m</td>
+                                            <td>{{ceil($bill->number_of_units*60)}}m</td>
                                         @else
                                             <td>{{$bill->number_of_units}}</td>
                                         @endif

+ 61 - 0
resources/views/app/practice-management/tickets.blade.php

@@ -0,0 +1,61 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1">
+    <div class="card">
+
+        <div class="card-header px-3 py-2 d-flex align-items-center">
+            <strong class="mr-4">
+                <i class="fas fa-user-injured"></i>
+                Tickets
+            </strong>
+            
+        </div>
+        <div class="card-body p-0">
+            <table class="table table-sm table-condensed p-0 m-0">
+                <thead class="bg-light">
+                <tr>
+                    <th>Category</th>
+                    <th>Status</th>
+                    <th>Status Memo</th>
+                    <th>Initiating Pro</th>
+                    <th>Assigned Pro</th>
+                    <th>Manager Pro</th>
+                    <th>Ordering Pro</th>
+                    <th>Has Assigned Pro Signed</th>
+                    <th>Has Initiating Pro Signed</th>
+                    <th>Has Manager Pro Signed</th>
+                    <th>Has Ordering Pro Signed</th>
+                    <th>Is Open</th>
+                    <th>Is Entry Error</th>
+                </tr>
+                </thead>
+                <tbody>
+                @foreach ($tickets as $ticket)
+                    <tr>
+                        <td><a href="/patients/view/{{$ticket->patient->uid}}/action-items-{{$ticket->category}}">{{$ticket->category}}</a></td>
+                        <td>{{$ticket->data_status}}</td>
+                        <td>{{$ticket->data_status_memo}}</td>
+                        <td>{{$ticket->initiatingPro->name_first ?? ''}} {{$ticket->initiatingPro->name_last ?? ''}}</td>
+                        <td>{{$ticket->assignedPro->name_first ?? ''}} {{$ticket->assignedPro->name_last ?? ''}}</td>
+                        <td>{{$ticket->managerPro->name_first ?? ''}} {{$ticket->managerPro->name_last ?? ''}}</td>
+                        <td>{{$ticket->orderingPro->name_first ?? ''}} {{$ticket->orderingPro->name_last ?? ''}}</td>
+                        <td>{{$ticket->has_assigned_pro_signed ?'Yes':'No'}}</td>
+                        <td>{{$ticket->has_initiating_pro_signed ?'Yes':'No'}}</td>
+                        <td>{{$ticket->has_manager_pro_signed ?'Yes':'No'}}</td>
+                        <td>{{$ticket->has_ordering_pro_signed ?'Yes':'No'}}</td>
+                        <td>{{$ticket->is_open ?'Yes':'No'}}</td>
+                        <td>{{$ticket->is_entry_error ?'Yes':'No'}}</td>
+                    </tr>
+                @endforeach
+                </tbody>
+            </table>
+            <div>
+                {{$tickets->links()}}
+            </div>
+        </div>
+    </div>
+    </div>
+
+@endsection

+ 1 - 0
resources/views/layouts/template.blade.php

@@ -110,6 +110,7 @@
                         <a class="dropdown-item" href="{{ route('practice-management.proCalendar') }}">Pro Calendar</a>
                         @if($pro && $pro->pro_type == 'ADMIN')
                             <a class="dropdown-item" href="{{ route('practice-management.billingManager') }}">Billing Manager</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.tickets') }}">Tickets</a>
                         @endif
                     </div>
                 </li>

+ 5 - 1
routes/web.php

@@ -81,7 +81,11 @@ Route::middleware('pro.auth')->group(function () {
         Route::get('my-favorites/{filter?}', 'PracticeManagementController@myFavorites')->name('myFavorites');
         Route::get('pro-availability/{proUid?}', 'PracticeManagementController@proAvailability')->name('proAvailability');
         Route::get('calendar/{proUid?}', 'PracticeManagementController@calendar')->name('proCalendar');
-        Route::get('billing-manager/{proUid?}', 'PracticeManagementController@billingManager')->name('billingManager');
+       
+        Route::middleware('pro.auth.admin')->group(function(){
+            Route::get('billing-manager/{proUid?}', 'PracticeManagementController@billingManager')->name('billingManager');
+            Route::get('tickets', 'PracticeManagementController@tickets')->name('tickets');
+        });
     });
 
     Route::name('patients.view.')->prefix('patients/view/{patient}')->group(function () {