Ver código fonte

Payer info on note (wip)

Vijayakrishnan 4 anos atrás
pai
commit
50e55df772

+ 12 - 0
app/Models/Company.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Company extends Model
+{
+
+    protected $table = 'company';
+
+}

+ 12 - 0
app/Models/CompanyPayer.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class CompanyPayer extends Model
+{
+
+    protected $table = 'company_payer';
+
+}

+ 12 - 0
app/Models/CompanyPro.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class CompanyPro extends Model
+{
+
+    protected $table = 'company_pro';
+
+}

+ 27 - 0
app/Models/CompanyProPayer.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class CompanyProPayer extends Model
+{
+
+    protected $table = 'company_pro_payer';
+
+    public function company()
+    {
+        return $this->hasOne(Company::class, 'id', 'company_id');
+    }
+
+    public function pro()
+    {
+        return $this->hasOne(Pro::class, 'id', 'pro_id');
+    }
+
+    public function payer()
+    {
+        return $this->hasOne(Payer::class, 'id', 'payer_id');
+    }
+
+}

+ 5 - 0
app/Models/Note.php

@@ -72,4 +72,9 @@ class Note extends Model
         }, $parts);
         return implode("", $parts);
     }
+
+    public function hcpCompanyProPayer()
+    {
+        return $this->hasOne(CompanyProPayer::class, 'id', 'hcp_company_pro_payer_id');
+    }
 }

+ 12 - 0
app/Models/Payer.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Payer extends Model
+{
+
+    protected $table = 'payer';
+
+}

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

@@ -140,6 +140,23 @@
         </form>
     </span>
 @endif
+
+@if($note->method === 'IN_CLINIC' || $pro->pro_type === 'ADMIN')
+    <span class="ml-auto">
+        Payer: <b>{{$note->hcpCompanyProPayer && $note->hcpCompanyProPayer->payer ? $note->hcpCompanyProPayer->payer->name : '-'}}</b>
+        <span moe class="ml-2">
+            <a class="text-primary" href="" show start><i class="fa fa-edit"></i></a>
+            <form url="/api/note/fooBar" right>
+                <input type="hidden" name="uid" value="{{$note->uid}}">
+                <p>Underway</p>
+                <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>
+        </span>
+    </span>
+@endif
 <script>
     (function() {
         let selectedCodeHourlyRate = 0;

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

@@ -886,7 +886,7 @@
                 @if($note->bills->count())
                     <div class="p-3 border-bottom">
                         <div class="d-flex align-items-center mb-2">
-                            <p class="font-weight-bold text-secondary m-0">Bills</p>
+                            <p class="font-weight-bold text-secondary font-size-13 m-0">Bills</p>
                             @include('app/patient/note/_create-bill')
                         </div>