diff --git a/cron.php b/cron.php
index b51a9422..9e8273ce 100644
--- a/cron.php
+++ b/cron.php
@@ -173,6 +173,8 @@ while($row = mysqli_fetch_array($sql_companies)){
$invoice_due = $row['invoice_due'];
$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'];
@@ -205,7 +207,7 @@ while($row = mysqli_fetch_array($sql_companies)){
$mail->Subject = "Overdue Invoice $invoice_prefix$invoice_number";
$mail->Body = "Hello $contact_name,
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.
- Please view the details of the invoice below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: $$invoice_amount
Due Date: $invoice_due
To view your invoice online click
here~
$company_name
$company_phone";
+ Please view the details of the invoice below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: $invoice_currency_symbol$invoice_amount
Due Date: $invoice_due
To view your invoice online click
here~
$company_name
$company_phone";
$mail->send();
@@ -234,11 +236,13 @@ 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'];
$client_name = mysqli_real_escape_string($mysqli,$row['client_name']); //Escape SQL just in case a name is like Safran's etc
$client_net_terms = $row['client_net_terms'];
+
//Get the last Invoice Number and add 1 for the new invoice number
$sql_invoice_number = mysqli_query($mysqli,"SELECT * FROM settings WHERE company_id = $company_id");
@@ -326,7 +330,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,
Please view the details of the invoice below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: $$invoice_amount
Due Date: $invoice_due
To view your invoice online click
here~
$company_name
$company_phone";
+ $mail->Body = "Hello $contact_name,
Please view the details of the invoice below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: $recurring_currency_symbol$invoice_amount
Due Date: $invoice_due
To view your invoice online click
here~
$company_name
$company_phone";
$mail->send();
diff --git a/post.php b/post.php
index 89c3c401..ba480b3d 100644
--- a/post.php
+++ b/post.php
@@ -2945,6 +2945,8 @@ if(isset($_GET['email_quote'])){
$quote_amount = $row['quote_amount'];
$quote_note = $row['quote_note'];
$quote_url_key = $row['quote_url_key'];
+ $quote_currency_code = $row['quote_currency_code'];
+ $quote_currency_symbol = htmlentities(get_currency_symbol($quote_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'];
@@ -2953,8 +2955,6 @@ if(isset($_GET['email_quote'])){
$contact_extension = $row['contact_extension'];
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
$client_website = $row['client_website'];
- $client_currency_code = $row['client_currency_code'];
- $client_currency_symbol = htmlentities(get_currency_symbol($client_currency_code)); //Needs HTML entities due to encoding (Â was showing up)
$base_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']);
$company_name = $row['company_name'];
$company_country = $row['company_country'];
@@ -2995,7 +2995,7 @@ if(isset($_GET['email_quote'])){
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = "Quote";
- $mail->Body = "Hello $contact_name,
Thank you for your inquiry, we are pleased to provide you with the following estimate.
Total Cost: $client_currency_symbol$quote_amount
View and accept your estimate online
here~
$company_name
$company_phone";
+ $mail->Body = "Hello $contact_name,
Thank you for your inquiry, we are pleased to provide you with the following estimate.
Total Cost: $quote_currency_symbol$quote_amount
View and accept your estimate online
here~
$company_name
$company_phone";
$mail->send();
echo 'Message has been sent';
@@ -3398,6 +3398,7 @@ if(isset($_POST['add_payment'])){
$amount = floatval($_POST['amount']);
$account = intval($_POST['account']);
$currency_code = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['currency_code'])));
+ $currency_symbol = htmlentities(get_currency_symbol($currency_code)); //Needs HTML entities due to encoding (Â was showing up)
$payment_method = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['payment_method'])));
$reference = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['reference'])));
$email_receipt = intval($_POST['email_receipt']);
@@ -3485,7 +3486,7 @@ if(isset($_POST['add_payment'])){
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = "Payment Recieved - Invoice $invoice_prefix$invoice_number";
- $mail->Body = "Hello $contact_name,
We have recieved your payment in the amount of $$formatted_amount for invoice
$invoice_prefix$invoice_number. Please keep this email as a receipt for your records.
Amount: $$formatted_amount
Balance: $$formatted_invoice_balance
Thank you for your business!
~
$company_name
$company_phone";
+ $mail->Body = "Hello $contact_name,
We have recieved your payment in the amount of $currency_symbol$formatted_amount for invoice
$invoice_prefix$invoice_number. Please keep this email as a receipt for your records.
Amount: $currency_symbol$formatted_amount
Balance: $currency_symbol$formatted_invoice_balance
Thank you for your business!
~
$company_name
$company_phone";
$mail->send();
echo 'Message has been sent';
@@ -3521,7 +3522,7 @@ if(isset($_POST['add_payment'])){
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = "Partial Payment Recieved - Invoice $invoice_prefix$invoice_number";
- $mail->Body = "Hello $contact_name,
We have recieved partial payment in the amount of $$formatted_amount and it has been applied to invoice
$invoice_prefix$invoice_number. Please keep this email as a receipt for your records.
Amount: $$formatted_amount
Balance: $$formatted_invoice_balance
Thank you for your business!
~
$company_name
$company_phone";
+ $mail->Body = "Hello $contact_name,
We have recieved partial payment in the amount of $currency_symbol$formatted_amount and it has been applied to invoice
$invoice_prefix$invoice_number. Please keep this email as a receipt for your records.
Amount: $currency_symbol$formatted_amount
Balance: $currency_symbol$formatted_invoice_balance
Thank you for your business!
~
$company_name
$company_phone";
$mail->send();
echo 'Message has been sent';
@@ -3614,6 +3615,8 @@ if(isset($_GET['email_invoice'])){
$invoice_due = $row['invoice_due'];
$invoice_amount = $row['invoice_amount'];
$invoice_url_key = $row['invoice_url_key'];
+ $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'];
$client_name = $row['client_name'];
@@ -3623,8 +3626,7 @@ if(isset($_GET['email_invoice'])){
$contact_extension = $row['contact_extension'];
$contact_mobile = formatPhoneNumber($row['contact_mobile']);
$client_website = $row['client_website'];
- $client_currency_code = $row['client_currency_code'];
- $client_currency_symbol = htmlentities(get_currency_symbol($client_currency_code)); //Needs HTML entities due to encoding (Â was showing up)
+
$base_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']);
$company_name = $row['company_name'];
$company_country = $row['company_country'];
@@ -3676,7 +3678,7 @@ if(isset($_GET['email_invoice'])){
}else{
$mail->Subject = "Invoice $invoice_prefix$invoice_number";
- $mail->Body = "Hello $contact_name,
Please view the details of the invoice below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: $client_currency_symbol$invoice_amount
Balance Due: $client_currency_symbol$balance
Due Date: $invoice_due
To view your invoice online click
here~
$company_name
$company_phone";
+ $mail->Body = "Hello $contact_name,
Please view the details of the invoice below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: $invoice_currency_symbol$invoice_amount
Balance Due: $invoice_currency_symbol$balance
Due Date: $invoice_due
To view your invoice online click
here~
$company_name
$company_phone";
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
}