Commit Graph
22 Commits
Author SHA1 Message Date
rickyandClaude Opus 5.5 9296f3f4b4 Remove orphaned code
Issue#children_line_items, #children_line_items_total and
#line_items_total (the issue page uses the descendants' total), and the
unused notice_added_from key (the "Added from:" memo stays literal:
redmine_qbo matches it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:48:17 -05:00
rickyandClaude Opus 5.5 063da99904 Record added, changed and removed line items in the issue's history
Line item changes go into the journal of the issue update that made them, shown like
Redmine's own changes (e.g. "Line item Brake pads: 2 × $45.00 added"). They're only
visible to users who may view line items, in the history, emails, PDF, API and webhooks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:38:02 -05:00
Claude 3a2d50ae8d Move items, accounts and estimate writing to redmine_qbo_billing
The QuickBooks product/service list and income accounts (models, syncs,
admin pages, routes, settings) now live in redmine_qbo_billing, which this
plugin requires. The closing-an-issue estimate is written through
RedmineQboBilling::EstimateWriter.create_estimate, so estimate building isn't
duplicated; it now also gets the customer email, VIN, default message and
expiration date.

Migrations: 002 now only links line items to items (skipped where the column
exists). 003 and 004 are removed; billing's migrations find the existing
items and accounts tables and leave them alone, so nothing is dropped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-30 13:50:15 -04:00
Claude 39f6b64049 Polish: permissions, billed-line locking, sync and billing fixes
Permissions
- Item catalog and accounts pages, and their syncs, are admin-only (they
  push to / pull from QuickBooks); shown in the Administration layout
- Item autocomplete is allowed with Add or Edit line items
- Permissions now map to real actions (they pointed at a non-existent
  line_items controller); line_items_attributes is only accepted from
  users with a line item permission
- Line item changes are checked on the server: adding, editing and
  deleting each need their permission, and billed lines (already on a
  QBO estimate) can't be changed or removed

Bugs
- Billing on close now runs from an Issue after_commit, so closing via
  bulk edit or the context menu bills too (replaces the save hook);
  the job takes an issue id
- Full sync runs Accounts before Items, and item sync no longer fails
  when an item has no income account or its account hasn't synced
- New QBO items default to Non-inventory in the default income account
  (the account ref was being assigned to the item type)
- Choosing a blank account on an item no longer raises; set_default
  handles no selection
- Item autocomplete escapes item names, SKUs and descriptions (they were
  inserted into the page as HTML)
- Items list showed "translation missing" for Yes/No

Polish
- Fractional quantities allowed (0.5 hrs, 2.5 qts)
- Billed lines show a Billed badge and are read-only; remove button only
  where allowed; add button only with Add line items
- Removed dead code (Item belongs_to :issue, Item#ref, no-op in new,
  swallowed errors); validation failures return 422

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-28 22:37:41 -04:00
ricky 9a9efcbaf9 Implement permission checks for adding and deleting line items in issue forms 2026-09-07 21:32:44 -04:00
ricky c9d2a47a92 Added running total calculated using subtask totals from the entire issue tree 2026-04-17 21:13:33 -04:00
ricky 9b9a5c3505 Preventing Implicit Deletions 2026-04-03 11:58:56 -04:00
ricky b63e8f2a45 Updated hooks & patches 2026-03-21 20:02:11 -04:00
ricky 4d6c16373a Don't display form if issue if closed 2026-03-19 08:38:21 -04:00
ricky f81fe0ef87 Added accounts to allow for assinging income account to items, and selecting default income account. Also added item type selection 2026-03-16 22:59:54 -04:00
ricky 564158722d Updated t work with redmine_qbo 2026.3.9 2026-03-14 21:56:09 -04:00
ricky d1f8f027c0 Allow doing math in price field for each markups 2026-03-09 20:45:26 -04:00
ricky 60fb4e197c Added QBO Item support with autocomplete 2026-03-08 14:24:30 -04:00
ricky bb55c45b9b update copyright year 2026-03-07 22:01:11 -05:00
ricky 151bbf2d7f tweaked layout, added JS for live totals 2026-03-07 21:47:03 -05:00
ricky 67513c527e use view_issues_edit_notes_bottom 2026-03-07 18:44:28 -05:00
ricky 5789fef3b6 No longer need leading z since using view hook view_issues_show_description_bottom 2026-03-07 13:19:20 -05:00
ricky 1d29d2a816 Don't save blank line items 2026-03-07 12:49:34 -05:00
ricky b0c1da0b51 display line items on issue if any exist 2026-03-07 09:35:02 -05:00
ricky 47a7447688 Create estimate on issue close. 2026-03-06 21:42:27 -05:00
ricky b297657763 renamed plugin with leading z to ensure the view hook gets called last. 2026-03-06 19:16:41 -05:00
ricky f297830750 Initial Commit 2026-03-05 08:40:23 -05:00