diff --git a/projects/plugins/crm/changelog/fix-crm-3523-email-invoices-not-sending b/projects/plugins/crm/changelog/fix-crm-3523-email-invoices-not-sending new file mode 100644 index 0000000000000..870cd956beaed --- /dev/null +++ b/projects/plugins/crm/changelog/fix-crm-3523-email-invoices-not-sending @@ -0,0 +1,4 @@ +Significance: patch +Type: fixed + +Invoices: Fix bug introduced in 6.5.0 that prevented email invoices from being sent. diff --git a/projects/plugins/crm/js/ZeroBSCRM.admin.invoicebuilder.js b/projects/plugins/crm/js/ZeroBSCRM.admin.invoicebuilder.js index 3591b68266f0e..f2af1cacf2d70 100644 --- a/projects/plugins/crm/js/ZeroBSCRM.admin.invoicebuilder.js +++ b/projects/plugins/crm/js/ZeroBSCRM.admin.invoicebuilder.js @@ -22,6 +22,7 @@ window.zbs_invoice = false; // stores data of this inv (post init) window.zbs_tax = false; // ? window.zbs_tax_table = false; // stores tax table window.zbsInvBlocker = false; // this is a blocker... ctrl F it +window.invoice_id = 0; // ======================================================================== // ======= /Globals @@ -41,10 +42,10 @@ jQuery( function () { // but DAL3.0 should return the next available ID and reserve it? // WH - how do we handle the case where YOU and I make a new invoice (same time) // we fill it in, and the ID is the same - won't we have a race condition here? - const invoice_id = jQuery( '.zbs_invoice_html_canvas' ).data( 'invid' ); + window.invoice_id = jQuery( '.zbs_invoice_html_canvas' ).data( 'invid' ); //draw the invoice HTML UI (v2.98) start by drawing the data from the DB (drawing / getting) - zbscrm_JS_retrieve_invoice_data( invoice_id ); + zbscrm_JS_retrieve_invoice_data( window.invoice_id ); // hack for weird tax bug if ( jQuery( '#invoice_tax_total' ).val() > 0 ) {