Refactored Currency Display using PHP numfmt_format_currency() function as this is best practice and will put the right currency symbol in the right place based off locale and currency type

This commit is contained in:
johnnyq
2022-02-17 22:20:59 -05:00
parent 8d8b922ba5
commit a9346845ab
26 changed files with 148 additions and 174 deletions

View File

@@ -81,7 +81,7 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<td class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($tax_collected_quarter_one,2); ?></td>
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $tax_collected_quarter_one, $session_company_currency); ?></td>
<?php
@@ -104,7 +104,7 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<td class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($tax_collected_quarter_two,2); ?></td>
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $tax_collected_quarter_two, $session_company_currency); ?></td>
<?php
@@ -127,7 +127,7 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<td class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($tax_collected_quarter_three,2); ?></td>
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $tax_collected_quarter_three, $session_company_currency); ?></td>
<?php
@@ -152,9 +152,9 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<td class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($tax_collected_quarter_four,2); ?></td>
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $tax_collected_quarter_four, $session_company_currency); ?></td>
<td class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($total_tax_collected_four_quarters,2); ?></td>
<td class="text-right"><?php echo numfmt_format_currency($currency_format, $total_tax_collected_four_quarters, $session_company_currency); ?></td>
</tr>
<?php
@@ -177,7 +177,7 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<th class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($expense_total_amount_for_quarter_one,2); ?></th>
<th class="text-right"><?php echo numfmt_format_currency($currency_format, $expense_total_amount_for_quarter_one, $session_company_currency); ?></th>
<?php
@@ -191,7 +191,7 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<th class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($expense_total_amount_for_quarter_two,2); ?></th>
<th class="text-right"><?php echo numfmt_format_currency($currency_format, $expense_total_amount_for_quarter_two, $session_company_currency); ?></th>
<?php
@@ -205,7 +205,7 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<th class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($expense_total_amount_for_quarter_three,2); ?></th>
<th class="text-right"><?php echo numfmt_format_currency($currency_format, $expense_total_amount_for_quarter_three, $session_company_currency); ?></th>
<?php
@@ -221,9 +221,9 @@ $sql_tax = mysqli_query($mysqli,"SELECT * FROM taxes WHERE company_id = $session
?>
<th class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($expense_total_amount_for_quarter_four,2); ?></th>
<th class="text-right"><?php echo numfmt_format_currency($currency_format, $expense_total_amount_for_quarter_four, $session_company_currency); ?></th>
<th class="text-right"><?php echo get_currency_symbol($session_company_currency); ?> <?php echo number_format($total_expenses_for_all_four_quarters,2); ?></th>
<th class="text-right"><?php echo numfmt_format_currency($currency_format, $total_expenses_for_all_four_quarters, $session_company_currency); ?></th>
</tr>
</tbody>
</table>