diff --git a/CHANGELOG.md b/CHANGELOG.md index 199afe473..eb3750a8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,9 +6,9 @@ This file documents all notable changes made to ITFlow. ### Upgrading to 26.11 -Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's database changes (2.7.9 to 3.0.8) in the same pass. Nothing else is required. +Update from Maintenance > Update — Queue Update hands the job to cron, which updates the files and applies this release's database changes (2.7.9 to 3.0.9) in the same pass. Nothing else is required. -This is a big release, with twenty-nine database steps in one go, so take a backup before you update. +This is a big release, with thirty database steps in one go, so take a backup before you update. The update also clears out data that deletes in older versions left behind, all of it pointing at something that no longer exists: @@ -29,7 +29,7 @@ Trips already logged keep the miles they were entered with (see Breaking Changes Other income already entered (money in that isn't for an invoice, which used to be called revenue) takes who entered it from the audit log, where it has a record of it. Income with no category now counts in the dashboard and reports, so their totals can go up by that much (see Breaking Changes, Income). -Every account is given a kind - checking, savings, credit card, cash or payment processor - guessed from its name: Visa, Amex or card is a credit card, savings or reserve is savings, cash or petty cash is cash, and Stripe, PayPal, Square or merchant is a payment processor. An account given a liability type back when accounts had types (2023) is a credit card, so what is on it reads as owed. Anything else is checking. Change any that came out wrong with Edit on the Accounts page. An account's balance now leaves out archived payments, income and expenses everywhere, so the Accounts page can show less or more than before (see Bug Fixes). No account is reconciled after the update - the first statement you reconcile on each starts from its opening balance (see New Features, Accounts and transactions). +Every account is given a kind - checking, savings, credit card, cash or payment processor - guessed from its name: Visa, Amex or card is a credit card, savings or reserve is savings, cash or petty cash is cash, and Stripe, PayPal, Square or merchant is a payment processor. An account given a liability type back when accounts had types (2023) is a credit card, so what is on it reads as owed. Anything else is checking. Change any that came out wrong with Edit on the Accounts page. An account's balance now leaves out archived payments, income and expenses everywhere, so the Accounts page can show less or more than before (see Bug Fixes). No account is reconciled after the update. The first statement you reconcile on each can start from the bank's balance on the day it starts, bringing everything before it forward as reconciled, or from the account's opening balance (see New Features, Accounts and transactions). Transfers already made out of a cash account count as having taken everything in it up to then to the bank, so the first deposit you make after the update only offers the checks and cash taken in since the last one. If you are coming from 26.08 or earlier, the database update still has to be run from the command line one time, exactly as described under Upgrading to 26.09 below. @@ -117,7 +117,8 @@ If you are coming from 26.08 or earlier, the database update still has to be run - deleting a client with cleared payments or other income, from ITFlow or through the API (keep the client archived instead) - Bulk Set Account and Bulk Delete on the Income and Expenses lists, which leave cleared ones as they are and say how many - undoing a reimbursement whose money out has cleared - - An account's opening balance can't be changed once a statement on it is reconciled, as the first statement starts from it. + - An account brought forward as reconciled (see New Features, Accounts and transactions) has everything before the day it was brought forward to locked the same way, until that is undone. + - An account's opening balance can't be changed by hand once a statement on it is reconciled, as the first statement starts from it. On an account brought forward from the bank's balance, Correct the opening balance can still move it once. - Notifications now follow access too. An agent only sees notifications for clients and areas they can open, so someone without sales access no longer sees invoice and quote notifications. - Drop-downs: Tom Select is gone, replaced by ITFlow's own picker. It works the way you are used to: type to search, tick several in a multi-select, and type a new value in fields that allow it, such as ticket watchers. See Developer Updates if you have custom pages that used Tom Select. - Several small windows are gone because the change is now made where the value is shown: @@ -647,18 +648,26 @@ If you are coming from 26.08 or earlier, the database update still has to be run - Transfers keep their place in the menu, which opens the Transfers pill for every account. Each transfer shows once there, from the account it left, and the cards show what was moved, what paid off cards and what payment processors paid out. - New Transfer, Pay the Card and Edit are one form: where it comes from and where it goes, each with what it holds now, a Swap button to turn it round, the amount in the currency of the account it leaves, the date, how it was moved and notes. Every field is checked when it is saved: two different open accounts, an amount, a real date and one of your payment methods. Editing moves both sides together. - A transfer into a credit card is a card payment, and says so on the ledger and in its quick look. Clicking a transfer opens its quick look: what came out of one account and went into the other, with what each holds now and a link to its ledger, how it was moved, who entered it, notes, and Edit and Delete. A transfer's expense opens it too. + - **Deposits** out of a cash account: a new transfer out of a cash account lists the payments and other income taken into it that haven't gone to the bank yet, oldest first, each with its date, what it is for, the client, how it was paid and the amount. Tick the checks and cash going to the bank, and the amount and notes fill in, until either is typed over. What is ticked goes with the transfer and isn't offered again. A transfer out of it with nothing ticked - every one made before the update, and any made since without ticking - counts as taking everything up to it, so only what came in after it is listed. + - A deposit's quick look lists what was in it, and says so when they don't add up to the amount. The quick look of a payment or other income in one says which deposit it went in, opening it. + - Deleting the transfer, or changing it to come out of another account, puts what it carried back to waiting. So does moving one of them to another account, with Edit or Bulk Set Account. - The dashboard's accounts open their ledgers, and a card shows what is owed on it. - Adding and changing accounts and transfers needs write access to Financial, and deleting full access, as before. Restoring an archived account needs write access. - The demo data adds a Business Visa for software, hosting, supplies, meals and the other small costs, paid off from Operating Checking each month. - **Reconcile**, from an account's menu on the Accounts page or Transactions, checks the account against its bank or card statement: - - Enter the statement's ending date and balance (for a card, what the statement says is owed), with notes such as the statement's number. It starts from where the last statement ended, or the opening balance the first time. + - Enter the statement's ending date and balance (for a card, what the statement says is owed), with notes such as the statement's number. It starts from where the last statement ended. + - The first statement on an account starts from the bank's balance or the opening balance: + - From the bank's balance, enter the day the statement starts and the balance it starts from (for a card, what was owed then). Everything on the account before that day is brought forward as reconciled - cleared and locked as if a statement had been reconciled to the day before - so an account with years of history starts matching the bank from that statement on, without ticking its past. This is picked for you when the account has lines from before the statement's month. + - From the opening balance, every line since the account was opened is listed to tick, as before. + - Where ITFlow had the account at a different balance from the bank's on the day it was brought forward to, the statement says how far apart they were. Correct the opening balance moves the account's opening balance by that much, once, so ITFlow's balance matches the bank's from then on. Leave it, and the statements still reconcile from the bank's balance. + - Brought forward shows in the history with everything before the day it covers, and what the opening balance was corrected by or how far ITFlow was off. While it is the latest and nothing is in progress, Undo takes it away, frees its lines and puts the opening balance back. - Every line on the account up to the statement's date that hasn't cleared yet is listed, oldest first. Tick each one the statement shows. Lines brought in with Import Statement or Import Deposits start ticked. - The cards show where it started, the statement, what is ticked (cleared) and the difference, and the bar at the bottom keeps the difference and Finish in view down a long statement. Finish opens once the difference is nothing. - Pills for Money in, Money out, Not ticked and Ticked, a search by who, reference or amount, and Tick all shown and Untick all shown for what they leave. - Ticks are saved as they are made, so a statement can be left and finished later. Change the statement's date or balance from its menu, or Discard it. - Add what the statement has and ITFlow doesn't - a bank fee, interest - with New Expense, New Income or New Transfer from its menu, starting on the account. - With nothing in progress, Reconcile shows where the account is reconciled to, how much hasn't cleared yet, and the statements reconciled before - each with its ending balance, the lines it cleared, what came in and went out, and who reconciled it when. The latest can be undone, which puts it back in progress with what was ticked. - - On Transactions, a line cleared on a statement has a tick by its date, opening the lines that statement cleared. The Uncleared pill lists what no statement has cleared yet, and the export has a Cleared column with the statement's date. The Accounts page shows where each account is reconciled to, or that one is being reconciled. + - On Transactions, a line cleared on a statement has a tick by its date, opening the lines that statement cleared - or saying it was brought forward. The Uncleared pill lists what no statement has cleared yet, and the export has a Cleared column with the statement's date. The Accounts page shows where each account is reconciled to, or that one is being reconciled. - A cleared line's quick look says which statement it cleared on, and its Edit window keeps its amount, date and account as they are (see Breaking Changes, Accounts, transactions and transfers). - Reconciling needs write access to Financial, and undoing a reconciled statement full access. Agents with read access can look at the statements. - The demo data reconciles Operating Checking and the Business Visa to each month's statement through last month. @@ -777,6 +786,7 @@ If you are coming from 26.08 or earlier, the database update still has to be run - 3.0.6: `payments.payment_import_key` and `revenues.revenue_import_key` (keyed), and `income_import_rules` (`import_rule_match` unique, `import_rule_action` - payment, income or transfer - `import_rule_client_id`, `import_rule_category_id`, `import_rule_account_id`, `import_rule_used_count`). - 3.0.7: no schema change. `accounts.account_type` is set from the name for every account without a kind from 1 to 6 (1 checking, 2 savings, 3 credit card, 4 cash, 5 payment processor, 6 other), the same way as `accountTypeGuess()`, with the 2023 liability types (20 to 29) as 3. Setup and `scripts/setup_cli.php` create the Cash account as type 4. - 3.0.8: `account_reconciliations` (`reconciliation_account_id` and `reconciliation_statement_date` keyed together, `reconciliation_starting_balance`, `reconciliation_ending_balance`, `reconciliation_notes`, `reconciliation_created_by`, `reconciliation_created_at`, `reconciliation_finished_by`, `reconciliation_finished_at` - NULL while in progress), and `payments.payment_reconciliation_id`, `revenues.revenue_reconciliation_id` and `expenses.expense_reconciliation_id` (keyed). + - 3.0.9: `account_reconciliations.reconciliation_opening` (0, 1 for an account brought forward as reconciled) and `reconciliation_adjustment` (`decimal(15,2)`, 0.00 - what its opening balance was corrected by), and `payments.payment_deposit_transfer_id` and `revenues.revenue_deposit_transfer_id` (NULL, keyed - the transfer out of a cash account they were deposited with). - New shared function files, loaded by `functions.php`: `functions/asset.php`, `asset_interface.php`, `certificate.php`, `client_overview.php`, `contact.php`, `credential.php`, `dashboard.php`, `links.php`, `location.php`, `notifications.php`, `project.php`, `rack.php`, `search.php`, `service.php`, `software.php`, `tags.php`, `ticket.php`, `ticket_fields.php`, `user.php` and `vendor.php`. They hold the queries and rules, so the pages, the API and cron share one definition. - Removed post models: `agent/post/{asset_interface,certificate,credential,domain,event,location,network_ip,network,recurring_ticket,vendor}_model.php`, `admin/post/user_model.php` and `api/v1/certificates/certificate_model.php`. Their handlers call the shared functions above. Interface handlers moved to `agent/post/asset_interface.php`. - New scripts: `js/itflow_select.js`, `quick_pick.js`, `tag_picker.js`, `global_search.js`, `notifications.js`, `dashboard.js`, `client_overview.js`, `client_switcher.js`, `credentials.js` and `autosubmit.js`, and `agent/js/calendar.js`, `calendar_event_modal.js`, `files.js`, `interface_form.js`, `network_form.js`, `project_modal.js` and `ticket_schedule_modal.js`. @@ -1024,6 +1034,12 @@ If you are coming from 26.08 or earlier, the database update still has to be run - `agent/transactions.php` takes `?reconciliation=` and `?show=uncleared`, and the `transactions` export adds `transaction_cleared` (off by default). `agent/modals/expense/expense_add.php` and `agent/modals/revenue/revenue_add.php` take `?account_id=`. - Seeds: `demoReconcileAccounts()` reconciles Operating Checking and the Business Visa monthly, and `demoDataRemove()` removes the reconciliations on the demo's accounts. - CSS: `.itflow-reconcile-table`, `.itflow-reconcile-ticked`, `.itflow-reconcile-balanced` and `.itflow-reconcile-bar`, which sticks to the bottom of the window - `.app-main` is `overflow: visible` on that page so it can. + - Brought forward: on an account never reconciled, `reconcileStart()` takes `start_from` ('statement'; anything else starts from the opening balance), `start_date` (on or before `statement_date`) and `start_balance` (owed, for a card), and first calls `reconcileBringForward($account, $to, $balance)` - a finished reconciliation with `reconciliation_opening` 1, starting at the opening balance and ending at the bank's, clearing every line up to the day before `start_date`. `reconcileOpening($account_id)` is that row, `reconcileOpeningGap($opening)` the bank's balance less ITFlow's there, and `reconcileCorrectOpening($id, &$error)` adds the gap to `accounts.opening_balance` and the row's starting balance once, keeping it in `reconciliation_adjustment`. `reconcileUndo()` deletes a brought forward row, freeing its lines and taking the adjustment back off the opening balance. `reconcileRow()` adds `opening`, `reconcileLock()` returns `reconciliation_opening` (worded by `reconcileLockText()` and `reconcileGlanceHtml()`), and the statement after it pre-ticks only the imported lines after the day brought forward to. `accountLedgerSql()` adds `txn_cleared_opening`. + - GET `reconcile_correct_opening` (the brought forward reconciliation's id) in `agent/post/reconcile.php`, at Financial 2, logged as an Account Edit. `reconcilePostInput()` adds `start_from`, `start_date` and `start_balance`. +- Deposits, in `functions/accounts.php`: `transferDepositCandidates($account_id, $limit = 200)` (payments and non-transfer revenues on the account, not in a deposit or archived, after the latest transfer out of it with nothing linked, by date then `*_created_at` - each with `kind`, `id`, `key`, `date`, `amount`, `what`, `client_name`, `method` and `reference`), `transferDepositLink($transfer_id, $from_account_id, $keys)`, `transferDepositItems($transfer_id)`, `transferDepositedIn($kind, $id)`, `transferDepositedGlanceHtml($deposit)` and `transferDepositRelease($kind, $id, $account_id)`. + - `transferSave()` takes `deposit` (`payment-12`, `revenue-5`; only on a new transfer, only lines on the account it leaves) and clears the links when an edit moves the account it leaves. `transferDelete()` clears them. `transferPostInput()` adds `deposit[]`. `edit_payment`, `bulk_edit_income` (Set Account) and `incomeRevenueSave()` call `transferDepositRelease()` before a line moves account. Linking and clearing leave `*_updated_at` as it was. + - `agent/modals/transfer/transfer_form.php` puts each cash account's waiting lines (account type 4) in `[data-transfer-deposit]`'s `data-deposits` JSON for a new transfer, and renders them as `deposit[]` checkboxes. `transfer.php` lists the deposit, and `payment.php` and `revenue.php` show the deposit it went in. + - CSS: `.itflow-deposit-list`. - The billing helpers (`billingTimeInvoice()`, `quoteConvert()`, `recurringInvoiceGenerate()` and the rest) take the agent's name as plain text. Their handlers now pass `stripslashes($session_name)`, so a name with an apostrophe no longer shows a backslash in history and the audit log. - Sidebar brand: `agent/css/sidebar_brand_fix.css` and `agent/js/sidebar_brand_fix.js` from 26.10 are replaced by CSS in `css/itflow_custom.css`. `includes/load_company_settings.php` now sets `$session_company_logo`. - `alertMessageHtml()` no longer double-encodes, and save messages built from `escapeSql()` values use `stripslashes()` at the flash. diff --git a/admin/database_updates/3.0.9.php b/admin/database_updates/3.0.9.php new file mode 100644 index 000000000..245cb587a --- /dev/null +++ b/admin/database_updates/3.0.9.php @@ -0,0 +1,27 @@ + = timeAgo($row['payment_created_at']) ?> from a bank statement + = transferDepositedGlanceHtml($deposited) ?> = reconcileGlanceHtml($cleared) ?>