Commit Graph
77 Commits
Author SHA1 Message Date
rickyandClaude Opus 5.5 e2a871b1e8 Customer page: Customers » name trail, actions under it, Open in QuickBooks
- The title is a trail back to the customer list, like Redmine's pages, instead of "Customer #id - name"
- The action links sit on their own line under the title (qbo-under-title, also used by
  redmine_qbo_vehicles), so a long name and the many actions don't crowd each other
- Open in QuickBooks joins the action links, as on the payments, invoice and estimate pages, in place of
  the name linking to QuickBooks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 17:47:19 -05:00
rickyandClaude Opus 5.5 489edd97fa Customers page lists every customer, paged by Redmine instead of will_paginate
- The Customers page shows all customers without a search: a Redmine list with name, phone, mobile,
  issue count and last update, sortable by column, with Redmine's pagination and per-page choices
- Search works as before (best matches first, a single match opens the customer); clicking a column
  sorts the matches by it instead, and Clear goes back to everyone
- New Customer and Sync move to the page's action links
- will_paginate removed from the Gemfile and init.rb; redmine_qbo_vehicles 2026.11.3 no longer needs it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 17:47:19 -05:00
rickyandClaude Opus 5.5 64e4a149ab Business report: only open projects in the project filter
Closed and archived projects aren't listed. A saved project that has since closed is dropped from the
filter (and from "Opens with"), so the report never filters by a project the picker can't show.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 17:02:24 -05:00
rickyandClaude Opus 5.5 51159d5034 Business report: project filter, remembered per user
- Projects picker (project tree, visible projects only) limits issues' estimated time and spent time
  to the chosen projects, in the totals, charts, last-year lines and months; none picked is every project
