From ae561d3195dd0bcfef609a648773e5176fda3aaf Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 25 Oct 2024 14:33:12 -0400 Subject: [PATCH] FEATURE: New Invoice Status Non-Billable --- cron.php | 1 + invoice.php | 11 +++++++++-- post/user/invoice.php | 16 ++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/cron.php b/cron.php index fa447ced..6766352d 100644 --- a/cron.php +++ b/cron.php @@ -438,6 +438,7 @@ if ($config_send_invoice_reminders == 1) { WHERE invoice_status != 'Draft' AND invoice_status != 'Paid' AND invoice_status != 'Cancelled' + AND invoice_status != 'Non-Billable' AND DATE_ADD(invoice_due, INTERVAL $day DAY) = CURDATE() ORDER BY invoice_number DESC" ); diff --git a/invoice.php b/invoice.php index 6bb4dd2c..c4b7d938 100644 --- a/invoice.php +++ b/invoice.php @@ -159,7 +159,7 @@ if (isset($_GET['invoice_id'])) {
- + @@ -181,6 +181,13 @@ if (isset($_GET['invoice_id'])) { Add Payment + + + + Mark Non-Billable + + +
@@ -238,7 +245,7 @@ if (isset($_GET['invoice_id'])) {
- +

Invoice

diff --git a/post/user/invoice.php b/post/user/invoice.php index 55042237..4ee1cf64 100644 --- a/post/user/invoice.php +++ b/post/user/invoice.php @@ -373,6 +373,22 @@ if (isset($_GET['mark_invoice_sent'])) { header("Location: " . $_SERVER["HTTP_REFERER"]); +} +if (isset($_GET['mark_invoice_non-billable'])) { + + $invoice_id = intval($_GET['mark_invoice_non-billable']); + + mysqli_query($mysqli,"UPDATE invoices SET invoice_status = 'Non-Billable' WHERE invoice_id = $invoice_id"); + + mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Non-Billable', history_description = 'INVOICE marked Non-Billable', history_invoice_id = $invoice_id"); + + //Logging + mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Invoice', log_action = 'Update', log_description = '$invoice_id marked Non-Billable', log_ip = '$session_ip', log_user_agent = '$session_user_agent', log_user_id = $session_user_id"); + + $_SESSION['alert_message'] = "Invoice marked Non-Billable"; + + header("Location: " . $_SERVER["HTTP_REFERER"]); + } if (isset($_GET['cancel_invoice'])) {