mirror of
https://github.com/itflow-org/itflow
synced 2026-03-14 01:34:51 +00:00
Added the new tax feature to quotes and recurring invoices as well as edit item
This commit is contained in:
@@ -66,10 +66,23 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="tax">
|
<select class="form-control select2" name="tax" required>
|
||||||
<option <?php if($item_tax == '0.00'){ echo "selected"; } ?> value="0.00">None</option>
|
<option value="0.00">None</option>
|
||||||
<option <?php if($item_tax == '0.07'){ echo "selected"; } ?> value="0.07">State Tax 7%</option>
|
<?php
|
||||||
|
|
||||||
|
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session_company_id ORDER BY tax_name ASC");
|
||||||
|
while($row = mysqli_fetch_array($taxes_sql)){
|
||||||
|
$tax_id = $row['tax_id'];
|
||||||
|
$tax_name = $row['tax_name'];
|
||||||
|
$tax_percent = $row['tax_percent'];
|
||||||
|
?>
|
||||||
|
<option value="<?php echo "$tax_percent"; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -67,9 +67,21 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="tax">
|
<select class="form-control select2" name="tax" required>
|
||||||
<option <?php if($item_tax == '0.00'){ echo "selected"; } ?> value="0.00">None</option>
|
<option value="0.00">None</option>
|
||||||
<option <?php if($item_tax == '0.07'){ echo "selected"; } ?> value="0.07">State Tax 7%</option>
|
<?php
|
||||||
|
|
||||||
|
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session_company_id ORDER BY tax_name ASC");
|
||||||
|
while($row = mysqli_fetch_array($taxes_sql)){
|
||||||
|
$tax_id = $row['tax_id'];
|
||||||
|
$tax_name = $row['tax_name'];
|
||||||
|
$tax_percent = $row['tax_percent'];
|
||||||
|
?>
|
||||||
|
<option value="<?php echo "$tax_percent"; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -67,9 +67,21 @@
|
|||||||
<div class="input-group-prepend">
|
<div class="input-group-prepend">
|
||||||
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
<span class="input-group-text"><i class="fa fa-fw fa-piggy-bank"></i></span>
|
||||||
</div>
|
</div>
|
||||||
<select class="form-control select2" name="tax">
|
<select class="form-control select2" name="tax" required>
|
||||||
<option <?php if($item_tax == '0.00'){ echo "selected"; } ?> value="0.00">None</option>
|
<option value="0.00">None</option>
|
||||||
<option <?php if($item_tax == '0.07'){ echo "selected"; } ?> value="0.07">State Tax 7%</option>
|
<?php
|
||||||
|
|
||||||
|
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session_company_id ORDER BY tax_name ASC");
|
||||||
|
while($row = mysqli_fetch_array($taxes_sql)){
|
||||||
|
$tax_id = $row['tax_id'];
|
||||||
|
$tax_name = $row['tax_name'];
|
||||||
|
$tax_percent = $row['tax_percent'];
|
||||||
|
?>
|
||||||
|
<option value="<?php echo "$tax_percent"; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
10
post.php
10
post.php
@@ -1629,7 +1629,7 @@ if(isset($_POST['add_quote_item'])){
|
|||||||
$tax = floatval($_POST['tax']);
|
$tax = floatval($_POST['tax']);
|
||||||
|
|
||||||
$subtotal = $price * $qty;
|
$subtotal = $price * $qty;
|
||||||
$tax = $subtotal * $tax;
|
$tax = $subtotal * $tax / 100;
|
||||||
$total = $subtotal + $tax;
|
$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");
|
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']);
|
$tax = floatval($_POST['tax']);
|
||||||
|
|
||||||
$subtotal = $price * $qty;
|
$subtotal = $price * $qty;
|
||||||
$tax = $subtotal * $tax;
|
$tax = $subtotal * $tax / 100;
|
||||||
$total = $subtotal + $tax;
|
$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");
|
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']);
|
$tax = floatval($_POST['tax']);
|
||||||
|
|
||||||
$subtotal = $price * $qty;
|
$subtotal = $price * $qty;
|
||||||
$tax = $subtotal * $tax;
|
$tax = $subtotal * $tax / 100;
|
||||||
$total = $subtotal + $tax;
|
$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");
|
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']);
|
$tax = floatval($_POST['tax']);
|
||||||
|
|
||||||
$subtotal = $price * $qty;
|
$subtotal = $price * $qty;
|
||||||
$tax = $subtotal * $tax;
|
$tax = $subtotal * $tax / 100;
|
||||||
$total = $subtotal + $tax;
|
$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");
|
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']);
|
$tax = floatval($_POST['tax']);
|
||||||
|
|
||||||
$subtotal = $price * $qty;
|
$subtotal = $price * $qty;
|
||||||
$tax = $subtotal * $tax;
|
$tax = $subtotal * $tax / 100;
|
||||||
$total = $subtotal + $tax;
|
$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");
|
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");
|
||||||
|
|||||||
16
quote.php
16
quote.php
@@ -227,9 +227,21 @@ if(isset($_GET['quote_id'])){
|
|||||||
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: center;" name="qty" placeholder="QTY"></td>
|
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: center;" name="qty" placeholder="QTY"></td>
|
||||||
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
|
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
|
||||||
<td>
|
<td>
|
||||||
<select class="form-control select2" name="tax">
|
<select class="form-control select2" name="tax" required>
|
||||||
<option value="0.00">None</option>
|
<option value="0.00">None</option>
|
||||||
<option value="0.07">State Tax 7%</option>
|
<?php
|
||||||
|
|
||||||
|
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session_company_id ORDER BY tax_name ASC");
|
||||||
|
while($row = mysqli_fetch_array($taxes_sql)){
|
||||||
|
$tax_id = $row['tax_id'];
|
||||||
|
$tax_name = $row['tax_name'];
|
||||||
|
$tax_percent = $row['tax_percent'];
|
||||||
|
?>
|
||||||
|
<option value="<?php echo "$tax_percent"; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
@@ -205,9 +205,21 @@ if(isset($_GET['recurring_id'])){
|
|||||||
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: center;" name="qty" placeholder="QTY"></td>
|
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: center;" name="qty" placeholder="QTY"></td>
|
||||||
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
|
<td><input type="number" step="0.01" min="0" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
|
||||||
<td>
|
<td>
|
||||||
<select class="form-control select2" name="tax">
|
<select class="form-control select2" name="tax" required>
|
||||||
<option <?php if($item_tax == '0.00'){ echo "selected"; } ?> value="0.00">None</option>
|
<option value="0.00">None</option>
|
||||||
<option <?php if($item_tax == '0.07'){ echo "selected"; } ?> value="0.07">State Tax 7%</option>
|
<?php
|
||||||
|
|
||||||
|
$taxes_sql = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session_company_id ORDER BY tax_name ASC");
|
||||||
|
while($row = mysqli_fetch_array($taxes_sql)){
|
||||||
|
$tax_id = $row['tax_id'];
|
||||||
|
$tax_name = $row['tax_name'];
|
||||||
|
$tax_percent = $row['tax_percent'];
|
||||||
|
?>
|
||||||
|
<option value="<?php echo "$tax_percent"; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|||||||
Reference in New Issue
Block a user