|
@@ -9,23 +9,73 @@
|
|
|
Financial Transactions
|
|
|
</strong>
|
|
|
<div class="ml-auto">
|
|
|
- <span class="">
|
|
|
+ <b class="mr-2">{{$pro->displayName()}}</b>
|
|
|
+ <i class="fa fa-arrow-right mr-2"></i>
|
|
|
+ <span class="text-secondary">
|
|
|
<strong>Current Balance:</strong> ${{ $pro->balance }}
|
|
|
</span>
|
|
|
- <span>
|
|
|
+ <span class="text-secondary">
|
|
|
<?php $lastPayment = $pro->lastPayment(); ?>
|
|
|
<strong>Last Payment:</strong>
|
|
|
{{ $lastPayment ? '$' . $lastPayment->amount . ' (' . friendly_date_time($lastPayment->created_at, false) . ')' : '-' }}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="card-header p-3">
|
|
|
+ <div class="d-flex align-items-center">
|
|
|
+ <div class="width-200px">
|
|
|
+ <select provider-search data-pro-uid="{{ request()->input('p') ? request()->input('p') : '' }}"
|
|
|
+ name="proUid" class="form-control form-control-sm mr-auto width-200px min-width-unset"
|
|
|
+ onchange="return transactionsFilter('p', this.value)">
|
|
|
+ <option value="" {{!request()->input('p') ? 'selected' : ''}}>All Pros</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ <select name="filter" class="form-control form-control-sm width-200px ml-2"
|
|
|
+ onchange="return transactionsFilter('t', this.value)">
|
|
|
+ <option {{request()->input('t') === '' ? 'selected' : ''}} value="">All Transactions</option>
|
|
|
+ <option {{request()->input('t') === 'PLUS' ? 'selected' : ''}} value="PLUS">Credits
|
|
|
+ </option>
|
|
|
+ <option {{request()->input('t') === 'MINUS' ? 'selected' : ''}} value="MINUS">Debits
|
|
|
+ </option>
|
|
|
+ </select>
|
|
|
+ <select name="filter" class="form-control form-control-sm width-200px ml-2"
|
|
|
+ onchange="return transactionsFilter('c', this.value)">
|
|
|
+ <option {{!request()->input('c') ? 'selected' : ''}} value="">All Companies</option>
|
|
|
+ @foreach($companies as $company)
|
|
|
+ <option {{request()->input('c') == $company->id ? 'selected' : ''}}
|
|
|
+ value="{{$company->id}}">
|
|
|
+ {{$company->name}}
|
|
|
+ </option>
|
|
|
+ @endforeach
|
|
|
+ </select>
|
|
|
+ <div class="ml-4 d-inline-flex align-items-center">
|
|
|
+ <span class="mr-2">Date</span>
|
|
|
+ <input type="date"
|
|
|
+ value="{{request()->input('bs')}}"
|
|
|
+ onchange="return transactionsFilter('bs', this.value)"
|
|
|
+ class="form-control form-control-sm width-150px" name="bpdFrom">
|
|
|
+ <span class="mx-2">to</span>
|
|
|
+ <input type="date"
|
|
|
+ value="{{request()->input('be')}}"
|
|
|
+ onchange="return transactionsFilter('be', this.value)"
|
|
|
+ class="form-control form-control-sm width-150px" name="bpdTo">
|
|
|
+ </div>
|
|
|
+ @if(count(array_filter(request()->all(), function($_x) { return !!$_x;})))
|
|
|
+ <a href="/practice-management/financial-transactions" class="ml-4">Clear Filters</a>
|
|
|
+ @endif
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<div class="card-body p-0">
|
|
|
- <table class="table table-sm table-condensed p-0 m-0" style="table-layout: fixed">
|
|
|
+ <table class="table table-sm table-condensed p-0 m-0">
|
|
|
<thead class="bg-light">
|
|
|
<tr>
|
|
|
<th class="px-3 border-0">Date</th>
|
|
|
<th class="border-0">Type</th>
|
|
|
<th class="border-0">Client</th>
|
|
|
+ @if($pro->pro_type === 'ADMIN')
|
|
|
+ <th class="border-0">Pro</th>
|
|
|
+ @endif
|
|
|
+ <th class="border-0">Company</th>
|
|
|
<th class="border-0">Context</th>
|
|
|
<th class="border-0">Amount</th>
|
|
|
<th class="border-0">Balance</th>
|
|
@@ -49,7 +99,15 @@
|
|
|
-
|
|
|
@endif
|
|
|
</td>
|
|
|
+ @if($pro->pro_type === 'ADMIN')
|
|
|
+ <td>
|
|
|
+ {{$transaction->pro ? $transaction->pro->displayName() : ''}}
|
|
|
+ </td>
|
|
|
+ @endif
|
|
|
<td>
|
|
|
+ {{$transaction->company ? $transaction->company->name : ''}}
|
|
|
+ </td>
|
|
|
+ <td class="text-nowrap">
|
|
|
@if($transaction->bill && $transaction->bill->note)
|
|
|
<a href="{{route('patients.view.notes.view.dashboard', ['patient'=>$transaction->client, 'note'=>$transaction->bill->note])}}">
|
|
|
({{$transaction->bill->note->effective_dateest}})
|
|
@@ -108,5 +166,53 @@
|
|
|
</table>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <div class="d-flex align-items-center mt-3">
|
|
|
+ {{ $transactions->withQueryString()->links() }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <script>
|
|
|
+ (function() {
|
|
|
+ window.transactionsFilter = function(_key, _value) {
|
|
|
+
|
|
|
+ <?php
|
|
|
+ $keys = ['p', 'bs', 'be', 't', 'c'];
|
|
|
+ $currentParams = [];
|
|
|
+ for($i = 0; $i < count($keys); $i++) {
|
|
|
+ if(!!request()->input($keys[$i])) {
|
|
|
+ $currentParams[$keys[$i]] = request()->input($keys[$i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+
|
|
|
+ let base = '/practice-management/financial-transactions',
|
|
|
+ keys = ['p', 'bs', 'be', 't', 'c'].filter(_x => _x !== _key),
|
|
|
+ currentParams = {!! json_encode($currentParams) !!},
|
|
|
+ url = [];
|
|
|
+
|
|
|
+ // base
|
|
|
+ url.push(base);
|
|
|
+ url.push('?');
|
|
|
+
|
|
|
+ // params
|
|
|
+ let getParams = [];
|
|
|
+ for (let i = 0; i < keys.length; i++) {
|
|
|
+ if(currentParams[keys[i]]) {
|
|
|
+ getParams.push(keys[i] + '=' + encodeURIComponent(currentParams[keys[i]]));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // new params
|
|
|
+ getParams.push(_key + '=' + encodeURIComponent(_value));
|
|
|
+
|
|
|
+ // generate url
|
|
|
+ url.push(getParams.join('&'));
|
|
|
+
|
|
|
+ // go
|
|
|
+ fastLoad(url.join(''));
|
|
|
+
|
|
|
+ return false;
|
|
|
+ };
|
|
|
+ }).call(window);
|
|
|
+ </script>
|
|
|
@endsection
|