bills.blade.php 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. @extends ('layouts/template')
  2. @section('content')
  3. <div class="p-3 mcp-theme-1">
  4. <div class="card">
  5. <div class="card-header px-3 py-2 d-flex align-items-center">
  6. <strong class="mr-4">
  7. <i class="fas fa-user-injured"></i>
  8. Bills
  9. </strong>
  10. <select class="ml-auto max-width-300px form-control form-control-sm" onchange="fastLoad('/bills/' + this.value, true, false, false)">
  11. <option value="" {{ $filter === '' ? 'selected' : '' }}>All bills</option>
  12. <option value="not-yet-signed" {{ $filter === 'not-yet-signed' ? 'selected' : '' }}>Bills not yet signed</option>
  13. </select>
  14. </div>
  15. <div class="card-body p-0">
  16. <table class="table table-sm table-condensed p-0 m-0">
  17. <thead class="bg-light">
  18. <tr>
  19. <th class="px-3 border-0">Created</th>
  20. <th class="border-0">Patient</th>
  21. <th class="border-0">Reason</th>
  22. <th class="border-0">Role</th>
  23. <th class="border-0 w-50">Amount</th>
  24. </tr>
  25. </thead>
  26. <tbody>
  27. @foreach ($bills as $bill)
  28. <tr class="{{ $bill->is_cancelled ? 'cancelled-item always-clickable' : '' }}">
  29. <td class="px-3">
  30. {{ friendly_date_time($bill->created_at, true) }}
  31. </td>
  32. <td class="">
  33. <a href="/patients/view/{{ $bill->client->uid }}">{{ $bill->client->displayName() }}</a>
  34. </td>
  35. <td class="stag-no-wrap-td">
  36. @if($bill->careMonth)
  37. <b>{{ $bill->code }}</b>
  38. -
  39. <a href="/patients/view/{{ $bill->client->uid }}/care-months/view/{{ $bill->careMonth->uid }}">
  40. <b>{{ friendly_month($bill->careMonth->start_date) }}</b>
  41. </a>
  42. @elseif($bill->note)
  43. <b>{{ $bill->code }}</b>
  44. -
  45. <a href="/patients/view/{{ $bill->client->uid }}/notes/view/{{ $bill->note->uid }}">
  46. <b>Note</b>
  47. </a>
  48. @endif
  49. @if(!empty($bill->reason1))
  50. <div class="text-secondary text-sm stag-no-wrap" title="{{ $bill->reason1 }}">{{ $bill->reason1 }}</div>
  51. @endif
  52. </td>
  53. <td>
  54. <?php
  55. $roles = [];
  56. if($bill->hcp_pro_id === $pro->id) $roles[] = 'HCP';
  57. if($bill->cm_pro_id === $pro->id) $roles[] = 'CM';
  58. if($bill->rme_pro_id === $pro->id) $roles[] = 'RME';
  59. if($bill->rmm_pro_id === $pro->id) $roles[] = 'RMM';
  60. $roles = implode("<br>", $roles);
  61. ?>
  62. {!! $roles !!}
  63. </td>
  64. <td>
  65. @if($bill->hcp_pro_id === $pro->id)
  66. @if($bill->has_hcp_been_paid)
  67. <span class="text-dark">HCP Received:</span><span class="font-weight-bold text-success ml-2">${{ $bill->hcp_payment_amount }}</span>
  68. @else
  69. <span class="text-dark">HCP Expected:</span><span class="font-weight-bold text-dark ml-2">{{ $bill->hcp_expected_payment_amount ? '$' . $bill->hcp_expected_payment_amount : '-' }}</span>
  70. @endif
  71. @endif
  72. @if($bill->cm_pro_id === $pro->id)
  73. @if($bill->has_cm_been_paid)
  74. <span class="text-dark">HCP Received:</span><span class="font-weight-bold text-success ml-2">${{ $bill->cm_payment_amount }}</span>
  75. @else
  76. <span class="text-dark">HCP Expected:</span><span class="font-weight-bold text-dark ml-2">{{ $bill->cm_expected_payment_amount ? '$' . $bill->cm_expected_payment_amount : '-' }}</span>
  77. @endif
  78. @endif
  79. @if($bill->rmm_pro_id === $pro->id)
  80. @if($bill->has_rmm_been_paid)
  81. <span class="text-dark">HCP Received:</span><span class="font-weight-bold text-success ml-2">${{ $bill->rmm_payment_amount }}</span>
  82. @else
  83. <span class="text-dark">HCP Expected:</span><span class="font-weight-bold text-dark ml-2">{{ $bill->rmm_expected_payment_amount ? '$' . $bill->rmm_expected_payment_amount : '-' }}</span>
  84. @endif
  85. @endif
  86. @if($bill->rme_pro_id === $pro->id)
  87. @if($bill->has_rme_been_paid)
  88. <span class="text-dark">HCP Received:</span><span class="font-weight-bold text-success ml-2">${{ $bill->rme_payment_amount }}</span>
  89. @else
  90. <span class="text-dark">HCP Expected:</span><span class="font-weight-bold text-dark ml-2">{{ $bill->rme_expected_payment_amount ? '$' . $bill->rme_expected_payment_amount : '-' }}</span>
  91. @endif
  92. @endif
  93. </td>
  94. </tr>
  95. @endforeach
  96. </tbody>
  97. </table>
  98. </div>
  99. </div>
  100. </div>
  101. @endsection