From 48177e4250317da44c0301d0f0c1a88e4c6a2dac Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 21 Nov 2023 16:17:17 -0500 Subject: [PATCH] Updated Quote and Recurring to Automatically select the Tax based off the product tax --- invoice.php | 2 +- quote.php | 3 ++- recurring_invoice.php | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/invoice.php b/invoice.php index d0dd115c..e6f0282b 100644 --- a/invoice.php +++ b/invoice.php @@ -581,7 +581,7 @@ require_once "footer.php"; $("#desc").val(ui.item.description); // Product description field $("#qty").val(1); // Product quantity field automatically make it a 1 $("#price").val(ui.item.price); // Product price field - $("#tax").val(ui.item.tax); // Product price field + $("#tax").val(ui.item.tax); // Product tax field return false; } }); diff --git a/quote.php b/quote.php index 81c51cf8..933a722d 100644 --- a/quote.php +++ b/quote.php @@ -90,7 +90,7 @@ if (isset($_GET['quote_id'])) { } //Product autocomplete - $products_sql = mysqli_query($mysqli, "SELECT product_name AS label, product_description AS description, product_price AS price FROM products WHERE product_archived_at IS NULL"); + $products_sql = mysqli_query($mysqli, "SELECT product_name AS label, product_description AS description, product_price AS price, product_tax_id AS tax FROM products WHERE product_archived_at IS NULL"); if (mysqli_num_rows($products_sql) > 0) { while ($row = mysqli_fetch_array($products_sql)) { @@ -537,6 +537,7 @@ require_once "footer.php"; $("#desc").val(ui.item.description); // Product description field $("#qty").val(1); // Product quantity field automatically make it a 1 $("#price").val(ui.item.price); // Product price field + $("#tax").val(ui.item.tax); // Tax field return false; } }); diff --git a/recurring_invoice.php b/recurring_invoice.php index 57a63b24..9dd3ba8f 100644 --- a/recurring_invoice.php +++ b/recurring_invoice.php @@ -72,7 +72,7 @@ if (isset($_GET['recurring_id'])) { $sql_history = mysqli_query($mysqli, "SELECT * FROM history WHERE history_recurring_id = $recurring_id ORDER BY history_id DESC"); //Product autocomplete - $products_sql = mysqli_query($mysqli, "SELECT product_name AS label, product_description AS description, product_price AS price FROM products WHERE product_archived_at IS NULL"); + $products_sql = mysqli_query($mysqli, "SELECT product_name AS label, product_description AS description, product_price AS price, product_tax_id AS tax FROM products WHERE product_archived_at IS NULL"); if (mysqli_num_rows($products_sql) > 0) { while ($row = mysqli_fetch_array($products_sql)) { @@ -306,7 +306,7 @@ if (isset($_GET['recurring_id'])) { -