This commit is contained in:
dineshkumarkannan 2018-05-15 14:49:42 +05:30
commit f3f601a1ec
5 changed files with 93 additions and 14 deletions

View File

@ -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';

View File

@ -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";
}

View File

@ -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;
}
}

View File

@ -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

View File

@ -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;
}
</style>
<form name="Form" id="form" novalidate>
<div class="row">
@ -381,6 +387,7 @@
<th>Others</th>
<!-- <th>Waiver</th>-->
<th>Payable Fees</th>
<th></th>
</tr>
</thead>
@ -395,6 +402,14 @@
<td>{{p.Others}}</td>
<!-- <td>{{p.Waiver}}</td>-->
<td>{{p.PayableFees}}</td>
<td>
<a ng-if="p.FeesPaidID =='' || p.FeesPaidID ==null" class="text-red" id="deleteRowBtn{{p.ID}}" tooltip="Delete" ng-click="deleteSetFees(user,p);"><b class="fa fa-hover fa-trash " aria-hidden="true"></b>
</a>
<a ng-if="p.FeesPaidID !='' && p.FeesPaidID !=null">
&nbsp;
</a>
</td>
</tr>