- Estimates, invoices and payments have no project in QuickBooks, so they stay whole-business; the page
  says so while filtered (the CPI's invoiced hours included)
- "Remember these projects" saves the choice in the user's Redmine preferences; the report opens with it
  when the address has no projects, and saving none goes back to every project

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:44:03 -05:00
Claude 8f2cef2bc8 Business report: week periods and line charts with last-year comparison
- This week and last week periods; weeks start on Redmine's "Start calendars on" day
- Sales and Hours line charts above the bars, same figures and colors, drawn with
  Redmine's bundled Chart.js: a point per day (a week), week (up to ~3 months) or month
- "Compare with last year" toggle adds dashed, faded last-year lines instantly and is
  kept in the URL; days/weeks go back 52 weeks so weekdays line up, months to the same month
- Legend: one entry per figure (hides both years' lines) plus a single "last year" entry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 21:58:58 -04:00
Claude bd29ec2978 Imported time replaces its own line, not one block at the first
Importing time with "Replace these lines" put all the time where the first ticked line was and removed the
others, so ticking several lines jumbled the invoice (time out of order, subtotals over the wrong lines).
Each time entry now takes the place of one ticked line: the one whose description is its issue's subject
(issues created from an estimate are named after the line: "Install #134: Install Lift Kit" replaces
"Install Lift Kit"), then any others in order. Extra time goes after the last replaced line; extra ticked
lines are removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 18:05:01 -04:00
Claude 03af3457ab Show invoice statuses
Invoices get a status badge on the customer page's invoice list and the invoice page: Paid, Partially
paid, Overdue, Open or Voided (zero total), worked out from the total, balance and due date like
QuickBooks' invoice list (RedmineQboBilling::InvoiceStatus; QuickBooks keeps no status on invoices).
The list uses the cached balance and due date; the invoice page uses QuickBooks' current figures.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 14:10:11 -04:00
Claude 0d35cffb83 Cost performance index on the business report
CPI = invoiced hours / spent hours, for the period and for each month, colour-coded: green at 1.00 or
more, yellow below 1, red below 0.80. It replaces the invoiced-vs-spent percentage (the same figure).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 13:51:19 -04:00
Claude d91e80199e Subtotal from the keyboard: sub, subtotal or = in a product box
Typing sub, subtotal or = in a line's product box, then Tab or Enter, adds a subtotal there: an otherwise
empty line becomes the subtotal; a line with a description, quantity or rate keeps them and gets the
subtotal after it. The next line's product box gets the focus. Lines with a product are left alone.
Tabbing into a box now selects its text right away, so the first key typed already replaces it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 13:06:03 -04:00
Claude d054b0d872 Math in the amount box
Arithmetic typed into a line's amount (e.g. 300*1.1) is rounded to the nearest penny and sets the rate from
the quantity, as a typed amount already did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 12:59:11 -04:00
Claude 632d81b98b Math in the rate and quantity boxes
Typing arithmetic into a line's rate or quantity (33*1.3, (120+15)/2; + - * /, x for times, parentheses)
works it out when leaving the box, and before saving; the amount updates while typing. Math in the rate is
rounded to the nearest penny, half up and exactly (1.005 -> 1.01). It's parsed, never run as code; broken
math is left as typed. A click right after a Tab no longer selects the box's text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 12:58:30 -04:00
Claude 331a2d1da7 Keyboard estimate entry: Tab picks the product; Tab selects the text
- In a line's product box, Tab picks the product the typed text points to: an exact name, else the only
  match, else the only name starting with it ("lab" -> Labor). Tabbing before the search comes back
  fills the line when it does; ambiguous text is left as typed; an item highlighted in the list still wins.
- Tabbing into a line's description, quantity or rate selects its text so typing replaces it (a click
  still places the cursor).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 12:56:49 -04:00
Claude 338b4db237 Mark an estimate Accepted when issues are created from it
Creating issues from an estimate means the work is going ahead, so a pending estimate becomes Accepted in
QuickBooks (sparse update with today's accepted date, like closing an estimate) and the local estimate is
synced, so its status badge updates. Accepted, Closed, Converted and Rejected estimates are left alone. A
failure is logged and doesn't affect the created issues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 12:36:05 -04:00
Claude 388ac915d7 Handle QuickBooks custom fields generically; no vehicle code left
redmine_qbo now works the same for any business; vehicle behaviour lives in redmine_qbo_vehicles.

- Every enabled QuickBooks text custom field gets a box on the estimate/invoice editor (the sales person
  is still filled in automatically). Forms keep custom_fields { field_id => value } instead of vin and
  mileage; Duplicate and Create invoice copy them all.
- Company: custom_field_matching(pattern) and editable_custom_fields; the VIN and Mileage name patterns
  are gone.
- Hooks are keyed by custom field id: qbo_billing_field_options (box suggestions) and
  qbo_billing_field_defaults (values for a document's work orders) replace the VIN hooks;
  qbo_billing_issue_values returns { field_id => { issue_id => value } }.
- Editor script API for plugins: window.qboEditor, the qbo:customer-changed and qbo:imported events, and
  the view_qbo_estimate_form_bottom hook to add a script. The VIN/mileage filling and the several-vehicle
  warning moved to redmine_qbo_vehicles.
- EstimateWriter.create_estimate(custom_fields:), custom_field_value and custom_field_values replace
  the vin/mileage arguments and vin_for.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 11:34:10 -04:00
Claude cb705d9525 Blank VIN on new documents; VIN from attached estimates; read estimate VINs with newer custom fields
- New estimates and invoices start with a blank VIN; picking a customer only fills the VIN box's
  suggestions.
- Importing an estimate whose work orders give no VIN fills the invoice's VIN box with the estimate's
  own VIN (open estimates now carry it).
- EstimateWriter.vin_for reads an estimate's VIN with QuickBooks' newer custom fields (cached a minute).
  The local Estimate's details leave those out, so plugins matching the estimate's VIN to a vehicle
  never found one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 10:52:39 -04:00
Claude abeb0fe0f5 Let plugins add fields to the Create issues from estimate page
View hook view_qbo_estimate_issues_form draws plugins' fields in the shared Issue fields box; values
posted as issue_plugin_fields[name] override the plugin defaults and reach qbo_billing_build_issue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 10:25:03 -04:00
Claude b84f39afce Fill the VIN on new estimates and invoices through a hook
New hook qbo_billing_default_vin, { customer:, issues: }: a blank estimate or invoice starts with the VIN
a plugin gives for the customer, and an invoice made from an estimate without a VIN gets the one for the
estimate's work orders. The editor only filled the VIN when the customer was changed or work orders were
imported, so pages opened with the customer already set started blank.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 10:17:25 -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 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
ricky 938f9d9f3b Add customer action hooks to _actions.html.erb for enhanced integration 2026-08-09 21:09:56 -04:00
ricky baca0ed6c7 updated readme 2026-07-02 22:48:25 -04:00
ricky 7c79f2388a removed Custom Field Synchronization 2026-03-28 00:32:22 -04:00
ricky e681203a45 Removed custom field sync, it was never really useful anyways. 2026-03-28 00:25:07 -04:00
ricky 643b15391b Added support for adding other QBO entities from othe plugins 2026-03-08 15:04:57 -04:00
ricky d8a26f98c0 updaed readme 2026-03-07 13:28:31 -05:00
ricky 8fc01cd8fb Updated Readme 2026-03-06 23:05:43 -05:00
ricky 924aa7657b Fixed typo 2026-01-28 10:11:28 -05:00
ricky 16fe07f177 Fixed typo 2026-01-28 08:50:37 -05:00
ricky 0227681e92 Added hook list to README 2026-01-28 08:41:55 -05:00
ricky ffdabccd84 Updated README with information about plugin hooks 2026-01-28 08:18:29 -05:00
ricky a90d6b839f Updated readme 2026-01-22 20:57:09 -05:00
ricky 3c2f1d0edd Merge branch 'redmine-6' into HEAD 2026-01-22 20:39:20 -05:00
ricky 20d9f0a84e update readme 2026-01-20 21:41:58 -05:00
ricky 0647b7708f Udated README & Copyright Date 2026-01-20 13:49:38 -05:00
ricky 7839116134 Version 2.0.0 2023-12-27 16:31:11 -05:00
ricky b686110145 Initial Vehicle Delete 2022-03-14 07:22:43 -04:00
ricky 3ff9132acb Updated readme 2022-03-13 01:00:34 -05:00
ricky 49507d06c7 Updated TODO list 2022-03-12 00:03:26 -05:00
ricky 89e4132fc1 Update readme & comments 2022-03-09 21:51:06 -05:00