osb/resources/theme/backend/adminlte/u/invoice.blade.php
2018-08-09 09:33:51 +10:00

243 lines
7.1 KiB
PHP

@extends('adminlte::layouts.app')
@section('htmlheader_title')
Invoice #{{ $o->id }}
@endsection
@section('contentheader_title')
Invoice #
@endsection
@section('contentheader_description')
{{ $o->invoice_account_id }}
@endsection
@section('main-content')
<!-- Main content -->
<section class="invoice">
<!-- title row -->
<div class="row">
<div class="col-xs-12">
<h2 class="page-header">
<i class="fa fa-globe"></i> {{ $so->site_name }}
<small class="pull-right">Date: {{ $o->invoice_date}}</small>
</h2>
</div>
<!-- /.col -->
</div>
<!-- info row -->
<div class="row invoice-info">
<div class="col-sm-3 invoice-col">
<table class="table-condensed">
<tr>
<th>FROM:</th>
<td><strong>{{ $so->site_name }}</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
<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 class="col-md-offset-1 col-sm-3 invoice-col">
<table class="table table-condensed">
<tr>
<th>TO:</th>
<td><strong>{{ $o->account->company }}</strong></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>{!! $o->account->address('html') !!}</td>
</tr>
<tr>
@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 class="col-md-offset-2 col-sm-3 invoice-col">
<table class="table table-condensed">
<tr>
<th class="lead">Invoice #</th>
<td class="lead text-right"><strong>{{ $o->invoice_id }}</strong></td>
</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>
<!-- /.row -->
<!-- Table row -->
<div class="row">
<div class="col-xs-12 table-responsive">
<table id="restripe" class="table table-bordered table-striped" width="100%">
<thead>
<tr>
<th class="col-sm-1 text-right">Qty</th>
<th class="col-sm-1">Product</th>
<th class="col-sm-8" colspan="2">Description</th>
<th class="col-sm-2 text-right" colspan="3">Subtotal</th>
</tr>
</thead>
<tbody>
@foreach ($o->products() as $po)
<tr id="invoice-services">
<td class="text-right">{{ $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>
</tr>
@foreach ($o->product_services($po) as $so)
<tr id="invoice-service-items" class="invoice-services @if($o->products()->count() > 1) visible-print @endif">
<td colspan="2">&nbsp;</td>
<td colspan="2">Service: <strong>{{ $so->service_id }}: {{ $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 visible-print">
<td colspan="2">&nbsp;</td>
<td width="5%">&nbsp;</td>
<td>{{ $io->item_type_name }}</td>
<td class="text-right">${{ number_format($io->total,$o->currency()->rounding) }}</td>
<td colspan="2">&nbsp;</td>
</tr>
@endforeach
@endforeach
@endforeach
</tbody>
</table>
</div>
<!-- /.col -->
</div>
<!-- /.row -->
<div class="row">
<!-- accepted payments column -->
<div class="col-xs-6">
<p class="lead">Payment Methods:</p>
{{--
<img src="../../dist/img/credit/visa.png" alt="Visa">
<img src="../../dist/img/credit/mastercard.png" alt="Mastercard">
<img src="../../dist/img/credit/american-express.png" alt="American Express">
<img src="../../dist/img/credit/paypal2.png" alt="Paypal">
--}}
<p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
{{ $o->invoice_text }}
</p>
</div>
<!-- /.col -->
<div class="col-xs-offset-2 col-xs-4">
<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>
<!-- /.col -->
</div>
<!-- /.row -->
<!-- this row will not appear when printing -->
<div class="row no-print">
<div class="col-xs-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>
<a href="{{ url(sprintf('u/invoice/%s/pdf',$o->id)) }}" class="btn btn-primary pull-right" style="margin-right: 5px;">
<i class="fa fa-download"></i> Download PDF
</a>
</div>
</div>
</section>
<!-- /.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(.visible-print)").each(function (index) {
$(this).toggleClass("stripe-odd", (index & 1));
$(this).toggleClass("stripe-even", !!(index & 1));
});
$('tr[id="invoice-services"]').click(function() {
$(".invoice-services").toggleClass("visible-print");
});
$('tr[id="invoice-service-items"]').click(function() {
$(".invoice-service-items").toggleClass("visible-print");
});
})
</script>
@append