mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-11-17 18:20:36 -05:00
Warn about the customer's open issues on a new invoice
A new invoice lists the customer's open issues (any project, those the user can see) in a warning under the title, so work orders aren't left open once the work is billed. It's there when the page opens with a customer (from the customer page or an estimate) and follows the customer when it's changed: customer_info returns open_issues_html for invoices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
88160a985d
commit
4ba96e2dfd
5 files changed
+31
-2
No files matched your search
@@ -116,13 +116,19 @@ class QboEstimatesController < ApplicationController
|
||||
customer = Customer.find_by(id: params[:customer_id])
|
||||
return render(json: {}, status: :not_found) unless customer
|
||||
|
||||
render json: {
|
||||
info = {
|
||||
id: customer.id,
|
||||
name: customer.name,
|
||||
email: RedmineQboBilling::EstimateWriter.customer_email(customer),
|
||||
billing_address: RedmineQboBilling::EstimateWriter.customer_address(customer),
|
||||
field_options: RedmineQboBilling.field_options(customer)
|
||||
}
|
||||
# A new invoice warns about the customer's open issues
|
||||
if params[:document] == 'invoice'
|
||||
info[:open_issues_html] = render_to_string(partial: 'qbo_invoices/open_issues', formats: [:html],
|
||||
locals: { customer: customer })
|
||||
end
|
||||
render json: info
|
||||
end
|
||||
|
||||
# Product/service search for the line table (the QuickBooks item list)
|
||||
|
||||
Reference in new issue
Block a user