mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-04-02 08:21:57 -04:00
Simplified detail calls
This commit is contained in:
@@ -33,14 +33,12 @@ class Customer < QboBaseModel
|
|||||||
|
|
||||||
# Returns the customer's email address
|
# Returns the customer's email address
|
||||||
def email
|
def email
|
||||||
details
|
return details&.email_address&.address
|
||||||
return @details&.email_address&.address
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updates the customer's email address
|
# Updates the customer's email address
|
||||||
def email=(s)
|
def email=(s)
|
||||||
details
|
details.email_address = s
|
||||||
@details.email_address = s
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Customers are not bound by a project
|
# Customers are not bound by a project
|
||||||
@@ -51,22 +49,19 @@ class Customer < QboBaseModel
|
|||||||
|
|
||||||
# returns the customer's mobile phone
|
# returns the customer's mobile phone
|
||||||
def mobile_phone
|
def mobile_phone
|
||||||
details
|
return details&.mobile_phone&.free_form_number
|
||||||
return @details&.mobile_phone&.free_form_number
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updates the custome's mobile phone number
|
# Updates the custome's mobile phone number
|
||||||
def mobile_phone=(n)
|
def mobile_phone=(n)
|
||||||
details
|
|
||||||
pn = Quickbooks::Model::TelephoneNumber.new
|
pn = Quickbooks::Model::TelephoneNumber.new
|
||||||
pn.free_form_number = n
|
pn.free_form_number = n
|
||||||
@details.mobile_phone = pn
|
details.mobile_phone = pn
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updates Both local DB name & QBO display_name
|
# Updates Both local DB name & QBO display_name
|
||||||
def name=(s)
|
def name=(s)
|
||||||
details
|
details.display_name = s
|
||||||
@details.display_name = s
|
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -78,22 +73,19 @@ class Customer < QboBaseModel
|
|||||||
|
|
||||||
# Sets the notes for the customer
|
# Sets the notes for the customer
|
||||||
def notes=(s)
|
def notes=(s)
|
||||||
details
|
details.notes = s
|
||||||
@details.notes = s
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# returns the customer's primary phone
|
# returns the customer's primary phone
|
||||||
def primary_phone
|
def primary_phone
|
||||||
details
|
return details&.primary_phone&.free_form_number
|
||||||
return @details&.primary_phone&.free_form_number
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Updates the customer's primary phone number
|
# Updates the customer's primary phone number
|
||||||
def primary_phone=(n)
|
def primary_phone=(n)
|
||||||
details
|
|
||||||
pn = Quickbooks::Model::TelephoneNumber.new
|
pn = Quickbooks::Model::TelephoneNumber.new
|
||||||
pn.free_form_number = n
|
pn.free_form_number = n
|
||||||
@details.primary_phone = pn
|
details.primary_phone = pn
|
||||||
end
|
end
|
||||||
|
|
||||||
# Seach for customers by name or phone number
|
# Seach for customers by name or phone number
|
||||||
|
|||||||
Reference in New Issue
Block a user