mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Update qbo_invoice.rb
This commit is contained in:
@@ -53,6 +53,8 @@ class QboInvoice < ActiveRecord::Base
|
|||||||
qbo_invoice.id = invoice.id
|
qbo_invoice.id = invoice.id
|
||||||
qbo_invoice.save!
|
qbo_invoice.save!
|
||||||
|
|
||||||
|
is_changed = false
|
||||||
|
|
||||||
# Scan the line items for hashtags and attach to the applicable issues
|
# Scan the line items for hashtags and attach to the applicable issues
|
||||||
invoice.line_items.each { |line|
|
invoice.line_items.each { |line|
|
||||||
if line.description
|
if line.description
|
||||||
@@ -60,11 +62,6 @@ class QboInvoice < ActiveRecord::Base
|
|||||||
i = Issue.find_by_id(issue.to_i)
|
i = Issue.find_by_id(issue.to_i)
|
||||||
i.qbo_invoice = QboInvoice.find_by_id(invoice.id.to_i)
|
i.qbo_invoice = QboInvoice.find_by_id(invoice.id.to_i)
|
||||||
i.save!
|
i.save!
|
||||||
}
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
is_changed = false
|
|
||||||
|
|
||||||
# update the invoive custom fields with infomation from the work ticket if available
|
# update the invoive custom fields with infomation from the work ticket if available
|
||||||
invoice.custom_fields.each { |cf|
|
invoice.custom_fields.each { |cf|
|
||||||
@@ -90,6 +87,9 @@ class QboInvoice < ActiveRecord::Base
|
|||||||
}
|
}
|
||||||
# Push updates
|
# Push updates
|
||||||
Qbo.get_base(:invoice).service.update(invoice) if is_changed
|
Qbo.get_base(:invoice).service.update(invoice) if is_changed
|
||||||
|
}
|
||||||
|
end
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.update(id)
|
def self.update(id)
|
||||||
|
|||||||
Reference in New Issue
Block a user