diff --git a/cron.php b/cron.php
index 411dbe4df..06decb6c7 100644
--- a/cron.php
+++ b/cron.php
@@ -420,7 +420,8 @@
$ticket_reply = $ticket_reply_row['ticket_reply'];
$subject = "Ticket pending closure - [$ticket_prefix$ticket_number] - $ticket_subject";
- $body = "##- Please type your reply above this line -##
Hello, $contact_name
This is an automatic friendly reminder that your ticket regarding $ticket_subject will be closed, unless you respond.
--------------------------------
$ticket_reply--------------------------------
If your issue is resolved, you can ignore this email - the ticket will automatically close shortly. If you need further assistance, please respond to this email.
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Status: $ticket_status
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
+
+ $body = "##- Please type your reply above this line -##
Hello, $contact_name
This is an automatic friendly reminder that your ticket regarding \"$ticket_subject\" will be closed, unless you respond.
--------------------------------
$ticket_reply--------------------------------
If your issue is resolved, you can ignore this email - the ticket will automatically close. If you need further assistance, please respond to this email.
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Status: $ticket_status
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
$data = [
[
@@ -500,10 +501,10 @@
mysqli_query($mysqli, "INSERT INTO notifications SET notification_type = 'Invoice Overdue', notification = 'Invoice $invoice_prefix$invoice_number for $client_name in the amount of $invoice_amount is overdue by $day days', notification_action = 'invoice.php?invoice_id=$invoice_id', notification_client_id = $client_id, notification_entity_id = $invoice_id");
- $subject = "Overdue Invoice $invoice_prefix$invoice_number";
- $body = "Hello $contact_name,
Our records indicate that we have not yet received payment for the invoice $invoice_prefix$invoice_number. We kindly request that you submit your payment as soon as possible. If you have any questions or concerns, please do not hesitate to contact us at $company_phone.
+ $subject = "$company_name Overdue Invoice $invoice_prefix$invoice_number";
+ $body = "Hello $contact_name,
Our records indicate that we have not yet received payment for the invoice $invoice_prefix$invoice_number. We kindly request that you submit your payment as soon as possible. If you have any questions or concerns, please do not hesitate to contact us at $company_email or $company_phone.
- Kindly review the invoice details mentioned below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Due Date: $invoice_due
Over Due By: $day Days
To view your invoice click here
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
+ Kindly review the invoice details mentioned below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Due Date: $invoice_due
Over Due By: $day Days
To view your invoice, please click here.
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
$mail = addToMailQueue($mysqli, [
[
@@ -610,6 +611,7 @@
$row = mysqli_fetch_array($sql);
$invoice_prefix = sanitizeInput($row['invoice_prefix']);
$invoice_number = intval($row['invoice_number']);
+ $invoice_scope = sanitizeInput($row['invoice_scope']);
$invoice_date = sanitizeInput($row['invoice_date']);
$invoice_due = sanitizeInput($row['invoice_due']);
$invoice_amount = floatval($row['invoice_amount']);
@@ -619,8 +621,8 @@
$contact_name = sanitizeInput($row['contact_name']);
$contact_email = sanitizeInput($row['contact_email']);
- $subject = "Invoice $invoice_prefix$invoice_number";
- $body = "Hello $contact_name,
Kindly review the invoice details mentioned below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_currency_code) . "
Due Date: $invoice_due
To view your invoice click here
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
+ $subject = "$company_name Invoice $invoice_prefix$invoice_number";
+ $body = "Hello $contact_name,
An invoice regarding \"$invoice_scope\" has been generated. Please view the details below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $recurring_currency_code) . "
Due Date: $invoice_due
To view your invoice, please click here.
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
$mail = addToMailQueue($mysqli, [
[
diff --git a/inc_all_client.php b/inc_all_client.php
index 8e26cfd05..4ebc4ffb5 100644
--- a/inc_all_client.php
+++ b/inc_all_client.php
@@ -124,7 +124,7 @@
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('asset_id') AS num FROM assets WHERE asset_archived_at IS NULL AND asset_client_id = $client_id"));
$num_assets = $row['num'];
- $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_status != 'Closed' AND ticket_client_id = $client_id"));
+ $row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_status != 'Closed' AND ticket_status != 'Auto Close' AND ticket_client_id = $client_id"));
$num_active_tickets = $row['num'];
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('ticket_id') AS num FROM tickets WHERE ticket_archived_at IS NULL AND ticket_status = 'Closed' AND ticket_client_id = $client_id"));
diff --git a/post/invoice.php b/post/invoice.php
index 4ecc70f74..da872849d 100644
--- a/post/invoice.php
+++ b/post/invoice.php
@@ -288,7 +288,7 @@
mysqli_query($mysqli,"INSERT INTO invoice_items SET item_name = '$name', item_description = '$description', item_quantity = $qty, item_price = $price, item_subtotal = $subtotal, item_tax = $tax_amount, item_total = $total, item_tax_id = $tax_id, item_order = $item_order, item_recurring_id = $recurring_id");
- //Get Discount
+ //Get Discount
$sql = mysqli_query($mysqli,"SELECT * FROM recurring WHERE recurring_id = $recurring_id");
$row = mysqli_fetch_array($sql);
@@ -461,7 +461,7 @@
} else {
$invoice_discount = 0;
}
-
+
//add up all line items
$sql = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE item_invoice_id = $invoice_id");
$invoice_total = 0;
@@ -674,7 +674,7 @@
if ($email_receipt == 1) {
- $subject = "Payment Received - Invoice $invoice_prefix$invoice_number";
+ $subject = "$company_name Payment Received - Invoice $invoice_prefix$invoice_number";
$body = "Hello $contact_name,
We have received your payment in the amount of " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . " for invoice $invoice_prefix$invoice_number. Please keep this email as a receipt for your records.
Amount: " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . "
Balance: " . numfmt_format_currency($currency_format, $invoice_balance, $invoice_currency_code) . "
Thank you for your business!
--
$company_name - Billing Department
$config_invoice_from_email
$company_phone";
// Queue Mail
@@ -706,9 +706,8 @@
if ($email_receipt == 1) {
-
- $subject = "Partial Payment Recieved - Invoice $invoice_prefix$invoice_number";
- $body = "Hello $contact_name,
We have recieved partial payment in the amount of " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . " and it has been applied to invoice $invoice_prefix$invoice_number. Please keep this email as a receipt for your records.
Amount: " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . "
Balance: " . numfmt_format_currency($currency_format, $invoice_balance, $invoice_currency_code) . "
Thank you for your business!
~
$company_name - Billing
$config_invoice_from_email
$company_phone";
+ $subject = "$company_name Partial Payment Received - Invoice $invoice_prefix$invoice_number";
+ $body = "Hello $contact_name,
We have received partial payment in the amount of " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . " and it has been applied to invoice $invoice_prefix$invoice_number. Please keep this email as a receipt for your records.
Amount: " . numfmt_format_currency($currency_format, $amount, $invoice_currency_code) . "
Balance: " . numfmt_format_currency($currency_format, $invoice_balance, $invoice_currency_code) . "
Thank you for your business!
~
$company_name - Billing
$config_invoice_from_email
$company_phone";
// Queue Mail
$email = [
@@ -813,7 +812,7 @@
$payment_amount = $bulk_payment_amount;
$invoice_status = "Partial";
}
-
+
// Subtract the payment amount from the bulk payment amount
$bulk_payment_amount -= $payment_amount;
@@ -879,7 +878,7 @@
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Payment', log_action = 'Email', log_description = 'Bulk Payment receipt for multiple Invoices queued to $contact_email Email ID: $email_id', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_client_id = $client_id, log_user_id = $session_user_id, log_entity_id = $payment_id");
$_SESSION['alert_message'] .= "Email receipt sent and ";
-
+
} // End Email
// Logging
@@ -950,6 +949,7 @@
$invoice_id = intval($row['invoice_id']);
$invoice_prefix = sanitizeInput($row['invoice_prefix']);
$invoice_number = intval($row['invoice_number']);
+ $invoice_scope = sanitizeInput($row['invoice_scope']);
$invoice_status = sanitizeInput($row['invoice_status']);
$invoice_date = sanitizeInput($row['invoice_date']);
$invoice_due = sanitizeInput($row['invoice_due']);
@@ -989,11 +989,11 @@
$balance = $invoice_amount - $amount_paid;
if ($invoice_status == 'Paid') {
- $subject = "Invoice $invoice_prefix$invoice_number Receipt";
- $body = "Hello $contact_name,
Please click on the link below to see your invoice marked paid.
Invoice Link
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
+ $subject = "$company_name Invoice $invoice_prefix$invoice_number Receipt";
+ $body = "Hello $contact_name,
Please click on the link below to see your invoice regarding \"$invoice_scope\" marked paid.
Invoice Link
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
} else {
- $subject = "Invoice $invoice_prefix$invoice_number";
- $body = "Hello $contact_name,
Please view the details of the invoice below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Balance Due: " . numfmt_format_currency($currency_format, $balance, $invoice_currency_code) . "
Due Date: $invoice_due
To view your invoice click here
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
+ $subject = "$company_name Invoice $invoice_prefix$invoice_number";
+ $body = "Hello $contact_name,
Please view the details of your invoice regarding \"$invoice_scope\" below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: " . numfmt_format_currency($currency_format, $invoice_amount, $invoice_currency_code) . "
Balance Due: " . numfmt_format_currency($currency_format, $balance, $invoice_currency_code) . "
Due Date: $invoice_due
To view your invoice, please click here.
--
$company_name - Billing
$config_invoice_from_email
$company_phone";
}
// Queue Mail
@@ -1007,7 +1007,7 @@
'body' => $body
]
];
-
+
addToMailQueue($mysqli, $data);
// Get Email ID for reference
@@ -1172,10 +1172,10 @@
// Email to client
- $subject = "Invoice $invoice_prefix$invoice_number";
- $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 click here
--
$company_name - Billing
$company_phone";
+ $subject = "$company_name Invoice $invoice_prefix$invoice_number";
+ $body = "Hello $contact_name,
An invoice regarding \"$invoice_scope\" has been generated. Please view the details below.
Invoice: $invoice_prefix$invoice_number
Issue Date: $invoice_date
Total: $$invoice_amount
Due Date: $invoice_due
To view your invoice, please click here.
--
$company_name - Billing
$company_phone";
+
-
$data = [
[
'from' => $config_invoice_from_email,
@@ -1338,7 +1338,7 @@
if (isset($_POST['update_recurring_item_order'])) {
-
+
$item_id = intval($_POST['item_id']);
$item_recurring_id = intval($_POST['item_recurring_id']);
@@ -1373,7 +1373,7 @@
}
if (isset($_POST['update_invoice_item_order'])) {
-
+
$item_id = intval($_POST['item_id']);
$item_invoice_id = intval($_POST['item_invoice_id']);
diff --git a/post/ticket.php b/post/ticket.php
index da61816fe..d0cdd1834 100644
--- a/post/ticket.php
+++ b/post/ticket.php
@@ -663,7 +663,7 @@
$data = [];
$subject = "Ticket closed - [$ticket_prefix$ticket_number] - $ticket_subject | (do not reply)";
- $body = "Hello $contact_name,
Your ticket regarding \"$ticket_subject\" has been closed.
$details
We hope the issue was resolved to your satisfaction. If you need further assistance, please raise a new ticket using the below details. Please do not reply to this email.
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Portal: https://$base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
+ $body = "Hello $contact_name,
Your ticket regarding \"$ticket_subject\" has been closed.
$details
We hope the request/issue was resolved to your satisfaction. If you need further assistance, please raise a new ticket using the below details. Please do not reply to this email.
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Portal: https://$base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
// Email Ticket Contact
// Queue Mail
@@ -910,10 +910,10 @@
if ($ticket_status == 'Closed') {
$subject = "Ticket closed - [$ticket_prefix$ticket_number] - $ticket_subject | (do not reply)";
- $body = "Hello $contact_name,
Your ticket regarding $ticket_subject has been closed.
--------------------------------
$ticket_reply
--------------------------------
We hope the issue was resolved to your satisfaction. If you need further assistance, please raise a new ticket using the below details. Please do not reply to this email.
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
+ $body = "Hello $contact_name,
Your ticket regarding $ticket_subject has been closed.
--------------------------------
$ticket_reply
--------------------------------
We hope the request/issue was resolved to your satisfaction. If you need further assistance, please raise a new ticket using the below details. Please do not reply to this email.
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
} elseif ($ticket_status == 'Auto Close') {
$subject = "Ticket update - [$ticket_prefix$ticket_number] - $ticket_subject | (pending closure)";
- $body = "##- Please type your reply above this line -##
Hello $contact_name,
Your ticket regarding $ticket_subject has been updated and is pending closure.
--------------------------------
$ticket_reply
--------------------------------
If your issue is resolved, you can ignore this email. If you need further assistance, please respond!
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Status: $ticket_status
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
+ $body = "##- Please type your reply above this line -##
Hello $contact_name,
Your ticket regarding $ticket_subject has been updated and is pending closure.
--------------------------------
$ticket_reply
--------------------------------
If your request/issue is resolved, you can simply ignore this email. If you need further assistance, please respond to let us know!
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Status: $ticket_status
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
} else {
$subject = "Ticket update - [$ticket_prefix$ticket_number] - $ticket_subject";
$body = "##- Please type your reply above this line -##
Hello $contact_name,
Your ticket regarding $ticket_subject has been updated.
--------------------------------
$ticket_reply
--------------------------------
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Status: $ticket_status
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
@@ -1136,7 +1136,7 @@
$data = [];
$subject = "Ticket closed - [$ticket_prefix$ticket_number] - $ticket_subject | (do not reply)";
- $body = "Hello $contact_name,
Your ticket regarding \"$ticket_subject\" has been closed.
We hope the issue was resolved to your satisfaction. If you need further assistance, please raise a new ticket using the below details. Please do not reply to this email.
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
+ $body = "Hello $contact_name,
Your ticket regarding \"$ticket_subject\" has been closed.
We hope the request/issue was resolved to your satisfaction. If you need further assistance, please raise a new ticket using the below details. Please do not reply to this email.
Ticket: $ticket_prefix$ticket_number
Subject: $ticket_subject
Portal: https://$config_base_url/portal/ticket.php?id=$ticket_id
--
$company_name - Support
$config_ticket_from_email
$company_phone";
// Email Ticket Contact
// Queue Mail
diff --git a/ticket.php b/ticket.php
index f42c7e1cb..1f8859f95 100644
--- a/ticket.php
+++ b/ticket.php
@@ -58,6 +58,11 @@
$ticket_billable = intval($row['ticket_billable']);
$ticket_scheduled_for = nullable_htmlentities($row['ticket_schedule']);
$ticket_onsite = nullable_htmlentities($row['ticket_onsite']);
+ if (empty($ticket_scheduled_for)) {
+ $ticket_scheduled_wording = "Add";
+ } else {
+ $ticket_scheduled_wording = "$ticket_scheduled_for";
+ }
//Set Ticket Badge Color based of priority
if ($ticket_priority == "High") {
@@ -627,28 +632,39 @@
+ 0) { ?>
+