diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index b5fbd1b2..a264d4a1 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -114,6 +114,7 @@ class Fees_status_model extends CI_Model $this->db->select('ifnull(SUM((BillAmount)),0) as PaidBillAmount'); $this->db->where('FeesId',$row->FeesID); + $this->db->where('IsActive','1'); $paidBillAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); if($paidBillAmount[0]->PaidBillAmount > $fetchData['PayableFees']){ $fetchData['BalanceAmount']=0; @@ -206,6 +207,7 @@ class Fees_status_model extends CI_Model $this->db->select('ifnull(SUM((BillAmount)),0) as PaidBillAmount'); $this->db->where('FeesId', $row->FeesID); + $this->db->where('IsActive','1'); $paidBillAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); if ($paidBillAmount[0]->PaidBillAmount > $fetchData['PayableFees']) { $fetchData['BalanceAmount'] = 0; @@ -254,6 +256,7 @@ class Fees_status_model extends CI_Model $this->db->where('SFS.StudentID', $student['StudentID']); $this->db->where('STC.StudentID', $student['StudentID']); $this->db->where('SFP.StudentID', $student['StudentID']); + $this->db->where('SFP.IsActive','1'); $this->db->order_by('SFP.ID', 'DESC'); $getFeeDetails = $this->db->get(); if($getFeeDetails->result()){ @@ -285,6 +288,7 @@ class Fees_status_model extends CI_Model $storePaidDetails['UniveShortName'] = $feeRow->UniversityShortName; $this->db->select('ifnull(SUM((BillAmount)),0) as PaidBillAmount'); $this->db->where('FeesId',$feeRow->FeesID); + $this->db->where('IsActive','1'); $paidBillAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); $storePaidDetails['PaidBillAmount']=$paidBillAmount[0]->PaidBillAmount; @@ -300,6 +304,7 @@ class Fees_status_model extends CI_Model // sepearte for student waiver and referral bill list $this->db->select('ifnull(SUM((BillAmount)),0) as StudentWaiverRefAmount'); $this->db->where('FeesId',$feeRow->FeesID); + $this->db->where('IsActive','1'); $this->db->where_in('ModeOfPayment',$serachArray); $studentWaiverRefAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); @@ -307,6 +312,7 @@ class Fees_status_model extends CI_Model $this->db->select('ifnull(SUM((BillAmount)),0) as StudentPaidAmount'); $this->db->where('FeesId',$feeRow->FeesID); + $this->db->where('IsActive','1'); $this->db->where('ModeOfPayment !=',WAIVER); $this->db->where('ModeOfPayment !=',REFERRAL); $studentPaidAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); @@ -320,6 +326,7 @@ class Fees_status_model extends CI_Model $this->db->join(LOGIN.' as LO','LO.ID = SFP.CreatedBy'); $this->db->join(STAFF.' as STF','STF.StaffID = LO.StaffID'); $this->db->where('SFP.FeesId',$feeRow->FeesID); + $this->db->where('IsActive','1'); $this->db->order_by('SFP.ID',"ASC"); $this->db->group_by('SFP.BillNO'); $storePaidDetails['paidDetails']=$this->db->get()->result(); @@ -361,6 +368,7 @@ class Fees_status_model extends CI_Model $this->db->where('SFS.StudentID', $student['StudentID']); $this->db->where('STC.StudentID', $student['StudentID']); $this->db->where('SFP.StudentID', $student['StudentID']); + $this->db->where('SFP.IsActive','1'); $this->db->where_in('SFS.FeesType', $serachArray); $this->db->order_by('SFP.ID', 'DESC'); $getFeeDetails = $this->db->get(); @@ -387,6 +395,7 @@ class Fees_status_model extends CI_Model $storePaidDetails['UniveShortName'] = $feeRow->UniversityShortName; $this->db->select('ifnull(SUM((BillAmount)),0) as PaidBillAmount'); $this->db->where('FeesId',$feeRow->FeesID); + $this->db->where('IsActive','1'); $paidBillAmount = $this->db->get(STUDENTS_FEES_PAID)->result(); $storePaidDetails['PaidBillAmount']=$paidBillAmount[0]->PaidBillAmount; if($paidBillAmount[0]->PaidBillAmount > $storePaidDetails['PayableAmount']){ @@ -404,6 +413,7 @@ class Fees_status_model extends CI_Model $this->db->join(LOGIN.' as LO','LO.ID = SFP.CreatedBy'); $this->db->join(STAFF.' as STF','STF.StaffID = LO.StaffID'); $this->db->where('SFP.FeesId',$feeRow->FeesID); + $this->db->where('SFP.IsActive','1'); $this->db->order_by('SFP.ID',"ASC"); $this->db->group_by('SFP.BillNO'); $storePaidDetails['paidDetails']=$this->db->get()->result(); @@ -437,7 +447,6 @@ class Fees_status_model extends CI_Model } $this->db->select('BillNO'); $this->db->where('UpdatedBy', $feesPaidDetails['UpdatedBy']); - $getLastBillNo=$this->db->get(STUDENTS_FEES_PAID)->last_row(); if($getLastBillNo){ $strExplode= explode("-", $getLastBillNo->BillNO); @@ -925,6 +934,7 @@ class Fees_status_model extends CI_Model $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFS.FeesID = SFP.FeesId'); $this->db->where('SFS.CourseID',$student['CourseID']); $this->db->where('SFS.StudentID',$student['StudentID']); + $this->db->where('SFP.IsActive','1'); $paidAmount = $this->db->get()->result(); if($feesAmount[0]->CourseFees+$feesAmount[0]->STFOrWR+$feesAmount[0]->Others-$feesAmount[0]->Waiver <= $paidAmount[0]->PaidAmount AND $feesAmount[0]->CourseFees !='0'){ @@ -1238,6 +1248,7 @@ class Fees_status_model extends CI_Model $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'FIN.FeesID = SFS.FeesID'); $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = FIN.FeesID','left'); $this->db->where('FIN.DueDate',$tomorrowDATE); + $this->db->where('SFP.IsActive','1'); $getStudentDetails = $this->db->get(); if ($getStudentDetails->result()){ @@ -1247,6 +1258,7 @@ class Fees_status_model extends CI_Model $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFP.FeesId = SFS.FeesID'); $this->db->where('SFS.CourseID',$row->CourseID); $this->db->where('SFS.StudentID',$row->StudentID); + $this->db->where('SFP.IsActive','1'); $getStudentPaiDetails = $this->db->get()->result(); if($row->Amount > $getStudentPaiDetails[0]->BillAmount){ @@ -1263,6 +1275,7 @@ class Fees_status_model extends CI_Model $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'FIN.FeesID = SFS.FeesID'); $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = FIN.FeesID','left'); $this->db->where('FIN.DueDate',$afterFiveDays); + $this->db->where('SFP.IsActive','1'); $getStudentDetails1 = $this->db->get(); if ($getStudentDetails1->result()){ foreach ($getStudentDetails1->result() as $row1){ @@ -1271,6 +1284,7 @@ class Fees_status_model extends CI_Model $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFP.FeesId = SFS.FeesID'); $this->db->where('SFS.CourseID',$row1->CourseID); $this->db->where('SFS.StudentID',$row1->StudentID); + $this->db->where('SFP.IsActive','1'); $getStudentPaiDetails1 = $this->db->get()->result(); if($row1->Amount < $getStudentPaiDetails1[0]->BillAmount){ $this->smssend($row1->StudentID,$row1->DueDate); @@ -1289,6 +1303,7 @@ class Fees_status_model extends CI_Model $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'FIN.FeesID = SFS.FeesID'); $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = FIN.FeesID','left'); $this->db->where('FIN.DueDate',$preDATE); + $this->db->where('SFP.IsActive','1'); $getStudentDetails2 = $this->db->get(); if ($getStudentDetails2->result()){ foreach ($getStudentDetails2->result() as $row2){ @@ -1297,6 +1312,7 @@ class Fees_status_model extends CI_Model $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFP.FeesId = SFS.FeesID'); $this->db->where('SFS.CourseID',$row2->CourseID); $this->db->where('SFS.StudentID',$row2->StudentID); + $this->db->where('SFP.IsActive','1'); $getStudentPaiDetails2 = $this->db->get()->result(); if($row2->Amount > $getStudentPaiDetails2[0]->BillAmount){