Files
redmine_qbo/app/views/estimates/_list.html.erb
T
rickyandClaude Opus 5.5 92f9eb1bc7 Customer page lists: short paid badge, aligned icons, appointment link
* The invoice list's paid badge is short so each invoice stays on one
  line: "Paid", or "Paid +3d" when it was paid in full 3 days after
  its date, with the day on hover. The invoice page keeps the date.
* The estimate and invoice lists are laid out in columns (checkbox,
  number, date, status, actions), so the edit/view icons line up.
* Ticked estimates (and redmine_qbo_vehicles' vehicles) fill in
  redmine_qbo_calendar's Add appointment link (estimate_id,
  vehicle_id) as well as New issue. Estimate checkboxes are only on
  the customer page, where they're used.
* application.js is gone: it only carried the old Google Calendar
  link code, which threw an error when a box was ticked on a vehicle
  page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 19:39:08 -05:00

25 lines
1.4 KiB
ERB

<% unless estimates.empty? %>
<%= render partial: 'qbo_estimates/status_styles' %>
<div class="qbo-estimate-list">
<% estimates.sort.reverse.each do |estimate| %>
<%# One cell each (qbo_estimates/_status_styles lines them up in columns, so the icons line up) %>
<div class="row">
<%# Ticking an estimate adds it to the customer page's New issue and Add appointment links (customers/_new_issue_link_script) %>
<span class="qbo-list-check"><%= check_box_tag "estimate_ids[]", estimate.id, false, data: { new_issue_param: 'issue[estimate_id]', appointment_param: 'estimate_id' }, class: "estimate-checkbox" if local_assigns[:new_issue_checkboxes] %></span>
<b class="qbo-list-number"><%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %></b>
<span class="qbo-list-date"><%= estimate.txn_date %></span>
<%# QuickBooks status, cached by the estimate sync (kept current by the webhook) %>
<span class="qbo-list-status">
<% if estimate.txn_status.present? %>
<span class="qbo-estimate-status qbo-estimate-status-<%= estimate.txn_status.downcase %>"><%= estimate.txn_status %></span>
<% end %>
</span>
<span class="qbo-list-actions"><%= render partial: 'qbo_estimates/estimate_actions', locals: { estimate: estimate } if RedmineQboBilling.writer? %></span>
</div>
<% end %>
</div>
<% else %>
<p><%=t(:label_no_estimates)%>.</p>
<% end %>