@extends('public.header')
@section('head')
@parent
@include('money_script')
@foreach ($invoice->client->account->getFontFolders() as $font)
@endforeach
@if (!empty($transactionToken) && $accountGateway->gateway_id == GATEWAY_BRAINTREE)
@if (!empty($partialView))
@include($partialView)
@else
@if ($invoice->isQuote())
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
@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() !!}
@if (count($paymentTypes) > 1)
{!! DropdownButton::success(trans('texts.pay_now'))->withContents($paymentTypes)->large() !!}
@else
{{ trans('texts.pay_now') }}
@endif
@else
{!! Button::normal(trans('texts.download_pdf'))->withAttributes(['onclick' => 'onDownloadClick()'])->large() !!}
@if ($account->isNinjaAccount())
{!! Button::primary(trans('texts.return_to_app'))->asLinkTo(URL::to('/settings/account_management'))->large() !!}
@endif
@endif
@endif
@if(!empty($documentsZipURL))
{!! Button::normal(trans('texts.download_documents', array('size'=>Form::human_filesize($documentsZipSize))))->asLinkTo($documentsZipURL)->large() !!}
@endif
@if ($account->isPro() && $invoice->hasDocuments())
{{ trans('texts.documents_header') }}
@endif
@if ($account->hasFeature(FEATURE_DOCUMENTS) && $account->invoice_embed_documents)
@foreach ($invoice->documents as $document)
@if($document->isPDFEmbeddable())
@endif
@endforeach
@foreach ($invoice->expenses as $expense)
@foreach ($expense->documents as $document)
@if($document->isPDFEmbeddable())
@endif
@endforeach
@endforeach
@endif
@include('invoices.pdf', ['account' => $invoice->client->account, 'viewPDF' => true])
@stop