Change up the tax calculation formula to get amount using percent

This commit is contained in:
johnny@pittpc.com 2021-01-15 15:28:21 -05:00
parent a2848fad09
commit c58925f4ff
2 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ if(isset($_GET['invoice_id'])){
<td><input type="number" step="0.01" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
<td>
<select class="form-control select2" name="client" required>
<select class="form-control select2" name="tax" required>
<option value="0.00">None</option>
<?php

View File

@ -2340,7 +2340,7 @@ if(isset($_POST['add_invoice_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(), invoice_id = $invoice_id, company_id = $session_company_id");