Created
April 15, 2013 18:53
-
-
Save coreycollins/5390401 to your computer and use it in GitHub Desktop.
Revisions
-
Corey Collins created this gist
Apr 15, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ oauth_client = OAuth::AccessToken.new($qb_oauth_consumer, qb[:token], qb[:secret]) #Create New Job/Customer job_service = Quickeebooks::Windows::Service::Job.new job_service.access_token = oauth_client job_service.realm_id = qb[:realm_id] qb_job = Quickeebooks::Windows::Model::Job.new qb_job.name = job.id qb_job.type_of = 'Organization' qb_job.customer_name = job.account.name qb_job.job_parent_name = job.account.name qb_job.customer_type_name = "#{job.account_type.value}:#{job.list.name}" email = Quickeebooks::Windows::Model::Email.new(job.account.email) email.tag = 'Business' qb_job.email = email #qb_job.phones = customer.phones #qb_job.addresses = customer.addresses begin response = job_service.create(qb_job) if response.success? puts "Saved Job - ID: #{job.id}, QBID: #{job.qbid}" else puts response end rescue Exception => exp puts "Error: #{exp.message}" end