2015-03-16 22:45:25 +01:00
|
|
|
@extends('public.header')
|
|
|
|
|
|
|
|
@section('head')
|
|
|
|
@parent
|
|
|
|
|
|
|
|
@include('script')
|
|
|
|
|
|
|
|
<script src="{{ asset('js/pdf_viewer.js') }}" type="text/javascript"></script>
|
|
|
|
<script src="{{ asset('js/compatibility.js') }}" type="text/javascript"></script>
|
|
|
|
|
2015-04-27 14:28:40 +02:00
|
|
|
@if ($invoice->client->account->utf8_invoices)
|
|
|
|
<script src="{{ asset('vendor/pdfmake/build/pdfmake.min.js') }}" type="text/javascript"></script>
|
|
|
|
<script src="{{ asset('js/vfs_fonts.js') }}" type="text/javascript"></script>
|
|
|
|
@endif
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
<style type="text/css">
|
|
|
|
body {
|
|
|
|
background-color: #f8f8f8;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
@stop
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
|
|
|
|
<div class="container">
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
<div class="pull-right" style="text-align:right">
|
|
|
|
@if ($invoice->is_quote)
|
2015-04-02 15:06:16 +02:00
|
|
|
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@if (!$isConverted)
|
2015-04-13 14:00:31 +02:00
|
|
|
{!! Button::success(trans('texts.approve'))->asLinkTo('/approve/' . $invitation->invitation_key)->large() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
|
|
|
@elseif ($invoice->client->account->isGatewayConfigured() && !$invoice->isPaid() && !$invoice->is_recurring)
|
2015-04-06 02:32:23 +02:00
|
|
|
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
|
2015-04-15 18:35:41 +02:00
|
|
|
@if (count($paymentTypes) > 1)
|
|
|
|
{!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@else
|
2015-04-15 18:35:41 +02:00
|
|
|
{!! Button::success(trans('texts.pay_now'))->asLinkTo('/payment/' . $invitation->invitation_key)->large() !!}
|
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
@else
|
2015-04-13 14:00:31 +02:00
|
|
|
{!! Button::normal('Download PDF')->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="clearfix"></div><p> </p>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
2015-03-31 19:42:37 +02:00
|
|
|
window.invoice = {!! $invoice->toJson() !!};
|
2015-03-16 22:45:25 +01:00
|
|
|
invoice.is_pro = {{ $invoice->client->account->isPro() ? 'true' : 'false' }};
|
|
|
|
invoice.is_quote = {{ $invoice->is_quote ? 'true' : 'false' }};
|
2015-03-31 19:42:37 +02:00
|
|
|
invoice.contact = {!! $contact->toJson() !!};
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2015-04-14 13:07:50 +02:00
|
|
|
function getPDFString(cb) {
|
2015-04-27 14:28:40 +02:00
|
|
|
doc = generatePDF(invoice, invoice.invoice_design.javascript);
|
|
|
|
doc.getDataUrl(cb);
|
2015-03-16 22:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
$(function() {
|
|
|
|
refreshPDF();
|
|
|
|
});
|
|
|
|
|
|
|
|
function onDownloadClick() {
|
|
|
|
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
|
2015-04-27 14:28:40 +02:00
|
|
|
var fileName = invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice;
|
2015-03-16 22:45:25 +01:00
|
|
|
doc.save(fileName + '-' + invoice.invoice_number + '.pdf');
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
@include('invoices.pdf', ['account' => $invoice->client->account])
|
|
|
|
|
|
|
|
<p> </p>
|
|
|
|
<p> </p>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2015-03-27 10:32:45 +01:00
|
|
|
@stop
|