FinanceBuddy: per-column net total in the header t1 (v0.4)

This commit is contained in:
2026-07-07 17:05:16 -03:00
parent 6328f3632f
commit d2383a76b7

View 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>