Compare commits

..
2 Commits
Author SHA1 Message Date
ricky ea29990cfa Version 2026.8.0 2026-08-10 19:36:25 -04:00
ricky c31ec82e61 Normalize customer name before saving and update QBO display name accordingly 2026-08-10 15:20:14 -04:00
2 changed files with 7 additions and 3 deletions
+6 -2
View File
@@ -20,6 +20,9 @@ class Customer < QboBaseModel
before_validation :normalize_phone_numbers
self.primary_key = :id
qbo_sync push: true
# Normalize the local database column :name
normalizes :name, with: ->(name) { name.to_s.strip.titleize }
acts_as_searchable columns: %w[name phone_number mobile_phone_number ],
scope: ->(_context) { left_joins(:project) },
@@ -61,8 +64,9 @@ class Customer < QboBaseModel
# Updates Both local DB name & QBO display_name
def name=(s)
details.display_name = s
super
super(s)
# Write the normalized value from Active Record to QBO details
details.display_name = self.name
end
# Normalizes phone numbers by removing non-digit characters. This method is called before validation to ensure that phone numbers are stored in a consistent format, which can help with searching and integration with external systems like QuickBooks Online.
+1 -1
View File
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo do
name 'Redmine QBO plugin'
author 'Rick Barrette'
description 'A pluging for Redmine to connect with QuickBooks Online to create Time Activity Entries for billable hours logged when an Issue is closed'
version '2026.3.17'
version '2026.8.0'
url 'https://github.com/rickbarrette/redmine_qbo'
author_url 'https://barrettefabrication.com'
settings default: {empty: true}, partial: 'qbo/settings'