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
|
# 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
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
2
init.rb
2
init.rb
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user