= 2; $can_undo = lookupUserPermission('module_financial') >= 3; $types = accountTypes(); $kinds = accountLedgerKinds(); $open_accounts = accountsList(false); $account_id = intval($_GET['account'] ?? 0); $account = $account_id ? accountRow($account_id) : null; $missing_account = $account_id && !$account; if (!$account) { $pick = 0; foreach ($open_accounts as $id => $option) { if ($option['reconciling_id']) { $pick = $id; break; } } if (!$pick && isset($open_accounts[intval($config_default_payment_account)])) { $pick = intval($config_default_payment_account); } if (!$pick && $open_accounts) { $pick = array_key_first($open_accounts); } $account = $pick ? $open_accounts[$pick] : null; } $account_id = $account ? intval($account['account_id']) : 0; $is_card = $account && $account['type'] === 3; $currency = $account ? (string) $account['account_currency_code'] : (string) $session_company_currency; $money = function ($amount) use ($currency) { return escapeHtml(billingMoney($amount, $currency)); }; // A balance as the statement reads it - a card's as what is owed $statement_money = function ($balance) use ($account, $money) { return $account ? escapeHtml(reconcileBalanceText($account, $balance)) : $money($balance); }; $open = $account ? reconcileOpen($account_id) : null; $last = $account ? reconcileLast($account_id) : null; $history = $account && !$open ? reconcileHistory($account_id) : []; $starting = $account ? reconcileStartingBalance($account_id) : 0.0; // The next statement most likely ends at the end of last month $suggest = date('Y-m-t', strtotime('first day of last month')); if ($last && $suggest <= $last['reconciliation_statement_date']) { $suggest = date('Y-m-d'); } if ($open) { $totals = reconcileTotals($open); $lines = reconcileLines($open, $later); $statement_date = $open['reconciliation_statement_date']; } else { $uncleared = $account ? mysqli_fetch_row(mysqli_query($mysqli, "SELECT COUNT(*), COALESCE(SUM(ledger.txn_amount), 0) FROM (" . accountLedgerSql($account_id) . ") AS ledger WHERE ledger.txn_cleared_id IS NULL")) : [0, 0]; } $statement_form = function ($row) use ($account, $is_card, $suggest, $last, $starting, $money, $statement_money) { $date = $row ? $row['reconciliation_statement_date'] : $suggest; $ending = $row ? floatval($row['reconciliation_ending_balance']) * ($is_card ? -1 : 1) : null; ?>
value="" required>
It starts from - .
That account no longer exists.
Add an account to reconcile first.
Accounts
Starting from
The statement
Ending
Cleared
ticked - in, out
Difference

Reconcile statement to

Cleared Date Who or what In Out
aria-label="Cleared">
-
0 ? $money($amount) : '' ?>
Nothing on up to is left to clear.
·
Reconciled to
Not cleared yet
line

Reconcile

The next statement
$row) { $t = $row['totals']; ?>
Statement to Cleared In Out Reconciled
line
from
Undo
hasn't been reconciled yet.