osb/resources/views/theme/backend/adminlte/a/payment/unapplied.blade.php
2022-06-13 17:31:11 +10:00

66 lines
1.7 KiB
PHP

@extends('adminlte::layouts.app')
@section('htmlheader_title')
Unapplied Payments
@endsection
@section('page_title')
Unapplied
@endsection
@section('contentheader_title')
Unapplied Payments
@endsection
@section('contentheader_description')
@endsection
@section('main-content')
<div class="row">
<div class="col-6">
<div class="card">
<div class="card-body">
<table class="table table-striped table-hover" id="unapplied_payments">
<thead>
<tr>
<th>ID</th>
<th>Date Paid</th>
<th>Account</th>
<th>Method</th>
<th class="text-right">Total</th>
<th class="text-right">Balance</th>
<th>Invoices</th>
</tr>
</thead>
<tbody>
@foreach(\App\Models\Payment::active()->unapplied()->with(['account.user','checkout','items'])->get() as $o)
@if (! $o->balance) @continue @endif
<tr>
<td><a href="{{ url('a/payment/addedit',$o->id) }}">{{ $o->id }}</td>
<td>{{ $o->paid_at->format('Y-m-d') }}</td>
<td>{{ $o->account->name }}</td>
<td>{{ $o->checkout->name }}</td>
<td class="text-right">{{ number_format($o->total_amt,2) }}</td>
<td class="text-right">{{ number_format($o->balance,2) }}</td>
<td>{!! $o->items->pluck('invoice_id')->map(function($item) { return sprintf('<a href="%s">%d</a>',url('u/invoice',$item),$item); })->join(', ') !!}</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection
@section('page-scripts')
@css(datatables,bootstrap4)
@js(datatables,bootstrap4)
<script type="text/javascript">
$(document).ready(function() {
$('#unapplied_payments').DataTable( {
order: [1,'desc'],
});
});
</script>
@append