|
@@ -0,0 +1,105 @@
|
|
|
+@extends ('layouts.patient')
|
|
|
+<?php
|
|
|
+// include the Diff class
|
|
|
+?>
|
|
|
+
|
|
|
+@section('inner-content')
|
|
|
+ <div id="patient-requests">
|
|
|
+ <h4 class="font-weight-bold m-0 mb-3">Patient Requests</h4>
|
|
|
+
|
|
|
+ <table class="table table-sm table-striped">
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th>Treatment</th>
|
|
|
+ <th>Amount</th>
|
|
|
+ <th>Paid</th>
|
|
|
+ <th>Balance</th>
|
|
|
+ <th>Status</th>
|
|
|
+ <th>Invoice</th>
|
|
|
+ <th>Actions</th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ @foreach ($patientRequests as $patientRequest)
|
|
|
+ <tr>
|
|
|
+ <td>{{ $patientRequest->title }}</td>
|
|
|
+ <td>${{ $patientRequest->amount }}</td>
|
|
|
+ <td>${{ $patientRequest->invoice ? $patientRequest->invoice->paid : '--' }}</td>
|
|
|
+ <td>${{ $patientRequest->invoice ? $patientRequest->invoice->balance : '--' }}</td>
|
|
|
+ <td>{{ $patientRequest->status }}</td>
|
|
|
+ <td>
|
|
|
+ @if ($patientRequest->invoice)
|
|
|
+ <a href="#" data-invoice-uid="{{ $patientRequest->invoice->uid }}" data-uid="{{ $patientRequest->invoice->customer->uid }}"
|
|
|
+ class="generate-and-copy-ic-pay-url" native target="_blank">Copy Pay Link</a>
|
|
|
+ @else
|
|
|
+ <div moe>
|
|
|
+ <a href="" start show>
|
|
|
+ + Create Invoice
|
|
|
+ </a>
|
|
|
+
|
|
|
+ <form url="{{ route('patient-request-create-invoice') }}" class="mcp-theme-1">
|
|
|
+ @csrf
|
|
|
+ <input type="hidden" name="customerUid"
|
|
|
+ value="{{ $patientRequest->customer->uid }}" />
|
|
|
+ <input type="hidden" name="patientRequestUid" value="{{ $patientRequest->uid }}" />
|
|
|
+ <p class="mb-2 text-secondary font-weight-bold">Add Invoice</p>
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="text-sm text-secondary mb-1">Amount</label>
|
|
|
+ <input type="text" name="amount" value="{{ $patientRequest->amount }}"
|
|
|
+ autocomplete="off" class="form-control form-control-sm" required>
|
|
|
+ </div>
|
|
|
+ <div class="mb-2">
|
|
|
+ <label class="text-sm text-secondary mb-1">Description</label>
|
|
|
+ <textarea rows="2" name="description" autocomplete="off" class="form-control form-control-sm" required></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>
|
|
|
+ @endif
|
|
|
+ </td>
|
|
|
+ <td>
|
|
|
+
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ @endforeach
|
|
|
+ </tbody>
|
|
|
+ </table>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <script>
|
|
|
+ (function($) {
|
|
|
+ var patientRequestsComponent = {
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+ patientRequestsComponent.init();
|
|
|
+ })(jQuery);
|
|
|
+</script>
|
|
|
+
|
|
|
+@endsection
|