mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 19:04:52 +00:00
Change up the tax calculation formula to get amount using percent
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
2
post.php
2
post.php
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user