Commit Graph
30 Commits
Author SHA1 Message Date
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 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
ricky 9373963c94 Fix association type for issues in Estimate model 2026-08-09 20:47:55 -04:00
ricky d18a0c180a added name function to estimate 2026-08-06 07:55:51 -04:00
ricky fd18205c10 Refactored all Sync Jobs into QboSyncJob 2026-03-13 23:26:02 -04:00
ricky 2bcb1840a4 Added qbo_sync flag 2026-03-13 08:33:18 -04:00
ricky 4fa8be856a Refactored models to use base model 2026-03-12 11:14:45 -04:00
ricky 28db5cb8c8 removed unused code 2026-03-02 22:50:43 -05:00
ricky f02b50ae26 Added time stamps to each qbo entity model 2026-03-02 07:10:13 -05:00
ricky ed111fefe7 Refactor: Update QBO connection handling to use QboConnectionService for consistency across services and controllers 2026-03-01 00:27:06 -05:00
ricky 6e90548dbb Removed unused method 2026-02-28 22:56:03 -05:00
ricky 19911b7940 Refactor EstimateSyncJob to support syncing by ID and document number; add EstimateSyncService for handling estimate synchronization 2026-02-28 08:24:25 -05:00
ricky a80f59cc45 Refactor sync_by_id method in Estimate model to use EstimateSyncJob for syncing 2026-02-28 07:50:23 -05:00
ricky 9c0f153518 Refactor logging across controllers and jobs to use a centralized log method; improve consistency and readability of log messages 2026-02-27 22:32:07 -05:00
ricky f32b48296d Refactor estimate synchronization to use EstimateSyncJob; remove direct sync logic from Estimate model for improved background processing 2026-02-27 08:29:52 -05:00
ricky b80e1d4e28 loose the hash rocket, use symbol keys 2026-01-29 22:30:59 -05:00
ricky d3a8c05f50 Added missing to_s method 2026-01-29 21:36:50 -05:00
ricky 1f03908040 Refactor employee and estimate models by removing redundant comments; update locale file to remove item references; delete unused QboItemTest file. 2026-01-28 07:45: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 7eb26facaf Use the first result 2024-08-19 22:49:20 -04:00
ricky 9e7c1dbfb2 removed () 2024-08-19 22:38:16 -04:00
ricky dd9ac3c481 Added Estimate.sync_by_doc_number 2024-08-19 22:30:34 -04:00
ricky 0c72ca9294 missed this authenticated_request 2023-12-30 23:01:32 -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 3220ff728f Fixed process_estimate that I accidently broke 2022-04-06 12:45:40 -04:00
ricky a75f1abd71 Removed extra white spaces 2022-03-09 22:53:03 -05:00
ricky 09c497ff96 Removed old #attr_accessible... comments 2022-03-09 22:31:19 -05:00
ricky 24f8be6e80 Drop the Qbo prefix 2022-03-09 21:31:56 -05:00