Update qbo_invoice.rb

This commit is contained in:
2016-09-26 16:33:56 -04:00
committed by GitHub
parent 6aae155933
commit fb40833abd

View File

@@ -65,6 +65,8 @@ class QboInvoice < ActiveRecord::Base
issue.qbo_invoices << qbo_invoice issue.qbo_invoices << qbo_invoice
issue.save! issue.save!
end end
compare_custom_fields(issue, invoice)
end end
# processes the invoice into the system # processes the invoice into the system
@@ -87,7 +89,9 @@ class QboInvoice < ActiveRecord::Base
} }
end end
} }
end
def self.compare_custom_fields(issue, invoice)
# 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|
@@ -150,5 +154,5 @@ class QboInvoice < ActiveRecord::Base
# Push updates # Push updates
get_base.update(invoice) if is_changed get_base.update(invoice) if is_changed
end end
end end