Merge pull request #11 from twetech:Invoice-add-ticket-modal-update

Improve invoice add ticket modal UI
This commit is contained in:
Andrew Malsbury
2024-01-10 15:31:48 -06:00
committed by GitHub
2 changed files with 70 additions and 34 deletions
+15 -4
View File
@@ -92,10 +92,21 @@ if (isset($_GET['invoice_id'])) {
"); ");
//Get billable, and unbilled tickets to add to invoice //Get billable, and unbilled tickets to add to invoice
$sql_tickets_billable = mysqli_query($mysqli, "SELECT * FROM tickets WHERE ticket_client_id = $client_id AND ticket_billable = 1 AND ticket_invoice_id = 0;"); $sql_tickets_billable = mysqli_query(
$mysqli, "
SELECT
*
FROM
tickets
WHERE
ticket_client_id = $client_id
AND
ticket_billable = 1
AND
ticket_invoice_id = 0
AND
ticket_status LIKE '%close%';
");
//Add up all the payments for the invoice and get the total amount paid to the invoice //Add up all the payments for the invoice and get the total amount paid to the invoice
+31 -6
View File
@@ -8,27 +8,52 @@
<span>&times;</span> <span>&times;</span>
</button> </button>
</div> </div>
<div class="modal->body bg-white"> <div class="modal-body bg-white">
<table class="table"> <div class="table-responsive">
<table class="table table-striped">
<thead>
<tr> <tr>
<th>Ticket Number</th> <th>Ticket Number</th>
<th>Scope</th> <th>Scope</th>
<th></th> <th>Add to Invoice</th>
</tr> </tr>
</thead>
<?php while ($row = mysqli_fetch_array($sql_tickets_billable)) { <?php while ($row = mysqli_fetch_array($sql_tickets_billable)) {
$ticket_id = intval($row['ticket_id']); $ticket_id = intval($row['ticket_id']);
$ticket_subject = nullable_htmlentities($row['ticket_subject']); $ticket_subject = nullable_htmlentities($row['ticket_subject']);
$ticket_number = intval($row['ticket_number']);
$ticket_prefix = nullable_htmlentities($row['ticket_prefix']);
$ticket_status = nullable_htmlentities($row['ticket_status']);
switch ($ticket_status) {
case 'Closed':
$ticket_status_class = 'badge-dark';
break;
case 'Auto Close':
$ticket_status_class = 'badge-warning';
break;
default:
$ticket_status_class = 'badge-secondary';
break;
}
?> ?>
<tr> <tr>
<td><?php echo $ticket_id?></td> <td>
<a href="ticket.php?ticket_id=<?php echo $ticket_id; ?>">
<span class="badge badge-pill <?php echo $ticket_status_class?> p-3"><?php echo "$ticket_prefix$ticket_number"; ?></span>
</a>
</td>
<td><?php echo $ticket_subject ?></td> <td><?php echo $ticket_subject ?></td>
<td></td> <td><a href='ticket.php?ticket_id=<?php echo $ticket_id?>&invoice_id=<?php echo $invoice_id?>#addInvoiceFromTicketModal'>
<td><a href='ticket.php?ticket_id=<?php echo $ticket_id?>&invoice_id=<?php echo $invoice_id?>#addInvoiceFromTicketModal'>Add</a></td> <i class="fas fa-fw fa-plus-circle"></i></td>
</tr> </tr>
<?php } ?> <?php } ?>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div>
</div> </div>