Rework payment tables, enable payment editing
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
@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::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->payment_date->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('//cdn.datatables.net/1.10.25/css/dataTables.bootstrap4.min.css','jq-dt-css')
|
||||
@js('//cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js','jq-dt-js')
|
||||
@js('//cdn.datatables.net/1.10.25/js/dataTables.bootstrap4.min.js','jq-dt-bs5-js','jq-dt-js')
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#unapplied_payments').DataTable( {
|
||||
order: [1,'desc'],
|
||||
orderFixed: [1,'desc']
|
||||
});
|
||||
|
||||
$('#unapplied_payments tbody').on('click','tr', function () {
|
||||
$(this).toggleClass('selected');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
Reference in New Issue
Block a user