Minor fix for invoice

This commit is contained in:
Deon George 2019-06-07 23:47:37 +10:00
parent 78d55fb423
commit d8b9bb9188
No known key found for this signature in database
GPG Key ID: 7670E8DC27415254
2 changed files with 45 additions and 85 deletions

View File

@ -60,7 +60,6 @@ class EzypayImport extends Command
{ {
$this->info(sprintf('Ignoring INACTIVE: [%s] %s %s',$c->EzypayReferenceNumber,$c->Firstname,$c->Surname)); $this->info(sprintf('Ignoring INACTIVE: [%s] %s %s',$c->EzypayReferenceNumber,$c->Firstname,$c->Surname));
continue; continue;
} }
// Load Account Details from ReferenceId // Load Account Details from ReferenceId
@ -114,4 +113,4 @@ class EzypayImport extends Command
} }
} }
} }

View File

@ -5,7 +5,7 @@
@endsection @endsection
@section('contentheader_title') @section('contentheader_title')
Invoice # Invoice #{{ $o->id }}
@endsection @endsection
@section('contentheader_description') @section('contentheader_description')
{{ $o->invoice_account_id }} {{ $o->invoice_account_id }}
@ -13,112 +13,75 @@
@section('main-content') @section('main-content')
<!-- Main content --> <!-- Main content -->
<section class="invoice"> <div class="invoice p-3 mb-3">
<!-- title row --> <!-- title row -->
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-12">
<h2 class="page-header"> <h4>
<i class="fa fa-globe"></i> {{ $so->site_name }} <i class="fa fa-globe"></i> {{ $so->site_name }}
<small class="pull-right">Date: {{ $o->invoice_date}}</small> <small class="pull-right">Date: {{ $o->invoice_date}}</small>
</h2> </h4>
</div> </div>
<!-- /.col --> <!-- /.col -->
</div> </div>
<!-- info row --> <!-- info row -->
<div class="row invoice-info"> <div class="row invoice-info">
<div class="col-sm-3 invoice-col"> <div class="col-sm-4 invoice-col">
<table class="table-condensed"> FROM:
<tr> <address>
<th>FROM:</th> <strong>{{ $so->site_name }}</strong><br>
<td><strong>{{ $so->site_name }}</strong></td> {!! $so->address('html') !!}<br>
</tr> <strong>Email:</strong> {{ $so->site_email }}<br>
<tr> <strong>Phone:</strong> {{ $so->site_phone }}
<td>&nbsp;</td> </address>
<td>{!! $so->address('html') !!}</td>
</tr>
<tr>
<th>Phone</th>
<td>{{ $so->site_phone }}</td>
</tr>
<tr>
<th>Email</th>
<td>{{ $so->site_email }}</td>
</tr>
</table>
</div> </div>
<div class="col-md-offset-1 col-sm-3 invoice-col"> <div class="col-sm-4 invoice-col">
<table class="table table-condensed"> TO:
<tr> <address>
<th>TO:</th> <strong>{{ $o->account->company }}</strong><br>
<td><strong>{{ $o->account->company }}</strong></td> {!! $o->account->address('html') !!}<br>
</tr> <strong>Email:</strong> {{ $o->account->email }}<br>
<tr> @if ($o->account->phone)
<td>&nbsp;</td> <strong>Phone:</strong> {{ $o->account->phone }}<br>
<td>{!! $o->account->address('html') !!}</td> @endif
</tr> <strong>Account:</strong> {{ $o->account->account_id }}
<tr> </address>
@if ($o->account->phone)
<th>Phone</th>
<td>{{ $so->site_phone }}</td>
@else
<td colspan="2>">&nbsp;</td>
@endif
</tr>
<tr>
<th>Email</th>
<td>{{ $o->account->email }}</td>
</tr>
<tr>
<th>Account</th>
<td>{{ $o->account->account_id }}</td>
</tr>
</table>
</div> </div>
<div class="col-md-offset-2 col-sm-3 invoice-col"> <div class="col-sm-4 invoice-col">
<table class="table table-condensed"> Invoice <strong>{{ $o->invoice_id }}</strong><br>
<tr> <br>
<th class="lead">Invoice #</th> Payment Due: <strong>{{ $o->due_date->format('Y-m-d') }}</strong><br>
<td class="lead text-right"><strong>{{ $o->invoice_id }}</strong></td> Total: <strong>${{ number_format($o->total,$o->currency()->rounding) }}</strong>
</tr>
<tr>
<th class="lead">Payment Due</th>
<td class="lead text-right"><strong>{{ $o->due_date->format('Y-m-d') }}</strong></td>
</tr>
<tr>
<th class="lead">Total</th>
<td class="lead text-right"><strong>${{ number_format($o->total,$o->currency()->rounding) }}</strong></td>
</tr>
</table>
</div> </div>
</div> </div>
<!-- /.row --> <!-- /.row -->
<!-- Table row --> <!-- Table row -->
<div class="row"> <div class="row">
<div class="col-xs-12 table-responsive"> <div class="col-12 table-responsive">
<table id="restripe" class="table table-bordered table-striped" width="100%"> <table id="restripe" class="table table-striped" width="100%">
<thead> <thead>
<tr> <tr>
<th class="col-sm-1 text-right">Qty</th> <th>Qty</th>
<th class="col-sm-1">Product</th> <th>Product</th>
<th class="col-sm-8" colspan="2">Description</th> <th colspan="2">Description</th>
<th class="col-sm-2 text-right" colspan="3">Subtotal</th> <th class="text-right" colspan="3">Subtotal</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach ($o->products() as $po) @foreach ($o->products() as $po)
<tr id="invoice-services"> <tr id="invoice-services">
<td class="text-right">{{ $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="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 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"> <tr id="invoice-service-items" class="invoice-services @if($o->products()->count() > 1) visible-print @endif d-none">
<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>
@ -126,7 +89,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"> <tr class="invoice-service-items visible-print d-none">
<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>
@ -145,7 +108,7 @@
<div class="row"> <div class="row">
<!-- accepted payments column --> <!-- accepted payments column -->
<div class="col-xs-6"> <div class="col-6">
<p class="lead">Payment Methods:</p> <p class="lead">Payment Methods:</p>
{{-- {{--
<img src="../../dist/img/credit/visa.png" alt="Visa"> <img src="../../dist/img/credit/visa.png" alt="Visa">
@ -160,7 +123,7 @@
</div> </div>
<!-- /.col --> <!-- /.col -->
<div class="col-xs-offset-2 col-xs-4"> <div class="col-6">
<div class="table-responsive"> <div class="table-responsive">
<table class="table"> <table class="table">
<tr> <tr>
@ -199,7 +162,7 @@
<!-- this row will not appear when printing --> <!-- this row will not appear when printing -->
<div class="row no-print"> <div class="row no-print">
<div class="col-xs-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>
<a href="{{ url(sprintf('u/invoice/%s/pdf',$o->id)) }}" class="btn btn-primary pull-right" style="margin-right: 5px;"> <a href="{{ url(sprintf('u/invoice/%s/pdf',$o->id)) }}" class="btn btn-primary pull-right" style="margin-right: 5px;">
@ -207,10 +170,8 @@
</a> </a>
</div> </div>
</div> </div>
</section> </div>
<!-- /.content --> <!-- /.content -->
<div class="clearfix"></div>
@endsection @endsection
@section('page-scripts') @section('page-scripts')
@ -232,11 +193,11 @@
}); });
$('tr[id="invoice-services"]').click(function() { $('tr[id="invoice-services"]').click(function() {
$(".invoice-services").toggleClass("visible-print"); $(".invoice-services").toggleClass("d-none");
}); });
$('tr[id="invoice-service-items"]').click(function() { $('tr[id="invoice-service-items"]').click(function() {
$(".invoice-service-items").toggleClass("visible-print"); $(".invoice-service-items").toggleClass("d-none");
}); });
}) })
</script> </script>