Made Invoice / Quote and Recurring more mobile responsive

This commit is contained in:
johnnyq 2021-11-09 15:42:21 -05:00
parent 100286738e
commit c66d7fa7bd
5 changed files with 393 additions and 383 deletions

View File

@ -188,67 +188,69 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
<div class="row mb-4"> <div class="row mb-4">
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<table class="table"> <div class="table-responsive">
<thead> <table class="table">
<tr> <thead>
<th>Product</th> <tr>
<th>Description</th> <th>Product</th>
<th class="text-center">Qty</th> <th>Description</th>
<th class="text-right">Price</th> <th class="text-center">Qty</th>
<th class="text-right">Tax</th> <th class="text-right">Price</th>
<th class="text-right">Total</th> <th class="text-right">Tax</th>
</tr> <th class="text-right">Total</th>
</thead> </tr>
<tbody> </thead>
<?php <tbody>
<?php
$total_tax = 0; $total_tax = 0;
$sub_total = 0; $sub_total = 0;
while($row = mysqli_fetch_array($sql_invoice_items)){ while($row = mysqli_fetch_array($sql_invoice_items)){
$item_id = $row['item_id']; $item_id = $row['item_id'];
$item_name = $row['item_name']; $item_name = $row['item_name'];
$item_description = $row['item_description']; $item_description = $row['item_description'];
$item_quantity = $row['item_quantity']; $item_quantity = $row['item_quantity'];
$item_price = $row['item_price']; $item_price = $row['item_price'];
$item_subtotal = $row['item_price']; $item_subtotal = $row['item_price'];
$item_tax = $row['item_tax']; $item_tax = $row['item_tax'];
$item_total = $row['item_total']; $item_total = $row['item_total'];
$total_tax = $item_tax + $total_tax; $total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total; $sub_total = $item_price * $item_quantity + $sub_total;
?> ?>
<tr> <tr>
<td><?php echo $item_name; ?></td> <td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td> <td><?php echo $item_description; ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td> <td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td>
</tr> </tr>
<?php <?php
} }
?> ?>
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-7"> <div class="col-sm-7">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<?php echo $invoice_note; ?> <?php echo $invoice_note; ?>
</div> </div>
</div> </div>
</div> </div>
<div class="col-3 offset-2"> <div class="col-sm-3 offset-sm-2">
<table class="table table-borderless"> <table class="table table-borderless">
<tbody> <tbody>
<tr class="border-bottom"> <tr class="border-bottom">

View File

@ -149,57 +149,59 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
<div class="row mb-4"> <div class="row mb-4">
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<table class="table"> <div class="table-responsive">
<thead> <table class="table">
<tr> <thead>
<th>Product</th> <tr>
<th>Description</th> <th>Product</th>
<th class="text-center">Qty</th> <th>Description</th>
<th class="text-right">Price</th> <th class="text-center">Qty</th>
<th class="text-right">Tax</th> <th class="text-right">Price</th>
<th class="text-right">Total</th> <th class="text-right">Tax</th>
</tr> <th class="text-right">Total</th>
</thead> </tr>
<tbody> </thead>
<?php <tbody>
<?php
while($row = mysqli_fetch_array($sql_items)){ while($row = mysqli_fetch_array($sql_items)){
$item_id = $row['item_id']; $item_id = $row['item_id'];
$item_name = $row['item_name']; $item_name = $row['item_name'];
$item_description = $row['item_description']; $item_description = $row['item_description'];
$item_quantity = $row['item_quantity']; $item_quantity = $row['item_quantity'];
$item_price = $row['item_price']; $item_price = $row['item_price'];
$item_subtotal = $row['item_price']; $item_subtotal = $row['item_price'];
$item_tax = $row['item_tax']; $item_tax = $row['item_tax'];
$item_total = $row['item_total']; $item_total = $row['item_total'];
$total_tax = $item_tax + $total_tax; $total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total; $sub_total = $item_price * $item_quantity + $sub_total;
?> ?>
<tr> <tr>
<td><?php echo $item_name; ?></td> <td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td> <td><?php echo $item_description; ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td> <td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td>
</tr> </tr>
<?php <?php
} }
?> ?>
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-7"> <div class="col-sm-7">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<?php echo $quote_note; ?> <?php echo $quote_note; ?>
@ -207,7 +209,7 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
</div> </div>
</div> </div>
<div class="col-3 offset-2"> <div class="col-sm-3 offset-sm-2">
<table class="table table-borderless"> <table class="table table-borderless">
<tbody> <tbody>
<tr class="border-bottom"> <tr class="border-bottom">

