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,