Commit Graph
203 Commits
Author SHA1 Message Date
ricky 2fb21c34bb 2026.11.16 2026-11-04 15:04:19 -05:00
rickyandClaude Opus 5.5 1c71e3a4c9 Add discounts, unlocking paid invoices and editing payments
- Estimates and invoices take a discount, as a percent of the subtotal or an
  amount, saved as QuickBooks' discount line and taken off before sales tax.
  Duplicated estimates and invoices made from an estimate keep it. The box is
  hidden when discounts are off in QuickBooks.
- A paid invoice can be unlocked for editing after a confirmation. The
  payments stay linked, and the total can't go below what's been paid.
  Unlocking needs the new "Edit partially paid invoices" or "Edit paid
  invoices" permission, checked again when saving.
- Saved payments can be edited: date, method, reference, memo, amount and the
  invoices they pay. Each invoice keeps its amount unless the amount or the
  invoices change. Payments that also apply credit memos stay read-only.
- Locked estimates and invoices are readable again (disabled boxes had faint
  or invisible text, especially in Safari).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 15:04:19 -05:00
ricky 89f4797bbe 2026.11.15 2026-11-04 12:41:32 -05:00
ricky d75dee2866 2026.11.14 2026-11-04 10:33:03 -05:00
rickyandClaude Opus 5.5 c8e2d2d92e Save new estimates and invoices as drafts
A draft is kept in Redmine only, however incomplete, so nothing is in QuickBooks
until it's saved from the editor. QuickBooks can't apply a deposit to an invoice
that's still being written, which made it read-only. Saving to QuickBooks deletes
the draft.

Drafts are listed on the customer's page, on a Drafts page linked from Customers,
and on a new invoice or estimate for a customer who already has one. Anyone with
Write invoices (or Write estimates) can continue or delete invoice (or estimate)
drafts. Adds the qbo_drafts table (migration 052).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 10:33:03 -05:00
ricky a1fb88e77c 2026.11.13 2026-11-04 10:07:54 -05:00
ricky fa1b4eed06 2026.11.12 2026-11-04 09:47:36 -05:00
ricky 92b2a18eb6 2026.11.11 2026-11-03 22:12:47 -05:00
ricky 7cfc8a370e 2026.11.10 2026-11-03 21:53:13 -05:00
rickyandClaude Opus 5.5 159420fac1 Show estimate, invoice and payment activity on the activity page
Each type appears only on the overall activity page, and only for users who may see it:
estimates need View customers or Write estimates, invoices View customers or Write invoices,
and payments View or Receive payments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:53:13 -05:00
rickyandClaude Opus 5.5 dbee228cdf 2026.11.9
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 22:22:51 -05:00
rickyandClaude Opus 5.5 839ac976e6 2026.11.8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 21:52:41 -05:00
rickyandClaude Opus 5.5 778111825b 2026.11.7
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 17:56:49 -05:00
ricky 88160a985d 2026.11.6 2026-11-01 17:47:43 -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
ricky 6a638fe7bb 2026.11.5 2026-11-01 16:45:52 -05:00
rickyandClaude Opus 5.5 b1ad2d5b40 2026.11.4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 14:17:15 -04:00
rickyandClaude Opus 5.5 e348042fef 2026.11.3
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 13:17:51 -04:00
rickyandClaude Opus 5.5 09e88232b0 2026.11.2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 12:11:36 -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
ricky d07d99109b 2026.11.0 2026-10-31 00:15:17 -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
ricky e61217b719 2026.10.1 2026-10-29 21:35:51 -04:00
ricky 609ddb098a 2026.10.0 2026-10-28 22:32:26 -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 cf3342bcc5 2026.9.0 2026-09-09 21:12:57 -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 fd91bd6fa2 Bump version to 2026.8.3 for Redmine QBO plugin 2026-08-26 21:22:12 -04:00
ricky 57dc8127b0 2026.8.2 2026-08-24 20:39:38 -04:00
ricky dfd3a641db Version 2026.8.1 2026-08-12 08:41:31 -04:00
ricky ea29990cfa Version 2026.8.0 2026-08-10 19:36:25 -04:00
ricky 36267893bd 2026.3.17 2026-03-28 00:25:55 -04:00
ricky 681e7f8047 2026.3.16 2026-03-26 08:13:01 -04:00
ricky 925cb1d2bc 2026.3.15
Note: breaking change, need to update settings
2026-03-22 14:24:22 -04:00
ricky 1dcccd7b98 Merge branch 'master' into rails-7 2026-03-21 10:28:46 -04:00
ricky f73973a4e1 2026.3.14 2026-03-21 10:27:33 -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 f3fe38cd57 2026.3.12 2026-03-19 08:34:27 -04:00
ricky df079b767c 2026.3.11 2026-03-17 23:37:17 -04:00
ricky a4f461fd4d 2026.3.10 2026-03-15 18:01:54 -04:00
ricky db3c6021c5 2026.3.9 2026-03-14 21:54:12 -04:00
ricky 9fd7140e4a 2026.3.8 2026-03-14 17:30:22 -04:00
ricky 8abc95c21e 2026.3.7 2026-03-13 08:35:25 -04:00
ricky da0f7ffc56 2026.3.6
Refactored models and services to use a base class
2026-03-12 11:21:42 -04:00
ricky cd88ce6217 2026.3.5 2026-03-09 08:22:26 -04:00
ricky 17ac19e435 2026.3.4 2026-03-08 21:59:47 -04:00
ricky 1f64e36892 2026.3.3 2026-03-08 15:22:20 -04:00
ricky c4c02f8d27 2026.3.2 2026-03-05 21:34:20 -05:00