Commit Graph
58 Commits
Author SHA1 Message Date
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
rickyandClaude Opus 5.5 fd3caf9839 Style the line items like redmine_qbo's estimate and invoice editor
The issue form gets the editor's line table (numbered rows, borderless inputs until worked on,
hover delete, billed pill), its buttons, totals and phone cards. The issue page keeps Redmine's
list table, with amounts right-aligned and labelled cards on phones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 19:36:01 -05:00
Claude 2d25e43bd5 Pass work-order custom fields generically to new estimates
create_estimate(custom_fields:) gets whatever other plugins give for the issue through redmine_qbo's
issue values hook (e.g. redmine_qbo_vehicles: VIN and mileage), instead of naming a VIN and mileage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-31 11:34:28 -04:00
Claude ff25bba08e Depend on redmine_qbo for items, accounts and estimates
Billing has been folded into redmine_qbo 2026.11.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-30 23:48:55 -04:00
Claude dec5b32165 Billing job: VIN and mileage from the work order via redmine_qbo_billing
The estimate made when an issue closes gets the issue's VIN and mileage from
redmine_qbo_billing's issue values hook, instead of reading the vehicle here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
2026-10-30 22:32:24 -04: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 5b1d98aa07 Show running total even if issue doesn't have line items but it's children do 2026-04-17 21:31:46 -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 da49b996da removed redundant private 2026-03-22 18:31:24 -04:00
ricky 9820646857 allow math on unit price field 2026-03-18 22:02:53 -04:00
ricky 4367c77393 updaed locale 2026-03-17 20:49:58 -04:00
ricky 8c0ce8ce48 updated locale 2026-03-17 20:45:21 -04:00
ricky 9fd1f4fb7d removed back link 2026-03-17 20:37:58 -04:00
ricky cca822c570 better display flags 2026-03-17 20:35:40 -04:00
ricky 795906b4f5 Sync Item account numbers 2026-03-17 20:26:52 -04:00
ricky d5e59c120c Make qbo item inactive if deleted 2026-03-17 19:45:36 -04:00
ricky c968893f94 fixed taxable check 2026-03-17 19:29:05 -04:00
ricky f59849e6e5 Merge remote-tracking branch 'origin/master' 2026-03-17 19:20:08 -04:00
ricky 6bf5575f9c Updated views for items and accounts 2026-03-17 19:18:03 -04:00
ricky 2703d6cc3e Default to taxable, otherwise folllow tax flag 2026-03-17 18:27:56 -04:00
ricky 24e3e4ba82 Added taxable flag 2026-03-17 12:25:58 -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 a2cc7a97fd Added comment 2026-03-15 18:57:48 -04:00
ricky 7088550184 Removed ItemSyncJob as it was replaced withj QboSyncJob 2026-03-15 17:44:14 -04:00
ricky 2302679c3a updated ItemSyncService init call 2026-03-15 07:50:07 -04:00
ricky ec1ef72267 Use a private note to make it clear where the estimate came from. 2026-03-14 22:13:45 -04:00
ricky 564158722d Updated t work with redmine_qbo 2026.3.9 2026-03-14 21:56:09 -04:00
ricky 62adcb11cd fixed typo 2026-03-13 08:38:41 -04:00
ricky 896813983c Updated to use DSL and qbo_sync flag 2026-03-13 08:36:49 -04:00
ricky ef7570fb3b Refactored to use QboBaseModel & ServiceBase from redmine_qbo 2026-03-12 11:23:07 -04:00
ricky a52ff3b860 fixed sync link 2026-03-11 23:50:05 -04:00
ricky 4f8e5d9b2c implemented some basic CRUD for QBO Items 2026-03-11 23:39:24 -04:00
ricky bfdf6b3065 Added support for item name & sku. Also added manual sync link 2026-03-11 19:36:27 -04:00
ricky d1f8f027c0 Allow doing math in price field for each markups 2026-03-09 20:45:26 -04:00
ricky 9736f1ac96 Added settings page for Item stats 2026-03-09 00:00:46 -04:00
ricky 3463698f8d Use self.page_size instead of a constant 2026-03-08 23:29:16 -04:00
ricky 1780896e84 Set page size to 10 2026-03-08 21:48:03 -04:00
ricky 91cdd86c12 Add logging 2026-03-08 20:10:14 -04:00
ricky 449910c941 minium qty is 1 2026-03-08 15:48:01 -04:00
ricky 42ea5dffc9 updated comments 2026-03-08 15:37:01 -04:00
ricky 30b493e2f9 Added support for making items inactive 2026-03-08 15:14:36 -04:00
ricky 88b452b889 use set ID like we do with the other entities 2026-03-08 15:04:31 -04:00
ricky 60fb4e197c Added QBO Item support with autocomplete 2026-03-08 14:24:30 -04:00
ricky d3d039f191 added locale notice_added_from 2026-03-07 22:06:05 -05: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 894741f60f Fixed remove button functionality 2026-03-07 13:03:44 -05:00
ricky 1d29d2a816 Don't save blank line items 2026-03-07 12:49:34 -05:00