2017-09-14 22:21:00 +03:00
|
|
|
@extends('layouts.customer')
|
|
|
|
|
|
|
|
@section('title', trans_choice('general.invoices', 1) . ': ' . $invoice->invoice_number)
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
<div class="box box-success">
|
|
|
|
<section class="invoice">
|
|
|
|
<span class="badge bg-aqua">{{ $invoice->status->name }}</span>
|
|
|
|
|
|
|
|
<div class="row invoice-header">
|
|
|
|
<div class="col-xs-7">
|
|
|
|
@if (setting('general.invoice_logo'))
|
2018-03-06 17:44:44 +03:00
|
|
|
<img src="{{ Storage::url(setting('general.invoice_logo')) }}" class="invoice-logo" />
|
|
|
|
@elseif (setting('general.company_logo'))
|
|
|
|
<img src="{{ Storage::url(setting('general.company_logo')) }}" class="invoice-logo" />
|
2017-09-14 22:21:00 +03:00
|
|
|
@else
|
2018-03-06 17:44:44 +03:00
|
|
|
<img src="{{ asset('public/img/company.png') }}" class="invoice-logo" />
|
2017-09-14 22:21:00 +03:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-5 invoice-company">
|
|
|
|
<address>
|
|
|
|
<strong>{{ setting('general.company_name') }}</strong><br>
|
|
|
|
{{ setting('general.company_address') }}<br>
|
|
|
|
@if (setting('general.company_tax_number'))
|
|
|
|
{{ trans('general.tax_number') }}: {{ setting('general.company_tax_number') }}<br>
|
|
|
|
@endif
|
|
|
|
<br>
|
|
|
|
@if (setting('general.company_phone'))
|
|
|
|
{{ setting('general.company_phone') }}<br>
|
|
|
|
@endif
|
|
|
|
{{ setting('general.company_email') }}
|
|
|
|
</address>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-7">
|
|
|
|
{{ trans('invoices.bill_to') }}
|
|
|
|
<address>
|
|
|
|
<strong>{{ $invoice->customer_name }}</strong><br>
|
|
|
|
{{ $invoice->customer_address }}<br>
|
|
|
|
@if ($invoice->customer_tax_number)
|
|
|
|
{{ trans('general.tax_number') }}: {{ $invoice->customer_tax_number }}<br>
|
|
|
|
@endif
|
|
|
|
<br>
|
|
|
|
@if ($invoice->customer_phone)
|
|
|
|
{{ $invoice->customer_phone }}<br>
|
|
|
|
@endif
|
|
|
|
{{ $invoice->customer_email }}
|
|
|
|
</address>
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-5">
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table no-border">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans('invoices.invoice_number') }}:</th>
|
|
|
|
<td class="text-right">{{ $invoice->invoice_number }}</td>
|
|
|
|
</tr>
|
|
|
|
@if ($invoice->order_number)
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans('invoices.order_number') }}:</th>
|
|
|
|
<td class="text-right">{{ $invoice->order_number }}</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans('invoices.invoice_date') }}:</th>
|
|
|
|
<td class="text-right">{{ Date::parse($invoice->invoiced_at)->format($date_format) }}</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans('invoices.payment_due') }}:</th>
|
|
|
|
<td class="text-right">{{ Date::parse($invoice->due_at)->format($date_format) }}</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12 table-responsive">
|
|
|
|
<table class="table table-striped">
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans_choice('general.items', 1) }}</th>
|
|
|
|
<th class="text-center">{{ trans('invoices.quantity') }}</th>
|
|
|
|
<th class="text-right">{{ trans('invoices.price') }}</th>
|
|
|
|
<th class="text-right">{{ trans('invoices.total') }}</th>
|
|
|
|
</tr>
|
|
|
|
@foreach($invoice->items as $item)
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
{{ $item->name }}
|
|
|
|
@if ($item->sku)
|
|
|
|
<br><small>{{ trans('items.sku') }}: {{ $item->sku }}</small>
|
|
|
|
@endif
|
|
|
|
</td>
|
|
|
|
<td class="text-center">{{ $item->quantity }}</td>
|
|
|
|
<td class="text-right">@money($item->price, $invoice->currency_code, true)</td>
|
2018-03-06 17:44:44 +03:00
|
|
|
<td class="text-right">@money($item->total, $invoice->currency_code, true)</td>
|
2017-09-14 22:21:00 +03:00
|
|
|
</tr>
|
|
|
|
@endforeach
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-7">
|
|
|
|
@if ($invoice->notes)
|
|
|
|
<p class="lead">{{ trans_choice('general.notes', 2) }}</p>
|
|
|
|
|
|
|
|
<p class="text-muted well well-sm no-shadow" style="margin-top: 10px;">
|
|
|
|
{{ $invoice->notes }}
|
|
|
|
</p>
|
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
<div class="col-xs-5">
|
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table">
|
|
|
|
<tbody>
|
2018-03-06 17:44:44 +03:00
|
|
|
@foreach($invoice->totals as $total)
|
|
|
|
@if($total->code != 'total')
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans($total['name']) }}:</th>
|
|
|
|
<td class="text-right">@money($total->amount, $invoice->currency_code, true)</td>
|
|
|
|
</tr>
|
|
|
|
@else
|
|
|
|
@if ($invoice->paid)
|
|
|
|
<tr class="text-success">
|
|
|
|
<th>{{ trans('invoices.paid') }}:</th>
|
|
|
|
<td class="text-right">- @money($invoice->paid, $invoice->currency_code, true)</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
<tr>
|
|
|
|
<th>{{ trans($total['name']) }}:</th>
|
|
|
|
<td class="text-right">@money($total->amount - $invoice->paid, $invoice->currency_code, true)</td>
|
|
|
|
</tr>
|
|
|
|
@endif
|
|
|
|
@endforeach
|
2017-09-14 22:21:00 +03:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="box-footer row no-print">
|
2017-11-29 17:17:21 +03:00
|
|
|
<div class="col-md-10">
|
2018-03-06 17:44:44 +03:00
|
|
|
<a href="{{ url('customers/invoices/' . $invoice->id . '/print') }}" target="_blank" class="btn btn-default">
|
2017-09-14 22:21:00 +03:00
|
|
|
<i class="fa fa-print"></i> {{ trans('general.print') }}
|
|
|
|
</a>
|
2018-03-06 17:44:44 +03:00
|
|
|
<a href="{{ url('customers/invoices/' . $invoice->id . '/pdf') }}" class="btn btn-default" data-toggle="tooltip" title="{{ trans('invoices.download_pdf') }}">
|
2017-09-14 22:21:00 +03:00
|
|
|
<i class="fa fa-file-pdf-o"></i> {{ trans('general.download') }}
|
2017-11-17 02:08:31 +03:00
|
|
|
</a>
|
2017-11-29 17:17:21 +03:00
|
|
|
</div>
|
2017-11-17 02:08:31 +03:00
|
|
|
|
2017-11-29 17:17:21 +03:00
|
|
|
<div class="col-md-2 no-padding-right">
|
2017-11-18 16:57:55 +03:00
|
|
|
@if($invoice->invoice_status_code != 'paid')
|
|
|
|
@if ($payment_methods)
|
2017-11-29 17:17:21 +03:00
|
|
|
{!! Form::select('payment_method', $payment_methods, null, array_merge(['id' => 'payment-method', 'class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)])])) !!}
|
|
|
|
{!! Form::hidden('invoice_id', $invoice->id, []) !!}
|
2017-11-18 16:57:55 +03:00
|
|
|
@else
|
2017-11-18 15:23:20 +03:00
|
|
|
|
2017-11-18 16:57:55 +03:00
|
|
|
@endif
|
2017-11-18 15:23:20 +03:00
|
|
|
@endif
|
2017-09-14 22:21:00 +03:00
|
|
|
</div>
|
2017-11-18 16:57:55 +03:00
|
|
|
<div id="confirm" class="col-md-12"></div>
|
2017-09-14 22:21:00 +03:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</div>
|
|
|
|
@endsection
|
|
|
|
|
2017-11-13 21:55:15 +03:00
|
|
|
@push('scripts')
|
2017-09-14 22:21:00 +03:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function(){
|
2017-11-18 15:23:20 +03:00
|
|
|
$(document).on('change', '#payment-method', function (e) {
|
2017-11-19 02:52:01 +03:00
|
|
|
var payment_method = $(this).val();
|
|
|
|
|
|
|
|
gateway = payment_method.split('.');
|
|
|
|
|
2017-09-14 22:21:00 +03:00
|
|
|
$.ajax({
|
2017-11-19 02:52:01 +03:00
|
|
|
url: '{{ url("customers/invoices/" . $invoice->id) }}/' + gateway[0],
|
|
|
|
type: 'GET',
|
2017-09-14 22:21:00 +03:00
|
|
|
dataType: 'JSON',
|
2017-11-17 02:08:31 +03:00
|
|
|
data: $('.box-footer input, .box-footer select'),
|
|
|
|
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
|
|
|
|
beforeSend: function() {
|
2017-11-29 17:17:21 +03:00
|
|
|
$('#confirm').html('');
|
|
|
|
|
2017-11-18 16:57:55 +03:00
|
|
|
$('#confirm').append('<div id="loading" class="text-center"><i class="fa fa-spinner fa-spin fa-5x checkout-spin"></i></div>');
|
2017-11-17 02:08:31 +03:00
|
|
|
},
|
|
|
|
complete: function() {
|
|
|
|
$('#loading').remove();
|
|
|
|
},
|
2017-09-14 22:21:00 +03:00
|
|
|
success: function(data) {
|
2017-11-29 17:17:21 +03:00
|
|
|
if (data['error']) {
|
2017-11-18 16:57:55 +03:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data['redirect']) {
|
|
|
|
location = data['redirect'];
|
|
|
|
}
|
2017-09-14 22:21:00 +03:00
|
|
|
|
2017-11-18 16:57:55 +03:00
|
|
|
if (data['html']) {
|
|
|
|
$('#confirm').append(data['html']);
|
|
|
|
}
|
2017-11-17 02:08:31 +03:00
|
|
|
},
|
|
|
|
error: function(data){
|
2017-09-14 22:21:00 +03:00
|
|
|
|
|
|
|
}
|
2017-11-17 02:08:31 +03:00
|
|
|
});
|
2017-09-14 22:21:00 +03:00
|
|
|
});
|
2017-11-17 02:08:31 +03:00
|
|
|
});
|
2017-09-14 22:21:00 +03:00
|
|
|
</script>
|
2017-11-13 21:55:15 +03:00
|
|
|
@endpush
|