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
This commit is contained in:
Claude committed 2026-10-31 07:54:28 -04:00
1 parent d07d99109b
commit 062ef9b8b3
20 files changed
+590 -5

No files matched your search

+3
View File
@@ -26,6 +26,9 @@ class EstimateSyncService < SyncServiceBase
end
map_attributes :doc_number, :txn_date
map_attribute :total_amount, :total
# Man-hours: quantities of the products/services set as "Replaced by imported time"
map_attribute(:hours) { |remote| RedmineQboBilling::ManHours.hours(remote) }
map_belongs_to :customer
end