Update qbo_invoice.rb

This commit is contained in:
2016-09-13 22:41:51 -04:00
committed by GitHub
parent 48edc85e2c
commit 53a0a47dd6

View File

@@ -61,16 +61,16 @@ class QboInvoice < ActiveRecord::Base
begin begin
# Load the invoice into the database # Load the invoice into the database
qbo_invoice = QboInvoice.find_or_create_by(id: invoice.id) qbo_invoice = QboInvoice.find_or_create_by(id: invoice.id)
if qbo_invoice.new? #if qbo_invoice.new?
qbo_invoice.doc_number = invoice.doc_number qbo_invoice.doc_number = invoice.doc_number
qbo_invoice.id = invoice.id qbo_invoice.id = invoice.id
qbo_invoice.save! qbo_invoice.save!
end #end
# Attach the invoice to the issue # Attach the invoice to the issue
unless i.qbo_invoices.include?(qbo_invoice) unless i.qbo_invoices.include?(qbo_invoice)
i.qbo_invoices << qbo_invoice i.qbo_invoices << qbo_invoice
i.save i.save!
end end
rescue rescue
puts "Something when wrong..." puts "Something when wrong..."