Added seperate tax section and added the ability add taxes to invoice this update requires a new table called taxes see the db.sql file for the structure More to come

This commit is contained in:
johnny@pittpc.com
2021-01-15 15:07:27 -05:00
parent 64b2ab3da9
commit a2848fad09
8 changed files with 250 additions and 8 deletions

View File

@@ -260,10 +260,24 @@ if(isset($_GET['invoice_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" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
<td>
<select class="form-control select2" name="tax">
<option <?php if($item_tax == '0.00'){ echo "selected"; } ?> value="0.00">None</option>
<option <?php if($item_tax == '0.07'){ echo "selected"; } ?> value="0.07">State Tax 7%</option>
<select class="form-control select2" name="client" required>
<option value="0.00">None</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>
</td>
<td>
<button class="btn btn-link text-success" type="submit" name="add_invoice_item">