Bläddra i källkod

pro-financials - show company details

Vijayakrishnan 3 år sedan
förälder
incheckning
c45c9c9f79

+ 4 - 0
app/Models/ProTransaction.php

@@ -15,4 +15,8 @@ class ProTransaction extends Model
     public function bill() {
         return $this->belongsTo(Bill::class);
     }
+
+    public function company() {
+        return $this->hasOne(Company::class, 'id', 'company_id');
+    }
 }

+ 14 - 2
resources/views/app/practice-management/pro-financials.blade.php

@@ -36,12 +36,24 @@
                     @foreach ($fPros as $row)
                         <tr>
                             <td>{{$row->displayName()}}</td>
-                            <td><b>${{friendly_money($row->balance)}}</b></td>
+                            <td><b>${{friendly_money($row->balance)}}</b>
+                                <div class="mt-2">
+                                    @foreach($row->companyPros as $companyPro)
+                                        @if($companyPro->balance)
+                                            <div class="mb-1 d-flex align-items-center text-secondary">
+                                                <b class="text-sm width-70px text-nowrap">${{$companyPro->balance}}</b>
+                                                <span class="text-sm text-nowrap">{{$companyPro->company->name}}</span>
+                                            </div>
+                                        @endif
+                                    @endforeach
+                                </div>
+                            </td>
                             <td>
                                 @foreach($row->recentDebits() as $debit)
                                     <div class="d-flex align-items-center mb-1">
                                         <span class="width-90px">{{'$' . $debit->amount}}</span>
-                                        <span class="text-secondary">{{friendly_date_time($debit->created_at, false)}}</span>
+                                        <span class="text-secondary width-90px">{{friendly_date_time($debit->created_at, false)}}</span>
+                                        <span class="text-secondary">{{$debit->company ? $debit->company->name : ''}}</span>
                                     </div>
                                 @endforeach
                             </td>