mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Update
This commit is contained in:
@@ -115,14 +115,14 @@ class Customer < ActiveRecord::Base
|
|||||||
service = Qbo.get_base(:customer).service
|
service = Qbo.get_base(:customer).service
|
||||||
|
|
||||||
# Sync ALL customers if the database is empty
|
# Sync ALL customers if the database is empty
|
||||||
if count == 0
|
#if count == 0
|
||||||
customers = service.all
|
customers = service.all
|
||||||
else
|
#else
|
||||||
last = Qbo.first.last_sync
|
# last = Qbo.first.last_sync
|
||||||
query = "Select Id, DisplayName From Customer"
|
# query = "Select Id, DisplayName From Customer"
|
||||||
query << " Where Metadata.LastUpdatedTime >= '#{last.iso8601}' " if last
|
# query << " Where Metadata.LastUpdatedTime >= '#{last.iso8601}' " if last
|
||||||
customers = service.query(query)
|
# customers = service.query(query)
|
||||||
end
|
#end
|
||||||
|
|
||||||
customers.each do |customer|
|
customers.each do |customer|
|
||||||
qbo_customer = Customer.find_or_create_by(id: customer.id)
|
qbo_customer = Customer.find_or_create_by(id: customer.id)
|
||||||
|
|||||||
Reference in New Issue
Block a user