|
@@ -0,0 +1,230 @@
|
|
|
+@extends ('layouts/template')
|
|
|
+
|
|
|
+@section('content')
|
|
|
+ <?php
|
|
|
+ function selectIf($_cond) {
|
|
|
+ return $_cond ? 'selected' : '';
|
|
|
+ }
|
|
|
+ if(request()->input('_ql')) \Illuminate\Support\Facades\DB::enableQueryLog();
|
|
|
+ ?>
|
|
|
+ <style>
|
|
|
+ .posneg {
|
|
|
+ width: 10px;
|
|
|
+ display: inline-block;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 12px !important;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ <div class="p-3 mcp-theme-1" id="accounting-items-container">
|
|
|
+ <div class="card">
|
|
|
+
|
|
|
+ <div class="card-header px-2 py-2 d-flex align-items-center">
|
|
|
+ <strong class="mr-4 font-size-14">
|
|
|
+ <i class="fas fa-user"></i>
|
|
|
+ Accounting Items
|
|
|
+ </strong>
|
|
|
+ </div>
|
|
|
+ <div class="card-body px-2 py-3 d-flex align-items-center">
|
|
|
+ <form action="" id="accounting-items-filter-form" class="d-flex align-items-center">
|
|
|
+ <div class="d-inline-flex align-items-baseline mr-3">
|
|
|
+ <span class="text-secondary mr-2">Type</span>
|
|
|
+ <select name="type" class="form-control form-control-sm max-width-110px min-width-unset">
|
|
|
+ <option value="" {{ selectIf(!request()->input('type')) }}>All</option>
|
|
|
+ <option value="revenue" {{ selectIf(request()->input('type') == 'revenue') }}>Revenue (+)</option>
|
|
|
+ <option value="cost" {{ selectIf(request()->input('type') == 'cost') }}>Cost (-)</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="d-inline-flex align-items-baseline mr-3">
|
|
|
+ <span class="text-secondary mr-2">Context</span>
|
|
|
+ <select name="context" class="form-control form-control-sm max-width-110px min-width-unset">
|
|
|
+ <option value="" {{ selectIf(!request()->input('context')) }}>All</option>
|
|
|
+ <option value="Note" {{ selectIf(request()->input('context') == 'Note') }}>Note</option>
|
|
|
+ <option value="CareMonth" {{ selectIf(request()->input('context') == 'CareMonth') }}>CareMonth</option>
|
|
|
+ <option value="Bill" {{ selectIf(request()->input('context') == 'Bill') }}>Bill</option>
|
|
|
+ <option value="SupplyOrder" {{ selectIf(request()->input('context') == 'SupplyOrder') }}>SupplyOrder</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="d-inline-flex align-items-baseline mr-3">
|
|
|
+ <span class="text-secondary mr-2">Open</span>
|
|
|
+ <select name="open" class="form-control form-control-sm max-width-110px min-width-unset">
|
|
|
+ <option value="" {{ selectIf(!request()->input('open')) }}>All</option>
|
|
|
+ <option value="open" {{ selectIf(request()->input('open') == 'open') }}>Open</option>
|
|
|
+ <option value="closed" {{ selectIf(request()->input('open') == 'closed') }}>Closed</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <div class="d-inline-flex align-items-baseline mr-3">
|
|
|
+ <span class="text-secondary mr-2">Active</span>
|
|
|
+ <select name="active" class="form-control form-control-sm max-width-110px min-width-unset">
|
|
|
+ <option value="" {{ selectIf(!request()->input('active')) }}>All</option>
|
|
|
+ <option value="active" {{ selectIf(request()->input('active') == 'active') }}>Active</option>
|
|
|
+ <option value="inactive" {{ selectIf(request()->input('active') == 'inactive') }}>Inactive</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <label class="d-inline-flex align-items-center mr-3 mb-0">
|
|
|
+ <input type="checkbox" name="paginate" class="mr-1" {{request()->input('paginate') ? 'checked' : ''}}>
|
|
|
+ <span>Paginate</span>
|
|
|
+ </label>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ <div class="card-body p-0">
|
|
|
+ <table class="table table-sm table-striped border-0 mb-0">
|
|
|
+ <thead class="bg-light">
|
|
|
+ <tr>
|
|
|
+ <th class="border-bottom-0 width-200px">Created</th>
|
|
|
+ <th class="border-bottom-0">Type</th>
|
|
|
+ <th class="border-bottom-0">Context</th>
|
|
|
+ <th class="border-bottom-0">Pro</th>
|
|
|
+ <th class="border-bottom-0">Client</th>
|
|
|
+ <th class="border-bottom-0 width-60px text-right">Expected</th>
|
|
|
+ <th class="border-bottom-0 width-60px text-right">Actual</th>
|
|
|
+ <th class="border-bottom-0 text-center">Open</th>
|
|
|
+ <th class="border-bottom-0">Memo</th>
|
|
|
+ <th class="border-bottom-0">Active</th>
|
|
|
+ <th class="border-bottom-0 width-200px">Updated</th>
|
|
|
+ <th class="border-bottom-0"> </th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ @foreach($records as $record)
|
|
|
+ <tr>
|
|
|
+ <td class="">
|
|
|
+ {{friendly_date_time($record->created_at)}}
|
|
|
+ </td>
|
|
|
+ <td class="">
|
|
|
+ {{$record->positive_or_negative == 0 ? 'Revenue' : 'Cost'}}
|
|
|
+ </td>
|
|
|
+ <td class="">
|
|
|
+ @switch($record->entity_type)
|
|
|
+ @case('Note')
|
|
|
+ <a href="{{route('patients.view.notes.view.dashboard', ['patient' => $record->client_uid, 'note' => $record->note_uid])}}">Note</a>
|
|
|
+ @break
|
|
|
+
|
|
|
+ @case('CareMonth')
|
|
|
+ <a href="{{route('patients.view.care-months.view.dashboard', ['patient' => $record->client_uid, 'careMonth' => $record->care_month_uid])}}">Care Month</a>
|
|
|
+ @break
|
|
|
+
|
|
|
+ @case('SupplyOrder')
|
|
|
+ <a href="{{route('patients.view.supply-orders', ['patient' => $record->client_uid, 'supplyOrder' => $record->supply_order_uid])}}">Supply Order</a>
|
|
|
+ @break
|
|
|
+
|
|
|
+ @default
|
|
|
+ {{$record->entity_type}}
|
|
|
+ @endswitch
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0">
|
|
|
+ {{implode(', ', [$record->pro_name_last, $record->pro_name_first])}}
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0">
|
|
|
+ @if($record->client_uid)
|
|
|
+ <a native target="_blank" href="{{route('patients.view.dashboard', $record->client_uid)}}">
|
|
|
+ {{implode(', ', [$record->client_name_last, $record->client_name_first])}}
|
|
|
+ </a>
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0 width-60px text-right">
|
|
|
+ @if($record->expected_value)
|
|
|
+ <span class="posneg">{{$record->positive_or_negative == 0 ? '+' : '-'}}</span>
|
|
|
+ {{'$' . $record->expected_value}}
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0 width-60px text-right">
|
|
|
+ @if($record->received_value)
|
|
|
+ <span class="posneg">{{$record->positive_or_negative == 0 ? '+' : '-'}}</span>
|
|
|
+ {{'$' . $record->received_value}}
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0 text-center">
|
|
|
+ {{$record->is_open ? 'Yes' : 'No'}}
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0">
|
|
|
+ {{$record->memo ? $record->memo : ''}}
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0">
|
|
|
+ {{$record->is_active ? 'Yes' : 'No'}}
|
|
|
+ </td>
|
|
|
+ <td class="">
|
|
|
+ {{friendly_date_time($record->last_updated_at)}}
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0">
|
|
|
+ <div class="d-flex">
|
|
|
+ @include('app.patient.partials.create-edit-accounting-item', ['entityType' => $record->entity_type, 'entityUid' => $record->entity_uid, 'record' => $record])
|
|
|
+ <span class="mx-2 text-secondary">|</span>
|
|
|
+ @if($record->is_active)
|
|
|
+ <div moe relative="">
|
|
|
+ <a start show class="py-0 mb-3">Deactivate</a>
|
|
|
+ <form url="/api/accountingItem/deactivate" class="mcp-theme-1" right="">
|
|
|
+ <input type="hidden" name="uid" value="{{$record->uid}}">
|
|
|
+ <p>Deactivate this record?</p>
|
|
|
+ <div>
|
|
|
+ <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
|
|
|
+ <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @else
|
|
|
+ <div moe relative="">
|
|
|
+ <a start show class="py-0 mb-3">Reactivate</a>
|
|
|
+ <form url="/api/accountingItem/reactivate" class="mcp-theme-1" right="">
|
|
|
+ <input type="hidden" name="uid" value="{{$record->uid}}">
|
|
|
+ <p>Reactivate this record?</p>
|
|
|
+ <div>
|
|
|
+ <button submit class="btn btn-sm btn-primary mr-1">Submit</button>
|
|
|
+ <button cancel class="btn btn-sm btn-default border">Cancel</button>
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ @endforeach
|
|
|
+ @if(count($records))
|
|
|
+ <tr>
|
|
|
+ <td class="border-bottom-0 text-right" colspan="5">
|
|
|
+ Total (from all pages):
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0 width-60px text-right font-weight-bold">
|
|
|
+ <span class="posneg">{{$expected_total >= 0 ? '+' : '-'}}</span>
|
|
|
+ {{'$' . abs($expected_total)}}
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0 width-60px text-right font-weight-bold">
|
|
|
+ <span class="posneg">{{$received_total >= 0 ? '+' : '-'}}</span>
|
|
|
+ {{'$' . abs($received_total)}}
|
|
|
+ </td>
|
|
|
+ <td class="border-bottom-0 text-right" colspan="5">
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ @endif
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ @if(request()->input('paginate') && $paginator->lastPage() > 1)
|
|
|
+ <div class="pt-3 px-3 d-flex justify-content-start">
|
|
|
+ {{ $paginator->withQueryString()->links() }}
|
|
|
+ </div>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <?php
|
|
|
+ if(request()->input('_ql')) printQueryLog(DB::getQueryLog());
|
|
|
+ ?>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ (function() {
|
|
|
+ function init() {
|
|
|
+ $('#accounting-items-filter-form')
|
|
|
+ .find('input, select')
|
|
|
+ .off('change')
|
|
|
+ .on('change', function() {
|
|
|
+ $(this).closest('form').submit();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ addMCInitializer('accounting-items', init, '#accounting-items-container');
|
|
|
+ }).call(window);
|
|
|
+ </script>
|
|
|
+@endsection
|
|
|
+
|