mirror of https://github.com/itflow-org/itflow
Convert account_id and invoice_id to integers in calculateAccountBalance and calculateInvoiceBalance functions
This commit is contained in:
parent
1f46ea79fc
commit
7004d9217d
|
|
@ -850,7 +850,7 @@ function calculateAccountBalance($mysqli, $account_id) {
|
|||
$sql_account = mysqli_query($mysqli, "SELECT * FROM accounts LEFT JOIN account_types ON accounts.account_type = account_types.account_type_id WHERE account_archived_at IS NULL AND account_id = $account_id ORDER BY account_name ASC; ");
|
||||
$row = mysqli_fetch_array($sql_account);
|
||||
$opening_balance = floatval($row['opening_balance']);
|
||||
$account_id = $row['account_id'];
|
||||
$account_id = intval($row['account_id']);
|
||||
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_account_id = $account_id");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
|
|
@ -877,7 +877,7 @@ function calculateInvoiceBalance($mysqli, $invoice_id) {
|
|||
$sql_invoice = mysqli_query($mysqli, "SELECT * FROM invoices WHERE invoice_id = $invoice_id");
|
||||
$row = mysqli_fetch_array($sql_invoice);
|
||||
$invoice_amount = floatval($row['invoice_amount']);
|
||||
$invoice_id = $row['invoice_id'];
|
||||
$invoice_id = intval($row['invoice_id']);
|
||||
|
||||
$sql_payments = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS total_payments FROM payments WHERE payment_invoice_id = $invoice_id");
|
||||
$row = mysqli_fetch_array($sql_payments);
|
||||
|
|
|
|||
Loading…
Reference in New Issue