diff --git a/app/controllers/customers_controller.rb b/app/controllers/customers_controller.rb index dae292c..9d08e4d 100644 --- a/app/controllers/customers_controller.rb +++ b/app/controllers/customers_controller.rb @@ -142,7 +142,7 @@ class CustomersController < ApplicationController def share Thread.new do - logger.debug "Removing expired customer tokens" + logger.info "Removing expired customer tokens" CustomerToken.remove_expired_tokens ActiveRecord::Base.connection.close end diff --git a/app/controllers/qbo_controller.rb b/app/controllers/qbo_controller.rb index 93e95d8..325dbf8 100644 --- a/app/controllers/qbo_controller.rb +++ b/app/controllers/qbo_controller.rb @@ -97,7 +97,7 @@ class QboController < ApplicationController id = entity['id'].to_i name = entity['name'] - logger.debug "Casting #{name.constantize} to obj" + logger.info "Casting #{name.constantize} to obj" # Magicly initialize the correct class obj = name.constantize diff --git a/app/models/invoice.rb b/app/models/invoice.rb index f66d1e8..f51ef0b 100644 --- a/app/models/invoice.rb +++ b/app/models/invoice.rb @@ -17,7 +17,7 @@ class Invoice < ActiveRecord::Base # sync ALL the invoices def self.sync - logger.debug "Syncing all invoices" + logger.info "Syncing all invoices" last = Qbo.first.last_sync query = "SELECT Id, DocNumber FROM Invoice" @@ -40,7 +40,7 @@ class Invoice < ActiveRecord::Base #sync by invoice ID def self.sync_by_id(id) - logger.debug "Syncing invoice #{id}" + logger.info "Syncing invoice #{id}" qbo = Qbo.first qbo.perform_authenticated_request do |access_token| service = Quickbooks::Service::Invoice.new(:company_id => qbo.realm_id, :access_token => access_token) @@ -58,7 +58,7 @@ class Invoice < ActiveRecord::Base # skip this issue if the issue customer is not the same as the invoice customer return if issue.customer_id != invoice.customer_ref.value.to_i - logger.debug "Attaching invoice #{invoice.id} to issue #{issue.id}" + logger.info "Attaching invoice #{invoice.id} to issue #{issue.id}" invoice = Invoice.find_or_create_by(id: invoice.id) @@ -105,7 +105,7 @@ class Invoice < ActiveRecord::Base # this condions causes an infinite loop as the webhook is called when an invoice is updated # TODO maybe add a cf_sync_confict flag to invoices def self.compare_custom_fields(issue, invoice) - logger.debug "Comparing custom fields" + logger.info "Comparing custom fields" # TODO break if Invoice.find(invoice.id).cf_sync_confict is_changed = false @@ -120,12 +120,12 @@ class Invoice < ActiveRecord::Base # Only update if blank to prevent infite loops # TODO check cf_sync_confict flag once implemented if cf.string_value.to_s.blank? - logger.debug " VIN was blank, updating the invoice vin in quickbooks" + logger.info " VIN was blank, updating the invoice vin in quickbooks" vin = Vehicle.find(issue.vehicles_id).vin break if vin.nil? if not cf.string_value.to_s.eql? vin cf.string_value = vin.to_s - logger.debug "VIN has changed" + logger.info "VIN has changed" is_changed = true end @@ -155,7 +155,7 @@ class Invoice < ActiveRecord::Base # Push updates begin - logger.debug "Trying to update invoice" + logger.info "Trying to update invoice" qbo = Qbo.first qbo.perform_authenticated_request do |access_token| service = Quickbooks::Service::Invoice.new(:company_id => qbo.realm_id, :access_token => access_token)