mirror of
https://github.com/rickbarrette/redmine_qbo_lineitems.git
synced 2026-04-02 07:01:59 -04:00
Updated t work with redmine_qbo 2026.3.9
This commit is contained in:
@@ -18,29 +18,25 @@ class Item < QboBaseModel
|
||||
|
||||
# Updates Both local & remote DB description
|
||||
def description=(s)
|
||||
details
|
||||
@details.description = s
|
||||
details.description = s
|
||||
super
|
||||
end
|
||||
|
||||
# Updates Both local & remote DB name
|
||||
def name=(s)
|
||||
details
|
||||
@details.name = s
|
||||
details.name = s
|
||||
super
|
||||
end
|
||||
|
||||
# Updates Both local & remote DB sku
|
||||
def sku=(s)
|
||||
details
|
||||
@details.sku = s
|
||||
details.sku = s
|
||||
super
|
||||
end
|
||||
|
||||
# Updates Both local & remote DB price
|
||||
def unit_price=(s)
|
||||
details
|
||||
@details.unit_price = s
|
||||
details.unit_price = s
|
||||
super
|
||||
end
|
||||
|
||||
|
||||
@@ -28,12 +28,7 @@ class ItemService < ServiceBase
|
||||
|
||||
def default_income_account
|
||||
log "Looking up sales income account"
|
||||
qbo = QboConnectionService.current!
|
||||
qbo.perform_authenticated_request do |token|
|
||||
service = Quickbooks::Service::Account.new(
|
||||
company_id: qbo.realm_id,
|
||||
access_token: token
|
||||
)
|
||||
QboConnectionService.with_qbo_service(entity: Invoice) do |service|
|
||||
service.query("SELECT * FROM Account WHERE AccountType='Income' AND Name LIKE '%Sales%'").first
|
||||
end
|
||||
end
|
||||
|
||||
2
init.rb
2
init.rb
@@ -22,7 +22,7 @@ Redmine::Plugin.register :redmine_qbo_lineitems do
|
||||
|
||||
# Ensure redmine_qbo is installed
|
||||
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
|
||||
raise 'Please install the redmine_qbo plugin (https://github.com/rickbarrette/redmine_qbo)'
|
||||
end
|
||||
|
||||
@@ -21,8 +21,8 @@ module RedmineQboLineItems
|
||||
|
||||
# Called by the QboSyncDispatcher
|
||||
def qbo_full_sync (context={})
|
||||
log "Adding ItemSyncJob to QBO sync dispatcher"
|
||||
return ItemSyncJob
|
||||
log "Adding Item to QBO sync dispatcher"
|
||||
return Item
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in New Issue
Block a user