Add links to transaction from dates in bill

This commit is contained in:
HamuZ HamuZ 2018-10-17 18:17:16 +03:00
parent 67cd3b6f81
commit 43c9737e6e
2 changed files with 8 additions and 3 deletions

View File

@ -381,7 +381,9 @@ class BillRepository implements BillRepositoryInterface
*/
public function getPaidDatesInRange(Bill $bill, Carbon $start, Carbon $end): Collection
{
$dates = $bill->transactionJournals()->before($end)->after($start)->get(['transaction_journals.date'])->pluck('date');
$dates = $bill->transactionJournals()->before($end)->after($start)->get([
'transaction_journals.id','transaction_journals.date'
])->pluck('date', 'id');
return $dates;
}

View File

@ -97,8 +97,11 @@
#}
{% if entry.paid_dates|length > 0 and entry.active %}
<td class="paid_in_period text-success" data-value="{{ entry.paid_dates[0] }}">
{% for date in entry.paid_dates %}
{{ formatDate(date, monthAndDayFormat) }}<br/>
{% for transaction_id, date in entry.paid_dates %}
<a href="{{ route('transactions.show',transaction_id) }}">
{{ formatDate(date, monthAndDayFormat) }}
</a>
<br/>
{% endfor %}
</td>
<td class="expected_in_period hidden-sm hidden-xs" data-value="{{ entry.next_expected_match }}">