From 530a76a9a296910571d8d1c9c876ffa29dd33356 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 27 Aug 2025 11:53:58 -0400 Subject: [PATCH] Fix undefined vars in export invoice / quote pdf fix regression company logo path in export invoice / quote --- guest/guest_post.php | 6 ++++++ user/post/invoice.php | 5 ++++- user/post/quote.php | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/guest/guest_post.php b/guest/guest_post.php index fffe3088..07870e8e 100644 --- a/guest/guest_post.php +++ b/guest/guest_post.php @@ -365,6 +365,9 @@ if (isset($_GET['export_quote_pdf'])) { '; // Load items + $sub_total = 0; + $total_tax = 0; + $sql_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_quote_id = $quote_id ORDER BY item_order ASC"); while ($item = mysqli_fetch_array($sql_items)) { $name = $item['item_name']; @@ -585,6 +588,9 @@ if (isset($_GET['export_invoice_pdf'])) { '; // Load items + $sub_total = 0; + $total_tax = 0; + $sql_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_invoice_id = $invoice_id ORDER BY item_order ASC"); while ($item = mysqli_fetch_array($sql_items)) { $name = $item['item_name']; diff --git a/user/post/invoice.php b/user/post/invoice.php index 94df534b..ef28ca90 100644 --- a/user/post/invoice.php +++ b/user/post/invoice.php @@ -2066,7 +2066,7 @@ if (isset($_GET['export_invoice_pdf'])) { '; if (!empty($company_logo) && file_exists("../uploads/settings/$company_logo")) { - $html .= ''; + $html .= ''; } $html .= ' @@ -2117,6 +2117,9 @@ if (isset($_GET['export_invoice_pdf'])) { '; // Load items + $sub_total = 0; + $total_tax = 0; + $sql_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_invoice_id = $invoice_id ORDER BY item_order ASC"); while ($item = mysqli_fetch_array($sql_items)) { $name = $item['item_name']; diff --git a/user/post/quote.php b/user/post/quote.php index fb566ac4..608376ec 100644 --- a/user/post/quote.php +++ b/user/post/quote.php @@ -680,7 +680,7 @@ if (isset($_GET['export_quote_pdf'])) { '; if (!empty($company_logo) && file_exists("../uploads/settings/$company_logo")) { - $html .= ''; + $html .= ''; } $html .= ' @@ -734,6 +734,9 @@ if (isset($_GET['export_quote_pdf'])) { '; // Load items + $sub_total = 0; + $total_tax = 0; + $sql_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_quote_id = $quote_id ORDER BY item_order ASC"); while ($item = mysqli_fetch_array($sql_items)) { $name = $item['item_name'];