## v3.0.2 edit invoice Save and Send - 2026-06-01 UTC - Added a second button on the admin Edit Invoice page: “Save and Send”. - “Save Invoice” keeps the existing save-only behavior. - “Save and Send” saves the invoice first, then reuses the existing invoice email workflow. - The email workflow continues to generate and attach the invoice PDF. - Successful sends redirect back to the invoice view with `email_sent=1`. - Failed sends redirect back to the invoice view with `email_failed=1`. - Works with the v3.0.1 multi-line invoice edit workflow. Verified: - Save Invoice still saves without sending. - Save and Send saves the invoice and sends the client invoice email. ## v3.0.1 multi-line invoice edit safety - 2026-06-01 UTC - Updated admin invoice edit workflow to preserve multi-line invoice items. - Edit Invoice now loads existing `invoice_items` rows instead of treating the invoice as one total/notes row. - Save Invoice now recalculates subtotal from edited line items. - Save Invoice now preserves separate `subtotal_amount`, `tax_amount`, and `total_amount` fields. - Save Invoice now recreates `invoice_items` from submitted line rows without flattening the invoice into one line. - Added editable Tax / HST field plus a “Set 13% HST” helper button. - Locked invoices with payment activity still protect core accounting fields and line items. - This prevents converted invoices such as INV-0041 from being accidentally collapsed if opened and saved. ## v3.0.0 selected portal invoice downloads - 2026-05-29 UTC - Added invoice selection checkboxes to the client portal dashboard. - Added a select-all checkbox in the portal invoice table header. - Converted portal invoice ZIP download from all-only GET behavior to GET/POST behavior. - Clicking “Download All Invoices” with no invoices selected still downloads all portal invoices. - Clicking “Download All Invoices” with checked invoices downloads only the selected invoices. - Selected downloads use `selected_invoices.zip`; full downloads continue using `all_invoices.zip`. - Auto-refresh now pauses when one or more invoice checkboxes are selected so the page does not reload during selection. - Existing portal invoice authorization is preserved: downloads are restricted to the logged-in client’s own invoices. Verified: - No selected invoices downloads all invoices. - Selected invoices download only those invoice PDFs. - Header checkbox selects/deselects visible invoices. ## v2.0.9 portal account-credit payments - 2026-05-29 UTC - Added portal “Use available credit” payment option for unpaid CAD invoices. - Added `/portal/invoice//apply-credit` route. - Added first-class `credit` value to `payments.payment_method`. - Applying credit now writes a confirmed `payments` row with `payment_method='credit'`. - Applying credit now writes a matching `credit_ledger` debit using `entry_type='invoice_deduction'`. - Invoice totals/status are recalculated through the existing `recalc_invoice_totals()` workflow. - Portal invoice detail now shows credit success/error messages. - Portal payment history and admin invoice payment history now show Credit payments. - Added SQL migration record: `sql/migrations/20260529_v2_0_9_credit_payment_method.sql`. Verified: - INV-0045 / invoice id 52 was paid using $11.30 CAD account credit. - Credit ledger balance dropped from $25.00 CAD to $13.70 CAD. ## v2.0.8 multi-line invoice creation - 2026-05-29 UTC - Added multi-line invoice item creation on the admin Create Invoice page. - Added “+ Add Line” support with per-line description, quantity, unit cost, and HST checkbox. - Invoice subtotal is now calculated from the sum of all line totals. - HST is calculated from taxable lines only. - Invoice creation now inserts one invoice_items row per invoice line. - Admin invoice view now displays all invoice line items with quantity, unit cost, and amount. - Invoice PDFs now render all invoice line items instead of only the invoice-level notes field. - Existing single-line invoices remain compatible. - Fixed Create Invoice table header/input styling for dark theme readability. ## v2.0.7 PDF invoice description wrapping - 2026-05-29 UTC - Fixed invoice PDFs so long invoice descriptions wrap across multiple lines instead of being truncated. - Updated PDF invoice item line to show subtotal/line amount instead of tax-included total. - PDF totals now show HST only when tax exists. - Portal Download All Invoices now creates client-copy PDFs without the optional invoice footer block. - Kept admin/portal HTML invoice views unchanged. ## v2.0.6 health revenue dashboard - 2026-05-29 UTC - Added Square / Revenue Health panel to /health. - Added confirmed payment totals for today, this month, and this year. - Added all-confirmed payment totals alongside Square-only totals. - Added latest confirmed payment summary. - Added Receivables Aging panel showing unpaid invoice totals and aging buckets. - Added matching revenue and receivables data to /health.json. - Cleaned health labels from Operations Bal / Treasury Bal to Operations Balance / Treasury Balance. ## v2.0.5 final invoice workflow - 2026-05-29 UTC - Create Invoice now supports a real invoice line description, quantity, unit cost, and optional 13% HST checkbox. - Invoice subtotal is calculated as quantity × unit cost. - Tax is calculated server-side only when Apply 13% HST is checked. - Invoice totals now store subtotal_amount, tax_amount, and total_amount correctly. - Portal invoice detail now displays Subtotal, HST 13% when applicable, Total Amount, Paid, and Outstanding. - Invoice item descriptions support long invoice text through invoice_items.description as TEXT. - Existing invoices are preserved. ## v2.0.5 portal invoice summary fix - 2026-05-29 UTC - Portal invoice detail now selects subtotal_amount and tax_amount from invoices. - Portal invoice summary now displays Subtotal, HST 13% when tax exists, Total Amount, Paid, and Outstanding correctly. - Reconciliation refresh path also preserves formatted subtotal and tax values. ## v2.0.5 follow-up - 2026-05-29 UTC - Added Qty to Create Invoice. - Unit Cost now combines with Qty to calculate invoice line subtotal. - Portal invoice detail now shows invoice subtotal, HST 13% when present, total amount, paid, and outstanding under the invoice items table. ## v2.0.5 - 2026-05-29 UTC - Updated Create Invoice flow to use Cost / Subtotal plus optional 13% HST checkbox. - Final Total Amount is now calculated from subtotal + tax server-side. - Invoice line description is entered as a proper multi-line description and stored in invoice_items. - Invoice view/print output now shows line amount as subtotal and hides the tax row when tax is zero. - Preserves existing invoices and uses existing subtotal_amount, tax_amount, and total_amount columns. ## v2.0.2 - 2026-05-24 19:40 UTC - Added Square / Revenue Health panel to /health before crypto balance panels. - Revenue panel now uses confirmed rows from the payments table, not invoice guesses. - Shows Square confirmed payment count + CAD total for today, this month, and this year. - Shows all confirmed payment count + CAD total for today, this month, and this year. - Added Receivables Aging panel with current, 1-30, 31-60, 61-90, and 90+ day unpaid buckets. - Renamed health cards from Operations Bal / Treasury Bal to Operations Balance / Treasury Balance. # OTB Billing - v2.0.2 Build date: 2026-05-18 ## v2.0.1 changes - Fixed Reconcile Now feedback on /health. - Removed the persistent "Manual reconcile started" message from the Crypto Reconcile card. - Kept the bottom-right temporary toast notification for manual reconcile feedback. - Toast automatically disappears after 3 seconds and cleans the reconcile query string from the browser URL. - Footer/app version bumped from v2.0.0 to v2.0.1. # OTB Billing - v2.0.0 Build date: 2026-05-18 ## v2.0.0 changes - Promoted OTB Billing to v2.0.0. - Added Last Run and Last Result fields to the Crypto Reconcile health card. - Last Run is read from systemd one-shot service timestamps for otb-billing-crypto-reconcile.service. - Confirmed Crypto Reconcile remains a normal card in the main /health grid. - Existing health cards remain: - Status - Database - Uptime - Load Average - Memory - Disk - Operations Bal - Treasury Bal - Crypto Reconcile - Existing Operations Bal and Treasury Bal cards retain clickable explorer links for USDC, ETH, ETHO, EGAZ, and ETI. - Reconcile Now button remains available on /health to manually start the crypto reconciliation worker. - Footer/app version bumped from v1.4.0 to v2.0.0. # OTB Billing - v1.4.0 Build date: 2026-05-18 ## v1.4.0 changes - Added clickable explorer links for payment asset names in the Operations Bal and Treasury Bal cards. - Added Crypto Reconcile health card to the main /health grid. - Crypto Reconcile card now shows: - timer status - service status - pending crypto payments - confirmed crypto payments today - stale pending crypto payments - Added Reconcile Now button on /health to manually trigger the existing crypto reconciliation worker. - Fixed crypto payment queue stats to use the project DB helper instead of guessing DB config. - Kept the reconcile worker as a systemd timer-triggered one-shot service; inactive service state between runs is expected when the timer is active. - Bumped footer/app version from v1.3.0 to v1.4.0. # OTB Billing - v1.3.0 Build date: 2026-05-17 ## v1.3.0 changes - Added health-page wallet balance cards for the OTB Operations wallet and OTB Treasury wallet. - Renamed the original wallet card to "Operations Bal". - Added matching "Treasury Bal" card. - Balance cards show the configured payment assets: - USDC on Arbitrum - ETH on Ethereum - ETHO on Etho Protocol - EGAZ on Etica - ETI on Etica - Added the same balance data to /health.json using: - operations_balances - treasury_balances - wallet_balances retained as backward-compatible alias for operations_balances. - Added RPC fallback handling for public Arbitrum/Ethereum RPCs so health checks are less likely to fail on single-provider HTTP 403 responses. - Confirmed explorer aliases for the OTB Operations wallet on Etica and ETHO Blockscout explorers. ## v1.2.0 (2026-05-03) - Platform-level Service Agreement - Improved privacy and data messaging - Multi-service legal structure ## v1.1.0 (2026-05-03) - Portal-based Android app downloads - Secure APK delivery via authenticated route - OTB Cloud card now includes app download button ## v1.0.0 (2026-05-03) - Clickable portal invite links - Direct account activation from email - Improved onboarding UX ## v0.6.2 - 2026-04-23 ### Changes - Continued Service Templates integration - Template selection fully wired into service create/edit flows - Stability improvements to service form handling ### Cleanup - Removed log files from git tracking - Ignored patch scripts and runtime logs ### Notes - Ready for template_id linkage phase ## v0.6.1 - 2026-04-18 ### Added - Service Templates system (standalone pricing catalog) - Admin UI for managing reusable service pricing - Template selector on service create/edit pages (auto-fill fields) ### Notes - Templates are not yet linked to services via template_id (planned) - Setup amount stored in templates for future invoice integration - Maintains compatibility with existing services table --- ## v0.6.0 - 2026-04-11 01:49:22 ### Highlights - Added authenticated /portal/services page as a service hub - Introduced modular route backend/routes/portal_services.py - Created shared templates/portal_base.html layout - Converted portal pages to base-template architecture - Added service cards (Follow-me, Video, Miner Rentals) - Fixed branding, nav, footer, and toggle consistency - Corrected Follow-me external link - External services now open in new tabs - Improved identity display for logged-in user ### Notes - portal_base.html is now the standard structure for future pages and projects - Billing portal is now the launch point for all OTB services ## v0.5.3 - 2026-03-27 21:25:11 - Fixed stale pending crypto payment lock issue so abandoned wallet attempts no longer trap the invoice - Confirmed crypto quote expiry and refresh flow works cleanly - Improved wallet/payment lifecycle stability for MetaMask and Rabby - Added retry logic for payment-received emails - Fixed dark-mode styling for the payment method dropdown - General crypto payment UX and recovery cleanup ## 2026-03-27 — v0.5.2 - Added retry logic for payment-received emails - Payment email helper now retries up to 3 times with delay - Added clearer retry failure logging for email send issues ## 2026-03-27 — v0.5.1 - Fixed crypto payment email auto-send path - Fixed payment-received emails to attach the real invoice PDF - Switched helper PDF generation to use the working invoice PDF route - Added explorer link into the payment-received email body - Improved invoice PDF payment section with time, TXID, wallet, and rate display - Cleaned helper error handling back to safe non-debug behavior ## 2026-03-27 — v0.5.1 - Fixed crypto payment email auto-send failure - Replaced internal PDF generator call with route-based PDF fetch - Restored PDF attachments in payment emails - Improved Payments Applied layout in invoice PDF (multi-line details + rate display) - Stabilized send_payment_received_email() (removed debug raise, safe failure handling) ## v0.5.0 - 2026-03-14 22:01:59 - Added per-invoice Square payment links - Added Square webhook validation and automatic invoice payment application - Added duplicate webhook protection - Added Square reconciliation page with filters and summary cards - Added Accountbook page with today / month / YTD totals - Added Accountbook CSV export - Added reminder worker logging plus systemd service/timer - Confirmed end-to-end automatic Square payment flow updates invoice, payments table, portal state, and email notifications ## v0.4.3 - 2026-03-13 Portal lifecycle features completed. New functionality: - Portal invite email from admin panel - Portal password reset email from admin panel - Single-use access code behavior clarified and enforced - Portal password reset invalidates previous credentials - Admin controls for portal enable/disable and code reset - Portal access wording updated to reflect single-use token design Existing functionality confirmed: - Client portal login - Forced password creation - Invoice dashboard - Invoice detail view - PDF invoice download - Deduplicated backend/app.py This version represents the first **complete client portal credential lifecycle**. ## v0.4.2 - 2026-03-12 - Deduped backend/app.py and removed duplicated major route/function sections. - Removed the text_for_pdf_routes snapshot hack from active runtime path. - Added secure portal-safe invoice PDF route. - Confirmed portal login, dashboard, invoice detail, invoice itemization, and PDF access flow. - This version is the first clean post-dedupe checkpoint. ## v0.4.1 - 2026-03-12 - Added secure client portal login using email plus one-time access code. - Added forced password setup on first portal login. - Added client portal dashboard with invoice listing. - Added portal invoice detail page. - Wired new and editable invoices to create invoice_items automatically. - Confirmed live admin edits refresh correctly in client portal views. - Polished invoice edit notice bar contrast for dark theme. - This version is the pre-refactor savepoint before cleaning duplicate sections in backend/app.py. - System package dependency note: install `zip` on deployment hosts for release snapshot creation. ## v0.4.0 - 2026-03-12 - Released stable service-managed build of OTB Billing. - Added working /health styled page and /health.json endpoint. - Added health backend module for app/server/db/disk/memory status reporting. - Added .env-based runtime configuration through run_dev.sh shell loading. - Moved runtime control to systemd via otb_billing.service. - Confirmed reboot persistence and mintme webfront reachability through LAN bind on port 5050. - Kept debug off and reloader disabled for stable service operation. # otb-billing ## v0.3.0 — 2026-03-09 Major operational milestone release. New Features ------------ - Revenue reporting system - JSON export for reports - Batch invoice printing - Batch CSV export - Filtered invoice export - Invoice logo support (PDF + print) - Business identity settings - Report frequency selector (monthly / quarterly / yearly) Infrastructure -------------- - Improved reporting backend - Cleaner filter handling - Settings system extended - Print layouts stabilized ## v0.3.1 — 2026-03-09 Milestone release. Features included ----------------- - Invoice PDF generation - Invoice email sending - Settings/config system - Branding/logo support - CSV exports - Filtered invoice export - Batch PDF ZIP export - Batch print - Revenue report - Revenue JSON export - Accounting package ZIP export - Email delivery for reports and accounting package Notes ----- - Core billing/export/report workflow is now operational. - Email logging/audit trail is planned for a future release. ## v0.3.1 — 2026-03-10 Milestone release. Features included ----------------- - Invoice PDF generation - Invoice email sending - Settings/config system - Branding/logo support - CSV exports - Filtered invoice export - Batch PDF ZIP export - Batch print - Revenue report - Revenue JSON export - Accounting package ZIP export - Email delivery for reports and accounting package - Email audit logging Notes ----- - Core billing/export/report workflow is now operational. - Email log table records invoice, revenue report, and accounting package sends. ## Installer From the project root: ```bash chmod +x install.sh ./install.sh ## Installer From the project root: chmod +x install.sh ./install.sh The installer will install dependencies, configure MariaDB, create the database, and start the service. ## Installer From the project root: chmod +x install.sh ./install.sh The installer will: - install Python and MariaDB dependencies - copy the app to the target path - create a Python virtualenv - install requirements.txt - create the database and import schema - create the systemd service - start the service