mirror of
https://github.com/itflow-org/itflow
synced 2026-03-11 00:04:50 +00:00
add item sort dropdowns
This commit is contained in:
23
invoice.php
23
invoice.php
@@ -247,7 +247,7 @@ if (isset($_GET['invoice_id'])) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_invoice_id = $invoice_id ORDER BY item_id ASC"); ?>
|
<?php $sql_invoice_items = mysqli_query($mysqli, "SELECT * FROM invoice_items WHERE item_invoice_id = $invoice_id ORDER BY item_order_id ASC"); ?>
|
||||||
|
|
||||||
<div class="row mb-4">
|
<div class="row mb-4">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
@@ -256,6 +256,7 @@ if (isset($_GET['invoice_id'])) {
|
|||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
<th class="text-left">Sort</th>
|
||||||
<th class="d-print-none"></th>
|
<th class="d-print-none"></th>
|
||||||
<th>Item</th>
|
<th>Item</th>
|
||||||
<th>Description</th>
|
<th>Description</th>
|
||||||
@@ -283,10 +284,28 @@ if (isset($_GET['invoice_id'])) {
|
|||||||
$tax_id = intval($row['item_tax_id']);
|
$tax_id = intval($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;
|
||||||
|
$item_order_id = intval($row['item_order_id']);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div class="d-print-none">
|
||||||
|
<?php if ($invoice_status !== "Paid" && $invoice_status !== "Cancelled") { ?>
|
||||||
|
<form action="post.php" method="post">
|
||||||
|
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||||
|
<input type="hidden" name="item_id" value="<?php echo $item_id; ?>">
|
||||||
|
<input type="hidden" name="item_order_id" value="<?php echo $item_order_id; ?>">
|
||||||
|
<button class="btn btn-sm btn-light" type="submit" name="update_invoice_item_order" value="up"><i class="fa fa-fw fa-arrow-up"></i></button>
|
||||||
|
<button class="btn btn-sm btn-light" type="submit" name="update_invoice_item_order" value="down"><i class="fa fa-fw fa-arrow-down"></i></button>
|
||||||
|
</form>
|
||||||
|
<?php }
|
||||||
|
echo $item_order_id;
|
||||||
|
?>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
|
||||||
<td class="d-print-none">
|
<td class="d-print-none">
|
||||||
<?php if ($invoice_status !== "Paid" && $invoice_status !== "Cancelled") { ?>
|
<?php if ($invoice_status !== "Paid" && $invoice_status !== "Cancelled") { ?>
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
@@ -323,6 +342,8 @@ if (isset($_GET['invoice_id'])) {
|
|||||||
<tr class="d-print-none" <?php if ($invoice_status == "Paid" || $invoice_status == "Cancelled") { echo "hidden"; } ?>>
|
<tr class="d-print-none" <?php if ($invoice_status == "Paid" || $invoice_status == "Cancelled") { echo "hidden"; } ?>>
|
||||||
<form action="post.php" method="post" autocomplete="off">
|
<form action="post.php" method="post" autocomplete="off">
|
||||||
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
<input type="hidden" name="invoice_id" value="<?php echo $invoice_id; ?>">
|
||||||
|
<input type="hidden" name="item_order_id" value="<?php echo mysqli_num_rows($sql_invoice_items) + 1; ?>">
|
||||||
|
<td></td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" class="form-control" id="name" name="name" placeholder="Item" required>
|
<input type="text" class="form-control" id="name" name="name" placeholder="Item" required>
|
||||||
|
|||||||
Reference in New Issue
Block a user