From 4c273364c730ed1f5b010995010a5e566289bfb9 Mon Sep 17 00:00:00 2001 From: Deon George Date: Sun, 11 Aug 2024 00:36:10 +1000 Subject: [PATCH] Fix rendering of invoice items, and links to payments and add payment dates to invoice --- app/Models/Invoice.php | 1 + .../theme/backend/adminlte/invoice/view.blade.php | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 8774eb4..7655b45 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -106,6 +106,7 @@ class Invoice extends Model implements IDs 'items_active.product:id', 'items_active.product.translate:id,product_id,name_short,name_detail', 'payment_items_active:id,amount,payment_id,invoice_id', + 'payment_items_active.payment:id,paid_at', ]; /* STATIC METHODS */ diff --git a/resources/views/theme/backend/adminlte/invoice/view.blade.php b/resources/views/theme/backend/adminlte/invoice/view.blade.php index 30de294..cb1e3ff 100644 --- a/resources/views/theme/backend/adminlte/invoice/view.blade.php +++ b/resources/views/theme/backend/adminlte/invoice/view.blade.php @@ -82,8 +82,8 @@
-
- +
+
@@ -192,7 +192,11 @@ - +
Qty
  Payments:#{{ $o->payment_items_active->pluck('payment_id')->join(', #') }} + @foreach($o->payment_items_active as $po) + @can('view',$po->payment)#{{ $po->payment_id }}@else #{{ $po->payment_id }} @endcan {{ $po->payment->paid_at->format('Y-m-d') }} + @endforeach + ${{ number_format($o->paid,2) }}