Switched to DB controlled Account Types

This commit is contained in:
Andrew Malsbury
2023-10-09 20:27:53 +00:00
parent 69272a8800
commit a8e03d4660
+10 -10
View File
@@ -1,9 +1,9 @@
<?php <?php
require_once("inc_all_reports.php"); require_once("inc_all_reports.php");
validateAccountantRole(); validateAccountantRole();
// Fetch Accounts and their balances // Fetch Accounts and their balances
$sql_accounts = " $sql_accounts = "
SELECT SELECT
a.account_id, a.account_id,
a.account_name, a.account_name,
@@ -21,12 +21,12 @@ $sql_accounts = "
GROUP BY a.account_id GROUP BY a.account_id
ORDER BY a.account_type, a.account_name ASC"; ORDER BY a.account_type, a.account_name ASC";
$result_accounts = mysqli_query($mysqli, $sql_accounts); $result_accounts = mysqli_query($mysqli, $sql_accounts);
$total_assets = 0; $total_assets = 0;
$total_liabilities = 0; $total_liabilities = 0;
$total_equity = 0; $total_equity = 0;
$currency = $session_company_currency; $currency = $session_company_currency;
?> ?>
<div class="card card-dark"> <div class="card card-dark">
@@ -155,7 +155,7 @@ function echoAccountRow($accountRow, $balance) {
30 => "Equity" 30 => "Equity"
]; ];
$account_type_string = $account_type_strings[$accountRow['account_type']] ?? "Unknown"; $account_type_string = $account_type_strings[$accountRow['account_type']] ?? "Unknown";
$account_name_encoded = urlencode($accountRow['account_name']); $account_name_encoded_numml = urlencode($accountRow['account_name']);
echo " echo "
<tr> <tr>
<td>$account_type_string</td> <td>$account_type_string</td>