% unless estimates.empty? %>
<%= render partial: 'qbo_estimates/status_styles' %>
<% estimates.sort.reverse.each do |estimate| %>
<%# One cell each (qbo_estimates/_status_styles lines them up in columns, so the icons line up) %>
<%# Ticking an estimate adds it to the customer page's New issue and Add appointment links (customers/_new_issue_link_script) %>
<%= 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] %>
<%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %>
<%= estimate.txn_date %>
<%# QuickBooks status, cached by the estimate sync (kept current by the webhook) %>
<% if estimate.txn_status.present? %>
<%= estimate.txn_status %>
<% end %>
<%= render partial: 'qbo_estimates/estimate_actions', locals: { estimate: estimate } if RedmineQboBilling.writer? %>
<% end %>
<% else %>
<%=t(:label_no_estimates)%>.
<% end %>