diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index f8351bb4..6ec5b605 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -167,7 +167,7 @@ $route['getStudentListFees'] = 'Fees_Status_Controller/getStudentList'; $route['getStudentFeesStructure'] = 'Fees_Status_Controller/getFeesStructure'; $route['getStudentFeesAssign'] = 'Fees_Status_Controller/getFeesStructureAssign'; $route['setFeesForStudent'] = 'Fees_Status_Controller/setFeesForStudent'; - +$route['deleteSetFeesDetails'] = 'Fees_Status_Controller/deleteSetFeesDetails'; /*update fees details for student*/ $route['updateFeesDetails'] = 'Fees_Status_Controller/updateFeesDetails'; $route['getUniversityCourseForFees'] = 'Fees_Status_Controller/getUniversityCourseForFees'; diff --git a/Apollo/api/application/models/Course_model.php b/Apollo/api/application/models/Course_model.php index 178bd819..fb8b796c 100755 --- a/Apollo/api/application/models/Course_model.php +++ b/Apollo/api/application/models/Course_model.php @@ -52,7 +52,7 @@ class Course_model extends CI_Model { } else{ $this -> db -> where('CourseCode', $arrayDetails['CourseCode']); - $this -> db -> delete('COURSE'); + $this -> db -> delete(COURSE); $result['courseStatus'] = false; $result['message'] = "Something went wrong.please try again"; } diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 70705f64..0ed74255 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -739,17 +739,20 @@ class Fees_status_model extends CI_Model $result_array['feesStatus']=true; foreach ($feesDetails->result() as $row){ $SNoValue=$SNoValue+1; - $this->db->select('SFS.FeesID,SFS.CourseFees,SFS.Comments,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFS.BatchCode,SM.SessionName as MasterSessionName,SM1.SessionName as MasterToSessionName'); + $this->db->select('SFS.FeesID,SFS.CourseFees,SFS.Comments,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFS.BatchCode,SM.SessionName as MasterSessionName,SM1.SessionName as MasterToSessionName,SFP.ID as FeesPaidID'); $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); $this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName'); $this->db->join(SESSIONMASTER.' as SM1', 'SM1.SessionID = SFS.ToSessionName','left'); - $this->db->where('StudentID',$student['StudentID']); - $this->db->where('CourseID',$student['CourseID']); - $this->db->where('FeesType',$row->ID); + $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID','left'); + $this->db->where('SFS.StudentID',$student['StudentID']); + $this->db->where('SFS.CourseID',$student['CourseID']); + $this->db->where('SFS.FeesType',$row->ID); $existFeesDetails = $this->db->get(); if($existData=$existFeesDetails->result()){ $fetchData['SNo']=$SNoValue; $fetchData['ExistValue']=1; + $fetchData['FeesPaidID']=$existData[0]->FeesPaidID; + $fetchData['FeesAssignID']=$existData[0]->FeesID; $fetchData['ID']=$row->ID; $fetchData['CourseID']=$row->CourseID; $fetchData['ProgramType']=$row->ProgramType; @@ -798,6 +801,8 @@ class Fees_status_model extends CI_Model else{ $fetchData['SNo']=$SNoValue; $fetchData['ExistValue']=0; + $fetchData['FeesPaidID']=""; + $fetchData['FeesAssignID']=""; $fetchData['ID']=$row->ID; $fetchData['CourseID']=$row->CourseID; $fetchData['ProgramType']=$row->ProgramType; @@ -1005,15 +1010,18 @@ class Fees_status_model extends CI_Model // default course fees details in student status foreach ($myArray as $row1){ - $this->db->select('FeesID,CourseFees,STFOrWR,Waiver,Comments,Others,SessionName,ToSessionName,RollNo'); - $this->db->where('StudentID',$student['StudentID']); - $this->db->where('CourseID',$student['CourseID']); - $this->db->where('FeesType',$row1['Sem_Year']); - $existFeesDetails = $this->db->get(STUDENTS_FEES_STATUS); - + $this->db->select('SFS.FeesID,SFS.CourseFees,SFS.STFOrWR,SFS.Waiver,SFS.Comments,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFP.ID as FeesPaidID'); + $this->db->where('SFS.StudentID',$student['StudentID']); + $this->db->where('SFS.CourseID',$student['CourseID']); + $this->db->where('SFS.FeesType',$row1['Sem_Year']); + $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); + $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID','left'); + $existFeesDetails = $this->db->get(); if($existData=$existFeesDetails->result()){ $fetchData['Valid']=$valid; $fetchData['ExistValue']=1; + $fetchData['FeesPaidID']=$existData[0]->FeesPaidID; + $fetchData['FeesAssignID']=$existData[0]->FeesID; $fetchData['ID']=$row1['Sem_Year']; $fetchData['CourseID']=$row1['CourseID']; $fetchData['ProgramType']=$row1['Sem_Year']; @@ -1049,9 +1057,9 @@ class Fees_status_model extends CI_Model $fetchData['Valid']=$valid; $fetchData['ExistValue']=0; - + $fetchData['FeesPaidID']=""; + $fetchData['FeesAssignID']=""; $fetchData['ID']=$row1['Sem_Year']; - $fetchData['CourseID']=$row1['CourseID']; $fetchData['Sem_Year']=$row1['Sem_Year']; $fetchData['ActualFees']=$row1['ActualFees']; @@ -1741,6 +1749,26 @@ class Fees_status_model extends CI_Model } return $result; } + /*delete set fees details + created by kms + */ + public function deleteSetFees($details=null){ + $this->db->where('FeesID', $details['FeesID']); + $this->db->delete(FEES_INSTALLMENT); + if ($this->db->affected_rows() >= '1') { + $this->db->where('FeesID', $details['FeesID']); + $this->db->delete(STUDENTS_FEES_STATUS); + $result['deleteStatus']=true; + $result['message']="Successfully Fees Details Deleted"; + } + else{ + $result['deleteStatus']=false; + $result['message']="Something went wrong.please try again"; + } + return $result; + + + } } \ No newline at end of file diff --git a/Apollo/assets/js/controllers/feesStatusCtrl.js b/Apollo/assets/js/controllers/feesStatusCtrl.js index 6d26f6cb..9cd324d7 100755 --- a/Apollo/assets/js/controllers/feesStatusCtrl.js +++ b/Apollo/assets/js/controllers/feesStatusCtrl.js @@ -199,6 +199,42 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n } + /* + * Delete set fees for student + * */ + $scope.deleteSetFees = function (masterDetails,p) { + SweetAlert.swal({ + title: "Warning!", + text: "Want to delete "+p.Sem_Year+" Fees ?", + type: "warning", + showCancelButton: true, + confirmButtonColor: "#d43f3a", + confirmButtonText: "Yes!" + }, function (res) { + if (res === true) { + var deleteSetFees = { + method: 'POST', + url: apiPoint.url + 'deleteSetFeesDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + feesAssignID: p.FeesAssignID, + requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID, + branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, + } + }; + $http(deleteSetFees).then(function (response) { + if (response.data.deleteStatus == true) { + $scope.getStudentSetFees(masterDetails.ID,masterDetails.CourseID,masterDetails.StudentID); + swal(" ", response.data.message, "success"); + } else { + swal(" ", response.data.message, "error"); + } + }); + } + }); + } /* * update total fees amount after change value diff --git a/Apollo/assets/views/status-update/setFeesForStudent.html b/Apollo/assets/views/status-update/setFeesForStudent.html index 2f810876..1c8bbec2 100755 --- a/Apollo/assets/views/status-update/setFeesForStudent.html +++ b/Apollo/assets/views/status-update/setFeesForStudent.html @@ -2,6 +2,12 @@ a { color: #ffffff; } + b.fa { + display: inline-block; + border-radius: 60px; + box-shadow: 0px 0px 2px #d43f3a; + padding: 0.5em 0.6em; + }