25 lines
769 B
PHP
25 lines
769 B
PHP
|
|
<?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>
|