Parcourir la source

Gneric bills admin view (wip)

Vijayakrishnan il y a 4 ans
Parent
commit
b6a7be8c20

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

@@ -1357,4 +1357,9 @@ ORDER BY claim.created_at ASC
         return $response;
     }
 
+    public function genericBills(Request $request)
+    {
+        return view('app.practice-management.generic-bills');
+    }
+
 }

+ 32 - 22
resources/views/app/generic-bills/inline.blade.php

@@ -23,15 +23,20 @@ $genericBills = genericBills($pro, @$patient, @$entityType, @$entityUid);
     <div class="{{@$class ? $class : ''}}">
         <div class="d-flex align-items-center mb-2">
             <p class="font-weight-bold text-secondary font-size-13 m-0">{{@$label ? $label : 'Generic'}} Bills</p>
-            @include('app.generic-bills.create_generic-bill')
+            @if(!@$noCreate)
+                @include('app.generic-bills.create_generic-bill')
+            @endif
         </div>
             <table class="table table-sm tabe-striped mb-0 table-bordered">
                 <thead class="bg-light">
                 <tr class="text-secondary">
                     <th class="border-bottom-0">Date</th>
+                    <th class="border-bottom-0">Pro</th>
+                    @if(@$adminView)
+                        <th class="border-bottom-0">Context</th>
+                    @endif
                     <th class="border-bottom-0">Service</th>
                     <th class="border-bottom-0">Billable</th>
-                    <th class="border-bottom-0">Pro</th>
                     <th class="border-bottom-0 screen-only">Total</th>
                     <th class="border-bottom-0">Sign</th>
                     <th class="border-bottom-0">Cancellation</th>
@@ -45,22 +50,6 @@ $genericBills = genericBills($pro, @$patient, @$entityType, @$entityUid);
                 @foreach ($genericBills as $bill)
                     <tr class="{{$bill->is_cancelled ? 'bg-light text-secondary' : ''}}">
                         <td class="text-nowrap">{{friendlier_date_time($bill->effective_date, false)}}</td>
-                        <td>{{$bill->code}}</td>
-                        <td class="">
-                            <?php
-                            $totalSeconds = $bill->number_of_units * 3600;
-                            $remainder = $totalSeconds % 60;
-                            if ($remainder !== 0) {
-                                if ($remainder < 30) {
-                                    $totalSeconds = $totalSeconds - $remainder;
-                                }
-                                else {
-                                    $totalSeconds = $totalSeconds + (60 - $remainder);
-                                }
-                            }
-                            ?>
-                            {{ time_in_hrminsec($totalSeconds) }}
-                        </td>
                         <td class="">
                             <div class="text-nowrap font-weight-bold text-secondary">{{ $bill->genericPro->displayName() }}</div>
                             <div class="text-nowrap mt-1 screen-only">
@@ -70,22 +59,43 @@ $genericBills = genericBills($pro, @$patient, @$entityType, @$entityUid);
                             @if(!$bill->has_generic_pro_been_paid)
                                 <div class="text-nowrap mt-1 screen-only">
                                     <span class="text-secondary">Expected: </span>
-                                    <span class="font-weight-bold">${{ $bill->total_expected }}</span>
+                                    <span class="font-weight-bold">${{ round($bill->total_expected, 2) }}</span>
                                 </div>
                             @else
                                 <div class="text-nowrap mt-1 screen-only">
                                     <span class="text-secondary">Amount: </span>
-                                    <span class="font-weight-bold">${{ $bill->total_paid }}</span>
+                                    <span class="font-weight-bold">${{ round($bill->total_paid, 2) }}</span>
                                 </div>
                             @endif
                         </td>
+                        @if(@$adminView)
+                            <td>
+                                {{$bill->generic_target_entity_type ? $bill->generic_target_entity_type : '-'}}
+                            </td>
+                        @endif
+                        <td>{{$bill->code}}</td>
+                        <td class="">
+                            <?php
+                            $totalSeconds = $bill->number_of_units * 3600;
+                            $remainder = $totalSeconds % 60;
+                            if ($remainder !== 0) {
+                                if ($remainder < 30) {
+                                    $totalSeconds = $totalSeconds - $remainder;
+                                }
+                                else {
+                                    $totalSeconds = $totalSeconds + (60 - $remainder);
+                                }
+                            }
+                            ?>
+                            {{ time_in_hrminsec($totalSeconds) }}
+                        </td>
                         <td class="pr-3 screen-only">
                             @if($bill->has_generic_pro_been_paid)
                                 <span class="text-secondary">Paid. </span>
-                                <span class="font-weight-bold">${{ friendly_money($bill->total_paid) }}</span>
+                                <span class="font-weight-bold">${{ round($bill->total_paid, 2) }}</span>
                             @else
                                 <span class="text-secondary">Exp. </span>
-                                <span class="font-weight-bold">{{ $bill->total_expected ? '$' . friendly_money($bill->total_expected) : '-' }}</span>
+                                <span class="font-weight-bold">{{ $bill->total_expected ? '$' . round($bill->total_expected, 2) : '-' }}</span>
                             @endif
                         </td>
                         <td>

+ 11 - 0
resources/views/app/practice-management/generic-bills.blade.php

@@ -0,0 +1,11 @@
+@extends ('layouts/template')
+
+@section('content')
+
+    <div class="p-3 mcp-theme-1">
+
+    @include('app.generic-bills.inline', ['adminView' => true, 'noCreate' => true])
+
+    </div>
+
+@endsection

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

@@ -139,6 +139,7 @@
                             <a class="dropdown-item" href="{{ route('practice-management.shipments') }}">Shipments</a>
                             <a class="dropdown-item" href="{{ route('practice-management.packs-multi-print') }}">Print Pack Labels</a>
                             <a class="dropdown-item" href="{{ route('practice-management.handouts') }}">Handouts</a>
+                            <a class="dropdown-item" href="{{ route('practice-management.generic-bills') }}">Generic Bills</a>
                         @endif
                     </div>
                 </li>

+ 1 - 0
routes/web.php

@@ -142,6 +142,7 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('packs-multi-print', 'PracticeManagementController@packsMultiPrint')->name('packs-multi-print');
             Route::get('packs-multi-pdf/{ids?}', 'PracticeManagementController@packsMultiPDF')->name('packs-multi-pdf');
             Route::get('handouts', 'PracticeManagementController@handouts')->name('handouts');
+            Route::get('generic-bills', 'PracticeManagementController@genericBills')->name('generic-bills');
         });
 
         Route::get('supply-orders/cancelled-but-unacknowledged', 'PracticeManagementController@supplyOrdersCancelledButUnacknowledged')->name('supply-orders-cancelled-but-unacknowledged');