mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Show attachments for bills #2828
This commit is contained in:
@@ -169,6 +169,7 @@ class ShowController extends Controller
|
||||
|
||||
$location = $this->repository->getLocation($account);
|
||||
$isLiability = $this->repository->isLiability($account);
|
||||
$attachments = $this->repository->getAttachments($account);
|
||||
$objectType = config(sprintf('firefly.shortNamesByFullName.%s', $account->accountType->type));
|
||||
$end = new Carbon;
|
||||
$today = new Carbon;
|
||||
@@ -196,6 +197,7 @@ class ShowController extends Controller
|
||||
'location',
|
||||
'objectType',
|
||||
'isLiability',
|
||||
'attachments',
|
||||
'currency',
|
||||
'today',
|
||||
'chartUri',
|
||||
|
@@ -197,6 +197,7 @@ class BillController extends Controller
|
||||
$start = session('start');
|
||||
$end = session('end');
|
||||
$unfiltered = $this->billRepository->getBills();
|
||||
|
||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||
$parameters = new ParameterBag();
|
||||
$parameters->set('start', $start);
|
||||
@@ -208,7 +209,7 @@ class BillController extends Controller
|
||||
|
||||
/** @var Collection $bills */
|
||||
$bills = $unfiltered->map(
|
||||
static function (Bill $bill) use ($transformer, $defaultCurrency) {
|
||||
function (Bill $bill) use ($transformer, $defaultCurrency) {
|
||||
$return = $transformer->transform($bill);
|
||||
$currency = $bill->transactionCurrency ?? $defaultCurrency;
|
||||
$return['currency_id'] = $currency->id;
|
||||
@@ -216,6 +217,7 @@ class BillController extends Controller
|
||||
$return['currency_symbol'] = $currency->symbol;
|
||||
$return['currency_code'] = $currency->code;
|
||||
$return['currency_decimal_places'] = $currency->decimal_places;
|
||||
$return['attachments'] = $this->billRepository->getAttachments($bill);
|
||||
|
||||
return $return;
|
||||
}
|
||||
|
@@ -114,34 +114,7 @@
|
||||
<h3 class="box-title">{{ 'attachments'|_ }}</h3>
|
||||
</div>
|
||||
<div class="box-body table-responsive no-padding">
|
||||
<table class="table table-hover">
|
||||
{% for att in attachments %}
|
||||
<tr>
|
||||
<td>
|
||||
<div class="btn-group btn-group-xs">
|
||||
<a href="{{ route('attachments.edit', att.id) }}" class="btn btn-default"><i class="fa fa-pencil"></i></a>
|
||||
<a href="{{ route('attachments.delete', att.id) }}" class="btn btn-danger"><i class="fa fa-trash"></i></a>
|
||||
<a href="{{ route('attachments.download', att.id) }}" class="btn btn-default"><i class="fa fa-download"></i></a>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<i class="fa {{ att.mime|mimeIcon }}"></i>
|
||||
<a href="{{ route('attachments.view', att.id) }}" title="{{ att.filename }}">
|
||||
{% if att.title %}
|
||||
{{ att.title }}
|
||||
{% else %}
|
||||
{{ att.filename }}
|
||||
{% endif %}
|
||||
</a>
|
||||
({{ att.size|filesize }})
|
||||
{% if att.notes.first %}
|
||||
<br/>
|
||||
<em>{{ att.notes.first.text|markdown }}</em>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% include 'list.attachments' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
@@ -27,7 +27,7 @@
|
||||
{% endif %}
|
||||
<a href="{{ route('bills.show',entry.id) }}" title="{{ entry.name }}">{{ entry.name }}</a>
|
||||
{# count attachments #}
|
||||
{% if entry.attachments_count > 0 %}
|
||||
{% if entry.attachments.count > 0 %}
|
||||
<i class="fa fa-paperclip"></i>
|
||||
{% endif %}
|
||||
|
||||
|
Reference in New Issue
Block a user