From 87a86803ee7410fd48eca0c7e821cc163d935b3f Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 21 Dec 2024 18:49:42 -0500 Subject: [PATCH] Added Recurring Payment Creation and Deletion and display in the recurring Invoice sections, still not operational need to add to cron --- client_recurring_invoices.php | 32 ++++++++++++-- post/user/invoice.php | 58 +++++++++++++++++++++++++ recurring_invoices.php | 25 ++++++++++- recurring_payment_add_modal.php | 77 +++++++++++++++++++++++++++++++++ 4 files changed, 187 insertions(+), 5 deletions(-) create mode 100644 recurring_payment_add_modal.php diff --git a/client_recurring_invoices.php b/client_recurring_invoices.php index 9395cb3d..bd0593bd 100644 --- a/client_recurring_invoices.php +++ b/client_recurring_invoices.php @@ -16,6 +16,7 @@ $sql = mysqli_query( $mysqli, "SELECT * FROM recurring LEFT JOIN categories ON recurring_category_id = category_id + LEFT JOIN recurring_payments ON recurring_payment_recurring_invoice_id = recurring_id WHERE recurring_client_id = $client_id AND (CONCAT(recurring_prefix,recurring_number) LIKE '%$q%' OR recurring_frequency LIKE '%$q%' OR recurring_scope LIKE '%$q%' OR category_name LIKE '%$q%') ORDER BY $sort $order LIMIT $record_from, $record_to"); @@ -104,6 +105,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); Category + + + Auto Pay + + Status @@ -140,6 +146,22 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); $status = "Inactive"; $status_badge_color = "secondary"; } + $recurring_payment_recurring_invoice_id = intval($row['recurring_payment_recurring_invoice_id']); + if ($recurring_payment_recurring_invoice_id) { + $auto_pay_display = " + Yes + + + + "; + } else { + $auto_pay_display = " + + Create + + "; + require "recurring_payment_add_modal.php"; + } ?> @@ -151,10 +173,11 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); + - - - + + +