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

@@ -27,8 +27,8 @@ class CustomersController < ApplicationController
include SortHelper
helper :timelog
before_action :add_customer, :only => :new
before_action :view_customer, :except => [:new, :view]
before_action :add_customer, :only => :new
before_action :view_customer, :except => [:new, :view]
skip_before_action :verify_authenticity_token, :check_if_login_required, :only => [:view]
default_search_scope :names
@@ -162,9 +162,9 @@ class CustomersController < ApplicationController
session[:token] = @token.token
@issue = Issue.find @token.issue_id
@journals = @issue.journals.
preload(:details).
preload(:user => :email_address).
reorder(:created_on, :id).to_a
preload(:details).
preload(:user => :email_address).
reorder(:created_on, :id).to_a
@journals.each_with_index {|j,i| j.indice = i+1}
@journals.reject!(&:private_notes?) unless User.current.allowed_to?(:view_private_notes, @issue.project)
Journal.preload_journals_details_custom_fields(@journals)
@@ -212,7 +212,7 @@ class CustomersController < ApplicationController
# format a quickbooks address to a human readable string
def address_to_s (address)
return if address.nil?
string = address.line1
string = address.line1
string << "\n" + address.line2 if address.line2
string << "\n" + address.line3 if address.line3
string << "\n" + address.line4 if address.line4

View File

@@ -110,7 +110,7 @@ class VehiclesController < ApplicationController
private
# checks to see if there is only one item in an array
# checks to see if there is only one item in an array
# @return true if array only has one item
def only_one_non_zero?( array )
found_non_zero = false

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

View File

@@ -7,28 +7,28 @@
<div class="clearfix">
<%=t(:label_display_name)%>
<div class="input">
<%= f.text_field :name, :required => true, :autocomplete => "off" %>
<%= f.text_field :name, :required => true, :autocomplete => "off" %>
</div>
</div>
<div class="clearfix">
<%=t(:label_primary_phone)%>
<div class="input">
<%= f.telephone_field :primary_phone, :autocomplete => "off" %>
<%= f.telephone_field :primary_phone, :autocomplete => "off" %>
</div>
</div>
<div class="clearfix">
<%=t(:label_mobile_phone)%>:
<div class="input">
<%= f.telephone_field :mobile_phone, :autocomplete => "off" %>
<%= f.telephone_field :mobile_phone, :autocomplete => "off" %>
</div>
</div>
<div class="clearfix">
<%=t(:label_email)%>:
<div class="input">
<%= f.email_field :email, :autocomplete => "off" %>
<%= f.email_field :email, :autocomplete => "off" %>
</div>
</div>

View File

@@ -5,7 +5,7 @@
<%= avatar(@issue.author, :size => "50") %>
<div class="subject">
<%= render_issue_subject_with_tree(@issue) %>
<%= render_issue_subject_with_tree(@issue) %>
<%=t(:label_customer_link_expires)%> <%= distance_of_time_in_words(Time.now, @token.expires_at) %>
</div>
<p class="author">

View File

@@ -4,8 +4,8 @@
<%= form_for @vehicle do |f| %>
<div class="clearfix">
<%=t(:field_customer)%>:
<div class="input">
<%=t(:field_customer)%>:
<div class="input">
<%= f.autocomplete_field :customer, autocomplete_customer_name_customers_path, :value => @customer.name, :update_elements => {:id => '#customer_id', :value => '#issue_customer'}, :required => true %>
<%= f.hidden_field :customer_id, :id => "customer_id", :value => @customer.id %>
</div>

View File

@@ -1,4 +1,4 @@
<%= form_tag(vehicles_path, :method => "get", id: "search-form") do %>
<%= text_field_tag :search, params[:search], placeholder: t(:label_search_vin), :autocomplete => "off" %>
<%= text_field_tag :search, params[:search], placeholder: t(:label_search_vin), :autocomplete => "off" %>
<%= submit_tag t(:label_search) %>
<% end %>