2024-08-10 00:14:47 +00:00
|
|
|
@use(App\Models\Payment)
|
|
|
|
|
2021-07-23 07:25:26 +00:00
|
|
|
@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">
|
2024-08-10 00:14:47 +00:00
|
|
|
<div class="col">
|
2021-07-23 07:25:26 +00:00
|
|
|
<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>
|
2024-08-10 00:14:47 +00:00
|
|
|
@foreach(Payment::active()->unapplied()->with(['account.user','checkout','items'])->get() as $o)
|
|
|
|
@continue(! $o->balance)
|
2021-07-23 07:25:26 +00:00
|
|
|
<tr>
|
2024-08-10 00:14:47 +00:00
|
|
|
<td><a href="{{ url('r/payment',$o->id) }}">{{ $o->id }}</td>
|
2022-06-13 05:46:38 +00:00
|
|
|
<td>{{ $o->paid_at->format('Y-m-d') }}</td>
|
2021-07-23 07:25:26 +00:00
|
|
|
<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
|
|
|
|
|
2024-08-10 00:14:47 +00:00
|
|
|
@pa(datatables,rowgroup|conditionalpaging)
|
2021-07-23 07:25:26 +00:00
|
|
|
|
2024-08-10 00:14:47 +00:00
|
|
|
@section('page-scripts')
|
2021-07-23 07:25:26 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
2024-08-10 00:14:47 +00:00
|
|
|
$('#unapplied_payments').DataTable({
|
2021-07-23 07:25:26 +00:00
|
|
|
order: [1,'desc'],
|
2024-08-10 00:14:47 +00:00
|
|
|
rowGroup: {
|
|
|
|
dataSrc: 2,
|
|
|
|
},
|
|
|
|
conditionalPaging: true,
|
2021-07-23 07:25:26 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@append
|