mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-17 18:20:36 -05:00
Estimates, invoices and payments written in Redmine, issues from estimates, and the QuickBooks product/service list and accounts are now part of this plugin (the RedmineQboBilling code, its controllers, views, strings and permissions), so there's one plugin and one version instead of two that had to match. - The customer page, estimate and invoice lists and the issue page render the Create Estimate / Create invoice / Receive payment and Edit links directly; the hooks that only existed to let billing add them are gone. Users without the billing permissions still get the links to QuickBooks. - Migrations 043-046 create the items and accounts tables and the estimate line links, skipping whatever an existing database already has (redmine_qbo_lineitems' tables are used as they are), and copy calendar's existing estimate line links in. - The billing settings are a section of this plugin's settings page. - The hooks other plugins use stay: qbo_billing_issue_values, qbo_billing_validate, qbo_billing_issue_defaults, qbo_billing_issues_created and view_qbo_estimate_contextual. - rake redmine_qbo:relate_estimate_issues Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BiwYMjhoQvL7XsKKfRz4pM
74 lines
3.2 KiB
ERB
74 lines
3.2 KiB
ERB
<div class="contextual">
|
|
<%# New issue for this customer; picks up the estimate / vehicle ticked on this page %>
|
|
<%= link_to sprite_icon('add', l(:label_new_issue)), new_issue_path(issue: { customer_id: @customer.id }),
|
|
id: 'dynamic-new-issue-link', class: 'icon icon-add', target: :_blank %>
|
|
<%# Plugins add their customer actions here (e.g. redmine_qbo_calendar's Add appointment) %>
|
|
<%= call_hook :view_customers_show_contextual, { customer: @customer } %>
|
|
<%# Estimates, invoices and payments are written here; users without those permissions get QuickBooks' screens %>
|
|
<% if RedmineQboBilling.writer? %>
|
|
<%= render partial: 'qbo_estimates/customer_link', locals: { customer: @customer } %>
|
|
<% else %>
|
|
<%= link_to sprite_icon('document', l(:label_create_estimate)), "https://qbo.intuit.com/app/estimate?nameId=#{@customer.id}",
|
|
class: 'icon icon-document', target: :_blank %>
|
|
<% end %>
|
|
<% if RedmineQboBilling.invoice_writer? %>
|
|
<%= render partial: 'qbo_invoices/customer_link', locals: { customer: @customer } %>
|
|
<% end %>
|
|
<% if RedmineQboBilling.payment_receiver? %>
|
|
<%= link_to sprite_icon('add', l(:button_receive_payment)), new_qbo_payment_path(customer_id: @customer.id), class: 'icon icon-add' %>
|
|
<% else %>
|
|
<%= link_to sprite_icon('add', l(:label_create_payment)), "https://qbo.intuit.com/app/recvpayment?nameId=#{@customer.id}",
|
|
class: 'icon icon-add', target: :_blank %>
|
|
<% end %>
|
|
<% if User.current.allowed_to?(:edit_customers, nil, global: true) %>
|
|
<%= link_to sprite_icon('edit', l(:button_edit)), edit_customer_path(@customer),
|
|
class: 'icon icon-edit', accesskey: accesskey(:edit) %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<h2><%=t(:field_customer)%> #<%= @customer.id %> - <%= link_to @customer.to_s, "https://#{RedmineQbo.sandbox_mode? ? "sandbox" : "app"}.qbo.intuit.com/app/customerdetail?nameId=#{@customer.id}", target: :_blank %> </h2>
|
|
<div class="issue">
|
|
|
|
<div class="splitcontent">
|
|
|
|
<div class="splitcontentleft">
|
|
|
|
<h4><%=t(:label_details)%>:</h4>
|
|
|
|
<!-- Customer Info -->
|
|
|
|
<%= render partial: 'customers/details', locals: {customer: @customer} %>
|
|
|
|
|
|
<!-- QBO Info -->
|
|
|
|
<div class="splitcontent">
|
|
<div class="splitcontentleft">
|
|
<h4><%=t(:estimates)%>:</h4>
|
|
<%= render partial: 'estimates/list', locals: {estimates: @customer.estimates} %>
|
|
</div>
|
|
|
|
<div class="splitcontentleft">
|
|
<h4><%=t(:label_invoices)%>:</h4>
|
|
<%= render partial: 'invoices/list', locals: {invoices: @customer.invoices} %>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="splitcontentleft">
|
|
<%= call_hook :show_customer_view_right, {customer: @customer} %>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<br/>
|
|
<h3><%=@open_issues.count%> <%=t(:label_open_issues)%> - <%=@hours.round(1)%> <%=t(:label_hours)%></h3>
|
|
<%= render partial: 'issues/list_simple', locals: {issues: @open_issues.open} %>
|
|
|
|
<h3><%=@closed_issues.count%> <%=t(:label_closed_issues)%> - <%= @closed_hours.round(1)%> <%=t(:label_hours)%></h3>
|
|
<%= render partial: 'issues/list_simple', locals: {issues: @closed_issues} %>
|
|
|
|
<%= render partial: 'customers/new_issue_link_script' %>
|