<%=t(:label_details)%>:
<%= render partial: 'customers/details', locals: {customer: @customer} %>
<%=t(:estimates)%>:
<%= render partial: 'estimates/list', locals: {estimates: @customer.estimates} %>
<%=t(:label_invoices)%>:
<%= render partial: 'invoices/list', locals: {invoices: @customer.invoices} %>
<%# Estimate and invoice drafts, kept in Redmine until they're saved to QuickBooks %>
<% customer_drafts = QboDraft.visible.where(customer_id: @customer.id).includes(:user).newest_first.to_a %>
<% if customer_drafts.any? %>
<%= l(:label_qbo_drafts) %>:
<%= render partial: 'qbo_drafts/list', locals: { drafts: customer_drafts, show_customer: false } %>
<% end %>
<%# Refunds made from Redmine (SOP-OPS-014) %>
<% if RedmineQboBilling.refunder? %>
<% customer_refunds = QboRefund.where(customer_id: @customer.id).recent.limit(10).to_a %>
<% if customer_refunds.any? %>
<%= l(:label_refunds) %>:
<% customer_refunds.each do |refund| %>
| <%= link_to format_date(refund.txn_date), qbo_refund_path(refund) %> |
<%= refund.estimate_id.present? ? link_to("E#{refund.estimate_number}", RedmineQboBilling.writer? ? edit_qbo_estimate_path(refund.estimate_id) : estimate_path(refund.estimate_id)) : '' %> |
<%= refund.method_name %> |
<%= RedmineQboBilling::RefundWriter.money(refund.refund_amount) %> |
<%= refund.done? ? '' : l(:label_refund_incomplete) %> |
<% end %>
<% end %>
<% end %>
<%= call_hook :show_customer_view_right, {customer: @customer} %>