mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Fix expense include documents
This commit is contained in:
parent
947c1e2a12
commit
48dbf0f287
@ -71,7 +71,9 @@ class ContactMailer extends Mailer
|
||||
$documents = $invoice->documents;
|
||||
|
||||
foreach ($invoice->expenses as $expense) {
|
||||
$documents = $documents->merge($expense->documents);
|
||||
if ($expense->invoice_documents) {
|
||||
$documents = $documents->merge($expense->documents);
|
||||
}
|
||||
}
|
||||
|
||||
$documents = $documents->sortBy('size');
|
||||
|
@ -38,8 +38,10 @@ class TemplateService
|
||||
$documentsHTML .= '<li><a href="'.HTML::entities($document->getClientUrl($invitation)).'">'.HTML::entities($document->name).'</a></li>';
|
||||
}
|
||||
foreach ($invoice->expenses as $expense) {
|
||||
foreach ($expense->documents as $document) {
|
||||
$documentsHTML .= '<li><a href="'.HTML::entities($document->getClientUrl($invitation)).'">'.HTML::entities($document->name).'</a></li>';
|
||||
if ($expense->invoice_documents) {
|
||||
foreach ($expense->documents as $document) {
|
||||
$documentsHTML .= '<li><a href="'.HTML::entities($document->getClientUrl($invitation)).'">'.HTML::entities($document->name).'</a></li>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$documentsHTML .= '</ul>';
|
||||
|
@ -155,11 +155,11 @@
|
||||
<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)
|
||||
@if ($expense->invoice_documents)
|
||||
@if ($expense->invoice_documents)
|
||||
@foreach ($expense->documents as $document)
|
||||
<li><a target="_blank" href="{{ $document->getClientUrl($invitation) }}">{{$document->name}} ({{Form::human_filesize($document->size)}})</a></li>
|
||||
@endif
|
||||
@endforeach
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user