1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 05:32:39 +01:00
invoiceninja/app/views/invoices/view.blade.php

72 lines
2.0 KiB
PHP
Raw Normal View History

2014-05-13 23:53:41 +02:00
@extends('public.header')
2013-11-26 13:45:07 +01:00
2013-12-08 20:08:17 +01:00
@section('head')
@parent
2014-05-13 23:53:41 +02:00
@include('script')
<!-- <link href="{{ asset('css/bootstrap.min.css') }}" rel="stylesheet" type="text/css"/> -->
2014-05-13 23:53:41 +02:00
2014-01-05 15:03:29 +01:00
<script src="{{ asset('js/pdf_viewer.js') }}" type="text/javascript"></script>
<script src="{{ asset('js/compatibility.js') }}" type="text/javascript"></script>
2014-05-13 23:53:41 +02:00
<style type="text/css">
body {
background-color: #f8f8f8;
}
</style>
2013-12-08 20:08:17 +01:00
@stop
2013-11-26 13:45:07 +01:00
@section('content')
2014-05-13 23:53:41 +02:00
<div class="container">
<p>&nbsp;</p>
2014-05-25 15:40:09 +02:00
@if ($invoice->client->account->isGatewayConfigured() && !$invoice->isPaid() && !$invoice->is_recurring)
2015-01-25 21:44:36 +01:00
<div class="pull-right" style="text-align:right">
{{ Button::normal(trans('texts.download_pdf'), array('onclick' => 'onDownloadClick()', 'class' => 'btn-lg')) }}&nbsp;&nbsp;
{{ Button::success_link(URL::to('payment/' . $invitation->invitation_key), trans('texts.pay_now'), array('class' => 'btn-lg')) }}
2014-05-13 23:53:41 +02:00
</div>
@else
<div class="pull-right">
{{ Button::success('Download PDF', array('onclick' => 'onDownloadClick()', 'class' => 'btn-lg')) }}
2014-05-13 23:53:41 +02:00
</div>
@endif
<div class="clearfix"></div><p>&nbsp;</p>
2014-10-26 09:42:02 +01:00
<script type="text/javascript">
2014-05-13 23:53:41 +02:00
2014-10-26 09:42:02 +01:00
window.invoice = {{ $invoice->toJson() }};
invoice.is_pro = {{ $invoice->client->account->isPro() ? 'true' : 'false' }};
invoice.is_quote = {{ $invoice->is_quote ? 'true' : 'false' }};
2014-12-03 23:05:38 +01:00
invoice.contact = {{ $contact->toJson() }};
2014-05-13 23:53:41 +02:00
2014-10-26 09:42:02 +01:00
function getPDFString() {
var doc = generatePDF(invoice, invoice.invoice_design.javascript);
if (!doc) return;
return doc.output('datauristring');
}
2013-11-26 13:45:07 +01:00
2014-10-26 09:42:02 +01:00
$(function() {
refreshPDF();
});
2015-01-25 21:44:36 +01:00
function onDownloadClick() {
2014-10-26 09:42:02 +01:00
var doc = generatePDF(invoice, invoice.invoice_design.javascript, true);
2015-01-25 21:44:36 +01:00
var fileName = invoice.is_quote ? invoiceLabels.quote : invoiceLabels.invoice;
doc.save(fileName + '-' + invoice.invoice_number + '.pdf');
2014-10-26 09:42:02 +01:00
}
2013-11-26 13:45:07 +01:00
2014-10-12 20:11:41 +02:00
2014-10-26 09:42:02 +01:00
</script>
2014-10-12 20:11:41 +02:00
2014-10-26 09:42:02 +01:00
@include('invoices.pdf', ['account' => $invoice->client->account])
2013-12-08 20:08:17 +01:00
2014-10-26 09:42:02 +01:00
<p>&nbsp;</p>
<p>&nbsp;</p>
2013-12-08 20:08:17 +01:00
2014-10-26 09:42:02 +01:00
</div>
2013-11-26 13:45:07 +01:00
@stop