1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 07:02:34 +01:00
invoiceninja/resources/views/invoices/view.blade.php

135 lines
5.7 KiB
PHP
Raw Normal View History

2015-03-16 22:45:25 +01:00
@extends('public.header')
@section('head')
@parent
@include('money_script')
2015-03-16 22:45:25 +01:00
2016-01-07 08:08:30 +01:00
@foreach ($invoice->client->account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
2016-01-31 20:36:50 +01:00
<script src="{{ asset('pdf.built.js') }}" type="text/javascript"></script>
2015-10-18 09:30:28 +02:00
2015-03-16 22:45:25 +01:00
<style type="text/css">
body {
background-color: #f8f8f8;
}
</style>
@stop
@section('content')
<div class="container">
@if ($checkoutComToken)
@include('partials.checkout_com_payment')
@else
<div class="pull-right" style="text-align:right">
2016-05-10 20:17:46 +02:00
@if (Session::get('trackEventAction') === '/buy_pro_plan')
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}&nbsp;&nbsp;
{!! Button::primary(trans('texts.return_to_app'))->asLinkTo(URL::to('/dashboard'))->large() !!}
@elseif ($invoice->is_quote)
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}&nbsp;&nbsp;
@if ($showApprove)
{!! Button::success(trans('texts.approve'))->asLinkTo(URL::to('/approve/' . $invitation->invitation_key))->large() !!}
@endif
@elseif ($invoice->client->account->isGatewayConfigured() && !$invoice->isPaid() && !$invoice->is_recurring)
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}&nbsp;&nbsp;
@if (count($paymentTypes) > 1)
{!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!}
@else
<a href='{!! $paymentURL !!}' class="btn btn-success btn-lg">{{ trans('texts.pay_now') }}</a>
@endif
@else
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
@endif
</div>
<div class="pull-left">
@if(!empty($documentsZipURL))
{!! Button::normal(trans('texts.download_documents', array('size'=>Form::human_filesize($documentsZipSize))))->asLinkTo($documentsZipURL)->large() !!}
@endif
</div>
@endif
2015-03-16 22:45:25 +01:00
<div class="clearfix"></div><p>&nbsp;</p>
@if ($account->isPro() && $invoice->hasDocuments())
<div class="invoice-documents">
<h3>{{ trans('texts.documents_header') }}</h3>
<ul>
@foreach ($invoice->documents as $document)
<li><a target="_blank" href="{{ $document->getClientUrl($invitation) }}">{{$document->name}} ({{Form::human_filesize($document->size)}})</a></li>
@endforeach
@foreach ($invoice->expenses as $expense)
@foreach ($expense->documents as $document)
<li><a target="_blank" href="{{ $document->getClientUrl($invitation) }}">{{$document->name}} ({{Form::human_filesize($document->size)}})</a></li>
@endforeach
@endforeach
</ul>
</div>
@endif
@if ($account->hasFeature(FEATURE_DOCUMENTS) && $account->invoice_embed_documents)
2016-03-23 23:40:42 +01:00
@foreach ($invoice->documents as $document)
@if($document->isPDFEmbeddable())
<script src="{{ $document->getClientVFSJSUrl() }}" type="text/javascript" async></script>
@endif
2016-03-23 23:40:42 +01:00
@endforeach
@foreach ($invoice->expenses as $expense)
@foreach ($expense->documents as $document)
@if($document->isPDFEmbeddable())
<script src="{{ $document->getClientVFSJSUrl() }}" type="text/javascript" async></script>
@endif
@endforeach
@endforeach
2016-03-23 23:40:42 +01:00
@endif
2015-03-16 22:45:25 +01:00
<script type="text/javascript">
2015-03-31 19:42:37 +02:00
window.invoice = {!! $invoice->toJson() !!};
invoice.features = {
customize_invoice_design:{{ $invoice->client->account->hasFeature(FEATURE_CUSTOMIZE_INVOICE_DESIGN) ? 'true' : 'false' }},
2016-04-19 22:01:44 +02:00
remove_created_by:{{ $invoice->client->account->hasFeature(FEATURE_REMOVE_CREATED_BY) ? 'true' : 'false' }},
invoice_settings:{{ $invoice->client->account->hasFeature(FEATURE_INVOICE_SETTINGS) ? 'true' : 'false' }}
};
2015-03-16 22:45:25 +01:00
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
function getPDFString(cb) {
2015-09-17 21:01:06 +02:00
return generatePDF(invoice, invoice.invoice_design.javascript, true, cb);
2015-03-16 22:45:25 +01:00
}
2015-11-21 22:10:26 +01:00
if (window.hasOwnProperty('pjsc_meta')) {
window['pjsc_meta'].remainingTasks++;
}
2015-03-16 22:45:25 +01:00
$(function() {
2015-09-17 21:01:06 +02:00
@if (Input::has('phantomjs'))
doc = getPDFString();
doc.getDataUrl(function(pdfString) {
document.write(pdfString);
document.close();
2015-11-21 22:10:26 +01:00
if (window.hasOwnProperty('pjsc_meta')) {
window['pjsc_meta'].remainingTasks--;
}
2015-09-17 21:01:06 +02:00
});
@else
refreshPDF();
@endif
2015-03-16 22:45:25 +01:00
});
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, 'viewPDF' => true])
2015-03-16 22:45:25 +01:00
<p>&nbsp;</p>
<p>&nbsp;</p>
2016-03-23 23:40:42 +01:00
</div>
2015-03-27 10:32:45 +01:00
@stop