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:
@@ -54,20 +54,14 @@ class QboInvoice < ActiveRecord::Base
|
|||||||
qbo_invoice.save!
|
qbo_invoice.save!
|
||||||
|
|
||||||
# Scan the line items for hashtags and attach to the applicable issues
|
# Scan the line items for hashtags and attach to the applicable issues
|
||||||
if invoice.line_items
|
|
||||||
invoice.line_items.each |line_item|
|
invoice.line_items.each |line_item|
|
||||||
if line_item.description
|
|
||||||
line_item.description.scan(/#(\w+)/).flatten.each |issue|
|
line_item.description.scan(/#(\w+)/).flatten.each |issue|
|
||||||
i = issue.find_by_id(issue.to_i)
|
i = issue.find_by_id(issue.to_i)
|
||||||
if i
|
|
||||||
i.qbo_invoice = issue.to_i
|
i.qbo_invoice = issue.to_i
|
||||||
i.save!
|
i.save!
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.update(id)
|
def self.update(id)
|
||||||
# Update the item table
|
# Update the item table
|
||||||
|
|||||||
Reference in New Issue
Block a user