RVRNEXT-5 make community main currency a general currency

This commit is contained in:
bence committed 2023-04-28 21:06:18 +02:00
1 parent 157f530ad5
commit 20a850f011
6 files changed
+82 -21

No files matched your search

+15 -10
View File
@@ -16,14 +16,15 @@
</div>
<div>
<h3 class="marginBottom">Currencies</h3>
<p>Main currency: <b><?= $community->getCurrency() ?></b></p>
<?php if (count($currencies) > 0): ?>
<p>Further currencies: <b>
<?php foreach ($currencies as $currency): ?>
<?php foreach ($currencies as $currency): ?>
<p>
<?php if ($currency->getId() === $community->getMainCurrencyId()): ?>
<b><?= $currency->getCode() ?></b>
<?php else: ?>
<a href="<?= Container::$routeCollection->getRoute('community-currency-exchange-rates')->generateLink(['communityId' => $community->getId(), 'code' => $currency->getCode()]) ?>"><?= $currency->getCode() ?></a>
<?php endforeach; ?>
</b></p>
<?php endif; ?>
<?php endif; ?>
</p>
<?php endforeach; ?>
<?php if ($editPermission): ?>
<hr>
<p><a href="<?= Container::$routeCollection->getRoute('community-currencies')->generateLink(['communityId' => $community->getId()]) ?>">Edit currencies</a></p>
@@ -40,19 +41,23 @@
<?php endif; ?>
</div>
<div>
<?php
$mainCurrencyCode = $community->getMainCurrency()->getCode();
$mainCurrencyRoundDigits = $community->getMainCurrency()->getRoundDigits();
?>
<h3 class="marginBottom">Finances</h3>
<table class="fullWidth">
<tr>
<td>You owe</td>
<td style="text-align: right; color: red;">0 <?= $community->getCurrency() ?></td>
<td style="text-align: right; color: red;"><?= number_format(0, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
</tr>
<tr>
<td>You're owed</td>
<td style="text-align: right; color: green;">0 <?= $community->getCurrency() ?></td>
<td style="text-align: right; color: green;"><?= number_format(0, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
</tr>
<tr>
<td>Your balance</td>
<td style="text-align: right;">0 <?= $community->getCurrency() ?></td>
<td style="text-align: right;"><?= number_format(0, $mainCurrencyRoundDigits) ?> <?= $mainCurrencyCode ?></td>
</tr>
</table>
</div>