Updated t work with redmine_qbo 2026.3.9

This commit is contained in:
2026-03-14 21:56:09 -04:00
parent 60a7f769ce
commit 564158722d
4 changed files with 8 additions and 17 deletions

View File

@@ -18,29 +18,25 @@ class Item < QboBaseModel
# Updates Both local & remote DB description # Updates Both local & remote DB description
def description=(s) def description=(s)
details details.description = s
@details.description = s
super super
end end
# Updates Both local & remote DB name # Updates Both local & remote DB name
def name=(s) def name=(s)
details details.name = s
@details.name = s
super super
end end
# Updates Both local & remote DB sku # Updates Both local & remote DB sku
def sku=(s) def sku=(s)
details details.sku = s
@details.sku = s
super super
end end
# Updates Both local & remote DB price # Updates Both local & remote DB price
def unit_price=(s) def unit_price=(s)
details details.unit_price = s
@details.unit_price = s
super super
end end

View File

@@ -28,12 +28,7 @@ class ItemService < ServiceBase
def default_income_account def default_income_account
log "Looking up sales income account" log "Looking up sales income account"
qbo = QboConnectionService.current! QboConnectionService.with_qbo_service(entity: Invoice) do |service|
qbo.perform_authenticated_request do |token|
service = Quickbooks::Service::Account.new(
company_id: qbo.realm_id,
access_token: token
)
service.query("SELECT * FROM Account WHERE AccountType='Income' AND Name LIKE '%Sales%'").first service.query("SELECT * FROM Account WHERE AccountType='Income' AND Name LIKE '%Sales%'").first
end end
end end

View File

@@ -22,7 +22,7 @@ Redmine::Plugin.register :redmine_qbo_lineitems do
# Ensure redmine_qbo is installed # Ensure redmine_qbo is installed
begin begin
requires_redmine_plugin :redmine_qbo, version_or_higher: '2026.3.7' requires_redmine_plugin :redmine_qbo, version_or_higher: '2026.3.9'
rescue Redmine::PluginNotFound rescue Redmine::PluginNotFound
raise 'Please install the redmine_qbo plugin (https://github.com/rickbarrette/redmine_qbo)' raise 'Please install the redmine_qbo plugin (https://github.com/rickbarrette/redmine_qbo)'
end end

View File

@@ -21,8 +21,8 @@ module RedmineQboLineItems
# Called by the QboSyncDispatcher # Called by the QboSyncDispatcher
def qbo_full_sync (context={}) def qbo_full_sync (context={})
log "Adding ItemSyncJob to QBO sync dispatcher" log "Adding Item to QBO sync dispatcher"
return ItemSyncJob return Item
end end
private private