Fix collections report

This commit is contained in:
o-psi 2024-02-15 16:09:10 -06:00
parent 5d15a7ded9
commit 79157c88ea
2 changed files with 9 additions and 1 deletions

View File

@ -66,7 +66,7 @@ validateAccountantRole();
?>
<tr>
<td><a href="client_overview.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
<td><a href="client_statement.php?client_id=<?php echo $client_id; ?>"><?php echo $client_name; ?></a></td>
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $balance, $session_company_currency); ?></td>
</tr>
<?php

View File

@ -85,8 +85,16 @@
</thead>
<tbody>
<?php
$processed_clients = []; // Array to keep track of processed client IDs
while ($row = mysqli_fetch_assoc($result_client_balance_report)) {
$client_id = intval($row['client_id']);
// Skip this row if we've already processed this client ID
if (in_array($client_id, $processed_clients)) {
continue; // Skip to the next iteration of the loop
} // Add the client ID to the array of processed clients
$processed_clients[] = $client_id;
$client_name = nullable_htmlentities($row['client_name']);
$balance = floatval($row['balance']);
$billing_contact_phone = formatPhoneNumber($row['billing_contact_phone']);