Commit Graph
85 Commits
Author SHA1 Message Date
Claude 6f40308029 Fix migration 050 on MySQL; add the estimate status column
- 050 wrote the kept rows' times back with their zone offset ('2026-10-31 10:06:08 -0400'), which MySQL
  refuses; dates and times are now written with Rails' quoted_date. Each record's delete and re-insert
  run in one transaction, so a failure can't leave it deleted.
- 051 adds estimates.txn_status for databases that ran migration 047 before that column was added to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 11:52:32 -04:00
Claude b739b84917 Fix duplicate estimates: make QuickBooks ids unique
The customers, employees, estimates and invoices tables were created with
t.integer :id, options: 'PRIMARY KEY', which Rails ignores, so the QuickBooks id was never unique. Two
syncs of the same record at once (saving an estimate in Redmine, then QuickBooks' webhook) inserted it
twice, so it showed twice on the customer page and counted twice on the business report.

- Migration 050 keeps one row per id (the most recently updated) and adds a unique index on id.
- A sync that collides with another one's insert retries once as an update.
- Estimates, customers and employees validate a unique id, like invoices already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 11:48:23 -04:00
Claude 28538d4c7f Show when a QuickBooks sync is running
Syncs record their state in a new qbo_sync_statuses table: queued when asked for, running with how
many records have been read, removed when finished (stale rows are ignored after 6 hours). The
business report says when estimates, invoices or payments are still syncing and refreshes every 30
seconds until they finish; the settings page's Synchronization table shows the same per type.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 10:03:12 -04:00
Claude 3304fce92f Make billed estimates read-only
An estimate that's Converted or Closed in QuickBooks, or linked to an invoice, opens read-only and is
refused on save (this includes redmine_qbo_lineitems' estimates once invoiced). Its page lists the
invoices it's on. Estimates cache their status so lists show View instead of Edit for them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 08:34:41 -04:00
Claude 062ef9b8b3 Cache totals, man-hours and payments; add a business report
- Estimates now keep their total; estimates and invoices keep their man-hours: the quantities of the
  products/services set as "Replaced by imported time" (bundles included; the estimate item codes
  while that setting is blank). Filled in by the webhook and the sync.
- Payment model (QboBaseModel) caching each payment's customer, date, amount and unapplied amount,
  kept current by the webhook, the sync and the Receive payment page.
- Business report (View business reports permission, top menu): estimates written vs. invoices written
  vs. payments received, and estimated hours on estimates and issues vs. invoiced and spent hours, for
  a period, with a month-by-month breakdown.
- Fix two keyword arguments that defaulted to themselves (QboSyncDispatcher.enque_jobs, PdfService),
  which newer Ruby refuses to parse.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 07:54:28 -04:00
Claude 9121e079a0 Fold redmine_qbo_billing into redmine_qbo
Estimates, invoices and payments written in Redmine, issues from estimates,
and the QuickBooks product/service list and accounts are now part of this
plugin (the RedmineQboBilling code, its controllers, views, strings and
permissions), so there's one plugin and one version instead of two that had
to match.

- The customer page, estimate and invoice lists and the issue page render the
  Create Estimate / Create invoice / Receive payment and Edit links directly;
  the hooks that only existed to let billing add them are gone. Users without
  the billing permissions still get the links to QuickBooks.
- Migrations 043-046 create the items and accounts tables and the estimate
  line links, skipping whatever an existing database already has
  (redmine_qbo_lineitems' tables are used as they are), and copy calendar's
  existing estimate line links in.
- The billing settings are a section of this plugin's settings page.
- The hooks other plugins use stay: qbo_billing_issue_values,
  qbo_billing_validate, qbo_billing_issue_defaults, qbo_billing_issues_created
  and view_qbo_estimate_contextual.
- rake redmine_qbo:relate_estimate_issues

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-30 23:47:01 -04:00
ricky 0df15693d2 removed unused begin 2026-03-02 22:49:53 -05:00
ricky 5a662f67b8 Removed sync from migration 2026-02-28 23:45:55 -05:00
ricky 6f8af9bba8 Implement Employee synchronization; add EmployeeSyncJob and EmployeeSyncService for improved background processing and logging 2026-02-27 23:07:12 -05:00
ricky 03109d5775 Refactor invoice processing and synchronization; implement InvoiceSyncJob and related services for improved background processing and logging 2026-02-27 22:33:04 -05:00
ricky 3d37f01bff Added timestamps to estiamtes and invoices 2026-02-27 08:08:39 -05:00
ricky 65db8f00a8 Improve customer search with Full-Text index and phonetic matching 2026-02-22 19:07:20 -05:00
ricky a54de28db5 Extending customers to Redmine's built in search 2026-02-21 11:20:20 -05:00
ricky b80e1d4e28 loose the hash rocket, use symbol keys 2026-01-29 22:30:59 -05:00
ricky 02b48d2de4 Dont add reference for customers to projects 2026-01-27 18:07:37 -05:00
ricky 3c2f1d0edd Merge branch 'redmine-6' into HEAD 2026-01-22 20:39:20 -05:00
ricky 2aeb3fa028 Updated copyright dates 2026-01-21 20:40:06 -05:00
ricky dac9a7c756 Started Support for Redmine 6 2024-12-12 06:00:36 -05:00
ricky 02b5fb4d0e Fixed returned variable handling 2023-12-30 22:53:08 -05:00
ricky bf417c163c Rework performing authenticated requests 2023-12-30 22:33:28 -05:00
ricky 45056e8ff4 Remove unsed columns 2023-12-30 19:28:04 -05:00
ricky d6ec34cef9 added realm_id 2023-12-30 12:56:46 -05:00
ricky 517a239485 Started reworking Oauth token sorage 2023-12-30 12:39:51 -05:00
ricky b686110145 Initial Vehicle Delete 2022-03-14 07:22:43 -04:00
ricky 25159c760a FIX - forgot to drop qbo from time_entries.billed 2022-03-13 01:17:18 -05:00
ricky a75f1abd71 Removed extra white spaces 2022-03-09 22:53:03 -05:00
ricky 24f8be6e80 Drop the Qbo prefix 2022-03-09 21:31:56 -05:00
ricky 3159289ac0 Removed unused code, only need to bill time
removed line items, payments, drop used db tables
2022-03-06 17:26:57 -05:00
ricky 495243d177 Add trim & doors to vehicle 2022-03-06 08:59:48 -05:00
ricky 6ad4929d53 Sync Estimates & Invoices on database update 2022-02-21 05:17:35 -05:00
ricky 255af13b20 Add txn_date to invoice & estimate databse 2022-02-20 17:40:41 -05:00
ricky f66fbf6656 specified the rails version in migrations 2022-02-12 16:14:36 -05:00
ricky b5d17dc862 Removed oauth1 database columns & updated settings 2020-01-05 12:21:36 -05:00
ricky e6c5feb3f3 Remove uneeded columns from qbos table 2020-01-05 12:03:19 -05:00
ricky fd85f296de Update 030_update_qbos_token.rb 2020-01-04 22:16:07 -05:00
ricky 35a7c3cfeb Create 030_update_qbos_token.rb 2020-01-04 13:28:22 -05:00
ricky 647923e5e6 Update 029_update_qbos_types.rb 2020-01-04 13:19:21 -05:00
ricky 70ca4e9964 Create 029_update_qbos_types.rb 2020-01-04 13:17:15 -05:00
ricky b4f5112fc3 Create 028_add_customers_mobile_phone_number.rb 2019-06-25 12:46:03 -04:00
ricky 9e9b29fef9 Update 027_add_customers_phone_number.rb 2019-06-25 11:53:40 -04:00
ricky 61c76ad80a Create 027_add_customers_phone_number.rb 2019-06-25 10:59:34 -04:00
ricky 7412ac4f91 Added boolean billed 2018-03-31 08:03:26 -04:00
ricky ea502d5b7b Create 026_create_line_items.rb 2018-03-29 10:05:37 -04:00
ricky d98a8b8cc4 Fixed Project releationships and database migration 2017-11-17 10:14:05 -05:00
ricky 71cfa28817 Create 025_update_projects.rb
Added customer & vehicle reference to a project.
2017-11-13 19:40:14 -05:00
ricky 3be69d5efd Update 024_update_invoices_and_estimates.rb 2017-04-02 07:00:43 -04:00
ricky eff1f97ab2 Create 024_update_invoices_and_estimates.rb 2017-04-02 06:56:17 -04:00
ricky 224b0b4238 Update 023_create_customer_tokens.rb 2016-09-01 23:57:24 -04:00
ricky 63d969c844 Added Customer Token Model 2016-09-01 23:45:51 -04:00
ricky 1138b0d5c9 Rename 21_add_issues_qbo_invoices.rb to 021_add_issues_qbo_invoices.rb 2016-09-01 23:37:07 -04:00