Optimise users home page

This commit is contained in:
Deon George
2021-06-29 16:36:34 +10:00
parent 638472fb4f
commit bac4fd6227
34 changed files with 915 additions and 627 deletions

View File

@@ -1,14 +1,16 @@
@extends('adminlte::layouts.app')
@section('htmlheader_title')
Invoice #{{ $o->id }}
Invoice #{{ $o->lid }}
@endsection
@section('page_title')
{{ $o->sid }}
@endsection
@section('contentheader_title')
Invoice #{{ $o->id }}
Tax Invoice <strong>#{{ $o->lid }}</strong>
@endsection
@section('contentheader_description')
{{ $o->invoice_account_id }}
@endsection
@section('main-content')
@@ -16,11 +18,14 @@
<div class="invoice p-3 mb-3">
<!-- title row -->
<div class="row">
<div class="col-12">
<h4>
<i class="fa fa-globe"></i> {{ $so->site_name }}
<small class="float-right">Date: {{ $o->invoice_date}}</small>
</h4>
<div class="col-8">
<h2>
<img src="{{ $so->site_logo }}">
</h2>
</div>
<div class="col-4 text-right">
<h1 class="text-uppercase">Tax Invoice</h1>
</div>
<!-- /.col -->
</div>
@@ -54,17 +59,26 @@
<div class="ml-auto col-3">
<table class="table table-borderless text-right" style="font-size: 1.1rem;">
<tr >
<td class="p-0">Account:</td><td class="p-0"><strong>{{ $o->account->account_id }}</strong></td>
<td class="p-0">Issue Date:</td><td class="p-0"><strong>{{ $o->invoice_date->format('Y-m-d') }}</strong></td>
</tr>
<tr >
<td class="p-0">Invoice:</td><td class="p-0"><strong>{{ $o->invoice_id }}</strong></td>
<td class="p-0">Account:</td><td class="p-0"><strong>{{ $o->account->sid }}</strong></td>
</tr>
<tr >
<td class="p-0">Invoice:</td><td class="p-0"><strong>{{ $o->lid }}</strong></td>
</tr>
<tr>
<td class="p-0">Payment Due:</td><td class="p-0"><strong>{{ $o->due_date->format('Y-m-d') }}</strong></td>
</tr>
<tr>
<td class="p-0">Total Due:</td><td class="p-0"><strong>${{ number_format($o->total,$o->currency()->rounding) }}</strong></td>
<td class="p-0">This Invoice Due:</td><td class="p-0"><strong>${{ number_format($o->total,$o->currency()->rounding) }}</strong></td>
</tr>
{{--
<!-- @todo -->
<tr>
<td class="p-0">Total Account Due:</td><td class="p-0"><strong>${{ number_format($o->account->due,$o->currency()->rounding) }}</strong></td>
</tr>
--}}
</table>
</div>
</div>
@@ -73,7 +87,7 @@
<!-- Table row -->
<div class="row">
<div class="col-12 table-responsive">
<table id="restripe" class="table" width="100%">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>Qty</th>
@@ -87,20 +101,22 @@
@foreach ($o->products() as $po)
<tr id="invoice-services">
<td>{{ $po->count }}</td>
<td>{{ $po->product_id }}</td>
<td>#{{ $po->lid }}</td>
<td colspan="2">{{ $po->name($o->account->user->language) }}</td>
<td colspan="3" class="text-right">${{ number_format($o->items->filter(function($item) use ($po) {return $item->product_id == $po->id; })->sum('total'),$o->currency()->rounding) }}</td>
</tr>
@foreach ($o->product_services($po) as $so)
<tr id="invoice-service-items" class="invoice-services d-none @if($o->products()->count() > 1) d-print-table-row @endif">
<tr id="invoice-service-items" class="invoice-services @if($o->products()->count() > 1) d-print-table-row @endif">
<td colspan="2">&nbsp;</td>
<td colspan="2">Service: <strong>{{ $so->service_id }}: {{ $so->name }}</strong></td>
<td colspan="2">Service: <strong>{{ $so->sid }}: {{ $so->name }}</strong></td>
<td>&nbsp;</td>
<td class="text-right">${{ number_format($o->product_service_items($po,$so)->sum('total'),$o->currency()->rounding) }}</td>
<td>&nbsp;</td>
</tr>
@foreach ($o->product_service_items($po,$so) as $io)
<tr class="invoice-service-items d-none d-print-table-row">
<tr class="invoice-service-items d-print-table-row">
<td colspan="2">&nbsp;</td>
<td width="5%">&nbsp;</td>
<td>{{ $io->item_type_name }}</td>
@@ -117,6 +133,9 @@
</div>
<!-- /.row -->
<!-- padding -->
<div class="row pb-5"></div>
<div class="row">
<!-- accepted payments column -->
<div class="col-6">
@@ -138,16 +157,17 @@
<table class="table">
<tr>
<th colspan="2" style="width:50%">Subtotal:</th>
<td class="text-right">${{ number_format($o->sub_total,$o->currency()->rounding) }}</td>
<td class="text-right">${{ number_format($o->total_sub,$o->currency()->rounding) }}</td>
</tr>
<tr>
<th>&nbsp;</th>
<th>Tax (GST 10%)</th>
<td class="text-right">${{ number_format($o->tax_total,$o->currency()->rounding) }}</td>
<td class="text-right">${{ number_format($o->total_tax,$o->currency()->rounding) }}</td>
</tr>
<tr>
<th>&nbsp;</th>
<th>Other Charges:</th>
<!-- @todo -->
<td class="text-right">$0.00</td>
</tr>
<tr>
@@ -158,23 +178,17 @@
<tr>
<th>&nbsp;</th>
<th>Payments To Clear:</th>
<td class="text-right">${{ number_format($o->pending_paid,$o->currency()->rounding) }}</td>
<td class="text-right">${{ number_format($o->paid_pending,$o->currency()->rounding) }}</td>
</tr>
<tr>
<th>&nbsp;</th>
<th>Payments:</th>
<td class="text-right">${{ number_format($o->paid,$o->currency()->rounding) }}</td>
</tr>
<tr>
<th colspan="2">Invoice Total Due:</th>
<tr style="font-size: 145%">
<th colspan="2">Invoice Due:</th>
<td class="text-right">${{ number_format($o->due,$o->currency()->rounding) }}</td>
</tr>
{{--
<tr>
<th colspan="2">Account Due:</th>
<td class="text-right">${{ number_format($o->account->due,$o->currency()->rounding) }}</td>
</tr>
--}}
@endif
</table>
</div>
@@ -185,13 +199,13 @@
<!-- this row will not appear when printing -->
<div class="row d-print-none">
<div class="col-12">
<a href="javascript:window.print();" class="btn btn-default"><i class="fa fa-print"></i> Print</a>
<a href="javascript:window.print();" class="btn btn-default"><i class="fas fa-print"></i> Print</a>
@if($o->id)
<a href="{{ url('u/invoice/cart',$o->id) }}" class="btn btn-success float-right">
<i class="fa fa-credit-card"></i> Pay
<i class="fas fa-credit-card"></i> Pay
</a>
<a href="{{ url(sprintf('u/invoice/%s/pdf',$o->id)) }}" class="btn btn-primary float-right mr-2">
<i class="fa fa-download"></i> Download PDF
<i class="fas fa-download"></i> Download PDF
</a>
@endif
</div>
@@ -200,33 +214,4 @@
<!-- /.content -->
<div class="clearfix"></div>
@endsection
@section('page-scripts')
<style>
.stripe-odd {
background-color: #f9f9f9;
}
.stripe-even {
background-color: #e9e9e9;
}
</style>
<script>
$(document).ready(function() {
$("table#restripe").removeClass("table-striped");
$("table#restripe tr:not(.d-print-table-row)").each(function (index) {
$(this).toggleClass("stripe-odd", (index & 1));
$(this).toggleClass("stripe-even", !!(index & 1));
});
$('tr[id="invoice-services"]').click(function() {
$(".invoice-services").toggleClass("d-none");
});
$('tr[id="invoice-service-items"]').click(function() {
$(".invoice-service-items").toggleClass("d-none");
});
})
</script>
@append
@endsection