2023-05-28 03:44:19 +02:00
|
|
|
@extends(templates/layout_normal)
|
|
|
|
|
|
|
|
@section(main)
|
|
|
|
<h2>
|
|
|
|
<a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>"><?= $community->getName() ?></a> »
|
|
|
|
<a href="<?= Container::$routeCollection->getRoute('community.events')->generateLink(['communitySlug' => $community->getSlug()]) ?>">Events</a> »
|
|
|
|
<?= $event->getTitle() ?>
|
|
|
|
<span class="small">[<a href="<?= Container::$routeCollection->getRoute('community.event.edit')->generateLink(['communitySlug' => $community->getSlug(), 'eventSlug' => $event->getSlug()]) ?>">edit</a>]</span>
|
|
|
|
</h2>
|
|
|
|
|
|
|
|
<div class="gridContainer marginTop">
|
|
|
|
<div>
|
|
|
|
<?php
|
|
|
|
$mainCurrencyCode = $community->getMainCurrency()->getCode();
|
|
|
|
$mainCurrencyRoundDigits = $community->getMainCurrency()->getRoundDigits();
|
|
|
|
?>
|
|
|
|
<h3 class="marginBottom">Finances</h3>
|
|
|
|
<p><a href="<?= Container::$routeCollection->getRoute('community.transactions')->generateLink(['communitySlug' => $community->getSlug(), 'event' => $event->getSlug()]) ?>">Transactions</a> | <a href="<?= Container::$routeCollection->getRoute('community.transactions.new')->generateLink(['communitySlug' => $community->getSlug(), 'event' => $event->getSlug()]) ?>">New transaction</a></p>
|
|
|
|
<table class="fullWidth marginTop">
|
|
|
|
<tr>
|
|
|
|
<td class="bold">Total cost</td>
|
|
|
|
<td class="mono" style="text-align: right;"><?= number_format($totalCost, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2023-07-12 00:26:59 +02:00
|
|
|
<table class="fullWidth marginTop">
|
|
|
|
<tr>
|
|
|
|
<td class="bold">You owe*</td>
|
|
|
|
<td class="mono red" style="text-align: right;"><?= number_format($debtBalance, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php foreach ($debtItems as $item): ?>
|
|
|
|
<tr>
|
|
|
|
<td class="small"><?= $item['payee']->getUser()->getDisplayName() ?></td>
|
|
|
|
<td class="small mono red" style="text-align: right;"><?= number_format($item['amount'], $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<tr>
|
|
|
|
<td class="bold">You're owed*</td>
|
|
|
|
<td class="mono green" style="text-align: right;"><?= number_format($outstandingBalance, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php foreach ($outstandingItems as $item): ?>
|
|
|
|
<tr>
|
|
|
|
<td class="small"><?= $item['payer']->getUser()->getDisplayName() ?></td>
|
|
|
|
<td class="small mono green" style="text-align: right;"><?= number_format($item['amount'], $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
<tr>
|
|
|
|
<td class="bold">Your balance*</td>
|
|
|
|
<td class="mono <?= $balance < 0 ? 'red' : ($balance > 0 ? 'green' : '') ?>" style="text-align: right;;"><?= number_format($balance, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<p class="small right">* Virtual balance only for this event. Check <a href="<?= Container::$routeCollection->getRoute('community')->generateLink(['communitySlug' => $community->getSlug()]) ?>">community</a> finances for your real balance.</p>
|
2023-05-28 03:44:19 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|