diff --git a/post/invoice.php b/post/invoice.php index 6b74699f..435383ee 100644 --- a/post/invoice.php +++ b/post/invoice.php @@ -686,14 +686,14 @@ if (isset($_POST['add_payment'])) { 'body' => $body ]; - $email_data = $email; + $email_data[] = $email; // Get Email ID for reference $email_id = mysqli_insert_id($mysqli); // Email Logging - $_SESSION['alert_message'] .= "Email receipt sent "; + $_SESSION['alert_message'] = "Email receipt sent "; mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Emailed Receipt!', history_invoice_id = $invoice_id"); @@ -719,7 +719,7 @@ if (isset($_POST['add_payment'])) { 'body' => $body ]; - $email_data = $email; + $email_data[] = $email; // Get Email ID for reference $email_id = mysqli_insert_id($mysqli); @@ -736,7 +736,7 @@ if (isset($_POST['add_payment'])) { // Add emails to queue if (!empty($email)) { - addToMailQueue($mysqli, $email); + addToMailQueue($mysqli, $email_data); } //Update Invoice Status diff --git a/ticket_invoice_add_modal.php b/ticket_invoice_add_modal.php index e219564c..d3de8af3 100644 --- a/ticket_invoice_add_modal.php +++ b/ticket_invoice_add_modal.php @@ -121,10 +121,13 @@ $addToExistingInvoice = isset($_GET['ticket_id']) && isset($_GET['invoice_id']); $invoice_due = nullable_htmlentities($row['invoice_due']); $invoice_amount = floatval($row['invoice_amount']); + if (isset($invoice_id)) { ?> - - + @@ -150,7 +153,9 @@ $addToExistingInvoice = isset($_GET['ticket_id']) && isset($_GET['invoice_id']);