Sync services and other items without a description or rate

QuickBooks only requires an item's name, but the local Item required a description and a rate, so
services such as Labor (often with neither) failed validation and were silently skipped by the sync.
Name is now the only requirement; a missing description syncs as blank and a missing rate as 0.
Product/service pickers and the labor setting list sellable items only (no Categories or Bundles).

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 09:34:22 -04:00
1 parent 06a78ebccb
commit bf7c7b0905
6 files changed
+18 -6

No files matched your search

+5 -1
View File
@@ -30,6 +30,10 @@ class ItemSyncService < SyncServiceBase
account_id = remote.income_account_ref&.value
account_id.present? ? Account.find_by(id: account_id.to_i) : nil
end
map_attributes :description, :id, :name, :sku, :type, :unit_price
map_attributes :id, :name, :sku, :type
# Services such as Labor often have no description or rate in QuickBooks; they sync as blank and 0
# instead of failing validation and being skipped
map_attribute(:description) { |remote| remote.description.to_s }
map_attribute(:unit_price) { |remote| remote.unit_price || 0 }
end