mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-08 17:04:23 -05:00
Update qbo_invoice.rb
This commit is contained in:
@@ -64,8 +64,12 @@ class QboInvoice < ActiveRecord::Base
|
|||||||
if line.description
|
if line.description
|
||||||
line.description.scan(/#(\w+)/).flatten.each { |issue|
|
line.description.scan(/#(\w+)/).flatten.each { |issue|
|
||||||
i = Issue.find_by_id(issue.to_i)
|
i = Issue.find_by_id(issue.to_i)
|
||||||
i.qbo_invoices << QboInvoice.find_by_id(invoice.id.to_i) if not i.qbo_invoice_ids.include?(invoice.id)
|
begin
|
||||||
i.save!
|
i.qbo_invoices << QboInvoice.find_by_id(invoice.id.to_i)
|
||||||
|
i.save!
|
||||||
|
rescue
|
||||||
|
# do nothing, the reccord exists
|
||||||
|
end
|
||||||
|
|
||||||
# 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|
|
||||||
|
|||||||
Reference in New Issue
Block a user