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", "php": "^7.1.3",
"acacha/user": "^0.2.2", "acacha/user": "^0.2.2",
"barryvdh/laravel-debugbar": "^3.2", "barryvdh/laravel-debugbar": "^3.2",
"barryvdh/laravel-snappy": "^0.4.1", "barryvdh/laravel-snappy": "^0.4.4",
"clarkeash/doorman": "^2.0", "clarkeash/doorman": "^2.0",
"creativeorange/gravatar": "^1.0", "creativeorange/gravatar": "^1.0",
"doctrine/dbal": "^2.9", "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", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "8825756d6702446213ff7c7dd0beee21", "content-hash": "811c846e37c98427b477d58a8e8ded48",
"packages": [ "packages": [
{ {
"name": "acacha/user", "name": "acacha/user",

View File

@ -49,12 +49,22 @@
<strong>Account:</strong> {{ $o->account->account_id }} <strong>Account:</strong> {{ $o->account->account_id }}
</address> </address>
</div> </div>
{{-- col-sm-offset-2 not working here --}}
<div class="col-sm-1"></div>
<div class="col-sm-4 invoice-col"> <div class="col-md-3 invoice-col">
Invoice <strong>{{ $o->invoice_id }}</strong><br> <table class="table table-borderless text-right" style="font-size: 1.1rem;">
<br> <tr >
Payment Due: <strong>{{ $o->due_date->format('Y-m-d') }}</strong><br> <td class="p-0">Invoice:</td><td class="p-0"><strong>{{ $o->invoice_id }}</strong></td>
Total: <strong>${{ number_format($o->total,$o->currency()->rounding) }}</strong> </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>
</div> </div>
<!-- /.row --> <!-- /.row -->
@ -62,7 +72,7 @@
<!-- Table row --> <!-- Table row -->
<div class="row"> <div class="row">
<div class="col-12 table-responsive"> <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> <thead>
<tr> <tr>
<th>Qty</th> <th>Qty</th>
@ -77,11 +87,10 @@
<td>{{ $po->count }}</td> <td>{{ $po->count }}</td>
<td>{{ $po->product_id }}</td> <td>{{ $po->product_id }}</td>
<td colspan="2">{{ $po->name($o->account->user->language) }}</td> <td colspan="2">{{ $po->name($o->account->user->language) }}</td>
<td colspan="2">&nbsp;</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>
<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>
</tr> </tr>
@foreach ($o->product_services($po) as $so) @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">&nbsp;</td>
<td colspan="2">Service: <strong>{{ $so->service_id }}: {{ $so->name }}</strong></td> <td colspan="2">Service: <strong>{{ $so->service_id }}: {{ $so->name }}</strong></td>
<td>&nbsp;</td> <td>&nbsp;</td>
@ -89,7 +98,7 @@
<td>&nbsp;</td> <td>&nbsp;</td>
</tr> </tr>
@foreach ($o->product_service_items($po,$so) as $io) @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 colspan="2">&nbsp;</td>
<td width="5%">&nbsp;</td> <td width="5%">&nbsp;</td>
<td>{{ $io->item_type_name }}</td> <td>{{ $io->item_type_name }}</td>
@ -123,9 +132,8 @@
</div> </div>
<!-- /.col --> <!-- /.col -->
<div class="col-6"> <div class="offset-2 col-4 table-responsive">
<div class="table-responsive"> <table class="table table-borderless">
<table class="table">
<tr> <tr>
<th colspan="2" style="width:50%">Subtotal:</th> <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->sub_total,$o->currency()->rounding) }}</td>
@ -155,13 +163,12 @@
</tr> </tr>
</table> </table>
</div> </div>
</div>
<!-- /.col --> <!-- /.col -->
</div> </div>
<!-- /.row --> <!-- /.row -->
<!-- this row will not appear when printing --> <!-- this row will not appear when printing -->
<div class="row no-print"> <div class="row d-print-none">
<div class="col-12"> <div class="col-12">
<a href="javascript:window.print();" target="_blank" class="btn btn-default"><i class="fa fa-print"></i> Print</a> <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> <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>
</div> </div>
<!-- /.content --> <!-- /.content -->
<div class="clearfix"></div>
@endsection @endsection
@section('page-scripts') @section('page-scripts')
@ -187,7 +196,7 @@
$(document).ready(function() { $(document).ready(function() {
$("table#restripe").removeClass("table-striped"); $("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-odd", (index & 1));
$(this).toggleClass("stripe-even", !!(index & 1)); $(this).toggleClass("stripe-even", !!(index & 1));
}); });

View File

@ -303,7 +303,7 @@
dataType: "html", dataType: "html",
cache: true, cache: true,
url: '{{ url('product_info') }}'+'/'+$(this).val(), url: '{{ url('product_info') }}'+'/'+$(this).val(),
timeout: 3000, timeout: 5000,
error: function(x) { error: function(x) {
alert("Failed to submit"); alert("Failed to submit");
}, },
@ -318,7 +318,7 @@
dataType: "html", dataType: "html",
cache: true, cache: true,
url: '{{ url('product_order') }}'+'/'+$(this).val(), url: '{{ url('product_order') }}'+'/'+$(this).val(),
timeout: 3000, timeout: 5000,
error: function(x) { error: function(x) {
alert("Failed to submit"); 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> <td class="text-right">${{ is_numeric($o->setup_cost) ? number_format($o->setup_cost,2) : $o->setup_cost }}</td>
</tr> </tr>
<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> <td class="text-right">${{ is_numeric($o->default_cost) ? number_format($o->default_cost,2) : $o->default_cost }}</td>
</tr> </tr>
<tr> <tr>
@ -24,11 +24,14 @@
<td class="text-right">{{ $o->contract_term }} mths</td> <td class="text-right">{{ $o->contract_term }} mths</td>
</tr> </tr>
<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> <td class="text-right">${{ is_numeric($o->minimum_cost) ? number_format($o->minimum_cost,2) : $o->minimum_cost }}</td>
</tr> </tr>
<tfoot> <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> </tfoot>
</table> </table>