mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-17 18:20:36 -05:00
Show each estimate's status on the customer page
The estimate lists (customer page, and redmine_qbo_vehicles' vehicle page) show the QuickBooks status badge (Pending, Accepted, Closed, Converted, Rejected) after the date. It's the status the estimate sync already caches, kept current by the webhook. The badge styles are shared with the estimate page's header (qbo_estimates/_status_styles). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
09e88232b0
commit
ec6fecbd85
3 files changed
+18
-6
No files matched your search
@@ -1,12 +1,19 @@
|
|||||||
<% unless estimates.empty? %>
|
<% unless estimates.empty? %>
|
||||||
|
|
||||||
|
<%= render partial: 'qbo_estimates/status_styles' %>
|
||||||
|
<div class="qbo-estimate-list">
|
||||||
<% estimates.sort.reverse.each do |estimate| %>
|
<% estimates.sort.reverse.each do |estimate| %>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<%= check_box_tag "estimate_ids[]", estimate.id, false, onchange: "updateLink()", data: { text: "Estimate ##{estimate.doc_number}", new_issue_param: 'issue[estimate_id]' }, class: "estimate-checkbox appointment" %>
|
<%= check_box_tag "estimate_ids[]", estimate.id, false, onchange: "updateLink()", data: { text: "Estimate ##{estimate.doc_number}", new_issue_param: 'issue[estimate_id]' }, class: "estimate-checkbox appointment" %>
|
||||||
<b><%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %></b> <%= estimate.txn_date %>
|
<b><%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %></b> <%= estimate.txn_date %>
|
||||||
|
<%# QuickBooks status, cached by the estimate sync (kept current by the webhook) %>
|
||||||
|
<% if estimate.txn_status.present? %>
|
||||||
|
<span class="qbo-estimate-status qbo-estimate-status-<%= estimate.txn_status.downcase %>"><%= estimate.txn_status %></span>
|
||||||
|
<% end %>
|
||||||
<%= render partial: 'qbo_estimates/estimate_actions', locals: { estimate: estimate } if RedmineQboBilling.writer? %>
|
<%= render partial: 'qbo_estimates/estimate_actions', locals: { estimate: estimate } if RedmineQboBilling.writer? %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<p><%=t(:label_no_estimates)%>.</p>
|
<p><%=t(:label_no_estimates)%>.</p>
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
<%# QuickBooks status badges: the estimate page's header and the estimate lists (customer and vehicle pages) %>
|
||||||
|
<style>
|
||||||
|
.qbo-estimate-status { display: inline-block; font-size: .6em; font-weight: 600; vertical-align: middle; padding: 2px 8px; border-radius: 10px;
|
||||||
|
background: #eceef1; color: #393a3d; margin-left: 6px; }
|
||||||
|
.qbo-estimate-status-sent { background: #e6f4e4; color: #108000; }
|
||||||
|
.qbo-estimate-status-accepted { background: #e6f4e4; color: #108000; }
|
||||||
|
.qbo-estimate-status-closed, .qbo-estimate-status-converted { background: #e8eefa; color: #0d47a1; }
|
||||||
|
.qbo-estimate-status-rejected { background: #fdecea; color: #b71c1c; }
|
||||||
|
.qbo-estimate-list .qbo-estimate-status { font-size: .8em; padding: 1px 7px; margin-left: 4px; }
|
||||||
|
</style>
|
||||||
@@ -111,16 +111,10 @@
|
|||||||
.qbo-estimate .qbo-button-primary { background: var(--qbo-green); border-color: var(--qbo-green); color: #fff; }
|
.qbo-estimate .qbo-button-primary { background: var(--qbo-green); border-color: var(--qbo-green); color: #fff; }
|
||||||
.qbo-estimate .qbo-button-primary:hover { background: var(--qbo-green-dark); border-color: var(--qbo-green-dark); color: #fff; }
|
.qbo-estimate .qbo-button-primary:hover { background: var(--qbo-green-dark); border-color: var(--qbo-green-dark); color: #fff; }
|
||||||
|
|
||||||
.qbo-estimate-status { display: inline-block; font-size: .6em; font-weight: 600; vertical-align: middle; padding: 2px 8px; border-radius: 10px;
|
|
||||||
background: #eceef1; color: #393a3d; margin-left: 6px; }
|
|
||||||
.qbo-estimate-status-sent { background: #e6f4e4; color: #108000; }
|
|
||||||
.qbo-estimate-status-accepted { background: #e6f4e4; color: #108000; }
|
|
||||||
.qbo-estimate-status-closed, .qbo-estimate-status-converted { background: #e8eefa; color: #0d47a1; }
|
|
||||||
/* Warnings with a list (linked issues, invoices): the text, then one item per line */
|
/* Warnings with a list (linked issues, invoices): the text, then one item per line */
|
||||||
div.warning.qbo-estimate-notice { text-align: left; }
|
div.warning.qbo-estimate-notice { text-align: left; }
|
||||||
div.warning.qbo-estimate-notice ul { margin: 6px 0 0; padding-left: 22px; }
|
div.warning.qbo-estimate-notice ul { margin: 6px 0 0; padding-left: 22px; }
|
||||||
div.warning.qbo-estimate-notice li { margin: 2px 0; }
|
div.warning.qbo-estimate-notice li { margin: 2px 0; }
|
||||||
.qbo-estimate-status-rejected { background: #fdecea; color: #b71c1c; }
|
|
||||||
.qbo-estimate-edit-link { margin-left: 4px; vertical-align: middle; }
|
.qbo-estimate-edit-link { margin-left: 4px; vertical-align: middle; }
|
||||||
|
|
||||||
/* Phones: each line becomes a small card (number, product and delete; description; qty, rate, amount and tax) */
|
/* Phones: each line becomes a small card (number, product and delete; description; qty, rate, amount and tax) */
|
||||||
@@ -160,3 +154,4 @@
|
|||||||
.qbo-estimate-actions { padding: 10px 14px; }
|
.qbo-estimate-actions { padding: 10px 14px; }
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<%= render partial: 'qbo_estimates/status_styles' %>
|
||||||
Reference in new issue
Block a user