1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00
invoiceninja/resources/views/invoices/history.blade.php

90 lines
2.7 KiB
PHP
Raw Normal View History

2015-03-16 22:45:25 +01:00
@extends('header')
@section('head')
@parent
2015-12-30 19:45:52 +01:00
@include('money_script')
2016-01-07 08:08:30 +01:00
@foreach (Auth::user()->account->getFontFolders() as $font)
<script src="{{ asset('js/vfs_fonts/'.$font.'.js') }}" type="text/javascript"></script>
@endforeach
2016-06-05 21:55:23 +02:00
<script src="{{ asset('pdf.built.js') }}?no_cache={{ NINJA_VERSION }}" type="text/javascript"></script>
2015-03-16 22:45:25 +01:00
<script>
2015-04-16 19:12:56 +02:00
var invoiceDesigns = {!! $invoiceDesigns !!};
2016-01-07 08:08:30 +01:00
var invoiceFonts = {!! $invoiceFonts !!};
2017-05-08 21:10:39 +02:00
var currentInvoice = {!! $invoice !!};
2017-04-30 13:35:17 +02:00
var versionsJson = {!! strip_tags($versionsJson) !!};
2016-06-05 21:55:23 +02:00
function getPDFString(cb) {
2015-03-16 22:45:25 +01:00
var version = $('#version').val();
var invoice;
2017-01-09 09:17:22 +01:00
@if ($paymentId)
invoice = versionsJson[0];
@else
if (parseInt(version)) {
invoice = versionsJson[version];
} else {
invoice = currentInvoice;
}
@endif
2015-03-16 22:45:25 +01:00
invoice.image = window.accountLogo;
var invoiceDesignId = parseInt(invoice.invoice_design_id);
var invoiceDesign = _.findWhere(invoiceDesigns, {id: invoiceDesignId});
if (!invoiceDesign) {
invoiceDesign = invoiceDesigns[0];
}
2016-06-05 21:55:23 +02:00
generatePDF(invoice, invoiceDesign.javascript, true, cb);
2015-03-16 22:45:25 +01:00
}
2016-06-05 21:55:23 +02:00
$(function() {
2015-03-16 22:45:25 +01:00
refreshPDF();
});
2016-06-05 21:55:23 +02:00
</script>
2015-03-16 22:45:25 +01:00
@stop
@section('content')
2015-04-16 19:12:56 +02:00
{!! Former::open()->addClass('form-inline')->onchange('refreshPDF()') !!}
2017-01-09 09:17:22 +01:00
@if (count($versionsSelect) > 1)
{!! Former::select('version')
->options($versionsSelect)
->label(trans('select_version'))
->style('background-color: white !important') !!}
@endif
2016-06-05 21:55:23 +02:00
{!! Button::primary(trans('texts.edit_' . $invoice->getEntityType()))->asLinkTo(URL::to('/' . $invoice->getEntityType() . 's/' . $invoice->public_id . '/edit'))->withAttributes(array('class' => 'pull-right')) !!}
2015-04-16 19:12:56 +02:00
{!! Former::close() !!}
2015-03-16 22:45:25 +01:00
<br/>&nbsp;<br/>
2017-01-09 09:17:22 +01:00
@if (count($versionsSelect) <= 1)
<br/>&nbsp;<br/>
@endif
2015-03-16 22:45:25 +01:00
@include('invoices.pdf', ['account' => Auth::user()->account, 'pdfHeight' => 800])
2016-06-05 21:55:23 +02:00
@if (Utils::hasFeature(FEATURE_DOCUMENTS) && $invoice->account->invoice_embed_documents)
2016-03-23 23:40:42 +01:00
@foreach ($invoice->documents as $document)
@if($document->isPDFEmbeddable())
<script src="{{ $document->getVFSJSUrl() }}" 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->getVFSJSUrl() }}" type="text/javascript" async></script>
@endif
@endforeach
@endforeach
2016-03-23 23:40:42 +01:00
@endif
2016-06-05 21:55:23 +02:00
@stop