View File

@ -227,102 +227,104 @@ if(isset($_GET['invoice_id'])){
<div class="row mb-4"> <div class="row mb-4">
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<table class="table"> <div class="table-responsive">
<thead> <table class="table">
<tr> <thead>
<th class="d-print-none"></th> <tr>
<th>Item</th> <th class="d-print-none"></th>
<th>Description</th> <th>Item</th>
<th class="text-center">Qty</th> <th>Description</th>
<th class="text-right">Price</th> <th class="text-center">Qty</th>
<th class="text-right">Tax</th> <th class="text-right">Price</th>
<th class="text-right">Total</th> <th class="text-right">Tax</th>
</tr> <th class="text-right">Total</th>
</thead> </tr>
<tbody> </thead>
<?php <tbody>
<?php
$total_tax = 0; $total_tax = 0;
$sub_total = 0; $sub_total = 0;
while($row = mysqli_fetch_array($sql_invoice_items)){ while($row = mysqli_fetch_array($sql_invoice_items)){
$item_id = $row['item_id']; $item_id = $row['item_id'];
$item_name = $row['item_name']; $item_name = $row['item_name'];
$item_description = $row['item_description']; $item_description = $row['item_description'];
$item_quantity = $row['item_quantity']; $item_quantity = $row['item_quantity'];
$item_price = $row['item_price']; $item_price = $row['item_price'];
$item_subtotal = $row['item_price']; $item_subtotal = $row['item_price'];
$item_tax = $row['item_tax']; $item_tax = $row['item_tax'];
$item_total = $row['item_total']; $item_total = $row['item_total'];
$item_created_at = $row['item_created_at']; $item_created_at = $row['item_created_at'];
$tax_id = $row['item_tax_id']; $tax_id = $row['item_tax_id'];
$total_tax = $item_tax + $total_tax; $total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total; $sub_total = $item_price * $item_quantity + $sub_total;
?> ?>
<tr> <tr>
<td class="text-center d-print-none"> <td class="text-center d-print-none">
<a class="text-secondary" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>"><i class="fa fa-fw fa-edit"></i></a> <a class="text-secondary" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>"><i class="fa fa-fw fa-edit"></i></a>
<a class="text-danger" href="post.php?delete_invoice_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-trash-alt"></i></a> <a class="text-danger" href="post.php?delete_invoice_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-trash-alt"></i></a>
</td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td>
</tr>
<?php
include("edit_item_modal.php");
}
?>
<tr class="d-print-none">
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
<td></td>
<td><input type="text" class="form-control" name="name" placeholder="Item" required></td>
<td><textarea class="form-control" rows="2" name="description" placeholder="Description"></textarea></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" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
<td>
<select class="form-control select2" name="tax_id" required>
<option value="0">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_id; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
<?php
}
?>
</select>
</td> </td>
<td> <td><?php echo $item_name; ?></td>
<button class="btn btn-link text-success" type="submit" name="add_invoice_item"> <td><?php echo $item_description; ?></td>
<i class="fa fa-fw fa-check"></i> <td class="text-center"><?php echo $item_quantity; ?></td>
</button> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td>
</td> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td>
</form> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td>
</tr> </tr>
</tbody>
</table> <?php
include("edit_item_modal.php");
}
?>
<tr class="d-print-none">
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
<td></td>
<td><input type="text" class="form-control" name="name" placeholder="Item" required></td>
<td><textarea class="form-control" rows="2" name="description" placeholder="Description"></textarea></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" class="form-control" style="text-align: right;" name="price" placeholder="Price"></td>
<td>
<select class="form-control select2" name="tax_id" required>
<option value="0">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_id; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
<?php
}
?>
</select>
</td>
<td>
<button class="btn btn-link text-success" type="submit" name="add_invoice_item">
<i class="fa fa-fw fa-check"></i>
</button>
</td>
</form>
</tr>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-7"> <div class="col-sm-7">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
Notes Notes
@ -337,7 +339,7 @@ if(isset($_GET['invoice_id'])){
</div> </div>
</div> </div>
</div> </div>
<div class="col-3 offset-2"> <div class="col-sm-3 offset-sm-2">
<table class="table table-borderless"> <table class="table table-borderless">
<tbody> <tbody>
<tr class="border-bottom"> <tr class="border-bottom">
@ -431,39 +433,41 @@ if(isset($_GET['invoice_id'])){
</div> </div>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table"> <div class="table-responsive">
<thead> <table class="table">
<tr> <thead>
<th>Date</th> <tr>
<th class="text-right">Amount</th> <th>Date</th>
<th>Reference</th> <th class="text-right">Amount</th>
<th>Account</th> <th>Reference</th>
<th class="text-center">Action</th> <th>Account</th>
</tr> <th class="text-center">Action</th>
</thead> </tr>
<tbody> </thead>
<?php <tbody>
<?php
while($row = mysqli_fetch_array($sql_payments)){ while($row = mysqli_fetch_array($sql_payments)){
$payment_id = $row['payment_id']; $payment_id = $row['payment_id'];
$payment_date = $row['payment_date']; $payment_date = $row['payment_date'];
$payment_amount = $row['payment_amount']; $payment_amount = $row['payment_amount'];
$payment_reference = $row['payment_reference']; $payment_reference = $row['payment_reference'];
$account_name = $row['account_name']; $account_name = $row['account_name'];
?> ?>
<tr> <tr>
<td><?php echo $payment_date; ?></td> <td><?php echo $payment_date; ?></td>
<td class=" text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($payment_amount,2); ?></td> <td class=" text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($payment_amount,2); ?></td>
<td><?php echo $payment_reference; ?></td> <td><?php echo $payment_reference; ?></td>
<td><?php echo $account_name; ?></td> <td><?php echo $account_name; ?></td>
<td class="text-center"><a class="btn btn-danger btn-sm" href="post.php?delete_payment=<?php echo $payment_id; ?>"><i class="fa fa-trash"></i></a></td> <td class="text-center"><a class="btn btn-danger btn-sm" href="post.php?delete_payment=<?php echo $payment_id; ?>"><i class="fa fa-trash"></i></a></td>
</tr> </tr>
<?php <?php
} }
?> ?>
</tbody> </tbody>
</table> </table>
</div>
</div> </div>
</div> </div>
</div> </div>

175
quote.php
View File

@ -192,97 +192,98 @@ if(isset($_GET['quote_id'])){
<div class="row mb-4"> <div class="row mb-4">
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th class="d-print-none"></th>
<th>Item</th>
<th>Description</th>
<th class="text-center">Qty</th>
<th class="text-right">Price</th>
<th class="text-right">Tax</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<?php
<table class="table"> $total_tax = 0;
<thead> $sub_total = 0;
<tr>
<th class="d-print-none"></th>
<th>Item</th>
<th>Description</th>
<th class="text-center">Qty</th>
<th class="text-right">Price</th>
<th class="text-right">Tax</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<?php
$total_tax = 0; while($row = mysqli_fetch_array($sql_items)){
$sub_total = 0; $item_id = $row['item_id'];
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$item_created_at = $row['item_created_at'];
$tax_id = $row['item_tax_id'];
$total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total;
while($row = mysqli_fetch_array($sql_items)){ ?>
$item_id = $row['item_id'];
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$item_created_at = $row['item_created_at'];
$tax_id = $row['item_tax_id'];
$total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total;
?> <tr>
<td class="text-center d-print-none">
<tr> <a class="text-secondary" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>"><i class="fa fa-fw fa-edit"></i></a>
<td class="text-center d-print-none"> <a class="text-danger" href="post.php?delete_quote_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-trash-alt"></i></a>
<a class="text-secondary" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>"><i class="fa fa-fw fa-edit"></i></a>
<a class="text-danger" href="post.php?delete_quote_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-trash-alt"></i></a>
</td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td>
<td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td>
</tr>
<?php
include("edit_item_modal.php");
}
?>
<tr class="d-print-none">
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="quote_id" value="<?php echo $quote_id; ?>">
<td></td>
<td><input type="text" class="form-control" name="name" placeholder="Item" required></td>
<td><textarea class="form-control" rows="2" name="description" placeholder="Description"></textarea></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>
<select class="form-control select2" name="tax_id" required>
<option value="0">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_id; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
<?php
}
?>
</select>
</td> </td>
<td> <td><?php echo $item_name; ?></td>
<button class="btn btn-link text-success" type="submit" name="add_quote_item"> <td><?php echo $item_description; ?></td>
<i class="fa fa-fw fa-check"></i> <td class="text-center"><?php echo $item_quantity; ?></td>
</button> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_price,2); ?></td>
</td> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_tax,2); ?></td>
</form> <td class="text-right"><?php echo $client_currency_symbol; ?><?php echo number_format($item_total,2); ?></td>
</tr> </tr>
</tbody>
</table> <?php
include("edit_item_modal.php");
}
?>
<tr class="d-print-none">
<form action="post.php" method="post" autocomplete="off">
<input type="hidden" name="quote_id" value="<?php echo $quote_id; ?>">
<td></td>
<td><input type="text" class="form-control" name="name" placeholder="Item" required></td>
<td><textarea class="form-control" rows="2" name="description" placeholder="Description"></textarea></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>
<select class="form-control select2" name="tax_id" required>
<option value="0">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_id; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
<?php
}
?>
</select>
</td>
<td>
<button class="btn btn-link text-success" type="submit" name="add_quote_item">
<i class="fa fa-fw fa-check"></i>
</button>
</td>
</form>
</tr>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -304,7 +305,7 @@ if(isset($_GET['quote_id'])){
</div> </div>
</div> </div>
<div class="col-3 offset-2"> <div class="col-sm-3 offset-sm-2">
<table class="table table-borderless"> <table class="table table-borderless">
<tbody> <tbody>
<tr class="border-bottom"> <tr class="border-bottom">

View File

@ -165,103 +165,104 @@ if(isset($_GET['recurring_id'])){
<div class="row mb-4"> <div class="row mb-4">
<div class="col-md-12"> <div class="col-md-12">
<div class="card"> <div class="card">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th class="d-print-none"></th>
<th>Item</th>
<th>Description</th>
<th class="text-center">Qty</th>
<th class="text-right">Price</th>
<th class="text-right">Tax</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<?php
<table class="table"> $total_tax = 0;
<thead> $sub_total = 0;
<tr>
<th class="d-print-none"></th>
<th>Item</th>
<th>Description</th>
<th class="text-center">Qty</th>
<th class="text-right">Price</th>
<th class="text-right">Tax</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<?php
$total_tax = 0; while($row = mysqli_fetch_array($sql_items)){
$sub_total = 0; $item_id = $row['item_id'];
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$item_created_at = $row['item_created_at'];
$tax_id = $row['item_tax_id'];
$total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total;
while($row = mysqli_fetch_array($sql_items)){ ?>
$item_id = $row['item_id'];
$item_name = $row['item_name'];
$item_description = $row['item_description'];
$item_quantity = $row['item_quantity'];
$item_price = $row['item_price'];
$item_subtotal = $row['item_price'];
$item_tax = $row['item_tax'];
$item_total = $row['item_total'];
$item_created_at = $row['item_created_at'];
$tax_id = $row['item_tax_id'];
$total_tax = $item_tax + $total_tax;
$sub_total = $item_price * $item_quantity + $sub_total;
?> <tr>
<td class="text-center d-print-none">
<tr> <a class="text-secondary" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>"><i class="fa fa-fw fa-edit"></i></a>
<td class="text-center d-print-none"> <a class="text-danger" href="post.php?delete_recurring_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-trash-alt"></i></a>
<a class="text-secondary" href="#" data-toggle="modal" data-target="#editItemModal<?php echo $item_id; ?>"><i class="fa fa-fw fa-edit"></i></a>
<a class="text-danger" href="post.php?delete_recurring_item=<?php echo $item_id; ?>"><i class="fa fa-fw fa-trash-alt"></i></a>
</td>
<td><?php echo $item_name; ?></td>
<td><?php echo $item_description; ?></td>
<td class="text-center"><?php echo $item_quantity; ?></td>
<td class="text-right">$<?php echo number_format($item_price,2); ?></td>
<td class="text-right">$<?php echo number_format($item_tax,2); ?></td>
<td class="text-right">$<?php echo number_format($item_total,2); ?></td>
</tr>
<?php
include("edit_item_modal.php");
}
?>
<tr class="d-print-none">
<form action="post.php" method="post">
<input type="hidden" name="recurring_id" value="<?php echo $recurring_id; ?>">
<td></td>
<td><input type="text" class="form-control" name="name" placeholder="Item" required></td>
<td><textarea class="form-control" rows="1" name="description" placeholder="Description"></textarea></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>
<select class="form-control select2" name="tax_id" required>
<option value="0">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_id; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
<?php
}
?>
</select>
</td> </td>
<td> <td><?php echo $item_name; ?></td>
<button class="btn btn-link text-success" type="submit" name="add_recurring_item"> <td><?php echo $item_description; ?></td>
<i class="fa fa-fw fa-check"></i> <td class="text-center"><?php echo $item_quantity; ?></td>
</button> <td class="text-right">$<?php echo number_format($item_price,2); ?></td>
</td> <td class="text-right">$<?php echo number_format($item_tax,2); ?></td>
</form> <td class="text-right">$<?php echo number_format($item_total,2); ?></td>
</tr> </tr>
</tbody>
</table> <?php
include("edit_item_modal.php");
}
?>
<tr class="d-print-none">
<form action="post.php" method="post">
<input type="hidden" name="recurring_id" value="<?php echo $recurring_id; ?>">
<td></td>
<td><input type="text" class="form-control" name="name" placeholder="Item" required></td>
<td><textarea class="form-control" rows="1" name="description" placeholder="Description"></textarea></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>
<select class="form-control select2" name="tax_id" required>
<option value="0">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_id; ?>"><?php echo "$tax_name $tax_percent%"; ?></option>
<?php
}
?>
</select>
</td>
<td>
<button class="btn btn-link text-success" type="submit" name="add_recurring_item">
<i class="fa fa-fw fa-check"></i>
</button>
</td>
</form>
</tr>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="row mb-4"> <div class="row mb-4">
<div class="col-7"> <div class="col-sm-7">
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
Notes Notes
@ -276,7 +277,7 @@ if(isset($_GET['recurring_id'])){
</div> </div>
</div> </div>
</div> </div>
<div class="col-3 offset-2"> <div class="col-sm-3 offset-sm-2">
<table class="table table-borderless"> <table class="table table-borderless">
<tbody> <tbody>
<tr class="border-bottom"> <tr class="border-bottom">