Jelajahi Sumber

Merge branch 'cleanup' of https://rav.triplestart.com/tigerphp/stagfe2 into cleanup

Peter Muturi 1 tahun lalu
induk
melakukan
4d7feeeed7

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

@@ -59,6 +59,11 @@ class PatientController extends Controller
         return view('app.patient.invoicing.invoice-transactions', compact('patient', 'invoice', 'customer'));
     }
 
+    public function invoicingInvoiceTransactionsInPopup(Request $request, Client $patient, Invoice $invoice) {
+        $customer = $invoice->customer;
+        return view('app.patient.invoicing.invoice-transactions-in-popup', compact('patient', 'invoice', 'customer'));
+    }
+
     public function claimsResolver(Request $request, Client $patient)
     {
         $notes = $patient->notesAscending;

+ 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>

+ 12 - 5
resources/views/app/patient/company-client/customers.blade.php

@@ -24,11 +24,11 @@
         <table class="table table-striped table-sm table-bordered mb-0">
             <thead class="bg-light">
                 <tr>
-                    <th class="border-0 text-secondary w-50">Company</th>
-                    <th class="border-0 text-secondary">Customer Balance</th>
-                    <th class="border-0 text-secondary">Pending Invoices Balance</th>
-                    <th class="border-0 text-secondary w-25">Created At</th>
-                    <th class="border-0 text-secondary w-25">Portal</th>
+                    <th class="border-0 text-secondary">Company</th>
+                    <th class="border-0 text-secondary text-nowrap">Customer Balance</th>
+                    <th class="border-0 text-secondary text-nowrap">Pending Invoices Balance</th>
+                    <th class="border-0 text-secondary">Created At</th>
+                    <th class="border-0 text-secondary">Portal</th>
                     <th class="border-0 text-secondary delete-column">&nbsp;</th>
                 </tr>
             </thead>
@@ -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', ['button' => 'btn btn-primary text-white'])
+                        </td>
+                    </tr>
+                @endif
             </tbody>
         </table>
     </div>

+ 1 - 1
resources/views/app/patient/company-client/partials/create-company-client-customer-form.blade.php

@@ -1,5 +1,5 @@
 <div moe relative class="">
-    <a href="#" start show class="col-2-button">
+    <a href="#" start show class="{{ @$button }}">
     + Add Patient as Customer
     </a>
     <form url="/api/customer/create" class="mcp-theme-1">

+ 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

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

@@ -119,8 +119,13 @@ $invoices = $customer->invoices;
                                         </form>
                                     </div>
                                 @endif
-                                <a href="{{ route('patients.view.invoicing-invoice-transactions', ['patient' => $patient, 'invoice' => $record]) }}"
-                                    class="mr-2">Transactions</a>
+                                
+                                <a native target="_blank"
+                                    open-in-stag-popup
+                                    mc-initer="customer-invoice-transactions-{{$patient->uid}}"
+                                    href="{{ route('patients.view.invoicing-invoice-transactions-in-popup', ['patient' => $patient, 'invoice' => $record]) }}">
+                                        Transactions
+                                </a>
                             </div>
                         </td>
                     </tr>

+ 184 - 0
resources/views/app/patient/invoicing/invoice-transactions-in-popup.blade.php

@@ -0,0 +1,184 @@
+<div id="single-invoice-transactions-{{ $invoice->uid }}" class="row">
+    <div class="col-12">
+        <div class="p-3">
+            <div class="d-flex align-items-baseline pb-3">
+                <h4 class="font-weight-bold m-0 font-size-16">{{ $customer->company->name }} <i
+                        class="fa fa-chevron-right text-sm text-secondary mx-1"></i> Invoice Transactions</h4>
+                <span class="text-secondary mx-2">|</span>
+                <div moe class="">
+                    <a href="" start show class="font-weight-bold">
+                        + Add Manual Plus
+                    </a>
+                    <form url="/api/invoiceTransaction/createManualPlus" class="mcp-theme-1">
+                        <p class="mb-2 text-secondary font-weight-bold text-nowrap">Add Manual Plus</p>
+                        <input type="hidden" name="invoiceUid" value="{{ $invoice->uid }}">
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Amount</label>
+                            <input type="text" name="amount" autocomplete="off" class="form-control form-control-sm"
+                                required>
+                        </div>
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Memo</label>
+                            <textarea rows="2" name="customMemo" autocomplete="off" class="form-control form-control-sm"></textarea>
+                        </div>
+                        <div>
+                            <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
+                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                        </div>
+                    </form>
+                </div>
+                <span class="text-secondary mx-2">|</span>
+                <div moe class="">
+                    <a href="" start show class="font-weight-bold">
+                        + Add Manual Minus
+                    </a>
+                    <form url="/api/invoiceTransaction/createManualMinus" class="mcp-theme-1">
+                        <p class="mb-2 text-secondary font-weight-bold text-nowrap">Add Manual Minus</p>
+                        <input type="hidden" name="invoiceUid" value="{{ $invoice->uid }}">
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Amount</label>
+                            <input type="text" name="amount" autocomplete="off" class="form-control form-control-sm"
+                                required>
+                        </div>
+                        <div class="mb-2">
+                            <label class="text-sm text-secondary mb-1">Memo</label>
+                            <textarea rows="2" name="customMemo" autocomplete="off" class="form-control form-control-sm"></textarea>
+                        </div>
+                        <div>
+                            <button submit class="btn btn-sm btn-primary mr-2">Submit</button>
+                            <button cancel class="btn btn-sm btn-default border">Cancel</button>
+                        </div>
+                    </form>
+                </div>
+            </div>
+            @if (!count($invoice->invoiceTransactions))
+                <div class="border p-2 mb-3 font-weight-bold">This invoice does not have any transactions yet.</div>
+            @else
+                <table class="table table-sm table-bordered table-striped mb-3">
+                    <thead>
+                        <tr>
+                            <th class="border-bottom-0">Created</th>
+                            <th class="border-bottom-0">Plus / Minus</th>
+                            <th class="border-bottom-0">Amount</th>
+                            <th class="border-bottom-0">Memo</th>
+                            <th class="border-bottom-0">Starting<br>Balance</th>
+                            <th class="border-bottom-0">Resulting<br>Balance</th>
+                            <th class="border-bottom-0 w-50"></th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        @foreach ($invoice->invoiceTransactions as $record)
+                            <tr>
+                                <td>{{ friendly_date_time_with_seconds($record->created_at) }}</td>
+                                <td>{{ sanitize_state_name($record->plus_or_minus) }}</td>
+                                <td>${{ is_null($record->amount) ? 0 : $record->amount }}</td>
+                                <td>{{ $record->custom_memo ?: '' }}</td>
+                                <td>${{ is_null($record->starting_balance) ? 0 : $record->starting_balance }}</td>
+                                <td>${{ is_null($record->resulting_balance) ? 0 : $record->resulting_balance }}</td>
+                                <td></td>
+                            </tr>
+                        @endforeach
+                    </tbody>
+                </table>
+            @endif
+            <div class="mb-2 border p-2 bg-aliceblue">
+                <div class="d-flex align-items-baseline">
+                    <div class="mb-2 text-secondary font-weight-bold">Invoice Details</div>
+                    <!--<span class="mx-2 text-secondary">|</span>
+            <a href="#" data-invoice-uid="{{ $invoice->uid }}" data-uid="{{ $invoice->customer->uid }}" class="generate-and-visit-ic-pay" native target="_blank">Visit Pay Link</a>-->
+                    <span class="mx-2 text-secondary">|</span>
+                    <a href="#" data-invoice-uid="{{ $invoice->uid }}" data-uid="{{ $invoice->customer->uid }}"
+                        class="generate-and-copy-ic-pay-url" native target="_blank">Copy Pay Link</a>
+                </div>
+                <table class="table table-sm table-bordered bg-white mb-0">
+                    <thead>
+                        <tr>
+                            <th class="border-bottom-0 text-secondary bg-light">Date</th>
+                            <th class="border-bottom-0 text-secondary bg-light">Company</th>
+                            <th class="border-bottom-0 text-secondary bg-light">Particulars</th>
+                            <th class="border-bottom-0 text-secondary bg-light">Total</th>
+                            <th class="border-bottom-0 text-secondary bg-light">Paid</th>
+                            <th class="border-bottom-0 text-secondary bg-light">Due</th>
+                            <th class="border-bottom-0 text-secondary bg-light w-50"></th>
+                        </tr>
+                    </thead>
+                    <tbody class="font-weight-normal">
+                        <tr>
+                            <td>{{ friendly_date($invoice->created_at) }}</td>
+                            <td>{{ $customer->company->name }}</td>
+                            <td>{{ $invoice->description }}</td>
+                            <td class="font-weight-bold text-dark">
+                                ${{ !is_null($invoice->amount) ? $invoice->amount : 0 }}
+                            </td>
+                            <td class="font-weight-bold text-success">
+                                ${{ !is_null($invoice->paid) ? $invoice->paid : 0 }}</td>
+                            <td class="font-weight-bold text-warning-dark">
+                                ${{ !is_null($invoice->balance) ? $invoice->balance : 0 }}</td>
+                            <td></td>
+                        </tr>
+                        <tr>
+                            <td class="p-2 text-right" colspan="7">
+                                <div class="d-flex justify-content-start align-items-baseline mb-1">
+                                    <span class="text-secondary">Total Amount: </span>
+                                    <span
+                                        class="width-50px text-left text-secondary font-weight-bold pl-2">${{ !is_null($invoice->amount) ? $invoice->amount : 0 }}</span>
+                                </div>
+                                <div class="d-flex justify-content-start align-items-baseline mb-1">
+                                    <span class="text-secondary">Total Paid: </span>
+                                    <span
+                                        class="width-50px text-left text-secondary font-weight-bold pl-2">${{ !is_null($invoice->paid) ? $invoice->paid : 0 }}</span>
+                                </div>
+                                <div class="d-flex justify-content-start align-items-baseline">
+                                    <span class="font-weight-bold text-secondary">Total Due: </span>
+                                    <span
+                                        class="width-50px text-left font-weight-bold pl-2 font-size-14">${{ !is_null($invoice->balance) ? $invoice->balance : 0 }}</span>
+                                </div>
+                                @if ($invoice->balance <= 0)
+                                    <div class="text-left font-weight-bold mt-1">
+                                        <i class="fa fa-check text-success"></i>
+                                        <span class="text-success">PAID</span>
+                                    </div>
+                                @endif
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+        </div>
+    </div>
+</div>
+
+
+
+<script>
+    (function($) {
+        var invoiceTransactionsComponent = {
+            init: function() {
+                let parentSegment = $('body');
+                parentSegment.find('.copy-target')
+                    .off('click.copy-target')
+                    .on('click.copy-target', function() {
+                        copyTextToClipboard($(this).attr('data-target'));
+                        return false;
+                    });
+
+                parentSegment.find('.generate-and-copy-ic-pay-url')
+                    .off('click.generate-and-copy-ic-pay-url')
+                    .on('click.generate-and-copy-ic-pay-url', function() {
+                        $.post('/api/session/proLogInAsCustomer', {
+                            customerUid: $(this).attr('data-uid')
+                        }, _data => {
+                            if (!hasResponseError(_data)) {
+                                copyTextToClipboard('{{ config('app.url') }}/ic/pay/' + $(this)
+                                    .attr(
+                                        'data-invoice-uid') + '/' + _data.data);
+                                return false;
+                            }
+                        });
+                        return false;
+                    });
+            }
+        };
+        invoiceTransactionsComponent.init();
+    })(jQuery);
+</script>

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

@@ -1,26 +1,37 @@
 <?php
-	$medicaidStates = Config::get('constants.medicaid_states');
-	$cpc = $patient->getPrimaryCoverage();
+$medicaidStates = Config::get('constants.medicaid_states');
+$cpc = $patient->getPrimaryCoverage();
 ?>
-	<div id="new-coverage-form-{{$patient->uid}}">
-		<div class="p-3">
-			<form :url="url" class="mcp-theme-1" @submit.prevent="submitForm" autocomplete="off">
-				<input type="hidden" name="clientUid" value="{{$patient->uid}}" class="form-control input-sm" />
-				<div class="row">
-					<div class="form-group col-md-12">
-						<p class="mb-1 font-weight-bold">Type of insurance card:</p>
-						<div class="form-check form-check-inline">
-							<label class="form-check-label"><input class="form-check-input" type="radio" v-model="insuranceCardType" @change="updateUrl" name="insuranceCardType" value="medicare">Medicare Part B (Primary)</label>
-						</div>
-						<div class="form-check form-check-inline">
-							<label class="form-check-label"><input class="form-check-input" type="radio" v-model="insuranceCardType" @change="updateUrl" name="insuranceCardType" value="medicaid">Medicaid (Primary)</label>
-						</div>
-						<div class="form-check form-check-inline">
-							<label class="form-check-label"><input class="form-check-input" type="radio" v-model="insuranceCardType" @change="updateUrl" name="insuranceCardType" value="commercial">Commercial / Third Party (Primary)</label>
-						</div>
-					</div>
+<div id="new-coverage-form-{{ $patient->uid }}">
+	<div class="p-3">
+		<form :url="url" class="mcp-theme-1" @submit.prevent="submitForm" autocomplete="off">
+			<input type="hidden" name="clientUid" value="{{ $patient->uid }}" class="form-control input-sm" />
+			<div class="row">
+				<div class="form-group col-md-12">
+					<p class="mb-1 font-weight-bold">Type of insurance card:</p>
+					<div class="form-check form-check-inline">
+						<label class="form-check-label"><input class="form-check-input" type="radio" v-model="insuranceCardType" @change="updateUrl" name="insuranceCardType" value="medicare">Medicare Part B (Primary)</label>
+					</div>
+					<div class="form-check form-check-inline">
+						<label class="form-check-label"><input class="form-check-input" type="radio" v-model="insuranceCardType" @change="updateUrl" name="insuranceCardType" value="medicaid">Medicaid (Primary)</label>
+					</div>
+					<div class="form-check form-check-inline">
+						<label class="form-check-label"><input class="form-check-input" type="radio" v-model="insuranceCardType" @change="updateUrl" name="insuranceCardType" value="commercial">Commercial / Third Party (Primary)</label>
+					</div>
+					{{-- <div class="form-check form-check-inline">
+						<label class="form-check-label"><input class="form-check-input" type="radio" v-model="insuranceCardType" @change="updateUrl" name="insuranceCardType" value="selfPay">Self Pay</label>
+					</div> --}}
 				</div>
+			</div>
 
+			<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' => $patient, 'popupmode' => 1]) }}">Create/Manage customer payment methods</a>
+				</div>
+			</div>
+
+			<div v-if="insuranceCardType !== 'selfPay'">
 				<div class="row" v-show="insuranceCardType == 'commercial'">
 					<div class="form-group col-md-12">
 						<label for="" class="control-label">Commercial Payer</label>
@@ -28,7 +39,8 @@
 						<input type="hidden" name="commercialPayerUid" />
 					</div>
 					<div class="col-md-12">
-						<p class="mb-2 font-weight-bold">If payer not found above, please key in carrier name (and memo if any):</p>
+						<p class="mb-2 font-weight-bold">If payer not found above, please key in carrier name (and memo
+							if any):</p>
 					</div>
 					<div class="form-group col-md-6">
 						<label class="control-label">Carrier Name</label>
@@ -92,36 +104,36 @@
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Patient First Name</label>
-						<input type="text" name="patientNameFirst" value="{{$patient->name_first}}" class="form-control input-sm">
+						<input type="text" name="patientNameFirst" value="{{ $patient->name_first }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Patient Middle Name / MI</label>
-						<input type="text" name="patientNameMiddle" value="{{$patient->name_middle}}" class="form-control input-sm">
+						<input type="text" name="patientNameMiddle" value="{{ $patient->name_middle }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Patient Last Name</label>
-						<input type="text" name="patientNameLast" value="{{$patient->name_last}}" class="form-control input-sm">
+						<input type="text" name="patientNameLast" value="{{ $patient->name_last }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Patient Suffix</label>
-						<input type="text" name="patientNameSuffix" value="{{$patient->name_suffix}}" class="form-control input-sm">
+						<input type="text" name="patientNameSuffix" value="{{ $patient->name_suffix }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Patient Sex</label>
 						<select class="form-control input-sm" name="sex" select2>
 							<option value="">--</option>
-							<option value="M" @if($patient->sex === 'M') selected @endif>Male</option>
-							<option value="F"  @if($patient->sex === 'F') selected @endif>Female</option>
-							<option value="UNKNOWN"  @if($patient->sex === 'UNKNOWN') selected @endif>Unknown</option>
+							<option value="M" @if ($patient->sex === 'M') selected @endif>Male</option>
+							<option value="F" @if ($patient->sex === 'F') selected @endif>Female</option>
+							<option value="UNKNOWN" @if ($patient->sex === 'UNKNOWN') selected @endif>Unknown</option>
 						</select>
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Patient Dob</label>
-						<input type="date" name="patientDob" value="{{$patient->dob}}" class="form-control input-sm">
+						<input type="date" name="patientDob" value="{{ $patient->dob }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-6">
 						<label class="control-label">Date Of Service</label>
-						<input type="date" name="dateOfService" value="{{date('Y-m-d')}}" class="form-control input-sm">
+						<input type="date" name="dateOfService" value="{{ date('Y-m-d') }}" class="form-control input-sm">
 					</div>
 				</div>
 				<div class="row">
@@ -142,19 +154,19 @@
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Subscriber First Name</label>
-						<input type="text" name="subscriberNameFirst" value="{{$patient->name_first}}" class="form-control input-sm">
+						<input type="text" name="subscriberNameFirst" value="{{ $patient->name_first }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Subscriber Middle Name / MI</label>
-						<input type="text" name="subscriberNameMiddle" value="{{$patient->name_middle}}" class="form-control input-sm">
+						<input type="text" name="subscriberNameMiddle" value="{{ $patient->name_middle }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Subscriber Last Name</label>
-						<input type="text" name="subscriberNameLast" value="{{$patient->name_last}}" class="form-control input-sm">
+						<input type="text" name="subscriberNameLast" value="{{ $patient->name_last }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Subscriber Suffix</label>
-						<input type="text" name="subscriberNameSuffix" value="{{$patient->name_suffix}}" class="form-control input-sm">
+						<input type="text" name="subscriberNameSuffix" value="{{ $patient->name_suffix }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Subscriber Sex</label>
@@ -167,7 +179,7 @@
 					</div>
 					<div class="form-group col-md-4">
 						<label class="control-label">Subscriber Dob</label>
-						<input type="date" name="subscriberDob" value="{{$patient->dob}}" class="form-control input-sm">
+						<input type="date" name="subscriberDob" value="{{ $patient->dob }}" class="form-control input-sm">
 					</div>
 					<div class="form-group col-md-6">
 						<label class="control-label">What is the patient's relationship to the subscriber?</label>
@@ -196,9 +208,9 @@
 						<input class="form-control input-sm" list="mcdPayerOptions" name="mcdPayerName" id="mcdPayerName">
 						<datalist id="mcdPayerOptions">
 							<option value="">--</option>
-							@foreach($medicaidStates as $state)
-              <option>{{$state}}</option>
-              @endforeach
+							@foreach ($medicaidStates as $state)
+							<option>{{ $state }}</option>
+							@endforeach
 						</datalist>
 					</div>
 
@@ -226,167 +238,175 @@
 						</div>
 					</div>
 					<div class="col-md-12">
-					<div class="row">
-						<div class="col-md-12">
-							<div class="form-group">
-								<label>Plan Effective Date</label>
-								<input type="date" name="planEffectiveDate" class="form-control" value="{{$cpc->plan_effective_date ?? ''}}" />
+						<div class="row">
+							<div class="col-md-12">
+								<div class="form-group">
+									<label>Plan Effective Date</label>
+									<input type="date" name="planEffectiveDate" class="form-control" value="{{ $cpc->plan_effective_date ?? '' }}" />
+								</div>
 							</div>
-						</div>
-						<div class="col-md-12">
-							<div class="form-group">
-								<label>Plan Description</label>
-								<textarea name="planDescription" class="form-control" value="{{$cpc->plan_description ?? ''}}"></textarea>
+							<div class="col-md-12">
+								<div class="form-group">
+									<label>Plan Description</label>
+									<textarea name="planDescription" class="form-control" value="{{ $cpc->plan_description ?? '' }}"></textarea>
+								</div>
 							</div>
-						</div>
-						<div class="col-md-6">
-							<div class="form-group">
-								<label>Provider Status</label>
-								<select name="providerStatus" class="form-control" value="{{$cpc->provider_status ?? ''}}">
-									<option value=""></option>
-									<option value="IN_NETWORK" @if($cpc && $cpc->provider_status && $cpc->provider_status === 'IN_NETWORK') selected @endif>IN NETWORK</option>
-									<option value="OUT_OF_NETWORK" @if($cpc && $cpc->provider_status && $cpc->provider_status === 'OUT_OF_NETWORK') selected @endif>OUT_OF_NETWORK</option>
-								</select>
+							<div class="col-md-6">
+								<div class="form-group">
+									<label>Provider Status</label>
+									<select name="providerStatus" class="form-control" value="{{ $cpc->provider_status ?? '' }}">
+										<option value=""></option>
+										<option value="IN_NETWORK" @if ($cpc && $cpc->provider_status && $cpc->provider_status === 'IN_NETWORK') selected @endif>IN
+											NETWORK</option>
+										<option value="OUT_OF_NETWORK" @if ($cpc && $cpc->provider_status && $cpc->provider_status === 'OUT_OF_NETWORK') selected @endif>OUT_OF_NETWORK</option>
+									</select>
+								</div>
 							</div>
-						</div>
-						<div class="col-md-6">
-							<div class="form-group">
-								<label>Mental Health Coverage</label>
-								<select name="mentalHealthCoverage" class="form-control" value="{{$cpc->mental_health_coverage ?? ''}}">
-									<option value=""></option>
-									<option value="YES" @if($cpc && $cpc->mental_health_coverage && $cpc->mental_health_coverage === 'YES') selected @endif>YES</option>
-									<option value="NO" @if($cpc && $cpc->mental_health_coverage && $cpc->mental_health_coverage === 'YES') selected @endif>NO</option>
-									<option value="UNKNOWN" @if($cpc && $cpc->mental_health_coverage && $cpc->mental_health_coverage === 'YES') selected @endif>UNKNOWN</option>
-								</select>
+							<div class="col-md-6">
+								<div class="form-group">
+									<label>Mental Health Coverage</label>
+									<select name="mentalHealthCoverage" class="form-control" value="{{ $cpc->mental_health_coverage ?? '' }}">
+										<option value=""></option>
+										<option value="YES" @if ($cpc && $cpc->mental_health_coverage && $cpc->mental_health_coverage === 'YES') selected @endif>YES
+										</option>
+										<option value="NO" @if ($cpc && $cpc->mental_health_coverage && $cpc->mental_health_coverage === 'YES') selected @endif>NO
+										</option>
+										<option value="UNKNOWN" @if ($cpc && $cpc->mental_health_coverage && $cpc->mental_health_coverage === 'YES') selected @endif>
+											UNKNOWN</option>
+									</select>
+								</div>
 							</div>
-						</div>
-						<div class="col-md-6">
-							<div class="form-group">
-								<label>Telehealth Coverage</label>
-								<select name="telehealthCoverage" class="form-control">
-									<option value=""></option>
-									<option value="YES" @if($cpc && $cpc->telehealth_coverage && $cpc->telehealth_coverage === 'YES') selected @endif>YES</option>
-									<option value="NO" @if($cpc && $cpc->telehealth_coverage && $cpc->telehealth_coverage === 'NO') selected @endif>NO</option>
-									<option value="UNKNOWN" @if($cpc && $cpc->telehealth_coverage && $cpc->telehealth_coverage === 'UNKNOWN') selected @endif>UNKNOWN</option>
-								</select>
+							<div class="col-md-6">
+								<div class="form-group">
+									<label>Telehealth Coverage</label>
+									<select name="telehealthCoverage" class="form-control">
+										<option value=""></option>
+										<option value="YES" @if ($cpc && $cpc->telehealth_coverage && $cpc->telehealth_coverage === 'YES') selected @endif>YES
+										</option>
+										<option value="NO" @if ($cpc && $cpc->telehealth_coverage && $cpc->telehealth_coverage === 'NO') selected @endif>NO
+										</option>
+										<option value="UNKNOWN" @if ($cpc && $cpc->telehealth_coverage && $cpc->telehealth_coverage === 'UNKNOWN') selected @endif>
+											UNKNOWN</option>
+									</select>
+								</div>
 							</div>
-						</div>
-						<div class="col-md-6">
-							<div class="form-group">
-								<label>Deductible Amount</label>
-								<input type="number" name="deductibleAmount" class="form-control" value="{{$cpc->deductible_amount ?? ''}}" />
+							<div class="col-md-6">
+								<div class="form-group">
+									<label>Deductible Amount</label>
+									<input type="number" name="deductibleAmount" class="form-control" value="{{ $cpc->deductible_amount ?? '' }}" />
+								</div>
 							</div>
-						</div>
-						<div class="col-md-6">
-							<div class="form-group">
-								<label>Family Deductible</label>
-								<input type="number" name="familyDeductible" class="form-control" value="{{$cpc->family_deductible ?? ''}}" />
+							<div class="col-md-6">
+								<div class="form-group">
+									<label>Family Deductible</label>
+									<input type="number" name="familyDeductible" class="form-control" value="{{ $cpc->family_deductible ?? '' }}" />
+								</div>
 							</div>
-						</div>
-						<div class="col-md-6">
-							<div class="form-group">
-								<label>Member Accumulated Total</label>
-								<input type="number" name="memberAccumulatedTotal" class="form-control" value="{{$cpc->member_accumulated_total ?? ''}}" />
+							<div class="col-md-6">
+								<div class="form-group">
+									<label>Member Accumulated Total</label>
+									<input type="number" name="memberAccumulatedTotal" class="form-control" value="{{ $cpc->member_accumulated_total ?? '' }}" />
+								</div>
 							</div>
-						</div>
-						<div class="col-md-6">
-							<div class="form-group">
-								<label>Total Individual Balance</label>
-								<input type="number" name="totalIndividualBalance" class="form-control" value="{{$cpc->total_individual_balance ?? ''}}" />
+							<div class="col-md-6">
+								<div class="form-group">
+									<label>Total Individual Balance</label>
+									<input type="number" name="totalIndividualBalance" class="form-control" value="{{ $cpc->total_individual_balance ?? '' }}" />
+								</div>
 							</div>
-						</div>
-						<div class="col-md-6">
-							<div class="form-group">
-								<label>Total Family Balance</label>
-								<input type="number" name="totalFamilyBalance" class="form-control" value="{{$cpc->total_family_balance ?? ''}}" />
+							<div class="col-md-6">
+								<div class="form-group">
+									<label>Total Family Balance</label>
+									<input type="number" name="totalFamilyBalance" class="form-control" value="{{ $cpc->total_family_balance ?? '' }}" />
+								</div>
 							</div>
-						</div>
 
-					</div>
+						</div>
 					</div>
 				</div>
 
 				<div v-if="response" :class="response.success ? 'alert success' : 'alert alert-danger'">
 					@{{ response.message }}
 				</div>
-
 				<div class="form-group text-nowrap mb-0">
 					<button v-if="!processing" class="btn btn-sm btn-primary" type="submit" :disabled="url == ''">Submt</button>
 					<button v-else class="btn btn-sm btn-primary" type="button"><i class="fas fa-circle-notch fa-spin"></i> Processing...</button>
 				</div>
-			</form>
-		</div>
+			</div>
+			
+		</form>
 	</div>
-	<script>
-		(function() {
-			function init() {
-				new Vue({
-					el: '#new-coverage-form-{{$patient->uid}}',
-					delimiters: ['@{{', '}}'],
-					data: {
-						url: '',
-						insuranceCardType: '',
-						isPatientSubscriber: 1,
-						processing: false,
-						response: null
+</div>
+<script>
+	(function() {
+		function init() {
+			new Vue({
+				el: '#new-coverage-form-{{ $patient->uid }}',
+				delimiters: ['@{{ ', ' }}'],
+				data: {
+					url: '',
+					insuranceCardType: '',
+					isPatientSubscriber: 1,
+					processing: false,
+					response: null
+				},
+				methods: {
+					updateUrl: function() {
+						if (this.insuranceCardType == 'medicare') {
+							this.url = '/api/clientPrimaryCoverage/createNewCoverageForMedicare';
+						}
+						if (this.insuranceCardType == 'medicaid') {
+							this.url = '/api/clientPrimaryCoverage/createNewCoverageForMedicaid';
+						}
+						if (this.insuranceCardType == 'commercial') {
+							this.url = '/api/clientPrimaryCoverage/createNewCoverageForCommercial';
+						}
 					},
-					methods: {
-						updateUrl: function() {
-							if (this.insuranceCardType == 'medicare') {
-								this.url = '/api/clientPrimaryCoverage/createNewCoverageForMedicare';
-							}
-							if (this.insuranceCardType == 'medicaid') {
-								this.url = '/api/clientPrimaryCoverage/createNewCoverageForMedicaid';
-							}
-							if (this.insuranceCardType == 'commercial') {
-								this.url = '/api/clientPrimaryCoverage/createNewCoverageForCommercial';
-							}
-						},
-						onCommercialPayerChange: function() {
-							var input = $('input[name=commercialPayerUidSuggest]');
-							var hiddenInput = $('input[name=commercialPayerUid]');
-							input
-								.off('stag-suggest-selected')
-								.on('stag-suggest-selected', (e, input, _data) => {
-									hiddenInput.val(_data.uid);
-								});
-
-						},
-						submitForm: function(evt) {
-							var self = this;
-							if(self.processing) return;
-							var form = evt.target;
-							var data = $(form).serializeArray();
-							var url = $(form).attr('url');
-							if (!url) {
-								self.response = {
-									success: false,
-									message: 'Invalid url'
-								};
-								return;
-							}
+					onCommercialPayerChange: function() {
+						var input = $('input[name=commercialPayerUidSuggest]');
+						var hiddenInput = $('input[name=commercialPayerUid]');
+						input
+							.off('stag-suggest-selected')
+							.on('stag-suggest-selected', (e, input, _data) => {
+								hiddenInput.val(_data.uid);
+							});
 
-							self.processing = true;
-							$.post(url, data, function(response) {
-								self.processing = false;
-								if (response.success) {
-									closeStagPopup();
-									fastReload();
-								} else {
-									self.response = response;
-								}
-							}, 'json');
-						},
-						init: function() {
-							initStagSuggest();
-							this.onCommercialPayerChange();
+					},
+					submitForm: function(evt) {
+						var self = this;
+						if (self.processing) return;
+						var form = evt.target;
+						var data = $(form).serializeArray();
+						var url = $(form).attr('url');
+						if (!url) {
+							self.response = {
+								success: false,
+								message: 'Invalid url'
+							};
+							return;
 						}
+
+						self.processing = true;
+						$.post(url, data, function(response) {
+							self.processing = false;
+							if (response.success) {
+								closeStagPopup();
+								fastReload();
+							} else {
+								self.response = response;
+							}
+						}, 'json');
 					},
-					mounted: function() {
-						this.init();
+					init: function() {
+						initStagSuggest();
+						this.onCommercialPayerChange();
 					}
-				});
-			}
-			addMCInitializer('new-coverage-form-{{$patient->uid}}', init, '#new-coverage-form-{{$patient->uid}}')
-		}).call(window);
-	</script>
+				},
+				mounted: function() {
+					this.init();
+				}
+			});
+		}
+		addMCInitializer('new-coverage-form-{{ $patient->uid }}', init, '#new-coverage-form-{{ $patient->uid }}')
+	}).call(window);
+</script>

+ 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">

+ 1 - 0
routes/web.php

@@ -611,6 +611,7 @@ Route::middleware('pro.auth')->group(function () {
             Route::get('invoicing/invoices/{customer}', 'PatientController@invoicingInvoices')->name('invoicing-invoices');
             Route::get('invoicing/customer-transactions/{customer}', 'PatientController@invoicingCustomerTransactions')->name('invoicing-customer-transactions');
             Route::get('invoicing/invoice-transactions/{invoice}', 'PatientController@invoicingInvoiceTransactions')->name('invoicing-invoice-transactions');
+            Route::get('invoicing/invoice-transactions-in-popup/{invoice}', 'PatientController@invoicingInvoiceTransactionsInPopup')->name('invoicing-invoice-transactions-in-popup');
 
             // prescriptions (new)
             Route::get('prescriptions/{type?}/{currentErx?}', 'PatientController@prescriptions')->name('patient-prescriptions');