浏览代码

Coverage self cover

Samson Mutunga 1 年之前
父节点
当前提交
61e66d38e5

+ 5 - 1
app/Http/Middleware/EnsureCompanyClient.php

@@ -13,7 +13,11 @@ class EnsureCompanyClient
         if(!$patient) abort(403);
 
         if(!count($patient->companyClients)){
-            return redirect()->to(route('patients.view.show-set-company-client', $patient));
+            $params = [
+                'patient' => $patient,
+                'popupmode' => request()->input('popupmode')
+            ];
+            return redirect()->to(route('patients.view.show-set-company-client', $params));
         }
 
         return $next($request);

+ 2 - 2
resources/views/app/patient/company-client/customer.blade.php

@@ -20,10 +20,10 @@
 </div>
 
 <div class="row">
-    <div class="col-md-6">
+    <div class="col-md-8">
         @include('app.patient.company-client.partials.customer-invoices')
     </div>
-    <div class="col-md-6">
+    <div class="col-md-4">
         @include('app.patient.company-client.partials.customer-payment-methods')
     </div>
 </div>

+ 7 - 0
resources/views/app/patient/company-client/customers.blade.php

@@ -51,6 +51,13 @@
                         </td>
                     </tr>
                 @endforeach
+                @if(!count($customers))
+                    <tr>
+                        <td colspan="6">
+                            @include('app.patient.company-client.partials.create-company-client-customer-form')
+                        </td>
+                    </tr>
+                @endif
             </tbody>
         </table>
     </div>

+ 25 - 21
resources/views/app/patient/company-client/partials/create-company-client-form.blade.php

@@ -7,17 +7,7 @@
         <div class="mb-2">
             <label class="text-sm text-secondary mb-1">Company</label>
             <input type="hidden" name="companyUid" value="">
-            <input type="text"
-                    name="companyName"
-                    target-key="uid"
-                    target-field="companyUid"
-                    autocomplete="off"
-                    class="form-control form-control-sm"
-                    stag-suggest
-                    stag-suggest-ep="/company-suggest"
-                    value="{{@$company ? @$company->name : ''}}"
-                    {{@$company ? 'disabled readonly' : ''}}
-                    required>
+            <input type="text" name="companyName" target-key="uid" target-field="companyUid" autocomplete="off" class="form-control form-control-sm" stag-suggest stag-suggest-ep="/company-suggest" value="{{@$company ? @$company->name : ''}}" {{@$company ? 'disabled readonly' : ''}} required>
         </div>
         <div class="mb-2">
             <label for="" class="control-label">Date Referred (Optional)</label>
@@ -31,17 +21,31 @@
 </div>
 
 <script>
-    (function () {
+    function initCreateCompanyClient() {
+        initStagSuggest();
+        let parentSegment = $('body');
+        parentSegment.find('input[stag-suggest][target-key][target-field]')
+            .off('stag-suggest-selected')
+            .on('stag-suggest-selected', (_e, _input, _data) => {
+                _input = $(_input);
+                _input.closest('form').find('input[name="' + _input.attr('target-field') + '"]').val(_data[_input.attr('target-key')]);
+            });
+    }
+</script>
+
+@if(request()->input('popupmode'))
+<script>
+    (function() {
+        initCreateCompanyClient();
+    })();
+</script>
+@else
+<script>
+    (function() {
         function init() {
-            initStagSuggest();
-            let parentSegment = $('body');
-            parentSegment.find('input[stag-suggest][target-key][target-field]')
-                .off('stag-suggest-selected')
-                .on('stag-suggest-selected', (_e, _input, _data) => {
-                    _input = $(_input);
-                    _input.closest('form').find('input[name="' + _input.attr('target-field') + '"]').val(_data[_input.attr('target-key')]);
-                });
+            initCreateCompanyClient();
         }
         addMCInitializer('create-company-client', init)
     }).call(window);
-</script>
+</script>
+@endif

+ 1 - 1
resources/views/app/patient/primary-coverage-form.blade.php

@@ -27,7 +27,7 @@ $cpc = $patient->getPrimaryCoverage();
 			<div v-if="insuranceCardType === 'selfPay'">
 				<div class="alert alert-warning p-1 rounded-0">
 					Please create patient payment profile by clicking here: 
-					<a href="{{ route('patients.view.customers', $patient) }}">Create/Manage customer payment methods</a>
+					<a href="{{ route('patients.view.customers', ['patient' => $patient, 'popupmode' => 1]) }}">Create/Manage customer payment methods</a>
 				</div>
 			</div>
 

+ 0 - 1
resources/views/layouts/company-client-layout.blade.php

@@ -1,6 +1,5 @@
 @extends ('layouts.patient')
 @section('inner-content')
-
 <div id="company-client-{{ $patient->uid }}">
     @yield('company-client-content')
 </div>

+ 3 - 1
resources/views/layouts/patient.blade.php

@@ -240,7 +240,9 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 		</nav>
 		@endif
 		<main role="main" class="w-100 {{$trimLayout || $leanLeftNav ? 'p-0' : ''}}">
-			@include('app.patient.partials.cpt-alert')
+			@if(!request()->input('popupmode'))
+				@include('app.patient.partials.cpt-alert')
+			@endif
 			@if($pro->is_enrolled_as_mcp && !$patient->mcp)
 			<div class="d-flex align-items-center alert alert-info bg-white mcp-theme-1 p-3 hide-inside-ticket-popup m-1">
 				<div class="font-size-16 mr-3">