mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-18 02:20:37 -05:00
* 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>
41 lines
1.9 KiB
ERB
41 lines
1.9 KiB
ERB
<% unless invoices.empty? %>
|
|
<%= render partial: 'qbo_estimates/status_styles' %>
|
|
|
|
<%= form_with(url: invoice_path, method: :get) do |form| %>
|
|
|
|
<% if invoices.count > 1 %>
|
|
<div class="form-check">
|
|
<%= check_box_tag "select-all-invoices", "1", false, id: "select-all-invoices" %>
|
|
<%= label_tag "select-all-invoices", t(:label_select_all) %>
|
|
</div>
|
|
<hr>
|
|
<% end %>
|
|
|
|
<div class="qbo-invoice-list">
|
|
<% invoices.sort.reverse.each do |invoice| %>
|
|
<%# One cell each (qbo_estimates/_status_styles lines them up in columns, so the icons line up) %>
|
|
<div class="row">
|
|
<span class="qbo-list-check"><%= check_box_tag "invoice_ids[]", invoice.id, false, class: "invoice-checkbox" if invoices.count > 1 %></span>
|
|
<b class="qbo-list-number"><%= link_to "##{invoice.doc_number}", invoice_path(invoice), target: :_blank %></b>
|
|
<span class="qbo-list-date"><%= invoice.txn_date %></span>
|
|
<%# Paid / partially paid / overdue / open / voided, from the cached balance and due date; short so the list
|
|
stays narrow: "Paid", or "Paid +3d" when paid in full days after its date (the date on hover) %>
|
|
<span class="qbo-list-status">
|
|
<% if (status = invoice.status) %>
|
|
<span class="qbo-estimate-status qbo-invoice-status-<%= status %>" title="<%= RedmineQboBilling::InvoiceStatus.title(status, paid_on: invoice.paid_on) %>"><%= RedmineQboBilling::InvoiceStatus.short_label(status, paid_on: invoice.paid_on, invoice_date: invoice.txn_date) %></span>
|
|
<% end %>
|
|
</span>
|
|
<span class="qbo-list-actions"><%= render partial: 'qbo_invoices/invoice_actions', locals: { invoice: invoice } if RedmineQboBilling.invoice_writer? %></span>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<% if invoices.count > 1 %>
|
|
<%= form.submit t(:button_bulk_pdf) %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% else %>
|
|
<p><%=t(:label_no_invoices)%>.</p>
|
|
<% end %>
|