From 76b9aef9abdb1b99575e24205f26c92bafeeec47 Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Fri, 15 Jan 2021 15:41:47 -0500 Subject: [PATCH] Added the new tax feature to quotes and recurring invoices as well as edit item --- edit_invoice_item_modal.php | 19 ++++++++++++++++--- edit_quote_item_modal.php | 18 +++++++++++++++--- edit_recurring_item_modal.php | 18 +++++++++++++++--- post.php | 10 +++++----- quote.php | 16 ++++++++++++++-- recurring_invoice.php | 18 +++++++++++++++--- 6 files changed, 80 insertions(+), 19 deletions(-) diff --git a/edit_invoice_item_modal.php b/edit_invoice_item_modal.php index 27e696b0..81d5eab3 100644 --- a/edit_invoice_item_modal.php +++ b/edit_invoice_item_modal.php @@ -66,10 +66,23 @@
- + + + + + + diff --git a/edit_quote_item_modal.php b/edit_quote_item_modal.php index 25a7316f..25c9f017 100644 --- a/edit_quote_item_modal.php +++ b/edit_quote_item_modal.php @@ -67,9 +67,21 @@
- + + + + + diff --git a/edit_recurring_item_modal.php b/edit_recurring_item_modal.php index f738eb27..b99a41d3 100644 --- a/edit_recurring_item_modal.php +++ b/edit_recurring_item_modal.php @@ -67,9 +67,21 @@
- + + + + + diff --git a/post.php b/post.php index 651391ff..ce841c1f 100644 --- a/post.php +++ b/post.php @@ -1629,7 +1629,7 @@ if(isset($_POST['add_quote_item'])){ $tax = floatval($_POST['tax']); $subtotal = $price * $qty; - $tax = $subtotal * $tax; + $tax = $subtotal * $tax / 100; $total = $subtotal + $tax; mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', item_created_at = NOW(), quote_id = $quote_id, company_id = $session_company_id"); @@ -1673,7 +1673,7 @@ if(isset($_POST['edit_quote_item'])){ $tax = floatval($_POST['tax']); $subtotal = $price * $qty; - $tax = $subtotal * $tax; + $tax = $subtotal * $tax / 100; $total = $subtotal + $tax; mysqli_query($mysqli,"UPDATE invoice_items SET item_name = '$name', item_description = '$description', item_quantity = '$qty', item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total' WHERE item_id = $item_id"); @@ -2170,7 +2170,7 @@ if(isset($_POST['add_recurring_item'])){ $tax = floatval($_POST['tax']); $subtotal = $price * $qty; - $tax = $subtotal * $tax; + $tax = $subtotal * $tax / 100; $total = $subtotal + $tax; mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total', item_created_at = NOW(), recurring_id = $recurring_id, company_id = $session_company_id"); @@ -2214,7 +2214,7 @@ if(isset($_POST['edit_recurring_item'])){ $tax = floatval($_POST['tax']); $subtotal = $price * $qty; - $tax = $subtotal * $tax; + $tax = $subtotal * $tax / 100; $total = $subtotal + $tax; mysqli_query($mysqli,"UPDATE invoice_items SET item_name = '$name', item_description = '$description', item_quantity = '$qty', item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total' WHERE item_id = $item_id"); @@ -2385,7 +2385,7 @@ if(isset($_POST['edit_invoice_item'])){ $tax = floatval($_POST['tax']); $subtotal = $price * $qty; - $tax = $subtotal * $tax; + $tax = $subtotal * $tax / 100; $total = $subtotal + $tax; mysqli_query($mysqli,"UPDATE invoice_items SET item_name = '$name', item_description = '$description', item_quantity = '$qty', item_price = '$price', item_subtotal = '$subtotal', item_tax = '$tax', item_total = '$total' WHERE item_id = $item_id"); diff --git a/quote.php b/quote.php index bdf30f08..9cca81f3 100644 --- a/quote.php +++ b/quote.php @@ -227,9 +227,21 @@ if(isset($_GET['quote_id'])){ - - + + + + diff --git a/recurring_invoice.php b/recurring_invoice.php index a9ae09a7..37cbe272 100644 --- a/recurring_invoice.php +++ b/recurring_invoice.php @@ -205,9 +205,21 @@ if(isset($_GET['recurring_id'])){ - + + + + +