From 82e9c0e81484b3cbda55e7a9bd2dc0b66fc9ca72 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 9 Mar 2018 18:39:46 +0530 Subject: [PATCH] course details changes done --- .../application/models/Fees_status_model.php | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 8cf2f985..37aca292 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -394,8 +394,9 @@ class Fees_status_model extends CI_Model * created by kms * */ - public function updateFees($feesPaidDetails=null) + public function updateFees($feesPaidDetails=null,$courseID=null) { + if($feesPaidDetails['UpdatedBy']=='All'){ $this->db->select('BranchID'); $this->db->where('FeesID', $feesPaidDetails['FeesId']); @@ -406,6 +407,9 @@ class Fees_status_model extends CI_Model } + // $this->entryForAllStatus($feesPaidDetails,$courseID); + // die(); + $this->db->select('BillNO'); $this->db->where('UpdatedBy', $feesPaidDetails['UpdatedBy']); @@ -433,7 +437,7 @@ class Fees_status_model extends CI_Model $this->db->select('ReceiptNo'); $this->db->where('ReceiptNo', $feesPaidDetails['ReceiptNo']); - if($this->db->get(STUDENTS_FEES_PAID)->first_row()){ + if($this->db->get(STUDENTS_FEES_PAID)->first_row() AND $feesPaidDetails['ReceiptNo']!=''){ $result['paidStatus'] = false; $result['message'] = "This receipt number is already exist!"; } @@ -446,11 +450,15 @@ class Fees_status_model extends CI_Model $feesPayedID = $this->db->insert_id(); // $entryOfCallTrack = $this->updateInCallTrack($trackDetails); // day book entry + if($feesPaidDetails['BillAmount']!='0'){ $dayBookEntry = $this->insertDayBookMaster($feesPaidDetails,$feesPayedID); } + // Entry for all status screen except fees + + } else{ @@ -1551,6 +1559,44 @@ class Fees_status_model extends CI_Model } } + /* + * Entry for all status update + * created by kms + * */ + public function entryForAllStatus($feesDetails=null,$courseID=null){ + $singleFeesDetails=["SEM1","SEM2","SEM3","SEM4","SEM5","SEM6","SEM7","SEM8"]; + $this->db->select('SFS.FeesID'); + $this->db->from(STUDENTS_FEES_PAID.' as SFP'); + $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFS.FeesID = SFP.FeesId'); + $this->db->where('SFS.CourseID',$courseID); + $this->db->where('SFS.StudentID',$feesDetails['StudentID']); + $existDetails = $this->db->get(); + if($existDetails->result()){ + return true; + } + else{ + $this->db->select('ID,FeesType,ProgramType'); + $this->db->where('CourseID',$courseID); + $getFeesTypeDetails = $this->db->get(COURSE_FEES); + + if($getFeesTypeDetails->result()){ + foreach ($getFeesTypeDetails->result() as $row){ + if($row->ProgramType==REGULARFEES OR $row->ProgramType==LATERALFEES){ + $insertDetails['StudentID']=$feesDetails['StudentID']; + $insertDetails['CourseID']=$row->ID; + $insertDetails['BranchCode']=""; + $insertDetails['ListCode']=""; + $insertDetails['StudentID']=""; + + } + + } + + } + + } + + } } \ No newline at end of file