Commit Graph
1556 Commits
Author SHA1 Message Date
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 bf7c7b0905 Sync services and other items without a description or rate
QuickBooks only requires an item's name, but the local Item required a description and a rate, so
services such as Labor (often with neither) failed validation and were silently skipped by the sync.
Name is now the only requirement; a missing description syncs as blank and a missing rate as 0.
Product/service pickers and the labor setting list sellable items only (no Categories or Bundles).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 09:34:22 -04:00
Claude 06a78ebccb Move vehicle code out to redmine_qbo_vehicles
- IssueMileageListener removed: redmine_qbo_vehicles answers qbo_billing_issue_values with mileage.
- New hook qbo_billing_build_issue sets plugins' fields on issues created from an estimate; the vehicle
  lookup by VIN moved to redmine_qbo_vehicles.
- New hook qbo_billing_vin_options gives the VIN box's suggestions (RedmineQboBilling.vin_options)
  instead of reading customer.vehicles.
- The customer page's New issue link script is generic: any checkbox with
  data-new-issue-param="issue[field]" fills that field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 09:12:52 -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 4732c32409 Combine the labor settings into Labor products/services
The estimate item codes and "Replaced by imported time" become one list of products/services
(RedmineQboBilling::LaborItems), used to create issues from an estimate's labor lines (and an
appointment's minimum hours), to offer an invoice's labor lines to be replaced by imported time, and
to total the hours on estimates and invoices for the business report. While none are chosen,
products/services named Labor are used. The old settings and redmine_qbo_calendar's fallbacks are no
longer read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 08:22:32 -04:00
Claude 616ee13725 Tidy the plugin settings page
- Three sections: QuickBooks connection, Synchronization and Billing.
- Synchronization is one table of every synced type (customers, employees, estimates, invoices,
  payments, items, accounts) with its count, last sync and a Sync link, plus Sync changes and Full sync.
  The separate billing stats and management boxes are folded into it.
- New payments sync (admin only).
- Sync links return to the page they were clicked on instead of the home page.
- Remove locale strings nothing uses any more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 08:11:27 -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 9fd6e90c81 Drop QuickBooks estimate and payment links from customer actions
Estimates and payments are handled in Redmine; each action shows only to users with its permission.
The customer's name still links to their QuickBooks account page as a fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 00:12:03 -04:00
Claude 14f0409395 Add a customer payments page
Payments on the customer page lists the customer's QuickBooks payments, newest first, with the
invoices each was applied to, memo, amount, unapplied credit and totals; each links to the payment
page and its PDF. A new View payments permission allows the list, payment page and PDF; Receive
payments includes it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 00:00:36 -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
Claude 48a4185c16 Replaceable Create Payment link on the customer page
view_customers_show_payment_link lets a plugin replace the link that opens
QuickBooks' receive payment screen (redmine_qbo_billing receives payments in
Redmine).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-30 23:28:32 -04:00
Claude 71f31ccbed Invoice actions hook on the customer page's invoice list
view_invoice_actions adds links after each invoice (redmine_qbo_billing adds
an Edit link).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-30 21:44:45 -04:00
Claude afca8eb6ea Estimate hooks: replaceable Create Estimate link and per-estimate actions
view_customers_show_estimate_link lets a plugin replace the customer page's
Create Estimate link (which opens QuickBooks). view_estimate_actions adds
links after an estimate on the customer page's list and the issue page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-29 23:56:07 -04:00
Claude 6ec8853508 Customer page: actions in the contextual area, with a plugin hook
- New issue, Create estimate, Create payment and Edit now sit in
  Redmine's top-right contextual area (icons, like issue pages) instead
  of an "Actions" column next to the customer details
- New view hook :view_customers_show_contextual (context: customer) for
  plugins to add their own action links there; replaces
  customer_actions_top / customer_actions_bottom (README updated)
- The New issue link still picks up the estimate / vehicle ticked on the
  page (script moved to customers/_new_issue_link_script)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-29 23:29:46 -04:00
Claude b99887362f Customer new/edit pages in Redmine's form style
- labelled_form_for with Redmine's "box tabular" layout: labels on the
  left, Display name marked required
- Breadcrumb headings ("Customers » customer"), Create/Save buttons and
  a Cancel link back to the customer (or the customer list)
- Keeps the form tag in the partial and the customer_name / customer_notes
  ids used by redmine_qbo_calendar's quick-create popup (hide_submit /
  hide_toolbar still supported)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-29 23:23:18 -04:00
Claude 0dd3073841 Customer page: Edit link in the contextual area instead of a button
Moves "Edit customer" from a button under the actions list to Redmine's
standard top-right contextual area (pencil icon, "e" access key), shown
only to users with Edit customers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-29 22:56:06 -04:00
Claude f1d81890de Restore AuthHelper#require_user for plugins that still use it
redmine_qbo_vehicles calls before_action :require_user; removing it in
the security fixes would break every vehicles page. It now simply
requires a logged-in user.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-28 22:57:45 -04:00
Claude c4ab97b75e Customer search: bundled nickname data and sound-alike matching
- Nicknames now come from the carltonnorthern/nicknames data set
  (Apache 2.0, ~2,800 pairs, bundled in data/nicknames with its license),
  plus a few extra groups in EXTRA_NICKNAME_GROUPS. Names match if
  directly linked, or if both are short for the same longer name, so
  Bill/William and Bill/Will match but William/Robert don't (the data
  lists "bill" for both)
