mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Updated to quickbooks-ruby-base and added QboEstimate
This commit is contained in:
@@ -14,12 +14,13 @@ class QboItem < ActiveRecord::Base
|
||||
attr_accessible :name
|
||||
validates_presence_of :id, :name
|
||||
|
||||
def self.get_base
|
||||
Quickbooks::Base.new(Qbo.get_account, :item)
|
||||
end
|
||||
|
||||
def self.update_all
|
||||
qbo = Qbo.first
|
||||
service = Quickbooks::Service::Item.new(:company_id => qbo.realmId, :access_token => Qbo.get_auth_token)
|
||||
|
||||
# Update the item table
|
||||
service.find_by(:type, "Service").each { |item|
|
||||
get_base.service.find_by(:type, "Service").each { |item|
|
||||
qbo_item = QboItem.find_or_create_by(id: item.id)
|
||||
qbo_item.name = item.name
|
||||
qbo_item.id = item.id
|
||||
|
||||
Reference in New Issue
Block a user