Commit Graph
2482 Commits
Author SHA1 Message Date
rickyandClaude Opus 5.5 0d143e6eb1 Remove orphaned code
* customers#filter_estimates_by_customer and #filter_invoices_by_customer,
  their routes, permission entries and template: they filled an estimate
  dropdown on the old issue form, which is gone.
* Routes with no action: accounts new/create/show/edit/update/destroy
  (only index, Set default and Sync exist) and customers#destroy.
* Unused methods: AuthHelper#require_user, #allowed_to?, #check_permission;
  CustomersController#address_to_s; CustomerToken#expired? and
  .remove_expired_tokens; QboBaseModel#skip_qbo_push?;
  QboDraft.writable_document?; SyncServiceBase#extract_value.
* CustomersController's before_action helpers are private.
* The unused .autocomplete-meta style and 28 unused translation keys.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:48:17 -05:00
rickyandClaude Opus 5.5 92f9eb1bc7 Customer page lists: short paid badge, aligned icons, appointment link
* The invoice list's paid badge is short so each invoice stays on one
  line: "Paid", or "Paid +3d" when it was paid in full 3 days after
  its date, with the day on hover. The invoice page keeps the date.
* The estimate and invoice lists are laid out in columns (checkbox,
  number, date, status, actions), so the edit/view icons line up.
* Ticked estimates (and redmine_qbo_vehicles' vehicles) fill in
  redmine_qbo_calendar's Add appointment link (estimate_id,
  vehicle_id) as well as New issue. Estimate checkboxes are only on
  the customer page, where they're used.
* application.js is gone: it only carried the old Google Calendar
  link code, which threw an error when a box was ticked on a vehicle
  page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:39:08 -05:00
rickyandClaude Opus 5.5 40eb6205c4 2026.11.22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026.11.22
2026-11-17 19:09:07 -05:00
rickyandClaude Opus 5.5 0c5bac855e Business report: Sales tax section at the bottom
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:09:07 -05:00
rickyandClaude Opus 5.5 663639b8fd 2026.11.21
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026.11.21
2026-11-17 18:45:29 -05:00
rickyandClaude Opus 5.5 ec4e5f681d Business report: sales tax invoiced and collected
A Sales tax section: tax invoiced (on invoices dated in the period,
accrual) and tax collected (on invoices paid in full in the period,
counted on the day each was paid in full, cash), with counts, a line
chart and a month-by-month table. Only invoices are counted; sales tax
is filed from QuickBooks' Sales Tax Liability report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 18:45:29 -05:00
rickyandClaude Opus 5.5 a72b0fa73b Business report without sales tax; invoices paid in full; paid dates
Estimates and invoices written are reported without sales tax (new
estimates.tax_amount, filled in by the estimate sync), and a new
Invoices paid in full figure counts invoices on the day they were paid
in full. Payments stay as received, so collected vs. invoiced compares
them with the invoices' totals with tax.

Paid invoices show the day they were paid in full on the customer's
invoice list and the invoice page ("Paid 11/03/2026").

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 18:34:21 -05:00
rickyandClaude Opus 5.5 5b6c1ed2c2 Cache invoices' sales tax and the day they were paid in full
New invoices columns tax_amount and paid_on, filled in by the invoice
sync. An invoice is paid in full on the later of its date and the
dates of the payments and credit memos applied to it (local payments
first; QuickBooks only for ones not synced yet and credit memos), so
reports such as the monthly sales commission don't have to read
invoices from QuickBooks. A full sync fills them in for older
invoices; it now syncs payments before invoices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 18:34:21 -05:00
rickyandClaude Opus 5.5 4f6f81c87a 2026.11.20
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026.11.20
2026-11-16 20:43:36 -05:00
rickyandClaude Opus 5.5 9fa199aa98 Refunds for canceled orders and returned parts (SOP-OPS-014)
A Refund page on the customer: the canceled order's estimate fills in
the parts the 30% restocking fee is worked out on. Refunding makes the
fee invoice, pays it from the customer's credit, records the rest as a
Check (company check) or Expense (card refund on the terminal) with the
category Accounts Receivable, applies the credit to it so the balance
comes back to $0.00, and optionally marks the estimate Rejected,
cancels its work orders with the reason as a note and emails the
customer. Each refund has a page with a PDF of it.

