mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-08-21 13:50:44 -04:00
Compare commits
4
Commits
938f9d9f3b
...
2026.8.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfd3a641db | ||
|
|
75e5aeb668 | ||
|
|
ea29990cfa | ||
|
|
c31ec82e61 |
@@ -21,6 +21,9 @@ class Customer < QboBaseModel
|
|||||||
self.primary_key = :id
|
self.primary_key = :id
|
||||||
qbo_sync push: true
|
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 ],
|
acts_as_searchable columns: %w[name phone_number mobile_phone_number ],
|
||||||
scope: ->(_context) { left_joins(:project) },
|
scope: ->(_context) { left_joins(:project) },
|
||||||
date_column: :updated_at
|
date_column: :updated_at
|
||||||
@@ -61,8 +64,9 @@ class Customer < QboBaseModel
|
|||||||
|
|
||||||
# Updates Both local DB name & QBO display_name
|
# Updates Both local DB name & QBO display_name
|
||||||
def name=(s)
|
def name=(s)
|
||||||
details.display_name = s
|
super(s)
|
||||||
super
|
# Write the normalized value from Active Record to QBO details
|
||||||
|
details.display_name = self.name
|
||||||
end
|
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.
|
# 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.
|
||||||
|
|||||||
@@ -2,57 +2,53 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_name)%></th>
|
<th><%= t(:label_name) %></th>
|
||||||
<td><%= customer.name %></td>
|
<td><%= customer.name %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_email)%></th>
|
<th><%= t(:label_email) %></th>
|
||||||
<td><%= customer.email %></td>
|
<td><%= customer.email %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_primary_phone)%></th>
|
<th><%= t(:label_primary_phone) %></th>
|
||||||
<td><%= number_to_phone(customer&.primary_phone&.gsub(/[^\d]/, '').to_i, area_code: true) %></td>
|
<td><%= number_to_phone(customer&.primary_phone&.gsub(/[^\d]/, '').to_i, area_code: true) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_mobile_phone)%></th>
|
<th><%= t(:label_mobile_phone) %></th>
|
||||||
<td><%= number_to_phone(customer&.mobile_phone&.gsub(/[^\d]/, '').to_i, area_code: true) %></td>
|
<td><%= number_to_phone(customer&.mobile_phone&.gsub(/[^\d]/, '').to_i, area_code: true) %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_billing_address)%></th>
|
<th><%= t(:label_billing_address) %></th>
|
||||||
<td><pre><%= @billing_address %></pre></td>
|
<td><pre><%= @billing_address %></pre></td>
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
|
||||||
<th><%=t(:label_shipping_address)%></th>
|
|
||||||
<td><pre><%= @shipping_address %></pre></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th><%=t(:label_account_balance)%></th>
|
<th><%= t(:label_shipping_address) %></th>
|
||||||
<td>$<%= customer.balance %></td>
|
<td><pre><%= @shipping_address %></pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th colspan="2"><h4><%=t(:field_notes)%></hr></th>
|
<th><%= t(:label_account_balance) %></th>
|
||||||
|
<td>$<%= customer.balance %></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<% if customer.notes.present? %>
|
||||||
<td colspan="2">
|
<tr>
|
||||||
<pre id="note-display" style="text-align: left; white-space: pre-wrap; font-family: inherit;">
|
<th colspan="2"><h4><%= t(:field_notes) %></h4></th>
|
||||||
<%= customer.notes %>
|
</tr>
|
||||||
</pre>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<script>
|
<tr>
|
||||||
const preElement = document.getElementById('note-display');
|
<td colspan="2">
|
||||||
// This takes the text, trims the edges, and puts it back
|
<div class="wiki">
|
||||||
preElement.textContent = preElement.textContent.trim();
|
<%= textilizable(customer, :notes) %>
|
||||||
</script>
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -32,20 +32,17 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="clearfix">
|
<div class="clearfix">
|
||||||
<%=t(:field_notes)%>:
|
<%=t(:field_notes)%>:
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<p>
|
<p>
|
||||||
<%= content_tag :span, id: "issue_description_and_toolbar" do %>
|
<%= f.text_area :notes,
|
||||||
<%= f.text_area :notes,
|
rows: 8,
|
||||||
cols: 60,
|
class: 'wiki-edit',
|
||||||
rows: 10,
|
style: 'width: 95%;',
|
||||||
accesskey: accesskey(:edit),
|
id: 'customer_appointment_description' %>
|
||||||
class: 'wiki-edit',
|
<%= wikitoolbar_for 'customer_appointment_description' %>
|
||||||
no_label: true %>
|
</p>
|
||||||
<% end %>
|
|
||||||
</p>
|
|
||||||
<%= wikitoolbar_for :issue_description %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Redmine::Plugin.register :redmine_qbo do
|
|||||||
name 'Redmine QBO plugin'
|
name 'Redmine QBO plugin'
|
||||||
author 'Rick Barrette'
|
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'
|
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.1'
|
||||||
url 'https://github.com/rickbarrette/redmine_qbo'
|
url 'https://github.com/rickbarrette/redmine_qbo'
|
||||||
author_url 'https://barrettefabrication.com'
|
author_url 'https://barrettefabrication.com'
|
||||||
settings default: {empty: true}, partial: 'qbo/settings'
|
settings default: {empty: true}, partial: 'qbo/settings'
|
||||||
|
|||||||
Reference in New Issue
Block a user