mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 08:54:23 -05:00
Added customer association
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
class QboEstimate < ActiveRecord::Base
|
||||
unloadable
|
||||
has_many :issues
|
||||
belongs_to :customer
|
||||
attr_accessible :doc_number
|
||||
validates_presence_of :id, :doc_number
|
||||
|
||||
@@ -26,6 +27,7 @@ class QboEstimate < ActiveRecord::Base
|
||||
estimates.each { |estimate|
|
||||
qbo_estimate = QboEstimate.find_or_create_by(id: estimate.id)
|
||||
qbo_estimate.doc_number = estimate.doc_number
|
||||
qbo_invoice.customer_id = invoice.customer_ref
|
||||
qbo_estimate.id = estimate.id
|
||||
qbo_estimate.save!
|
||||
}
|
||||
@@ -39,6 +41,7 @@ class QboEstimate < ActiveRecord::Base
|
||||
estimate = 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_invoice.customer_id = invoice.customer_ref
|
||||
qbo_estimate.id = estimate.id
|
||||
qbo_estimate.save!
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user