New permission: Issue refunds. New settings under Billing » Refunds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:43:36 -05:00
rickyandClaude Opus 5.5 16f9441568 2026.11.19
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026.11.19
2026-11-16 08:42:08 -05:00
rickyandClaude Opus 5.5 5c48646041 Invoice page hook for plugin actions
:view_qbo_invoice_contextual, { invoice_id:, customer_id:, doc_number: }
in the invoice page's top-right actions, like the estimate page's hook
(used by redmine_qbo_labels' Print label).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:42:08 -05:00
rickyandClaude Opus 5.5 90adb96d54 2026.11.18
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026.11.18
2026-11-09 20:17:38 -05:00
rickyandClaude Opus 5.5 8a947483db Estimate/invoice numbers on issue PDF; create estimate issues as subtasks
- Issue PDF: show the issue's estimate number and invoice number(s)
- Create issues from estimate: optional parent task. The issues are created as
  its subtasks, take its customer, and start from its project, vehicle and
  custom field values (subtask_field_copier's rules when installed)
- Issue page: shortcut to create the estimate's issues as subtasks of the issue
- Create issues page: editable start and due dates, pre-filled from the
  appointment or the parent task
- Always show plugins' fields (e.g. the vehicle) on the Create issues page

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 20:17:38 -05:00
rickyandClaude Opus 5.5 42461e7899 2026.11.17
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026.11.17
2026-11-06 10:44:25 -05:00
rickyandClaude Opus 5.5 461fa79bc5 Show a saving indicator on estimates and invoices
Clicking Save, Save and send or Save draft shows a spinner in the action bar and locks the buttons until the page reloads, so a second click can't save or send twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 10:44:25 -05:00
ricky 2fb21c34bb 2026.11.16 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.15 2026-11-04 12:41:32 -05:00
rickyandClaude Opus 5.5 3bbceacda4 Don't take the sales person from a retired custom field
When an estimate didn't have the company's sales person field, the plugin fell back to
any field named like "Sales Rep", e.g. a retired "Sales Rep old" dropdown, which
QuickBooks returns as its option number. Invoices made from those estimates got "4"
as their sales person. Only the company's field is read now; an estimate without it
has no sales person, so the invoice gets the user who creates it. Matching by name is
left for when QuickBooks' settings can't be read, and never picks a hidden field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 12:41:32 -05:00
ricky d75dee2866 2026.11.14 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.13 2026-11-04 10:07:54 -05:00
rickyandClaude Opus 5.5 0a7b2e34b8 Fix the settings page before QuickBooks is connected
The token expiry came back as "never synced" text, which the page treated as a
time, so it failed. It's now empty, shown as N/A.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 10:07:54 -05:00
rickyandClaude Opus 5.5 895733f534 Let admins hide QuickBooks custom fields from estimates and invoices
QuickBooks doesn't tell apps which custom fields are inactive, and a field stays on
its old estimates after it's turned off, so an inactive "Sales Rep old" kept showing
and was filled in with the sales person. The billing settings now list the fields
found, with a box to hide each; hidden fields are left out of the editor, the sales
person and other plugins' field lookups.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 10:07:54 -05:00
ricky fa1b4eed06 2026.11.12 2026.11.12 2026-11-04 09:47:36 -05:00
rickyandClaude Opus 5.5 95e76a41fd Use QuickBooks' newer custom fields once estimates show them
QuickBooks keeps listing the legacy sales form fields (DefinitionIds 1-3) in the
preferences after a company moves to its newer custom fields, often renamed or inactive
(e.g. "Sales Rep old"). Once estimates show any newer field, only those are used.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 09:47:36 -05:00
ricky 92b2a18eb6 2026.11.11 2026.11.11 2026-11-03 22:12:47 -05:00
rickyandClaude Opus 5.5 084df36061 Link the Customer column in issue lists to the customer
Only for users with View customers, who can open the customer page; others see
the name as plain text. CSV and PDF exports are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 22:12:47 -05:00
rickyandClaude Opus 5.5 3b51625df4 Fix sorting and grouping time entries by Billed
The time entry Billed column sorted by time_entries.name, which doesn't exist, so
sorting or grouping by it failed. The issue list's Billed column is removed: issues
have no billed value, so showing or sorting it always failed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 22:12:47 -05:00
ricky 7cfc8a370e 2026.11.10 2026.11.10 2026-11-03 21:53:13 -05:00
rickyandClaude Opus 5.5 d2cdd798cd Show names in issue history, and record invoices the webhook attaches
The history showed the customer and estimate as id numbers. It now shows their names,
for existing entries too. When the QuickBooks webhook attaches an invoice to an issue,
the issue's history gets "Invoice 1042 added", linking to the invoice PDF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.9
2026-11-02 22:22:51 -05:00
rickyandClaude Opus 5.5 ec00684edd Clear all lines asks in redmine_dark_mode's dialog when it's installed
On dark pages the confirmation is dark instead of the browser's bright box; without redmine_dark_mode
it's the browser's box as before.

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.8
2026-11-02 21:52:41 -05:00
rickyandClaude Opus 5.5 dc72b11766 Business report charts take their colours from the page
The grid lines and labels read --qbo-chart-grid and --qbo-chart-text (Chart.js' own colours when
unset), and recolour on redmine_dark_mode's redmine:color-scheme event, so the charts get lighter
grid lines in dark mode.

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.7
2026-11-02 17:56:49 -05:00
rickyandClaude Opus 5.5 4ba96e2dfd Warn about the customer's open issues on a new invoice
A new invoice lists the customer's open issues (any project, those the user can see) in a warning under
the title, so work orders aren't left open once the work is billed. It's there when the page opens with a
customer (from the customer page or an estimate) and follows the customer when it's changed: customer_info
returns open_issues_html for invoices.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 17:55:14 -05:00
ricky 88160a985d 2026.11.6 2026.11.6 2026-11-01 17:47:43 -05:00
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
ricky 6a638fe7bb 2026.11.5 2026.11.5 2026-11-01 16:45:52 -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
rickyandClaude Opus 5.5 b1ad2d5b40 2026.11.4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026.11.4
2026-10-31 14:17:15 -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