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:
@@ -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..."
|
||||||
|
|||||||
Reference in New Issue
Block a user