Fix rendering of invoice items, and links to payments and add payment dates to invoice
This commit is contained in:
parent
ef0d4dc773
commit
4c273364c7
@ -106,6 +106,7 @@ class Invoice extends Model implements IDs
|
|||||||
'items_active.product:id',
|
'items_active.product:id',
|
||||||
'items_active.product.translate:id,product_id,name_short,name_detail',
|
'items_active.product.translate:id,product_id,name_short,name_detail',
|
||||||
'payment_items_active:id,amount,payment_id,invoice_id',
|
'payment_items_active:id,amount,payment_id,invoice_id',
|
||||||
|
'payment_items_active.payment:id,paid_at',
|
||||||
];
|
];
|
||||||
|
|
||||||
/* STATIC METHODS */
|
/* STATIC METHODS */
|
||||||
|
@ -82,8 +82,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col">
|
<div class="col-12">
|
||||||
<table class="table table-responsive table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Qty</th>
|
<th>Qty</th>
|
||||||
@ -192,7 +192,11 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th> </th>
|
<th> </th>
|
||||||
<th>Payments:</th>
|
<th>Payments:</th>
|
||||||
<td>#{{ $o->payment_items_active->pluck('payment_id')->join(', #') }}</td>
|
<td>
|
||||||
|
@foreach($o->payment_items_active as $po)
|
||||||
|
<span style="white-space:nowrap;">@can('view',$po->payment)#<a href="{{ url('r/payment',$po->payment_id) }}">{{ $po->payment_id }}</a>@else #{{ $po->payment_id }} @endcan <small>{{ $po->payment->paid_at->format('Y-m-d') }}</small></span>
|
||||||
|
@endforeach
|
||||||
|
</td>
|
||||||
<td class="text-right">${{ number_format($o->paid,2) }}</td>
|
<td class="text-right">${{ number_format($o->paid,2) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr style="font-size: 145%">
|
<tr style="font-size: 145%">
|
||||||
|
Loading…
Reference in New Issue
Block a user