Ver Fonte

fixes on note, bill context

= há 3 anos atrás
pai
commit
31521e7903

+ 8 - 7
app/Models/Pro.php

@@ -416,7 +416,7 @@ WHERE
         return Client::where('mcp_pro_id', $this->id)
                     ->where(function($q){
                         $q->whereNull('next_mcp_appointment_id')
-                        ->orWhere('next_mcp_appointment_date', '<', DB::raw('NOW()::DATE'));
+                        ->orWhere('next_mcp_appointment_date', '<=', DB::raw('NOW()::DATE'));
                     });
     }
 
@@ -439,14 +439,15 @@ WHERE
     function get_patients_without_remote_measurement_in_48_hours_count_as_mcp() {
     }
 
+    function get_cancelled_appointments_pending_acknowledgement_count_as_mcp_query() {
+        // SELECT * FROM appointment WHERE hcp_pro_id = :me.id AND status = 'REJECTED' AND wasAcknowledgedByAppointmentPro IS NOT TRUE;
+        return Appointment::where('pro_id', $this->id)
+            ->where('latest_confirmation_decision_enum', 'REJECTED')
+            ->where('is_decision_acknowledgement_from_appointment_pro_pending', true);
+    }
     function get_cancelled_appointments_pending_acknowledgement_count_as_mcp() {
         // SELECT * FROM appointment WHERE hcp_pro_id = :me.id AND status = 'REJECTED' AND wasAcknowledgedByAppointmentPro IS NOT TRUE;
-        /*return Appointment::where('pro_id', $this->id)
-            ->where('status', 'REJECTED')
-            ->where('was_acknowledged_by_appointment_pro', '<>', true)
-            ->count();*/
-        // TODO: once appointment.was_acknowledged_by_appointment_pro is in place
-        return '**';
+        return $this->get_cancelled_appointments_pending_acknowledgement_count_as_mcp_query()->count();
     }
 
     function get_cancelled_bills_awaiting_review_count_as_mcp() {

+ 22 - 0
resources/views/app/patient/note/_create-bill.blade.php

@@ -158,6 +158,28 @@
         </form>
     </span>
 @endif
+@if($pro->pro_type === 'ADMIN')
+<span class="mx-2 text-secondary">|</span>
+<b>{{$bill->hcp && $bill->hcpCompanyPro->company ? $bill->hcpCompanyPro->pro->displayName() . ' / ' . $bill->hcpCompanyPro->company->name : '-'}}</b>
+<div moe class="ml-1">
+    <a class="text-primary" href="" show start>Swap HCP Company Pro</a>
+    <form url="/api/bill/swapHcpCompanyPro">
+        <input type="hidden" name="uid" value="{{$bill->uid}}">
+        <div class="mb-2">
+            <select name="hcpCompanyProUid" class="form-control form-control-sm">
+                <option value="">-- select --</option>
+                @foreach($bill->hcp->companyPros as $companyPro)
+                    <option value="{{$companyPro->uid}}">{{$companyPro->pro->displayName() . ' / ' . $companyPro->company->name}}</option>
+                @endforeach
+            </select>
+        </div>
+        <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
 
 <script>
     (function() {

+ 1 - 1
resources/views/app/patient/note/dashboard.blade.php

@@ -1107,7 +1107,7 @@
                             @include('app/patient/note/_create-bill')
                         @endif
                     </div>
-
+                    
                     @if($pro->pro_type === 'ADMIN')
                                 <table class="table table-sm tabe-striped mb-0 table-bordered">
                         <thead class="bg-light">