mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 08:54:23 -05:00
Webhook
This commit is contained in:
@@ -35,6 +35,14 @@ class QboEstimate < ActiveRecord::Base
|
||||
where.not(estimates.map(&:id)).destroy_all
|
||||
end
|
||||
|
||||
def self.sync_by_id(id)
|
||||
estimates = get_base.service.fetch_by_id(id)
|
||||
qbo_estimate = QboEstimate.find_or_create_by(id: estimate.id)
|
||||
qbo_estimate.doc_number = estimate.doc_number
|
||||
qbo_estimate.id = estimate.id
|
||||
qbo_estimate.save!
|
||||
end
|
||||
|
||||
def self.update(id)
|
||||
# Update the item table
|
||||
estimate = get_base.service.fetch_by_id(id)
|
||||
|
||||
Reference in New Issue
Block a user