2026-07-07 17:05:16 -03:00
|
|
|
<?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 ?>">
|
2026-07-07 17:11:08 -03:00
|
|
|
<?= t('Total') ?>: <span class="fb-amount"><?= $sign ?>R$<?= \Kanboard\Plugin\FinanceBuddy\Helper\FinanceHelper::money(abs($net)) ?></span>
|
2026-07-07 17:05:16 -03:00
|
|
|
</div>
|