From e2a871b1e85ed4e772396a79de677a4ed83699b2 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Sun, 1 Nov 2026 17:47:19 -0500 Subject: [PATCH] =?UTF-8?q?Customer=20page:=20Customers=20=C2=BB=20name=20?= =?UTF-8?q?trail,=20actions=20under=20it,=20Open=20in=20QuickBooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - The title is a trail back to the customer list, like Redmine's pages, instead of "Customer #id - name" - The action links sit on their own line under the title (qbo-under-title, also used by redmine_qbo_vehicles), so a long name and the many actions don't crowd each other - Open in QuickBooks joins the action links, as on the payments, invoice and estimate pages, in place of the name linking to QuickBooks Co-Authored-By: Claude Opus 5.5 --- README.md | 4 ++-- app/views/customers/show.html.erb | 16 +++++++++++----- assets/stylesheets/autocomplete.css | 11 ++++++++++- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 347cf96..075f004 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ Estimates and invoices keep their number, date, customer, total and **man-hours* ## Billing: Estimates, Invoices and Payments -* **New estimate** from the customer page: Create Estimate opens the Redmine editor. The customer page no longer links to QuickBooks' estimate or payment screens; the customer's name still opens their QuickBooks account page as a fallback. +* **New estimate** from the customer page: Create Estimate opens the Redmine editor. The customer page no longer links to QuickBooks' estimate or payment screens; **Open in QuickBooks** opens their QuickBooks account page as a fallback. * **Edit** any estimate from the Edit link next to it on the customer page or the issue page. * **Keyboard entry**: in a line's product box, Tab picks the product the text points to (an exact name, the only match, or the only name starting with it, e.g. "lab" → Labor) and fills the line. Tabbing into the description, quantity or rate selects it, so typing replaces it. The quantity, rate and amount boxes take simple math (e.g. `33*1.3`, `(120+15)/2`; `+ - * /`, `x` for times, parentheses), worked out when you leave the box; math in the rate or amount is rounded to the nearest penny, and an amount sets the rate from the quantity. Typing `sub`, `subtotal` or `=` in a product box, then Tab or Enter, adds a subtotal there (an empty line becomes the subtotal; a line with a description keeps it and gets the subtotal after it) and moves on to the next line. * **Duplicate** an estimate to start a similar one: same customer, lines, subtotals, custom fields and messages, dated today, with the current user as sales person. @@ -218,7 +218,7 @@ Available hooks: |Type|Hook|Note |--|--|--| -View Hook|:view_customers_show_contextual, { customer: @customer } | Used to add action links to the customer page's top-right action area (return links styled like Redmine's, e.g. `link_to sprite_icon('add', 'Label'), path, class: 'icon icon-add'`). Replaces `customer_actions_top` / `customer_actions_bottom` +View Hook|:view_customers_show_contextual, { customer: @customer } | Used to add action links to the customer page's action area, under the title (return links styled like Redmine's, e.g. `link_to sprite_icon('add', 'Label'), path, class: 'icon icon-add'`). Replaces `customer_actions_top` / `customer_actions_bottom` View Hook|:pdf_left, { issue: issue } | Used to add text to left side of PDF View Hook|:pdf_right, { issue: issue } | Used to add text to right side of PDF View Hook|:show_customer_view_right, { customer: customer } | Used to show partials on right side of customer view diff --git a/app/views/customers/show.html.erb b/app/views/customers/show.html.erb index 1b1296c..97a3985 100644 --- a/app/views/customers/show.html.erb +++ b/app/views/customers/show.html.erb @@ -1,11 +1,16 @@ -
+<% html_title @customer.to_s %> + +

<%= link_to l(:label_customers), customers_path %> » <%= @customer.to_s %>

+ +<%# Under the title rather than beside it, so a long name and the many actions don't crowd each other %> +
<%# New issue for this customer; picks up what's ticked on this page (an estimate, other plugins' items) %> <%= link_to sprite_icon('add', l(:label_new_issue)), new_issue_path(issue: { customer_id: @customer.id }), id: 'dynamic-new-issue-link', class: 'icon icon-add', target: :_blank %> <%# Plugins add their customer actions here (e.g. redmine_qbo_calendar's Add appointment) %> <%= call_hook :view_customers_show_contextual, { customer: @customer } %> - <%# Estimates, invoices and payments are handled here, each shown to users with its permission. The customer's - name below links to their QuickBooks account page as a fallback. %> + <%# Estimates, invoices and payments are handled here, each shown to users with its permission; Open in + QuickBooks goes to their QuickBooks account page for anything else. %> <% if RedmineQboBilling.writer? %> <%= render partial: 'qbo_estimates/customer_link', locals: { customer: @customer } %> <% end %> @@ -22,9 +27,10 @@ <%= link_to sprite_icon('edit', l(:button_edit)), edit_customer_path(@customer), class: 'icon icon-edit', accesskey: accesskey(:edit) %> <% end %> + <%= link_to sprite_icon('link', l(:button_open_in_quickbooks)), + "https://#{RedmineQbo.sandbox_mode? ? 'sandbox' : 'app'}.qbo.intuit.com/app/customerdetail?nameId=#{@customer.id}", + class: 'icon icon-link', target: :_blank, rel: 'noopener' %>
- -

<%=t(:field_customer)%> #<%= @customer.id %> - <%= link_to @customer.to_s, "https://#{RedmineQbo.sandbox_mode? ? "sandbox" : "app"}.qbo.intuit.com/app/customerdetail?nameId=#{@customer.id}", target: :_blank %>

diff --git a/assets/stylesheets/autocomplete.css b/assets/stylesheets/autocomplete.css index 8530ce9..2a7e50b 100644 --- a/assets/stylesheets/autocomplete.css +++ b/assets/stylesheets/autocomplete.css @@ -2,4 +2,13 @@ .ui-autocomplete .autocomplete-meta { color: #888; font-size: 0.9em; -} \ No newline at end of file +} +/* Contextual links on their own line under the page title (customer and vehicle pages), where a long title and + many links would otherwise crowd each other */ +#content .contextual.qbo-under-title { + float: none; + text-align: right; + white-space: normal; + margin: -4px 0 10px; + padding-left: 0; +}