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
@@ -446,7 +446,9 @@ $(function () {
|
||||
var id = $(this).val();
|
||||
if (!id) return;
|
||||
dirty = true;
|
||||
$.getJSON($form.data('customerInfoUrl'), { customer_id: id }).done(function (info) {
|
||||
$.getJSON($form.data('customerInfoUrl'), { customer_id: id, document: $form.data('document') }).done(function (info) {
|
||||
// A new invoice's open issues notice follows the customer
|
||||
if (info.open_issues_html !== undefined) $('#qbo-open-issues').replaceWith(info.open_issues_html);
|
||||
// Replace the email only if it was the previous customer's (or empty)
|
||||
if (!$email.val().trim() || $email.val() === loadedEmail) $email.val(info.email || '');
|
||||
loadedEmail = info.email || '';
|
||||
|
||||
Reference in new issue
Block a user