Commit Graph
483 Commits
Author SHA1 Message Date
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 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 b8ddf1c38b Issue PDF: allow plugin rows with an HTML value
Rows from the :pdf_left / :pdf_right hooks can now be
[label, text, { html: "..." }]; the value is drawn with writeHTMLCell so
part of it can be bold (used by redmine_qbo_vehicles to bold the last 8
of a VIN). The text still sizes the row, plain rows are unchanged, and
PdfPatch::PDF_HTML_VALUES lets plugins check for support.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-29 20:21:07 -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 04a0eede5f Register customer and estimate fields with SubtaskFieldCopier if the plugin is installed, ensuring uniqueness to prevent duplicates. 2026-08-26 21:21:22 -04:00
ricky 8ae82f1423 Updated pdf patch to support markdown tables 2026-08-18 13:14:53 -04:00
ricky 7abb1aa06c fixed customer view to show attachments 2026-08-17 20:22:23 -04:00
ricky 396a56ceec Refactor associations in IssuePatch for clarity and consistency 2026-08-09 20:47:42 -04:00
ricky 61b02831e3 removed comment 2026-03-28 06:40:59 -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 eacdecd65b Updated patches and hooks 2026-03-21 00:09:42 -04:00
ricky 8a8c6f5fa0 renamed issue_customer_id to customer_id 2026-03-19 18:07:21 -04:00
ricky 8fb9d74277 removced placeholder for customer field 2026-03-19 07:20:59 -04:00
ricky b367687113 Implmented custom autocomplete for customer field 2026-03-18 21:55:55 -04:00
ricky 164252cb97 Refactored PDF services 2026-03-13 23:40:52 -04:00
ricky aff7d0c48e removed uneeded logging of issue and project contents. 2026-03-04 18:37:30 -05:00
ricky e9b3b1c838 Merge branch 'master' into dev 2026-03-04 17:42:42 -05:00
ricky 2fc2f94cd1 Fixed combining of estimate pdf 2026-03-04 13:23:59 -05:00
ricky 485a977d1a Use Safe Navigation Operator &. 2026-03-01 21:31:28 -05:00
ricky 4ed71f5667 Fix: Remove unnecessary QBO configuration check in billing enqueue method 2026-02-28 18:01:32 -05:00
ricky 8303dec501 Fix: Raise error if no QBO configuration is found in sync jobs 2026-02-28 17:58:11 -05:00
ricky dc6eba8566 Refactor logging in PdfPatch to use custom log method for better clarity and consistency 2026-02-28 08:29:10 -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 a64016eb95 Refactor QBO billing to use ActiveJob; remove threaded billing and add manual job enqueue support 2026-02-26 19:48:29 -05:00
ricky 4dc1f5d0bd Enhance billing functionality in IssuePatch with detailed logging and self-references 2026-02-20 09:47:47 -05:00
ricky 2f9ef6304f scope.includes(:customer) 2026-02-16 18:53:29 -05:00
ricky 1ade938eb3 Fixed Querying issues by customer name 2026-02-16 08:13:57 -05:00
ricky 3111f391f3 Filter by customer works now 2026-02-15 21:34:22 -05:00
ricky 359c582e22 Fixed partial billing and added flash messages 2026-02-13 18:25:07 -05:00
ricky e63b9e4217 use safe_join 2026-02-13 07:32:20 -05:00
ricky 167385bb99 override issues form to add passing @project to issues hook 2026-02-11 19:31:01 -05:00
ricky 11b9876d4f Removed unused controller_issues_new_before_save that was used for finding the 422 error 2026-02-11 08:09:00 -05:00
ricky 57adcce431 Refactor JavaScript path handling for issue form updates to help prevent 422 errors on new issue creation 2026-02-11 07:59:18 -05:00
ricky 7fdb15f7e8 more logging 2026-02-10 22:09:16 -05:00
ricky a4b51457bb moved controller_issues_new_before_save nito issues_hook_listener 2026-02-09 20:04:16 -05:00
ricky fb4a883b43 Added logging 2026-02-09 14:31:56 -05:00
ricky c24ec93335 force a tracker if still nil 2026-02-09 14:21:50 -05:00
ricky df49964bf9 added tracker nil check 2026-02-09 14:19:31 -05:00
ricky 502ba94465 Readded missing controller_issues_new_before_save 2026-02-09 14:12:01 -05:00
ricky 6a2f7a1146 initialize string link 2026-02-09 09:21:42 -05:00
ricky 548dc4fba8 Implement issue creation error handling; add project validation and refactored issue hooks 2026-02-08 13:07:28 -05:00
ricky 7a73b7e8a9 refactor error handling in issue creation; remove unused reload_new_issue method 2026-02-08 10:58:39 -05:00
ricky b38bd951f7 fiex typo tracker not project 2026-02-08 10:02:42 -05:00
ricky 0e3318efdd Added prefilters to help locate 422 on issue creation.
This is an effort to figure out why I get 422 Unprocessable Entity errors sometimes when creating new issues.
2026-02-08 09:58:34 -05:00
ricky d063494bd2 removed empty link string 2026-02-06 23:00:26 -05:00
ricky d59e52b111 removed subject from logs 2026-02-06 18:58:16 -05:00
ricky 2c3548d1ac Added logging 2026-02-06 18:55:49 -05:00
ricky d80007bc84 Titleize the subject before save , but keep words containing numbers mixed with letters capitalized 2026-02-06 18:52:11 -05:00
ricky 2f0ee6a6d6 refoactored hooks and patches under RedmineQbo module 2026-02-04 07:18:25 -05:00