Removed extra white spaces

This commit is contained in:
2022-03-09 22:53:03 -05:00
parent 09c497ff96
commit a75f1abd71
20 changed files with 58 additions and 60 deletions

View File

@@ -116,21 +116,21 @@ class Customer < ActiveRecord::Base
# Magic Method
# Maps Get/Set methods to QBO customer object
def method_missing(sym, *arguments)
def method_missing(sym, *arguments)
# Check to see if the method exists
if Quickbooks::Model::Customer.method_defined?(sym)
# download details if required
pull unless @details
method_name = sym.to_s
# Setter
if method_name[-1, 1] == "="
@details.method(method_name).call(arguments[0])
if method_name[-1, 1] == "="
@details.method(method_name).call(arguments[0])
# Getter
else
else
return @details.method(method_name).call
end
end
end
end
end
# proforms a bruteforce sync operation
# This needs to be simplified

View File

@@ -69,20 +69,20 @@ class Estimate < ActiveRecord::Base
# Magic Method
# Maps Get/Set methods to QBO estimate object
def method_missing(sym, *arguments)
def method_missing(sym, *arguments)
# Check to see if the method exists
if Quickbooks::Model::Estimate.method_defined?(sym)
# download details if required
pull unless @details
method_name = sym.to_s
# Setter
if method_name[-1, 1] == "="
@details.method(method_name).call(arguments[0])
if method_name[-1, 1] == "="
@details.method(method_name).call(arguments[0])
# Getter
else
else
return @details.method(method_name).call
end
end
end
end
private

View File

@@ -26,7 +26,7 @@ class Invoice < ActiveRecord::Base
last = Qbo.first.last_sync
query = "SELECT Id, DocNumber FROM Invoice"
query << " WHERE Metadata.LastUpdatedTime >= '#{last.iso8601}' " if last
query << " WHERE Metadata.LastUpdatedTime >= '#{last.iso8601}' " if last
# TODO actually do something with the above query
# .all() is never called since count is never initialized
@@ -81,7 +81,7 @@ class Invoice < ActiveRecord::Base
invoice.txn_date = invoice.txn_date
invoice.save!
# Scan the private notes for hashtags and attach to the applicable issues
# Scan the private notes for hashtags and attach to the applicable issues
if not invoice.private_note.nil?
invoice.private_note.scan(/#(\w+)/).flatten.each { |issue|
attach_to_issue(Issue.find_by_id(issue.to_i), invoice)
@@ -157,7 +157,7 @@ class Invoice < ActiveRecord::Base
logger.debug "Trying to update invoice"
get_base.update(invoice) if is_changed
rescue
# Do nothing, probaly custome field sync confict on the invoice.
# Do nothing, probaly custome field sync confict on the invoice.
# This is a problem with how it's billed
# TODO Add notes in memo area
# TODO flag Invoice.cf_sync_confict here
@@ -167,20 +167,20 @@ class Invoice < ActiveRecord::Base
# Magic Method
# Maps Get/Set methods to QBO invoice object
def method_missing(sym, *arguments)
def method_missing(sym, *arguments)
# Check to see if the method exists
if Quickbooks::Model::Invoice.method_defined?(sym)
# download details if required
pull unless @details
method_name = sym.to_s
# Setter
if method_name[-1, 1] == "="
@details.method(method_name).call(arguments[0])
if method_name[-1, 1] == "="
@details.method(method_name).call(arguments[0])
# Getter
else
else
return @details.method(method_name).call
end
end
end
end
# pull the details from quickbooks

View File

@@ -28,7 +28,6 @@ class Qbo < ActiveRecord::Base
return OAuth2::Client.new(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, oauth_params)
end
#
# Getter for oauth consumer
#
@@ -74,7 +73,7 @@ class Qbo < ActiveRecord::Base
when :account
return Quickbooks::Service::Account.new(:company_id => qbo.company_id, :access_token => access_token)
when :employee
return Quickbooks::Service:: Employee.new(:company_id => qbo.company_id, :access_token => access_token)
return Quickbooks::Service::Employee.new(:company_id => qbo.company_id, :access_token => access_token)
else
return access_token
end

View File

@@ -66,8 +66,8 @@ class Vehicle < ActiveRecord::Base
if @details
begin
self.year = @details.year unless @details.year.nil?
self.make = @details.make unless @details.make.nil?
self.model = @details.model unless @details.model.nil?
self.make = @details.make unless @details.make.nil?
self.model = @details.model unless @details.model.nil?
self.doors = @details.doors unless @details.doors.nil?
self.trim = @details.trim unless @details.trim.nil?
rescue Exception => e