Added some (yet without function) information icons. [skip ci] [skip Scrutinizer]

This commit is contained in:
James Cole 2016-02-06 20:17:55 +01:00
parent 6c2df1a783
commit 8fb3348a7c
8 changed files with 58 additions and 32 deletions

View File

@ -27,6 +27,9 @@ class BillLine
/** @var string */
protected $min;
/** @var int */
private $transactionJournalId;
/**
* @return string
*/
@ -91,6 +94,22 @@ class BillLine
$this->min = $min;
}
/**
* @return int
*/
public function getTransactionJournalId(): int
{
return $this->transactionJournalId ?? 0;
}
/**
* @param int $transactionJournalId
*/
public function setTransactionJournalId(int $transactionJournalId)
{
$this->transactionJournalId = $transactionJournalId;
}
/**
* @return boolean
*/

View File

@ -80,11 +80,13 @@ class ReportHelper implements ReportHelperInterface
$entry = $journals->filter(
function (TransactionJournal $journal) use ($bill) {
return $journal->bill_id == $bill->id;
return $journal->bill_id === $bill->id;
}
);
if (!is_null($entry->first())) {
$billLine->setAmount($entry->first()->journalAmount);
$first = $entry->first();
if (!is_null($first)) {
$billLine->setTransactionJournalId($first->id);
$billLine->setAmount($first->journalAmount);
$billLine->setHit(true);
} else {
$billLine->setHit(false);
@ -93,7 +95,6 @@ class ReportHelper implements ReportHelperInterface
$collection->addBill($billLine);
}
}
return $collection;

View File

@ -82,6 +82,7 @@ class BillRepository implements BillRepositoryInterface
->get(
[
'transaction_journals.bill_id',
'transaction_journals.id',
DB::Raw('SUM(`transactions`.`amount`) as `journalAmount`'),
]
);

View File

@ -41,6 +41,7 @@
<td>
{% if balanceEntry.getSpent != 0 %}
<span class="text-danger">{{ (balanceEntry.getSpent)|formatAmountPlain }}</span>
<i class="fa fa-fw text-muted fa-info-circle"></i>
{% endif %}
{% if balanceEntry.getLeft != 0 %}
<span class="text-success">{{ (balanceEntry.getLeft)|formatAmountPlain }}</span>

View File

@ -15,33 +15,30 @@
</thead>
<tbody>
{% for line in bills.getBills %}
{% if not line.isActive %}
<tr class="text-muted">
{% else %}
<tr>
{% endif %}
<td data-value="{{ line.getBill.name }}">
<a href="{{ route('bills.show',line.getBill.id) }}">{{ line.getBill.name }}</a>
<tr>
<td data-value="{{ line.getBill.name }}">
<a href="{{ route('bills.show',line.getBill.id) }}">{{ line.getBill.name }}</a>
</td>
<td data-value="{{ line.getMin }}">{{ line.getMin|formatAmount }}</td>
<td data-value="{{ line.getMax }}">{{ line.getMax|formatAmount }}</td>
{% if line.isHit %}
<td data-value="{{ line.getAmount }}">
<a href="{{ route('transactions.show', line.getTransactionJournalId) }}">
{{ line.getAmount|formatAmount }}
</a>
</td>
{% endif %}
{% if not line.isHit and line.isActive %}
<td data-value="0" class="bg-success">{{ 'notCharged'|_ }}</td>
{% endif %}
{% if not line.isActive %}
({{ 'inactive'|_|lower }})
<td data-value="-1">&nbsp;</td>
{% endif %}
</td>
<td data-value="{{ line.getMin }}">{{ line.getMin|formatAmount }}</td>
<td data-value="{{ line.getMax }}">{{ line.getMax|formatAmount }}</td>
{% if line.isHit %}
<td data-value="{{ line.getAmount }}">{{ line.getAmount|formatAmount }}</td>
{% endif %}
{% if not line.isHit and line.isActive %}
<td data-value="0" class="bg-success">{{ 'notCharged'|_ }}</td>
{% endif %}
{% if not line.isActive %}
<td data-value="-1">&nbsp;</td>
{% endif %}
<td data-value="{{ (line.getMax - line.getAmount) }}">
{% if line.isActive %}
{{ (line.getMax + line.getAmount)|formatAmount }}
{% endif %}
</td>
<td data-value="{{ (line.getMax - line.getAmount) }}">
{% if line.isActive %}
{{ (line.getMax + line.getAmount)|formatAmount }}
{% endif %}
</td>
</tr>

View File

@ -39,12 +39,13 @@
</td>
<td>
{% if budgetLine.getSpent != 0 %}
{{ budgetLine.getSpent|formatAmount }}
{{ budgetLine.getSpent|formatAmount }} <i class="fa fa-fw text-muted fa-info-circle"></i>
{% endif %}
{% if budgetLine.getSpent == 0 %}
{{ budgetLine.getSpent|formatAmount }}
{% endif %}
</td>
<td>
{% if(budgetLine.getOverspent == 0) %}

View File

@ -7,7 +7,7 @@
<thead>
<tr>
<th>{{ 'categories'|_ }}</th>
<th>{{ 'spent'|_ }}</th>
<th colspan="2">{{ 'spent'|_ }}</th>
</tr>
</thead>
<tbody>
@ -17,6 +17,9 @@
<a href="{{ route('categories.show',cat.id) }}">{{ cat.name }}</a>
</td>
<td>{{ cat.spent|formatAmount }}</td>
<td style="width:20px;">
<i class="fa fa-fw fa-info-circle text-muted"></i>
</td>
</tr>
{% endfor %}
</tbody>

View File

@ -15,7 +15,10 @@
<a href="{{ route('accounts.show',expense.id) }}">{{ expense.name }}</a>
{% if expense.count > 1 %}
<br/>
<small>{{ expense.count }} {{ 'transactions'|_|lower }}</small>
<small>
{{ expense.count }} {{ 'transactions'|_|lower }}
<i class="fa fa-fw text-muted fa-info-circle"></i>
</small>
{% endif %}
</td>
<td>{{ (expense.amount)|formatAmount }}</td>