= 2; $can_delete = lookupUserPermission('module_financial') >= 3; $show = ($_GET['show'] ?? '') === 'archived' ? 'archived' : ''; $open_accounts = accountsList(false); $archived_accounts = accountsList(true); $stats = accountsStats($open_accounts); $types = accountTypes(); $accounts = $show === 'archived' ? $archived_accounts : $open_accounts; $q_text = trim((string) ($_GET['q'] ?? '')); if ($q_text !== '') { $accounts = array_filter($accounts, function ($account) use ($q_text) { return mb_stripos($account['account_name'] . ' ' . $account['account_description'] . ' ' . $account['account_notes'], $q_text) !== false; }); } $cards = array_filter($open_accounts, function ($account) { return $account['type'] === 3; }); $owing_cards = array_filter($cards, function ($account) { return $account['balance'] < 0; }); $money = function ($amount, $currency = '') { return escapeHtml(billingMoney($amount, $currency)); }; $change = function ($now, $before) { if ($before <= 0) { return null; } return round(($now - $before) / $before * 100); }; $in_change = $change($stats['in'], $stats['last_in']); $out_change = $change($stats['out'], $stats['last_out']); $month_url = 'canned_date=custom&dtf=' . $stats['month_start'] . '&dtt=' . date('Y-m-t'); ?>
| Account | Kind | Holds | This month | Latest | |
|---|---|---|---|---|---|
|
= escapeHtml($account['account_name']) ?>
= escapeHtml($account['account_description'] ?: trim(strtok((string) $account['account_notes'], "\n"))) ?: ' ' ?>
= escapeHtml($default) ?>
|
= escapeHtml($type['label']) ?> = escapeHtml($currency) ?> |
= escapeHtml(accountBalanceText($account)) ?>
opened with = $money($account['opening_balance'], $currency) ?>
|
+= $money($account['month_in'], $currency) ?>
-= $money($account['month_out'], $currency) ?>
-
|
= escapeHtml($account['last_date']) ?> = $account['line_count'] ?> line= $account['line_count'] === 1 ? '' : 's' ?>
Nothing yet
Reconciling
To = escapeHtml(date('M j', strtotime($account['reconciled_to']))) ?>
|
|
| What you have, less what is owed on cards | = $money($net) ?> | ||||