FinanceBuddy: per-column net total in the header t1 (v0.4)
This commit is contained in:
24
Template/board/column_total.php
Normal file
24
Template/board/column_total.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
// Per-column net total in the column header (credits - debits). Shown in every column of an
|
||||
// enabled board, including "total R$0,00" -- never hidden on zero. Server-side, re-renders on
|
||||
// every board refresh.
|
||||
if (empty($column['project_id']) || ! $this->FinanceHelper->isEnabled($column['project_id'])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$net = $this->FinanceHelper->columnNet($column);
|
||||
|
||||
if ($net > 0) {
|
||||
$class = 'fb-column-total fb-total-credit';
|
||||
$sign = '+';
|
||||
} elseif ($net < 0) {
|
||||
$class = 'fb-column-total fb-total-debit';
|
||||
$sign = '-';
|
||||
} else {
|
||||
$class = 'fb-column-total fb-total-zero';
|
||||
$sign = '';
|
||||
}
|
||||
?>
|
||||
<div class="<?= $class ?>">
|
||||
<?= t('total') ?> <?= $sign ?>R$<?= \Kanboard\Plugin\FinanceBuddy\Helper\FinanceHelper::money(abs($net)) ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user