- Double Metaphone (text gem) matches names that sound alike but are
  spelled differently: Jon/John, Smyth/Smith, Cathy/Kathy,
  Steven/Stephen, Jeffrey/Geoffrey
- Faster ranking: per-search word-pair scores are cached, whole-name
  comparison only runs when it can succeed, and prepared search data is
  kept in process memory until a customer changes (~40 ms per search at
  5,000 customers)

Adds gem 'text', '~> 1.3' to the Gemfile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-28 22:22:00 -04:00
Claude 0523e8dd24 Security, permission and search fixes
Security
- Connecting to QuickBooks (authenticate/oauth_callback) and all syncs
  are admin-only; the OAuth state is stored and verified on callback
- New "Bill issue time to QuickBooks" project permission; billing is now
  a POST and checks the permission and issue visibility
- Estimate/invoice PDFs require a logged-in user, or a customer share
  link limited to the estimate and invoices attached to that issue
  (the old require_user check never ran)
- Attachments patch keeps the share token per request instead of in
  Thread.current, so it can't leak into other requests

Permissions and share links
- customers#autocomplete and the filter_* actions are part of View
  customers, so non-admins can pick customers on forms
- customers#view no longer goes through authorize_global; share needs
  the new "Share issues with customers" permission and a visible issue
- Removed a check in customers#view that compared a value to itself

Bugs
- Subjects and customer names capitalize each word without lowercasing
  the rest (LED, JL, 4x4 stay as typed); subjects only when changed
- Settings page shows Invoice/Estimate sync times (Item/Account models
  no longer exist)
- customers#update shows validation errors instead of reporting success
- Billing marks each activity billed once sent to QBO, so retries and
  token refreshes don't create duplicate TimeActivities

Search
- New CustomerSearchService for autocomplete and the customer search
  page: nicknames (Bill/William), typos, word order, partial words,
  accents, and phone digits in any format; ranked, with the candidate
  list cached until a customer changes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-28 22:08:36 -04:00
ricky aacc2d645d Refactor customer form layout for improved readability and structure 2026-10-23 09:34:50 -04:00
ricky bab019a152 Implement global permissions for customer actions and update views to check permissions before rendering buttons 2026-09-08 22:35:52 -04:00
ricky ba40496421 Enhance autocomplete functionality to support name and phone queries with fuzzy matching 2026-08-25 16:05:51 -04:00
ricky 9dc4b79355 Refactor customer controller and form to enhance error handling and conditional rendering 2026-08-24 20:17:21 -04:00
ricky b72c82fb2b Dynamically update the link with estimate id 2026-08-17 21:03:37 -04:00
ricky b901e64149 added new issue link to actions 2026-08-17 20:40:42 -04:00
ricky 75e5aeb668 Refactor customer details and form views for improved readability and consistency 2026-08-11 18:39:23 -04:00
ricky c31ec82e61 Normalize customer name before saving and update QBO display name accordingly 2026-08-10 15:20:14 -04:00
ricky 938f9d9f3b Add customer action hooks to _actions.html.erb for enhanced integration 2026-08-09 21:09:56 -04:00
ricky f2b0186ee2 Add EstimateService class 2026-08-09 20:50:20 -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 6bf84dd61a Added payment link 2026-07-01 14:06:02 -04:00
ricky e681203a45 Removed custom field sync, it was never really useful anyways. 2026-03-28 00:25:07 -04:00
ricky 4a6c414d9e Updated customer form to use auto complete to help prevent duplicate customer enteries 2026-03-26 07:56:59 -04:00
ricky 1dcccd7b98 Merge branch 'master' into rails-7 2026-03-21 10:28:46 -04:00
ricky 7cd388dbd4 Fixed webhook 2026-03-21 10:26:57 -04:00
ricky 7149e85d37 Updated how settings are handled.
Note: Breaking change. Will need to update settings after update
2026-03-21 10:25:46 -04:00
ricky ee2ab04206 added placeholder 2026-03-19 18:15:04 -04:00
ricky cc36bc16b4 use the autocomplete 2026-03-19 10:36:46 -04:00
ricky 82712f361c fixed estimate path 2026-03-19 08:07:34 -04:00
ricky b367687113 Implmented custom autocomplete for customer field 2026-03-18 21:55:55 -04:00
ricky 460bcd466f Fixed routes 2026-03-18 19:11:33 -04:00
ricky 020ea01d36 renamed controllers and updated routes 2026-03-18 00:08:56 -04:00
ricky 7d3908ec41 fixed estimate#sync 2026-03-17 23:31:42 -04:00
ricky f60e507029 Updated settings page 2026-03-17 21:23:29 -04:00
ricky c2d0e5c702 Improved qbo hooks to allow a single entity or an array of entities 2026-03-16 08:18:11 -04:00
ricky 3e81d2840a fixed typo 2026-03-15 17:59:53 -04:00
ricky c9a5dc20f9 Added manual sync links 2026-03-15 08:01:04 -04:00
ricky b8327be5d6 Updated to handle no qbo exception 2026-03-14 21:45:15 -04:00
ricky c4e1ece82c Merge branch 'master' into dev 2026-03-14 17:30:53 -04:00