Skip to content

Commit

Permalink
CRM: Fix email invoices not sending (#41172)
Browse files Browse the repository at this point in the history
* Make the var invoice_id global

* Add changelog

* Initialize global var invoice_id

* Update invoice_id param to use global var
  • Loading branch information
gogdzl authored Jan 20, 2025
1 parent 1e920f4 commit 873bdac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Invoices: Fix bug introduced in 6.5.0 that prevented email invoices from being sent.
5 changes: 3 additions & 2 deletions projects/plugins/crm/js/ZeroBSCRM.admin.invoicebuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 ) {
Expand Down

0 comments on commit 873bdac

Please sign in to comment.