From 5fd516972ae6ae2ea108c25fe9c7ad8d10aa4919 Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Wed, 20 Nov 2024 03:24:05 +0000 Subject: [PATCH] FIX_reimplement Renew flag copied from old code --- app/Controllers/Invoice.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index c5633380..d7a2ba5c 100755 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -538,6 +538,16 @@ public function create_or_update_subscription($invoice_id,$invoice_status, $msg_ if (count($result)>0){ $membership_id = $this->generate_membership_id(6); } + + $get_exists_subscription_where = ['S.customer_id' => (int)$customer_id, 'S.scheme_id' => $product_id, 'I.status' => 'Approved', 'I.isactive' => 1]; + $get_exists_subscription_dtls = $model->existsSubscriptionDetails($get_exists_subscription_where); + + // the scheme is already exists to the customer + if ($get_exists_subscription_dtls) { + $this->logger->info($msg_flag_name . ": This Scheme Already Existing in this Customer. "); + $renewal = 1; + } + // Prepare subscription data $subscription_data = [ 'customer_id' => $customer_id,