Update Accounts screen to show type

This commit is contained in:
Andrew Malsbury 2023-10-07 16:13:46 +00:00
parent db5eee0ebb
commit bc95bb4e15
1 changed files with 31 additions and 0 deletions

View File

@ -43,6 +43,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<thead class="text-dark <?php if ($num_rows[0] == 0) { echo "d-none"; } ?>">
<tr>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=account_name&order=<?php echo $disp; ?>">Name</a></th>
<th class="text-center">Type</th>
<th><a class="text-dark" href="?<?php echo $url_query_strings_sort; ?>&sort=account_currency_code&order=<?php echo $disp; ?>">Currency</a></th>
<th class="text-right">Balance</th>
<th class="text-center">Action</th>
@ -57,6 +58,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
$opening_balance = floatval($row['opening_balance']);
$account_currency_code = nullable_htmlentities($row['account_currency_code']);
$account_notes = nullable_htmlentities($row['account_notes']);
$account_type = intval($row['account_type']);
$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);
@ -75,6 +77,35 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
<tr>
<td><a class="text-dark" href="#" data-toggle="modal" data-target="#editAccountModal<?php echo $account_id; ?>"><?php echo $account_name; ?></a></td>
<td class="text-center">
<?php
switch ($account_type) {
case 11:
echo "Current Assets";
break;
case 12:
echo "Fixed Assets";
break;
case 13:
echo "Other Assets";
break;
case 21:
echo "Current Liabilities";
break;
case 22:
echo "Long Term Liabilities";
break;
case 23:
echo "Other Liabilities";
break;
case 30:
echo "Equity";
break;
default:
echo "Unknown Account Type";
}
?>
</td>
<td><?php echo $account_currency_code; ?></td>
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $balance, $account_currency_code); ?></td>
<td>