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 @@
Qty | @@ -192,7 +192,11 @@||||
---|---|---|---|---|
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) }} | |