<%# Estimate and invoice drafts (QboDraft) with Continue and Delete. show_customer: false on a customer's page. %> <% show_customer = local_assigns.fetch(:show_customer, true) %> <% if show_customer %><% end %> <% drafts.each do |draft| %> <% if show_customer %> <% end %> <% end %>
<%= l(:label_qbo_draft_document) %><%= l(:field_customer) %><%= l(:label_qbo_draft_lines) %> <%= l(:label_subtotal) %> <%= l(:label_qbo_draft_saved_by) %>
<%= link_to l(draft.invoice? ? :label_qbo_invoice_draft : :label_qbo_estimate_draft), draft.invoice? ? new_qbo_invoice_path(draft_id: draft.id) : new_qbo_estimate_path(draft_id: draft.id) %><%= draft.customer ? link_to(draft.customer.name, customer_path(draft.customer)) : (draft.customer_name || '–') %><%= draft.line_count %> <%= number_to_currency(draft.subtotal) %> <%= l(:text_qbo_draft_saved_by, user: h(draft.user&.name || l(:label_user_anonymous)), age: time_tag(draft.updated_at)).html_safe %> <%= link_to sprite_icon('edit', l(:button_qbo_continue_draft)), draft.invoice? ? new_qbo_invoice_path(draft_id: draft.id) : new_qbo_estimate_path(draft_id: draft.id), class: 'icon icon-edit' %> <%= link_to sprite_icon('del', l(:button_delete)), qbo_draft_path(draft), method: :delete, data: { confirm: l(:text_are_you_sure) }, class: 'icon icon-del' %>