Set Currency Symbols to Company's Default Currentcy Setting

This commit is contained in:
johnnyq 2021-11-19 20:04:03 -05:00
parent 0f60955120
commit cdae4ecfb6
3 changed files with 10 additions and 10 deletions

View File

@ -125,7 +125,7 @@ $vendors_added = $row['vendors_added'];
<h3>$<?php echo number_format($total_income,2); ?></h3> <h3>$<?php echo number_format($total_income,2); ?></h3>
<p>Revenue</p> <p>Revenue</p>
<hr> <hr>
<small>Receivables: $<?php echo number_format($receivables,2); ?></small> <small>Receivables: <?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($receivables,2); ?></small>
</div> </div>
<div class="icon"> <div class="icon">
<i class="fa fa-money-check"></i> <i class="fa fa-money-check"></i>
@ -138,7 +138,7 @@ $vendors_added = $row['vendors_added'];
<!-- small box --> <!-- small box -->
<a class="small-box bg-danger" href="expenses.php?dtf=<?php echo $year; ?>-01-01&dtt=<?php echo $year; ?>-12-31"> <a class="small-box bg-danger" href="expenses.php?dtf=<?php echo $year; ?>-01-01&dtt=<?php echo $year; ?>-12-31">
<div class="inner"> <div class="inner">
<h3>$<?php echo number_format($total_expenses,2); ?></h3> <h3><?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($total_expenses,2); ?></h3>
<p>Expenses</p> <p>Expenses</p>
</div> </div>
<div class="icon"> <div class="icon">
@ -152,7 +152,7 @@ $vendors_added = $row['vendors_added'];
<!-- small box --> <!-- small box -->
<div class="small-box bg-success"> <div class="small-box bg-success">
<div class="inner"> <div class="inner">
<h3>$<?php echo number_format($profit,2); ?></h3> <h3><?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($profit,2); ?></h3>
<p>Profit</p> <p>Profit</p>
</div> </div>
<div class="icon"> <div class="icon">
@ -166,7 +166,7 @@ $vendors_added = $row['vendors_added'];
<!-- small box --> <!-- small box -->
<div class="small-box bg-info"> <div class="small-box bg-info">
<div class="inner"> <div class="inner">
<h3>$<?php echo number_format($recurring_monthly_total,2); ?></h3> <h3><?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($recurring_monthly_total,2); ?></h3>
<p>Monthly Recurring</p> <p>Monthly Recurring</p>
</div> </div>
<div class="icon"> <div class="icon">
@ -180,7 +180,7 @@ $vendors_added = $row['vendors_added'];
<!-- small box --> <!-- small box -->
<div class="small-box bg-info"> <div class="small-box bg-info">
<div class="inner"> <div class="inner">
<h3>$<?php echo number_format($recurring_yearly_total,2); ?></h3> <h3><?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($recurring_yearly_total,2); ?></h3>
<p>Yearly Recurring</p> <p>Yearly Recurring</p>
</div> </div>
<div class="icon"> <div class="icon">
@ -359,7 +359,7 @@ $vendors_added = $row['vendors_added'];
$balance = '0.00'; $balance = '0.00';
} }
?> ?>
<td class="text-right">$<?php echo number_format($balance,2); ?></td> <td class="text-right"><?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($balance,2); ?></td>
</tr> </tr>
<?php <?php
} }
@ -403,7 +403,7 @@ $vendors_added = $row['vendors_added'];
<td><?php echo $payment_date; ?></td> <td><?php echo $payment_date; ?></td>
<td><?php echo $client_name; ?></td> <td><?php echo $client_name; ?></td>
<td><?php echo "$invoice_prefix$invoice_number"; ?></td> <td><?php echo "$invoice_prefix$invoice_number"; ?></td>
<td class="text-right">$<?php echo number_format($payment_amount,2); ?></td> <td class="text-right"><?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($payment_amount,2); ?></td>
</tr> </tr>
<?php <?php
} }
@ -446,7 +446,7 @@ $vendors_added = $row['vendors_added'];
<td><?php echo $expense_date; ?></td> <td><?php echo $expense_date; ?></td>
<td><?php echo $vendor_name; ?></td> <td><?php echo $vendor_name; ?></td>
<td><?php echo $category_name; ?></td> <td><?php echo $category_name; ?></td>
<td class="text-right">$<?php echo number_format($expense_amount,2); ?></td> <td class="text-right"><?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($expense_amount,2); ?></td>
</tr> </tr>
<?php <?php
} }

View File

@ -181,7 +181,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
<tr> <tr>
<td><?php echo $receipt_attached; ?> <a class="text-dark" href="#" data-toggle="modal" data-target="#editExpenseModal<?php echo $expense_id; ?>"><?php echo $expense_date; ?></a></td> <td><?php echo $receipt_attached; ?> <a class="text-dark" href="#" data-toggle="modal" data-target="#editExpenseModal<?php echo $expense_id; ?>"><?php echo $expense_date; ?></a></td>
<td class="text-right">$<?php echo number_format($expense_amount,2); ?></td> <td class="text-right"><?php echo get_currency_symbol($config_default_currency); ?><?php echo number_format($expense_amount,2); ?></td>
<td><?php echo $vendor_name; ?></td> <td><?php echo $vendor_name; ?></td>
<td><?php echo truncate($expense_description,50); ?></td> <td><?php echo truncate($expense_description,50); ?></td>
<td><?php echo $category_name; ?></td> <td><?php echo $category_name; ?></td>

View File

@ -184,7 +184,7 @@ function truncate($text, $chars) {
return $text; return $text;
} }
function get_currency_symbol($cc = 'USD'){ function get_currency_symbol($cc){
$cc = strtoupper($cc); $cc = strtoupper($cc);
$currency = array( $currency = array(
"USD" => "$" , //U.S. Dollar "USD" => "$" , //U.S. Dollar