mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 08:54:23 -05:00
Update qbo_invoice.rb
This commit is contained in:
@@ -20,7 +20,14 @@ class QboInvoice < ActiveRecord::Base
|
||||
|
||||
def self.sync
|
||||
#Pull the invoices from the quickbooks server
|
||||
invoices = get_base.service.all
|
||||
#invoices = get_base.service.all
|
||||
|
||||
last = Qbo.first.last_sync
|
||||
|
||||
query = "SELECT Id, DocNumber FROM Invoice"
|
||||
query << " WHERE Metadata.LastUpdatedTime>'#{last}' " if last
|
||||
|
||||
customers = get_base.service.query()
|
||||
|
||||
# Update the invoice table
|
||||
transaction do
|
||||
@@ -33,7 +40,7 @@ class QboInvoice < ActiveRecord::Base
|
||||
end
|
||||
|
||||
#remove deleted invoices
|
||||
where.not(invoices.map(&:id)).destroy_all
|
||||
#where.not(invoices.map(&:id)).destroy_all
|
||||
end
|
||||
|
||||
def self.update(id)
|
||||
|
||||
Reference in New Issue
Block a user