Updates to invoice

This commit is contained in:
Deon George 2019-06-08 22:33:03 +10:00
parent d8b9bb9188
commit c45f5136fe
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
5 changed files with 63 additions and 51 deletions

View File

@ -11,7 +11,7 @@
"php": "^7.1.3",
"acacha/user": "^0.2.2",
"barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-snappy": "^0.4.1",
"barryvdh/laravel-snappy": "^0.4.4",
"clarkeash/doorman": "^2.0",
"creativeorange/gravatar": "^1.0",
"doctrine/dbal": "^2.9",

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "8825756d6702446213ff7c7dd0beee21",
"content-hash": "811c846e37c98427b477d58a8e8ded48",
"packages": [
{
"name": "acacha/user",

View File

@ -49,12 +49,22 @@
<strong>Account:</strong> {{ $o->account->account_id }}
</address>
</div>
{{-- col-sm-offset-2 not working here --}}
<div class="col-sm-1"></div>
<div class="col-sm-4 invoice-col">
Invoice <strong>{{ $o->invoice_id }}</strong><br>
<br>
Payment Due: <strong>{{ $o->due_date->format('Y-m-d') }}</strong><br>
Total: <strong>${{ number_format($o->total,$o->currency()->rounding) }}</strong>
<div class="col-md-3 invoice-col">
<table class="table table-borderless text-right" style="font-size: 1.1rem;">
<tr >
<td class="p-0">Invoice:</td><td class="p-0"><strong>{{ $o->invoice_id }}</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:</td><td class="p-0"><strong>${{ number_format($o->total,$o->currency()->rounding) }}</strong></td>
</tr>
</table>
</div>
</div>
<!-- /.row -->
@ -62,7 +72,7 @@
<!-- Table row -->
<div class="row">
<div class="col-12 table-responsive">
<table id="restripe" class="table table-striped" width="100%">
<table id="restripe" class="table table-borderless table-striped" width="100%">
<thead>
<tr>
<th>Qty</th>
@ -77,11 +87,10 @@
<td>{{ $po->count }}</td>
<td>{{ $po->product_id }}</td>
<td colspan="2">{{ $po->name($o->account->user->language) }}</td>
<td colspan="2">&nbsp;</td>
<td class="text-right">${{ number_format($o->items->filter(function($item) use ($po) {return $item->product_id == $po->id; })->sum('total'),$o->currency()->rounding) }}</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 @if($o->products()->count() > 1) visible-print @endif d-none">
<tr id="invoice-service-items" class="invoice-services d-none @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>&nbsp;</td>
@ -89,7 +98,7 @@
<td>&nbsp;</td>
</tr>
@foreach ($o->product_service_items($po,$so) as $io)
<tr class="invoice-service-items visible-print d-none">
<tr class="invoice-service-items d-none d-print-table-row">
<td colspan="2">&nbsp;</td>
<td width="5%">&nbsp;</td>
<td>{{ $io->item_type_name }}</td>
@ -123,45 +132,43 @@
</div>
<!-- /.col -->
<div class="col-6">
<div class="table-responsive">
<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>
</tr>
<tr>
<th>&nbsp;</th>
<th>Tax (GST 10%)</th>
<td class="text-right">${{ number_format($o->tax_total,$o->currency()->rounding) }}</td>
</tr>
<tr>
<th>&nbsp;</th>
<th>Other Charges:</th>
<td class="text-right">$0.00</td>
</tr>
<tr>
<th colspan="2">Total:</th>
<td class="text-right">${{ number_format($o->total,$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">Account Due:</th>
<td class="text-right">${{ number_format($o->due,$o->currency()->rounding) }}</td>
</tr>
</table>
</div>
<div class="offset-2 col-4 table-responsive">
<table class="table table-borderless">
<tr>
<th colspan="2" style="width:50%">Subtotal:</th>
<td class="text-right">${{ number_format($o->sub_total,$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>
</tr>
<tr>
<th>&nbsp;</th>
<th>Other Charges:</th>
<td class="text-right">$0.00</td>
</tr>
<tr>
<th colspan="2">Total:</th>
<td class="text-right">${{ number_format($o->total,$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">Account Due:</th>
<td class="text-right">${{ number_format($o->due,$o->currency()->rounding) }}</td>
</tr>
</table>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<!-- this row will not appear when printing -->
<div class="row no-print">
<div class="row d-print-none">
<div class="col-12">
<a href="javascript:window.print();" target="_blank" class="btn btn-default"><i class="fa fa-print"></i> Print</a>
<button type="button" class="btn btn-success pull-right"><i class="fa fa-credit-card"></i> Submit Payment</button>
@ -172,6 +179,8 @@
</div>
</div>
<!-- /.content -->
<div class="clearfix"></div>
@endsection
@section('page-scripts')
@ -187,7 +196,7 @@
$(document).ready(function() {
$("table#restripe").removeClass("table-striped");
$("table#restripe tr:not(.visible-print)").each(function (index) {
$("table#restripe tr:not(.d-print-table-row)").each(function (index) {
$(this).toggleClass("stripe-odd", (index & 1));
$(this).toggleClass("stripe-even", !!(index & 1));
});

View File

@ -303,7 +303,7 @@
dataType: "html",
cache: true,
url: '{{ url('product_info') }}'+'/'+$(this).val(),
timeout: 3000,
timeout: 5000,
error: function(x) {
alert("Failed to submit");
},
@ -318,7 +318,7 @@
dataType: "html",
cache: true,
url: '{{ url('product_order') }}'+'/'+$(this).val(),
timeout: 3000,
timeout: 5000,
error: function(x) {
alert("Failed to submit");
},

View File

@ -12,7 +12,7 @@
<td class="text-right">${{ is_numeric($o->setup_cost) ? number_format($o->setup_cost,2) : $o->setup_cost }}</td>
</tr>
<tr>
<th>Cost</th>
<th>Cost <sup>+</sup></th>
<td class="text-right">${{ is_numeric($o->default_cost) ? number_format($o->default_cost,2) : $o->default_cost }}</td>
</tr>
<tr>
@ -24,11 +24,14 @@
<td class="text-right">{{ $o->contract_term }} mths</td>
</tr>
<tr>
<th>Minimum Costs <sup>*</sup></th>
<th>Minimum Costs <sup>+*</sup></th>
<td class="text-right">${{ is_numeric($o->minimum_cost) ? number_format($o->minimum_cost,2) : $o->minimum_cost }}</td>
</tr>
<tfoot>
<tr><td colspan="2"><sup>* Additional setup charges may apply for complex installations.</sup></td></tr>
<tr><td colspan="2"><sup>
* Additional setup charges may apply for complex installations.<br>
+ Additional charges may apply for regional installations.
</sup></td></tr>
</tfoot>
</table>