mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
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:
9
cron.php
9
cron.php
@@ -32,6 +32,9 @@ while($row = mysqli_fetch_array($sql_companies)){
|
||||
$config_recurring_auto_send_invoice = $row['config_recurring_auto_send_invoice'];
|
||||
$config_base_url = $row['config_base_url'];
|
||||
|
||||
//Set Currency Format
|
||||
$currency_format = numfmt_create('en-US', NumberFormatter::CURRENCY);
|
||||
|
||||
//Tickets
|
||||
$config_ticket_prefix = $row['config_ticket_prefix'];
|
||||
$config_ticket_next_number = $row['config_ticket_next_number'];
|
||||
@@ -184,7 +187,6 @@ while($row = mysqli_fetch_array($sql_companies)){
|
||||
$invoice_url_key = $row['invoice_url_key'];
|
||||
$invoice_amount = $row['invoice_amount'];
|
||||
$invoice_currency_code = $row['invoice_currency_code'];
|
||||
$invoice_currency_symbol = htmlentities(get_currency_symbol($invoice_currency_code)); //Needs HTML entities due to encoding (Â was showing up)
|
||||
$client_id = $row['client_id'];
|
||||
$client_name = $row['client_name'];
|
||||
$contact_name = $row['contact_name'];
|
||||
@@ -217,7 +219,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
||||
$mail->Subject = "Overdue Invoice $invoice_prefix$invoice_number";
|
||||
$mail->Body = "Hello $contact_name,<br><br>According to our records, we have not received payment for invoice $invoice_prefix$invoice_number. Please submit your payment as soon as possible. If you have any questions please contact us at $company_phone.
|
||||
<br><br>
|
||||
Please view the details of the invoice below.<br><br>Invoice: $invoice_prefix$invoice_number<br>Issue Date: $invoice_date<br>Total: $invoice_currency_symbol$invoice_amount<br>Due Date: $invoice_due<br><br><br>To view your invoice online click <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$invoice_id&url_key=$invoice_url_key'>here</a><br><br><br>~<br>$company_name<br>$company_phone";
|
||||
Please view the details of the invoice below.<br><br>Invoice: $invoice_prefix$invoice_number<br>Issue Date: $invoice_date<br>Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "<br>Due Date: $invoice_due<br><br><br>To view your invoice online click <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$invoice_id&url_key=$invoice_url_key'>here</a><br><br><br>~<br>$company_name<br>$company_phone";
|
||||
|
||||
$mail->send();
|
||||
|
||||
@@ -246,7 +248,6 @@ while($row = mysqli_fetch_array($sql_companies)){
|
||||
$recurring_next_date = $row['recurring_next_date'];
|
||||
$recurring_amount = $row['recurring_amount'];
|
||||
$recurring_currency_code = $row['recurring_currency_code'];
|
||||
$recurring_currency_symbol = htmlentities(get_currency_symbol($recurring_currency_code)); //Needs HTML entities due to encoding (Â was showing up)
|
||||
$recurring_note = mysqli_real_escape_string($mysqli,$row['recurring_note']); //Escape SQL
|
||||
$category_id = $row['recurring_category_id'];
|
||||
$client_id = $row['recurring_client_id'];
|
||||
@@ -340,7 +341,7 @@ while($row = mysqli_fetch_array($sql_companies)){
|
||||
$mail->isHTML(true); // Set email format to HTML
|
||||
|
||||
$mail->Subject = "Invoice $invoice_prefix$invoice_number";
|
||||
$mail->Body = "Hello $contact_name,<br><br>Please view the details of the invoice below.<br><br>Invoice: $invoice_prefix$invoice_number<br>Issue Date: $invoice_date<br>Total: $recurring_currency_symbol$invoice_amount<br>Due Date: $invoice_due<br><br><br>To view your invoice online click <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$new_invoice_id&url_key=$invoice_url_key'>here</a><br><br><br>~<br>$company_name<br>$company_phone";
|
||||
$mail->Body = "Hello $contact_name,<br><br>Please view the details of the invoice below.<br><br>Invoice: $invoice_prefix$invoice_number<br>Issue Date: $invoice_date<br>Total: " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_currency_code) . "<br>Due Date: $invoice_due<br><br><br>To view your invoice online click <a href='https://$config_base_url/guest_view_invoice.php?invoice_id=$new_invoice_id&url_key=$invoice_url_key'>here</a><br><br><br>~<br>$company_name<br>$company_phone";
|
||||
|
||||
$mail->send();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user