diff --git a/invoice.php b/invoice.php index 6c0ac9a7..219000cb 100644 --- a/invoice.php +++ b/invoice.php @@ -25,7 +25,7 @@ if (isset($_GET['invoice_id'])) { $row = mysqli_fetch_array($sql); $invoice_id = intval($row['invoice_id']); $invoice_prefix = htmlentities($row['invoice_prefix']); - $invoice_number = htmlentities($row['invoice_number']); + $invoice_number = intval($row['invoice_number']); $invoice_scope = htmlentities($row['invoice_scope']); $invoice_status = htmlentities($row['invoice_status']); $invoice_date = htmlentities($row['invoice_date']); @@ -73,7 +73,7 @@ if (isset($_GET['invoice_id'])) { //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 payment_invoice_id = $invoice_id"); $row = mysqli_fetch_array($sql_amount_paid); - $amount_paid = $row['amount_paid']; + $amount_paid = floatval($row['amount_paid']); $balance = $invoice_amount - $amount_paid; @@ -121,27 +121,33 @@ if (isset($_GET['invoice_id'])) {
- - Add Payment + + Add Payment +