Added select2 libs, started transactions, added additiona fields to vendor, new DB dump removed balance on invoices list

This commit is contained in:
root
2019-04-27 12:10:12 -04:00
parent 095def07a1
commit ee7a7f0ad7
259 changed files with 51996 additions and 56 deletions

View File

@@ -21,9 +21,8 @@
<th>Number</th>
<th>Client</th>
<th class="text-right">Amount</th>
<th class="text-right">Balance</th>
<th>Date</th>
<th>Due</th>
<th>Invoice Date</th>
<th>Due Date</th>
<th>Status</th>
<th class="text-center">Actions</th>
</tr>
@@ -60,28 +59,12 @@
$invoice_badge_color = "secondary";
}
//Add up all the payments for the invoice and get the total amount paid to the invoice
$sql_amount_paid = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS amount_paid FROM payments WHERE invoice_id = $invoice_id");
$row = mysqli_fetch_array($sql_amount_paid);
$amount_paid = $row['amount_paid'];
$balance = $invoice_amount - $amount_paid;
//set Text color on balance
if($balance > 0){
$balance_text_color = "text-danger";
}else{
$balance_text_color = "";
}
?>
<tr>
<td><a href="invoice.php?invoice_id=<?php echo $invoice_id; ?>">INV-<?php echo $invoice_number; ?></a></td>
<td><a href="client.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
<td class="text-right text-monospace">$<?php echo number_format($invoice_amount,2); ?></td>
<td class="text-right text-monospace <?php echo $balance_text_color; ?>">$<?php echo number_format($balance,2); ?></td>
<td><?php echo $invoice_date; ?></td>
<td class="<?php echo $overdue_color; ?>"><?php echo $invoice_due; ?></td>
<td>