|
@@ -0,0 +1,224 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+use App\Models\Note;
|
|
|
+use App\Models\Pro;
|
|
|
+use App\Models\Client;
|
|
|
+
|
|
|
+/** @var Note $note */
|
|
|
+/** @var Pro $genericPro */
|
|
|
+/** @var Pro $pro */
|
|
|
+/** @var Client $patient */
|
|
|
+/** @var $entityType */
|
|
|
+/** @var $entityUid */
|
|
|
+
|
|
|
+$genericBills = genericBills($pro, @$patient, @$entityType, @$entityUid);
|
|
|
+?>
|
|
|
+
|
|
|
+@if(!count($genericBills))
|
|
|
+ <div class="{{@$class ? $class : ''}} d-flex align-items-center">
|
|
|
+ <p class="font-weight-bold mb-0">No {{@$label ? $label : 'Admin.'}} Bills</p>
|
|
|
+ <span class="mx-2 text-secondary">|</span>
|
|
|
+ @include('app.rm-bills.create_generic-bill')
|
|
|
+ </div>
|
|
|
+@else
|
|
|
+ <div class="{{@$class ? $class : ''}}">
|
|
|
+ <div class="d-flex align-items-center mb-2">
|
|
|
+ <p class="font-weight-bold m-0">{{@$label ? $label : 'Admin.'}} Bills</p>
|
|
|
+ @if(!@$noCreate)
|
|
|
+ <span class="mx-2 text-secondary">|</span>
|
|
|
+ @include('app.rm-bills.create_generic-bill')
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ <table class="table table-sm table-striped mb-0 table-bordered">
|
|
|
+ <thead class="bg-light">
|
|
|
+ <tr class="text-secondary">
|
|
|
+ @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">Sign</th>
|
|
|
+ <th class="border-bottom-0">Cancel</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ @foreach ($genericBills as $bill)
|
|
|
+ <tr class="{{$bill->is_cancelled ? 'bg-light text-secondary' : ''}}">
|
|
|
+ @if(@$adminView)
|
|
|
+ <td>
|
|
|
+ @include('app.rm-bills.context')
|
|
|
+ </td>
|
|
|
+ @endif
|
|
|
+ <td>{{$bill->code}}
|
|
|
+ @if($bill->generic_description)
|
|
|
+ <pre class="max-width-300px text-wrap mb-0 text-sm text-secondary font-italic">{!! preg_replace('#<br\s*/?>#i', "\n", $bill->generic_description) !!}</pre>
|
|
|
+ @endif
|
|
|
+ @if(!$bill->is_signed_by_generic_pro)
|
|
|
+ <div moe wide relative class="d-block">
|
|
|
+ <a href="#" start show class="text-nowrap text-sm">Edit Description</a>
|
|
|
+ <form url="/api/bill/putGenericDescription" right>
|
|
|
+ <input type="hidden" name="uid" value="{{$bill->uid}}">
|
|
|
+ <p>Edit Description</p>
|
|
|
+ <div class="mb-2">
|
|
|
+ <textarea class="text form-control form-control-sm"
|
|
|
+ rows="5"
|
|
|
+ name="genericDescription"
|
|
|
+ placeholder="">{{$bill->generic_description ? preg_replace('#<br\s*/?>#i', "\n", $bill->generic_description) : ''}}</textarea>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <button class="btn btn-primary btn-sm" submit>Submit</button>
|
|
|
+ <button class="btn btn-default border btn-sm" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ <div class="text-nowrap screen-only">
|
|
|
+ <span class="text-secondary">Paid: </span>
|
|
|
+ <span>{{ $bill->has_generic_pro_been_paid ? 'Yes' : 'No' }}</span>
|
|
|
+ </div>
|
|
|
+ @if(!$bill->has_generic_pro_been_paid)
|
|
|
+ <div class="text-nowrap screen-only">
|
|
|
+ <span class="text-secondary">Expected: </span>
|
|
|
+ <span class="font-weight-bold">${{ round($bill->total_expected, 2) }}</span>
|
|
|
+ </div>
|
|
|
+ @else
|
|
|
+ <div class="text-nowrap screen-only">
|
|
|
+ <span class="text-secondary">Amount: </span>
|
|
|
+ <span class="font-weight-bold">${{ round($bill->total_paid, 2) }}</span>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ </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) }}
|
|
|
+ <div>
|
|
|
+ @if($bill->has_generic_pro_been_paid)
|
|
|
+ <span class="text-secondary">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 ? '$' . round($bill->total_expected, 2) : '-' }}</span>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+ @if(!$bill->is_cancelled)
|
|
|
+ @if($bill->is_signed_by_generic_pro)
|
|
|
+ <div class="d-block text-secondary text-nowrap">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ Pro Signed
|
|
|
+ </div>
|
|
|
+ @else
|
|
|
+ <div moe relative
|
|
|
+ class="d-block {{ $bill->generic_pro_id !== $pro->id ? 'moe-disabled' : '' }}"
|
|
|
+ title="{{ $bill->generic_pro_id !== $pro->id ? 'Only the bill\'s pro can sign' : '' }}">
|
|
|
+ <a class="text-nowrap" href="" show start>Sign</a>
|
|
|
+ <form url="/api/bill/signAsGenericPro" right>
|
|
|
+ <input type="hidden" name="uid" value="{{$bill->uid}}">
|
|
|
+ <p>Sign this bill?</p>
|
|
|
+ <div class="mb-0">
|
|
|
+ <button class="btn btn-success btn-sm" submit>Sign</button>
|
|
|
+ <button class="btn btn-default border btn-sm" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td> <!-- cancellation -->
|
|
|
+ @if($bill->is_cancelled)
|
|
|
+ <div class="text-warning-mellow font-weight-bold">Cancelled</div>
|
|
|
+ @if($bill->cancellation_memo)
|
|
|
+ <div class="text-dark text-sm font-italic my-1">{{$bill->cancellation_memo}}</div>
|
|
|
+ @endif
|
|
|
+ @if($bill->is_cancelled_by_administrator)
|
|
|
+ <div class="text-secondary text-sm text-nowrap">(by Administrator)</div>
|
|
|
+ @endif
|
|
|
+ <div moe class="mt-1">
|
|
|
+ <a class="text-nowrap" href="" show start>Update Memo</a>
|
|
|
+ <form url="/api/bill/updateCancellationMemo">
|
|
|
+ <input type="hidden" name="uid" value="{{$bill->uid}}">
|
|
|
+ <p>Update Cancellation Memo</p>
|
|
|
+ <div class="mb-2">
|
|
|
+ <textarea class="text form-control form-control-sm" name="cancellationMemo"
|
|
|
+ placeholder="">{{$bill->cancellation_memo ? $bill->cancellation_memo : ($pro->pro_type === 'ADMIN' ? 'Please contact billing.' : '')}}</textarea>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <button class="btn btn-success btn-sm" submit>Submit</button>
|
|
|
+ <button class="btn btn-default border btn-sm" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @else
|
|
|
+ <div class="d-block" moe relative="">
|
|
|
+ <a class="text-danger" href="" show start>Cancel</a>
|
|
|
+ <form url="/api/bill/markCancelled" right="">
|
|
|
+ <input type="hidden" name="uid" value="{{$bill->uid}}">
|
|
|
+ <p class="mb-2">Cancel this bill?</p>
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="mb-1 text-secondary">Cancellation Memo</label>
|
|
|
+ <textarea type="text" name="memo" placeholder="Memo" class="form-control form-control-sm">@if($pro->pro_type === 'ADMIN')Please contact billing.@endif</textarea>
|
|
|
+ </div>
|
|
|
+ <div class="mb-0">
|
|
|
+ <button class="btn btn-danger btn-sm" submit>Yes</button>
|
|
|
+ <button class="btn btn-default border btn-sm" cancel>No</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+
|
|
|
+ @if($bill->is_cancelled && !$bill->is_cancellation_acknowledged)
|
|
|
+ <div class="mt-2 text-secondary text-nowrap">
|
|
|
+ <i class="fa fa-exclamation-triangle"></i>
|
|
|
+ Not Ack.
|
|
|
+ </div>
|
|
|
+ <div class="d-block mt-1" moe>
|
|
|
+ <a class="text-nowrap" href="" show start>Ack. Cancellation</a>
|
|
|
+ <form url="/api/bill/acknowledgeCancellation">
|
|
|
+ <input type="hidden" name="uid" value="{{$bill->uid}}">
|
|
|
+ <p>Acknowledge Cancellation?</p>
|
|
|
+ <div class="mb-0">
|
|
|
+ {{--<input type="text" class="text form-control form-control-sm" name="cancellationMemo" value="{{$bill->cancellation_memo}}" placeholder=""><br>--}}
|
|
|
+ <button class="btn btn-primary btn-sm" submit>Submit</button>
|
|
|
+ <button class="btn btn-default border btn-sm" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+
|
|
|
+ @if($bill->is_cancellation_acknowledged)
|
|
|
+ <div class="mt-2 text-secondary">
|
|
|
+ <i class="fa fa-check"></i>
|
|
|
+ Ack.
|
|
|
+ </div>
|
|
|
+ <div class="d-block mt-1" moe>
|
|
|
+ <a class="text-nowrap" href="" show start>Undo Cancellation Ack.</a>
|
|
|
+ <form url="/api/bill/undoAcknowledgeCancellation">
|
|
|
+ <input type="hidden" name="uid" value="{{$bill->uid}}">
|
|
|
+ <p>Undo Acknowledge Cancellation?</p>
|
|
|
+ <div class="mb-0">
|
|
|
+ <button class="btn btn-success btn-sm" submit>Submit</button>
|
|
|
+ <button class="btn btn-default border btn-sm" cancel>Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ @endforeach
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+@endif
|