Show the customer's addresses again; blank missing phones

The customer page's Billing and Shipping Address were always empty: the
controller stopped setting them in March and the view still read them.
The page now formats the QuickBooks addresses itself. A missing phone
number showed as "0", and the balance as "$125.0"; they're now blank
and "$125.00".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-20 18:02:32 -05:00
1 parent 761722bbb1
commit ff9556e728
8 files changed
+27 -5

No files matched your search

+7 -5
View File
@@ -1,3 +1,5 @@
<%# Phone numbers as (401) 555-0101, left blank when the customer has none %>
<% phone = ->(number) { digits = number.to_s.gsub(/\D/, ''); digits.present? ? number_to_phone(digits.to_i, area_code: true) : '' } %>
<table>
<tbody>
@@ -13,27 +15,27 @@
<tr>
<th><%= t(:label_primary_phone) %></th>
<td><%= number_to_phone(customer&.primary_phone&.gsub(/[^\d]/, '').to_i, area_code: true) %></td>
<td><%= phone.call(customer&.primary_phone) %></td>
</tr>
<tr>
<th><%= t(:label_mobile_phone) %></th>
<td><%= number_to_phone(customer&.mobile_phone&.gsub(/[^\d]/, '').to_i, area_code: true) %></td>
<td><%= phone.call(customer&.mobile_phone) %></td>
</tr>
<tr>
<th><%= t(:label_billing_address) %></th>
<td><pre><%= @billing_address %></pre></td>
<td><pre><%= RedmineQboBilling::EstimateWriter.format_address(customer.billing_address) %></pre></td>
</tr>
<tr>
<th><%= t(:label_shipping_address) %></th>
<td><pre><%= @shipping_address %></pre></td>
<td><pre><%= RedmineQboBilling::EstimateWriter.format_address(customer.shipping_address) %></pre></td>
</tr>
<tr>
<th><%= t(:label_account_balance) %></th>
<td>$<%= customer.balance %></td>
<td><%= number_to_currency(customer.balance || 0) %></td>
</tr>
<% if customer.notes.present? %>