This commit is contained in:
resicovenba 2018-03-07 09:45:00 +05:30
commit bf65969406
7 changed files with 642 additions and 336 deletions

View File

@ -234,6 +234,7 @@ class Fees_Status_Controller extends REST_Controller {
$details['FeesType'] = $this->post('feesID');
$details['CourseFees'] = $this->post('courseAmount');
$details['SessionName'] = $this->post('session');
$details['ToSessionName'] = $this->post('sessionTo');
$details['RollNo'] = $this->post('rollNo');
$details['STFOrWR'] = $this->post('STFWR');
$details['Waiver'] = $this->post('waiver');

View File

@ -17,11 +17,11 @@ class Fees_status_model extends CI_Model
public function getStudentList($search=null)
{
if($search['MobileNumber']!='' OR $search['Firstname']!='' OR $search['UniversityID']!='' OR $search['CourseID']!=''){
$this->db->select('ST.StudentID,ST.MobileNumber,ST.Firstname,ST.Fathername,ST.EmailID,STC.ID,US.UniversityID,US.UniversityName,CU.CourseID,CU.CourseName,SM.SessionID,SM.SessionName');
$this->db->select('ST.StudentID,ST.MobileNumber,ST.Firstname,ST.Fathername,ST.EmailID,STC.ID,US.UniversityID,US.UniversityName,CU.CourseID,CU.CourseName');
$this->db->from(STUDENTS.' as ST');
$this->db->join(STUDENTCOURSE.' as STC', 'STC.StudentID = ST.StudentID');
$this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID');
$this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = STC.SessionID');
// $this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = STC.SessionID');
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = CU.UniversityID');
$this->db->where('ST.IsActive','1');
$this->db->where('STC.IsActive','1');
@ -80,8 +80,10 @@ class Fees_status_model extends CI_Model
public function getStudentFeesStructure($student=null){
$this->db->select('CF.ID,CF.Sem_Year,SFS.FeesID,SFS.CourseID,SFS.CourseFees,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.RollNo,CU.PC,CU.TC,CU.DC,CU.MC,CU.OtherFees');
$this->db->select('CF.ID,CF.Sem_Year,CF.ProgramType,SFS.FeesID,SFS.CourseID,SFS.CourseFees,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.RollNo,CU.PC,CU.TC,CU.DC,CU.MC,CU.OtherFees,SM.SessionName as SessionName,SM1.SessionName as ToSessionName');
$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->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType');
$this->db->join(COURSE.' as CU', 'CU.CourseID = CF.CourseID');
$this->db->where('SFS.CourseID',$student['CourseID']);
@ -94,11 +96,19 @@ class Fees_status_model extends CI_Model
$fetchData['FeesID'] = $row->FeesID;
$fetchData['CourseID'] = $row->CourseID;
$fetchData['Sem_Year'] = $row->Sem_Year;
$fetchData['ProgramType'] = $row->ProgramType;
$fetchData['ActualFees'] = $row->CourseFees;
$fetchData['STFOrWR'] = $row->STFOrWR;
$fetchData['Waiver'] = $row->Waiver;
$fetchData['Others'] = $row->Others;
$fetchData['SessionName'] = $row->SessionName;
if($row->ToSessionName=='' OR $row->ToSessionName==null){
$fetchData['ToSessionName'] = "Not Applicable";
}
else{
$fetchData['ToSessionName'] = $row->ToSessionName;
}
$fetchData['RollNo'] = $row->RollNo;
$fetchData['PayableFees']=$row->CourseFees+$row->STFOrWR+$row->Others-$row->Waiver;
@ -183,11 +193,13 @@ class Fees_status_model extends CI_Model
$fetchData['FeesID'] = $row->FeesID;
$fetchData['CourseID'] = $row->CourseID;
$fetchData['Sem_Year'] = $row->FeesType;
$fetchData['ProgramType'] = $row->FeesType;
$fetchData['ActualFees'] = $row->CourseFees;
$fetchData['STFOrWR'] = $row->STFOrWR;
$fetchData['Waiver'] = $row->Waiver;
$fetchData['Others'] = $row->Others;
$fetchData['SessionName'] = $row->SessionName;
$fetchData['SessionName'] = "Not Applicable";
$fetchData['ToSessionName'] = "Not Applicable";
$fetchData['RollNo'] = $row->RollNo;
$fetchData['PayableFees'] = $row->CourseFees + $row->STFOrWR + $row->Others - $row->Waiver;
@ -225,9 +237,11 @@ class Fees_status_model extends CI_Model
public function existStudentFeesDetails($student=null){
$this->db->distinct();
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.SessionName,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others,ST.Firstname,ST.MobileNumber,ST.Fathername,CU.CourseName,CU.CourseID,CF.Sem_Year,STC.EnrollmentID,US.UniversityName');
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others,ST.Firstname,ST.MobileNumber,ST.Fathername,CU.CourseName,CU.CourseID,CF.Sem_Year,STC.EnrollmentID,US.UniversityName,SM.SessionName,SM1.SessionName as ToSessionName,CF.ProgramType');
$this->db->from(STUDENTS_FEES_PAID.' as SFP');
$this->db->join(STUDENTS_FEES_STATUS.' as SFS','SFP.FeesId = SFS.FeesID');
$this->db->join(SESSIONMASTER.' as SM', 'SM.SessionID = SFS.SessionName');
$this->db->join(SESSIONMASTER.' as SM1', 'SM1.SessionID = SFS.ToSessionName','left');
$this->db->join(STUDENTS.' as ST', 'ST.StudentID = SFS.StudentID');
$this->db->join(COURSE.' as CU', 'CU.CourseID = SFS.CourseID');
$this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType');
@ -244,7 +258,15 @@ class Fees_status_model extends CI_Model
$storePaidDetails['FeesID'] = $feeRow->FeesID;
$storePaidDetails['FeesName'] = $feeRow->Sem_Year;
$storePaidDetails['CourseFees'] = $feeRow->CourseFees;
$storePaidDetails['ProgramType'] = $feeRow->ProgramType;
$storePaidDetails['SessionName'] = $feeRow->SessionName;
if($feeRow->ToSessionName=='' OR $feeRow->ToSessionName==null){
$storePaidDetails['ToSessionName'] = "Not Applicable";
}
else{
$storePaidDetails['ToSessionName'] = $feeRow->ToSessionName;
}
$storePaidDetails['RollNo'] = $feeRow->RollNo;
$storePaidDetails['STFOrWR'] = $feeRow->STFOrWR;
$storePaidDetails['Waiver'] = $feeRow->Waiver;
@ -302,7 +324,7 @@ class Fees_status_model extends CI_Model
public function existStudentCourseDefaultFees($student=null){
$serachArray = ["PC","TC","DC","MC","OTHER"];
$this->db->distinct();
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.SessionName,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others,ST.Firstname,ST.MobileNumber,ST.Fathername,CU.CourseName,CU.CourseID,STC.EnrollmentID,US.UniversityName');
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others,ST.Firstname,ST.MobileNumber,ST.Fathername,CU.CourseName,CU.CourseID,STC.EnrollmentID,US.UniversityName');
$this->db->from(STUDENTS_FEES_PAID.' as SFP');
$this->db->join(STUDENTS_FEES_STATUS.' as SFS','SFP.FeesId = SFS.FeesID');
$this->db->join(STUDENTS.' as ST', 'ST.StudentID = SFS.StudentID');
@ -321,8 +343,10 @@ class Fees_status_model extends CI_Model
foreach ($getFeeDetails->result() as $feeRow){
$storePaidDetails['FeesID'] = $feeRow->FeesID;
$storePaidDetails['FeesName'] = $feeRow->FeesType;
$storePaidDetails['ProgramType'] = $feeRow->FeesType;
$storePaidDetails['CourseFees'] = $feeRow->CourseFees;
$storePaidDetails['SessionName'] = $feeRow->SessionName;
$storePaidDetails['SessionName'] = "Not Applicable";
$storePaidDetails['ToSessionName'] = "Not Applicable";
$storePaidDetails['RollNo'] = $feeRow->RollNo;
$storePaidDetails['STFOrWR'] = $feeRow->STFOrWR;
$storePaidDetails['Waiver'] = $feeRow->Waiver;
@ -639,20 +663,26 @@ class Fees_status_model extends CI_Model
$this->db->where('CourseID',$student['CourseID']);
$this->db->order_by('ProgramType');
$feesDetails = $this->db->get(COURSE_FEES);
$SNoValue=0;
if($feesDetails->result()){
$result_array['feesStatus']=true;
foreach ($feesDetails->result() as $row){
$this->db->select('FeesID,CourseFees, STFOrWR,Waiver,Others,SessionName,RollNo,BatchCode');
$SNoValue=$SNoValue+1;
$this->db->select('SFS.FeesID,SFS.CourseFees,SFS.STFOrWR,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.ToSessionName,SFS.RollNo,SFS.BatchCode,SM.SessionName as MasterSessionName,SM1.SessionName as MasterToSessionName');
$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);
$existFeesDetails = $this->db->get(STUDENTS_FEES_STATUS);
$existFeesDetails = $this->db->get();
if($existData=$existFeesDetails->result()){
$fetchData['SNo']=$SNoValue;
$fetchData['ExistValue']=1;
$fetchData['ID']=$row->ID;
$fetchData['CourseID']=$row->CourseID;
$fetchData['ProgramType']=$row->ProgramType;
$fetchData['Sem_Year']=$row->Sem_Year;
$fetchData['ActualFees']=$existData[0]->CourseFees;
$fetchData['BatchCode']=$existData[0]->BatchCode;
@ -660,6 +690,15 @@ class Fees_status_model extends CI_Model
$fetchData['Waiver']=$existData[0]->Waiver;
$fetchData['Others']=$existData[0]->Others;
$fetchData['SessionName']=$existData[0]->SessionName;
$fetchData['ToSessionName']=$existData[0]->ToSessionName;
$fetchData['MasterSessionName']=$existData[0]->MasterSessionName;
if($existData[0]->MasterToSessionName=='' OR $existData[0]->MasterToSessionName==null){
$fetchData['MasterToSessionName']="Not Applicable";
}
else{
$fetchData['MasterToSessionName']=$existData[0]->MasterToSessionName;
}
$fetchData['RollNo']=$existData[0]->RollNo;
$fetchData['PayableFees']=$existData[0]->CourseFees+$existData[0]->STFOrWR+$existData[0]->Others-$existData[0]->Waiver;
// for installment details
@ -686,10 +725,11 @@ class Fees_status_model extends CI_Model
}
else{
$fetchData['SNo']=$SNoValue;
$fetchData['ExistValue']=0;
$fetchData['ID']=$row->ID;
$fetchData['CourseID']=$row->CourseID;
$fetchData['ProgramType']=$row->ProgramType;
$fetchData['Sem_Year']=$row->Sem_Year;
$fetchData['ActualFees']=$row->FeesAmount;
$fetchData['BatchCode']="";
@ -697,6 +737,9 @@ class Fees_status_model extends CI_Model
$fetchData['Waiver']="";
$fetchData['Others']="";
$fetchData['SessionName']="";
$fetchData['ToSessionName']="";
$fetchData['MasterSessionName']="Not Applicable";
$fetchData['MasterToSessionName']="Not Applicable";
$fetchData['RollNo']="";
$fetchData['PayableFees']=$row->FeesAmount;
// for installment details
@ -731,6 +774,8 @@ class Fees_status_model extends CI_Model
$result_array['feesStatus']=false;
}
$result_array['sessionDetails'] = $this->getSession($student);
return $result_array;
}
@ -859,7 +904,7 @@ 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,Others,SessionName,RollNo');
$this->db->select('FeesID,CourseFees,STFOrWR,Waiver,Others,SessionName,ToSessionName,RollNo');
$this->db->where('StudentID',$student['StudentID']);
$this->db->where('CourseID',$student['CourseID']);
$this->db->where('FeesType',$row1['Sem_Year']);
@ -869,12 +914,16 @@ class Fees_status_model extends CI_Model
$fetchData['ExistValue']=1;
$fetchData['ID']=$row1['Sem_Year'];
$fetchData['CourseID']=$row1['CourseID'];
$fetchData['ProgramType']=$row1['Sem_Year'];
$fetchData['Sem_Year']=$row1['Sem_Year'];
$fetchData['ActualFees']=$existData[0]->CourseFees;
$fetchData['STFOrWR']=$existData[0]->STFOrWR;
$fetchData['Waiver']=$existData[0]->Waiver;
$fetchData['Others']=$existData[0]->Others;
$fetchData['SessionName']=$existData[0]->SessionName;
$fetchData['ToSessionName']=$existData[0]->ToSessionName;
$fetchData['MasterSessionName']="Not applicable";
$fetchData['MasterToSessionName']="Not applicable";
$fetchData['RollNo']=$existData[0]->RollNo;
$fetchData['PayableFees']=$existData[0]->CourseFees+$existData[0]->STFOrWR+$existData[0]->Others-$existData[0]->Waiver;
// for installment details
@ -904,7 +953,10 @@ class Fees_status_model extends CI_Model
$fetchData['STFOrWR']="";
$fetchData['Waiver']="";
$fetchData['Others']="";
$fetchData['SessionName']="Nill";
$fetchData['SessionName']="Not applicable";
$fetchData['ToSessionName']="Not applicable";
$fetchData['MasterSessionName']="Not applicable";
$fetchData['MasterToSessionName']="Not applicable";
$fetchData['RollNo']="";
$fetchData['PayableFees']=$row1['ActualFees'];
$fetchData['InstallmentDetails']="";
@ -941,6 +993,7 @@ class Fees_status_model extends CI_Model
if($checkExist->result()){
$feesId = $checkExist->result();
$updateDetails['SessionName'] = $details['SessionName'];
$updateDetails['ToSessionName'] = $details['ToSessionName'];
$updateDetails['BatchCode'] = $details['BatchCode'];
$updateDetails['RollNo'] = $details['RollNo'];
$updateDetails['STFOrWR'] = $details['STFOrWR'];
@ -1036,6 +1089,8 @@ class Fees_status_model extends CI_Model
* created by kms
* */
public function insertDayBookMaster($data=null,$paymentID){
print_r($data);
die();
// this is for income entry
$insertArray['Date'] = $data['BillDate'];
$insertArray['CreatedBy'] = $data['CreatedBy'];
@ -1045,7 +1100,7 @@ class Fees_status_model extends CI_Model
$insertArray['Status'] = 'Approved';
$insertArray['PaymentStatus'] = false;
$insertArray['FeesPaymentID'] = $paymentID;
//$insertArray['Date'] = $data['BillDate'];
$insertArray['BranchCode'] = $data['UpdatedBy'];
$this->db->select('ID,TypeID');
@ -1439,5 +1494,32 @@ class Fees_status_model extends CI_Model
}
/*
* Get session master details
* created by kms
* */
public function getSession($details=null)
{
$this->db->select('SM.SessionID,SM.SessionDate,SM.SessionName,SM.IsActive');
$this->db->from(SESSIONMASTER.' as SM');
$this->db->join(SESSIONDETAILS.' as SD', 'SM.SessionID = SD.SessionID');
$this->db->join(UNIVERSITY.' as US', 'US.UniversityID = SD.UniversityID');
$this->db->join(COURSE.' as CU', 'CU.UniversityID = US.UniversityID');
// $this->db->where('SD.IsActive','1');
$this->db->order_by('CU.CreatedOn','DESC');
$this->db->where('CU.CourseID',$details['CourseID']);
// $this->db->group_by('SM.SessionName','DESC');
$sessionDetails = $this->db->get();
if($sessionDetails->result()){
return $sessionDetails->result();
}
else {
return false;
}
}
}

View File

@ -79,11 +79,11 @@ class Studentview_model extends CI_Model
* */
public function getStudentCourse($studentId=null){
$this->db->select('SCU.EnrollmentID,CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,SM.SessionName');
$this->db->select('SCU.EnrollmentID,CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName');
$this->db->from( STUDENTCOURSE . ' as SCU');
$this->db->join( COURSE . ' as CU', 'CU.CourseID = SCU.CourseID');
$this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID');
$this->db->join( SESSIONMASTER . ' as SM', 'SM.SessionID = SCU.SessionID');
// $this->db->join( SESSIONMASTER . ' as SM', 'SM.SessionID = SCU.SessionID');
$this->db->where('SCU.StudentID', $studentId);
$courseDetails = $this->db->get();
if($courseDetails->result()){
@ -93,7 +93,7 @@ class Studentview_model extends CI_Model
$fetchData['CourseName']=$row->CourseName;
$fetchData['UniversityID']=$row->UniversityID;
$fetchData['UniversityName']=$row->UniversityName;
$fetchData['SessionName']=$row->SessionName;
// $fetchData['SessionName']=$row->SessionName;
$fetchData['EnrollmentID']=$row->EnrollmentID;
// get student fees details
$fetchData['feesDetails']=$this->getStudentFeesDetails($studentId,$row->CourseID);
@ -123,8 +123,10 @@ class Studentview_model extends CI_Model
* */
public function getStudentFeesDetails($studentID=null,$courseID=null){
$this->db->distinct();
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.SessionName,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others,CF.Sem_Year,CF.FeesType as CourseFeesType');
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.RollNo,ifnull(SFS.CourseFees,0) as CourseFees,ifnull(SFS.STFOrWR,0) as STFOrWR,ifnull(SFS.Waiver,0) as Waiver,ifnull(SFS.Others,0) as Others,CF.Sem_Year,CF.FeesType as CourseFeesType,SM.SessionName,SM1.SessionName as ToSessionName');
$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->join(STUDENTS_FEES_PAID.' as SFP','SFP.FeesId = SFS.FeesID','left');
$this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType');
$this->db->where('SFS.CourseID', $courseID);
@ -137,6 +139,13 @@ class Studentview_model extends CI_Model
$storePaidDetails['FeesName'] = $feeRow->Sem_Year;
$storePaidDetails['CourseFees'] = $feeRow->CourseFees;
$storePaidDetails['SessionName'] = $feeRow->SessionName;
if($feeRow->ToSessionName=='' || $feeRow->ToSessionName==null){
$storePaidDetails['ToSessionName'] = "Not Applicable";
}
else{
$storePaidDetails['ToSessionName'] = $feeRow->ToSessionName;
}
$storePaidDetails['RollNo'] = $feeRow->RollNo;
$storePaidDetails['STFOrWR'] = $feeRow->STFOrWR;
$storePaidDetails['Waiver'] = $feeRow->Waiver;
@ -201,7 +210,8 @@ class Studentview_model extends CI_Model
$storePaidDetails['FeesID'] = $feeRow->FeesID;
$storePaidDetails['FeesName'] = $feeRow->FeesType;
$storePaidDetails['CourseFees'] = $feeRow->CourseFees;
$storePaidDetails['SessionName'] = $feeRow->SessionName;
$storePaidDetails['SessionName'] = "Not Applicable";
$storePaidDetails['ToSessionName'] = "Not Applicable";
$storePaidDetails['RollNo'] = $feeRow->RollNo;
$storePaidDetails['STFOrWR'] = $feeRow->STFOrWR;
$storePaidDetails['Waiver'] = $feeRow->Waiver;

View File

@ -198,6 +198,179 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
$scope.updateModel.billAmount = model.BalanceAmount;
}
/*
* change session details
* created by kms
* */
$scope.changeSessions = function (details) {
if(details.SessionName!=undefined && details.SessionName!=''){
$scope.sessionDetails=[];
$scope.sessionDetailsTo=[];
$scope.setModel.feesType.ToSessionName="";
if(details.ProgramType=='Y001' && details.SNo=='1'){
// get session details
var found = $filter('getById')($scope.masterSessionDetails, details.SessionName);
$scope.ExistSessionDate = new Date(found.SessionDate.substring(6,10)+'-'+found.SessionDate.substring(3,5)+'-'+found.SessionDate.substring(0,2));
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if((svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID)){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
});
}
else if(details.ProgramType=='Y001' && details.SNo!='1'){
if($scope.feesStructureInfo[0].SessionName!=''){
// get session details
var found = $filter('getById')($scope.masterSessionDetails, $scope.feesStructureInfo[0].SessionName);
$scope.ExistSessionDate = new Date(found.SessionDate.substring(6,10)+'-'+found.SessionDate.substring(3,5)+'-'+found.SessionDate.substring(0,2));
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if((svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID) && $scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
});
}
else{
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if(svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
});
}
}
else{
// get session details
var found = $filter('getById')($scope.masterSessionDetails, details.SessionName);
$scope.ExistSessionDate = new Date(found.SessionDate.substring(6,10)+'-'+found.SessionDate.substring(3,5)+'-'+found.SessionDate.substring(0,2));
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if(svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID || $scope.feesStructureInfo[0].ToSessionName==svalues.SessionID){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
if($scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetailsTo.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
}
});
}
}
else{
if(details.ProgramType=='Y001' && details.SNo!='1'){
$scope.sessionDetails=[];
$scope.sessionDetailsTo=[];
$scope.setModel.feesType.ToSessionName="";
if($scope.feesStructureInfo[0].SessionName!=''){
// get session details
var found = $filter('getById')($scope.masterSessionDetails, $scope.feesStructureInfo[0].SessionName);
$scope.ExistSessionDate = new Date(found.SessionDate.substring(6,10)+'-'+found.SessionDate.substring(3,5)+'-'+found.SessionDate.substring(0,2));
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if((svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID) && $scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
});
}
else{
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if(svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
});
}
}
else{
// get session details
var found = $filter('getById')($scope.masterSessionDetails, details.SessionName);
$scope.ExistSessionDate = new Date(found.SessionDate.substring(6,10)+'-'+found.SessionDate.substring(3,5)+'-'+found.SessionDate.substring(0,2));
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if(svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID || $scope.feesStructureInfo[0].ToSessionName==svalues.SessionID){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
if($scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetailsTo.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
}
});
}
}
}
@ -314,6 +487,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
}
angular.element('.ng-invalid[name=' + firstError + ']').focus();
} else {
/* if(isNaN(installment.date)){
$scope.pushDueDate1= $rootScope.lastInstallemtDate;
}
@ -339,69 +513,103 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
});
}*/
angular.forEach($rootScope.updateMoreItems, function (value, key) {
if(isNaN(value.DueDate)){
$scope.correctDate='';
}
else{
if(updateModel.Sem_Year!='TC' && updateModel.Sem_Year!='PC' && updateModel.Sem_Year!='DC' && updateModel.Sem_Year!='MC' && updateModel.Sem_Year!='OTHER'){
var checkTotamt=0;
$scope.convertGetDate2=new Date(value.DueDate).toDateString();
$scope.pushDueDate2 = $filter('date')(new Date($scope.convertGetDate2), 'dd-MM-yyyy');
$rootScope.updateMoreItems[key].DueDate=$scope.pushDueDate2;
}
});
$scope.ldloading5 = {};
angular.forEach($rootScope.updateMoreItems, function (value, key) {
checkTotamt=parseInt(checkTotamt)+parseInt(value.Amount);
$scope.ldloading5[loading.replace('-', '_')] = true;
if(isNaN(value.DueDate)){
$scope.correctDate='';
}
else{
$scope.convertGetDate2=new Date(value.DueDate).toDateString();
$scope.pushDueDate2 = $filter('date')(new Date($scope.convertGetDate2), 'dd-MM-yyyy');
$rootScope.updateMoreItems[key].DueDate=$scope.pushDueDate2;
}
});
if(parseInt($scope.setTotalAmount)<checkTotamt){
var statusUpdate=false;
swal("Please check total/installment amount ");
}
else if(parseInt($scope.setTotalAmount)>checkTotamt){
var statusUpdate=false;
swal("Please check total/installment amount ");
}
else if(parseInt($scope.setTotalAmount)==checkTotamt){
var statusUpdate=true;
}
}
else{
var statusUpdate=true;
}
if(statusUpdate==true){
$scope.setSessionTo="";
if(updateModel.ProgramType=='P001' || updateModel.ProgramType=='P002'){
$scope.setSessionTo=updateModel.ToSessionName;
}
var updateFees = {
method: 'POST',
url: apiPoint.url + 'setFeesForStudent/',
headers: {
'Content-Type': 'application/json'
},
data: {
studID: myModel.StudentID,
courseID:myModel.CourseID,
courseAmount:updateModel.ActualFees,
feesID: updateModel.ID,
STFWR:updateModel.STFOrWR,
waiver: updateModel.Waiver,
other: updateModel.Others,
session: updateModel.SessionName,
rollNo: updateModel.RollNo,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
installmentItems:$rootScope.updateMoreItems,
batchCode:updateModel.BatchCode,
$scope.ldloading5 = {};
}
};
$http(updateFees).then(function (response) {
if (response.data.status==200 && response.data.setStatus) {
$scope.ldloading5[loading.replace('-', '_')] = false;
swal("Success!", "Fees set successfully.", "success");
$scope.ldloading5[loading.replace('-', '_')] = true;
$scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID);
/*$scope.setModel = {
"feesType": "",
};*/
$scope.myModelInstallemt.ID="";
$scope.myModelInstallemt.name="";
$scope.myModelInstallemt.amount="";
$scope.myModelInstallemt.date="";
$rootScope.updateMoreItems=[];
$scope.setTotalAmount='';
form.$setPristine(true);
} else {
$scope.ldloading5[loading.replace('-', '_')] = false;
swal("Failed!", response.data.message, "error");
$rootScope.updateMoreItems.splice($scope.updateMoreItems.length-1);
// $scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID);
}
var updateFees = {
method: 'POST',
url: apiPoint.url + 'setFeesForStudent/',
headers: {
'Content-Type': 'application/json'
},
data: {
studID: myModel.StudentID,
courseID:myModel.CourseID,
courseAmount:updateModel.ActualFees,
feesID: updateModel.ID,
STFWR:updateModel.STFOrWR,
waiver: updateModel.Waiver,
other: updateModel.Others,
session: updateModel.SessionName,
sessionTo: $scope.setSessionTo,
rollNo: updateModel.RollNo,
createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
installmentItems:$rootScope.updateMoreItems,
batchCode:updateModel.BatchCode,
}
};
$http(updateFees).then(function (response) {
if (response.data.status==200 && response.data.setStatus) {
$scope.ldloading5[loading.replace('-', '_')] = false;
swal("Success!", "Fees set successfully.", "success");
$scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID);
/*$scope.setModel = {
"feesType": "",
};*/
$scope.myModelInstallemt.ID="";
$scope.myModelInstallemt.name="";
$scope.myModelInstallemt.amount="";
$scope.myModelInstallemt.date="";
$rootScope.updateMoreItems=[];
$scope.setTotalAmount='';
form.$setPristine(true);
} else {
$scope.ldloading5[loading.replace('-', '_')] = false;
swal("Failed!", response.data.message, "error");
$rootScope.updateMoreItems.splice($scope.updateMoreItems.length-1);
// $scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID);
}
});
}
});
}
};
/*
@ -460,9 +668,12 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
* */
$scope.feesStructureInfo="";
$scope.BatchDetails=[];
$scope.masterSessionDetails="";
$scope.sessionDetails=[];
$scope.getStudentSetFees = function (ID,courseID,studeID) {
$scope.BatchDetails=[];
$scope.sessionDetails=[];
$scope.sessionDetailsTo=[];
$scope.feesStructureInfo="";
$scope.myModelInstallemt.ID="";
$scope.myModelInstallemt.name="";
@ -486,6 +697,8 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
$http(setFees).then(function (response) {
if (response.data.status==200 && response.data.feesStatus) {
$scope.masterSessionDetails = response.data.sessionDetails;
$scope.feesStructureInfo=response.data.feesDetails;
$scope.setModel = {
"feesType": $scope.feesStructureInfo[0],
@ -507,6 +720,17 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
$scope.calculateInstallemnts($scope.feesStructureInfo[0],$scope.setTotalAmount,0,'1');
// get session details
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if(svalues.IsActive=='1'){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
});
}
@ -532,6 +756,36 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
}
$scope.setModel.feesType.BatchCode = $scope.feesStructureInfo[0].BatchCode;
$scope.ExistSessionDate="";
// get session details
var found = $filter('getById')($scope.masterSessionDetails, $scope.feesStructureInfo[0].SessionName);
$scope.ExistSessionDate = new Date(found.SessionDate.substring(6,10)+'-'+found.SessionDate.substring(3,5)+'-'+found.SessionDate.substring(0,2));
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if(svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID || $scope.feesStructureInfo[0].ToSessionName==svalues.SessionID){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
if($scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetailsTo.push({
"SessionName":svalues.SessionName +'('+svalues.SessionDate+')',
"SessionID":svalues.SessionID,
});
}
}
});
$scope.setModel.feesType.SessionName=$scope.feesStructureInfo[0].SessionName;
$scope.setModel.feesType.SessionNameTo=$scope.feesStructureInfo[0].ToSessionName;
}
$scope.dateValidations();
@ -553,8 +807,6 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
* */
$scope.changeBatch = function (Details) {
if(Details.InstallmentDetails != ''){
$scope.setFeesTotalAmount(Details,'2','2');
}
@ -747,7 +999,8 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
}
$scope.setTotalAmount= parseInt($scope.actFees) + parseInt($scope.stfFees) + parseInt($scope.othersFees) - parseInt($scope.wiverFees);
$scope.setModel.feesType.BatchCode = "Nill";
$scope.setModel.feesType.BatchCode = "Not applicable";
$scope.setModel.feesType.SessionName = "Not applicable";
$rootScope.updateMoreItems=[];
}
@ -1009,15 +1262,23 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
var exDatenew1;
var exDatenew2;
var exitPayAmt=parseInt(totAmt-other);
if(isNaN(moment($rootScope.updateMoreItems[position].DueDate))){
/* if(isNaN(moment($rootScope.updateMoreItems[position].DueDate))){
exDatenew1 = new Date($rootScope.updateMoreItems[position].DueDate.substring(6,10)+'-'+$rootScope.updateMoreItems[position].DueDate.substring(3,5)+'-'+$rootScope.updateMoreItems[position].DueDate.substring(0,2));
exDatenew1 = moment(exDatenew1);
}*/
if($rootScope.updateMoreItems[position].DueDate.length<=10){
exDatenew1 = new Date($rootScope.updateMoreItems[position].DueDate.substring(6,10)+'-'+$rootScope.updateMoreItems[position].DueDate.substring(3,5)+'-'+$rootScope.updateMoreItems[position].DueDate.substring(0,2));
exDatenew1 = moment(exDatenew1);
}
else{
exDatenew1 = moment($rootScope.updateMoreItems[position].DueDate);
}
if (exDatenew1 <= exBatchDate) {
if(type=='1'){
$scope.setTotalAmount = Math.round(parseInt(totAmt)-parseInt(other));
// $scope.setModel.feesType.Others = Math.round(parseInt(other));
@ -1041,7 +1302,9 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
existPercentage = Math.round(existPercentage / 10) * 10;
exitPayAmt = parseInt($scope.setTotalAmount)-parseInt(existPercentage);
if(position==0){
$rootScope.updateMoreItems[position].Amount = existPercentage;
}
else if(position==1){
$rootScope.updateMoreItems[position].Amount = exitPayAmt;
@ -1182,211 +1445,6 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
}
});
/* //start
var exDatenew1;
var exDatenew2;
var exitPayAmt=parseInt(totAmt-other);
if(isNaN(moment($rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].DueDate))){
exDatenew1 = new Date($rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].DueDate.substring(6,10)+'-'+$rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].DueDate.substring(3,5)+'-'+$rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].DueDate.substring(0,2));
exDatenew1 = moment(exDatenew1);
}
else{
exDatenew1 = moment($rootScope.updateMoreItems[$rootScope.updateMoreItems.length-1].DueDate);
}
if (exDatenew1 <= exBatchDate) {
if(type=='1'){
$scope.setTotalAmount = Math.round(parseInt(totAmt)-parseInt(other));
// $scope.setModel.feesType.Others = Math.round(parseInt(other));
$scope.setModel.feesType.Others = '';
}
else{
if(other==0){
$scope.setModel.feesType.Others = '';
$scope.setTotalAmount = Math.round(parseInt(totAmt)-parseInt(other));
}
else{
$scope.setTotalAmount = Math.round(parseInt(totAmt)-parseInt(other));
$scope.setModel.feesType.Others = '';
}
}
var existPercentage = Math.round($scope.setTotalAmount * 70 / 100);
existPercentage = Math.round(existPercentage / 10) * 10;
exitPayAmt = parseInt($scope.setTotalAmount)-parseInt(existPercentage);
$rootScope.updateMoreItems[0].Amount = existPercentage;
$rootScope.updateMoreItems[1].Amount = exitPayAmt;
if($rootScope.updateMoreItems.length>2){
angular.forEach($rootScope.updateMoreItems,function (values,key) {
if(key>=1 && $rootScope.updateMoreItems.length-1!=key){
var currentElementAmt = $rootScope.updateMoreItems[key].Amount;
var dividePrevElementAmt = Math.round(currentElementAmt * 50 / 100);
var divideNextElementAmt = parseInt(currentElementAmt)-parseInt(dividePrevElementAmt);
$rootScope.updateMoreItems[key].Amount = dividePrevElementAmt;
$rootScope.updateMoreItems[key+1].Amount = dividePrevElementAmt;
}
});
}
}
else if(exDatenew1 > exBatchDate){
var dayDiff = exDatenew1.diff(exBatchDate, 'days');
dayDiff = dayDiff+1;
var todatlFineAmt = 0;
var fineAmt1 = 0;
// var fineAmt2 = 0;
// var fineAmt3 = 0;
// var fineAmt4 = 0;
// var fineAmt5 = 0;
// var fineAmt6 = 0;
// var fineAmt7 = 0;
// var fineAmt8 = 0;
// var fineAmt9 = 0;
// var fineAmt10 = 0;
var fineAmt11 = 0;
var countDays = 0;
for (var k = 1; k <= dayDiff; k++) {
if (k <= 90) {
if (exitPayAmt <= 10000) {
fineAmt1 = 300;
}
else if ((exitPayAmt > 10000) && (exitPayAmt <= 20000)) {
fineAmt1 = 600;
}
else if (exitPayAmt > 30000) {
fineAmt1 = 900;
}
}
else {
countDays = countDays+1;
if (countDays<30) {
if(countDays==1){
fineAmt11 = parseInt(fineAmt11)+300;
}
}
else{
countDays=0;
}
}
/!* else if (k > 90) {
if (k > 90 && k <= 120) {
fineAmt2 = 300;
}
else if (k > 120 && k <= 150) {
fineAmt3 = 300;
}
else if (k > 150 && k <= 180) {
fineAmt4 = 300;
}
else if (k > 180 && k <= 210) {
fineAmt5 = 300;
}
else if (k > 210 && k <= 240) {
fineAmt6 = 300;
}
else if (k > 240 && k <= 270) {
fineAmt7 = 300;
}
else if (k > 270 && k <= 300) {
fineAmt8 = 300;
}
else if (k > 300 && k <= 330) {
fineAmt9 = 300;
}
else if (k > 330 && k <= 360) {
fineAmt10 = 300;
}
else {
countDays = countDays+1;
if (countDays<30) {
if(countDays==1){
fineAmt11 = parseInt(fineAmt11)+300;
}
// foo++;
}
else{
countDays=0;
}
}
}*!/
}
// todatlFineAmt = parseInt(fineAmt1) + parseInt(fineAmt2) + parseInt(fineAmt3) + parseInt(fineAmt4) + parseInt(fineAmt5) + parseInt(fineAmt6) + parseInt(fineAmt7) + parseInt(fineAmt8) + parseInt(fineAmt9) + parseInt(fineAmt10) + parseInt(fineAmt11);
todatlFineAmt = parseInt(fineAmt1) + parseInt(fineAmt11);
if(type1=='2'){
$scope.setTotalAmount = Math.round(parseInt(totAmt) -parseInt(other) + parseInt(todatlFineAmt));
$scope.setModel.feesType.Others = Math.round(parseInt(todatlFineAmt));
}
else{
$scope.setTotalAmount = Math.round(parseInt(totAmt));
if(other==0){
$scope.setModel.feesType.Others = '';
}
else{
$scope.setModel.feesType.Others = Math.round(parseInt(other));
}
}
exitPayAmt = parseInt($scope.setTotalAmount);
var existPercentage = Math.round(exitPayAmt * 70 / 100);
existPercentage = Math.round(existPercentage / 10) * 10;
exitPayAmt = parseInt(exitPayAmt)-parseInt(existPercentage);
$rootScope.updateMoreItems[0].Amount = existPercentage;
$rootScope.updateMoreItems[1].Amount = exitPayAmt;
if($rootScope.updateMoreItems.length>2){
angular.forEach($rootScope.updateMoreItems,function (values,key) {
if(key>=1 && $rootScope.updateMoreItems.length-1!=key){
var currentElementAmt = $rootScope.updateMoreItems[key].Amount;
var dividePrevElementAmt = Math.round(currentElementAmt * 50 / 100);
var divideNextElementAmt = parseInt(currentElementAmt)-parseInt(dividePrevElementAmt);
$rootScope.updateMoreItems[key].Amount = dividePrevElementAmt;
$rootScope.updateMoreItems[key+1].Amount = dividePrevElementAmt;
}
});
}
}
// end*/
}
}
@ -1431,35 +1489,88 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
}
/*
$scope.$watch('updateMoreItems', function (newValue, oldValue) {
// this is for watch function
/* $scope.$watch('updateMoreItems', function (newValue, oldValue) {
for (var i = 0; i < newValue.length; i++) {
if (newValue[i].Amount != oldValue[i].Amount) {
alert();
var currentValue=0;
var pastValue=0;
if(newValue[i].Amount>oldValue[i].Amount){
if(newValue[i].Amount>oldValue[i].Amount){
currentValue = parseInt(newValue[i].Amount)-oldValue[i].Amount;
}
else if(newValue[i].Amount<oldValue[i].Amount){
pastValue = oldValue[i].Amount-parseInt(newValue[i].Amount);
}
else if(newValue[i].Amount<oldValue[i].Amount){
pastValue = oldValue[i].Amount-parseInt(newValue[i].Amount);
}
else{
currentValue=0
pastValue=0;
}
else{
currentValue=0
pastValue=0;
}
console.log(currentValue);
console.log(pastValue);
}
}
//bla-bla-bla
}
}, true);*/
}, true);*/
$scope.changeInstallemtAmt = function (old,present,index) {
if($rootScope.updateMoreItems[index+1]!=undefined){
var currentValue=present;
var pastValue=old;
if(currentValue==undefined || currentValue==''){
var currentValue=0;
}
if(pastValue==undefined || pastValue==''){
pastValue=0;
}
if(currentValue!=0 && pastValue!=0){
if(parseInt(present)<=parseInt($scope.setTotalAmount)){
if(currentValue<=pastValue){
var diffVal1=parseInt(pastValue)-parseInt(currentValue);
$rootScope.updateMoreItems[index+1].Amount=parseInt($rootScope.updateMoreItems[index+1].Amount)+parseInt(diffVal1);
}
else if(pastValue<currentValue){
var diffVal2=parseInt(currentValue)-parseInt(pastValue);
if(diffVal2>$rootScope.updateMoreItems[index+1].Amount){
$rootScope.updateMoreItems[index+1].Amount=parseInt(diffVal2)-parseInt($rootScope.updateMoreItems[index+1].Amount);
}
else{
$rootScope.updateMoreItems[index+1].Amount=parseInt($rootScope.updateMoreItems[index+1].Amount)-parseInt(diffVal2);
}
}
}
else{
var diffVal3=parseInt(currentValue)-parseInt(pastValue);
// alert(diffVal3);
if(diffVal3>$rootScope.updateMoreItems[index].Amount){
$rootScope.updateMoreItems[index].Amount=parseInt(diffVal3)-parseInt($rootScope.updateMoreItems[index].Amount);
}
else{
$rootScope.updateMoreItems[index].Amount=parseInt($rootScope.updateMoreItems[index].Amount)-parseInt(diffVal3);
}
}
}
}
}
@ -1695,4 +1806,16 @@ app.filter('unique', function() {
return output;
};
});
app.filter('getById', function() {
return function(input, id) {
var i=0, len=input.length;
for (; i<len; i++) {
if (+input[i].SessionID == +id) {
return input[i];
}
}
return null;
}
});

View File

@ -107,7 +107,7 @@
<th>Mobile Number</th>
<th>University</th>
<th>Course</th>
<th>Session</th>
<!-- <th>Session</th>-->
<th>Action</th>
<th></th>
@ -119,7 +119,7 @@
<td><a tooltip="View Student" class="text-dark" ng-click="open(user);">{{user.MobileNumber}}</a></td>
<td>{{user.UniversityName}}</td>
<td>{{user.CourseName}}</td>
<td>{{user.SessionName}}</td>
<!-- <td>{{user.SessionName}}</td>-->
<td>
<input type="button" class="btn btn-info btn-xs btn-transparent tooltips" tooltip-placement="bottom" tooltip="Click To Set Fees" id="setRow{{user.ID}}" value="Set Fees" ng-click="setFees(user)">
</td>

View File

@ -21,7 +21,7 @@
<label>
Fees Type <span class="symbol required"></span>
</label>
<select class="form-control" name="setfeesType" tabindex="7" id="setfeesType" ng-change="changeInstallemt(setModel.feesType,Form);"
<select class="form-control" name="setfeesType" tabindex="7" id="setfeesType" ng-change="changeInstallemt(setModel.feesType,Form);changeSessions(setModel.feesType);"
ng-model="setModel.feesType"
ng-options="fees.Sem_Year for fees in feesStructureInfo"
required>
@ -60,23 +60,57 @@
<!--<span class="error text-small block"
ng-if="Form.batchCode.$dirty && Form.batchCode.$invalid">Batch is required</span>-->
</div>
<div class="col-md-3 form-group"
ng-class="{'has-error':Form.setsessionname.$dirty && Form.setsessionname.$invalid, 'has-success':Form.setsessionname.$valid}">
<label>
Session Name <span class="symbol required"></span>
ng-class="{'has-error':Form.setsessionname.$dirty && Form.setsessionname.$invalid, 'has-success':Form.setsessionname.$valid}" ng-if="setModel.feesType.Sem_Year!='TC' && setModel.feesType.Sem_Year!='PC' && setModel.feesType.Sem_Year!='DC' && setModel.feesType.Sem_Year!='MC' && setModel.feesType.Sem_Year!='OTHER'">
<label ng-if="setModel.feesType.ProgramType=='P001' || setModel.feesType.ProgramType=='P002'">
Session From <span class="symbol required"></span>
</label>
<label ng-if="setModel.feesType.ProgramType=='Y001'">
Session <span class="symbol required"></span>
</label>
<select class="form-control" name="setsessionname" tabindex="9" id="setsessionname"
ng-model="setModel.feesType.SessionName"
ng-options="sess.SessionID as sess.SessionName for sess in sessionDetails" ng-change="changeSessions(setModel.feesType);" ng-disabled="setModel.feesType.ExistValue=='1' && userType=='R002'"
required>
<option value=""> Select Session</option>
</select>
<span class="error text-small block"
ng-if="Form.setsessionname.$dirty && Form.setsessionname.$invalid">Session is required</span>
</div>
<div class="col-md-3 form-group"
ng-class="{'has-error':Form.settosessionname.$dirty && Form.settosessionname.$invalid, 'has-success':Form.settosessionname.$valid}" ng-if="setModel.feesType.ProgramType=='P001' || setModel.feesType.ProgramType=='P002'">
<label>
Session To <span class="symbol required"></span>
</label>
<select class="form-control" name="settosessionname" tabindex="9" id="settosessionname"
ng-model="setModel.feesType.ToSessionName"
ng-options="sess.SessionID as sess.SessionName for sess in sessionDetailsTo" ng-disabled="setModel.feesType.ExistValue=='1' && userType=='R002'"
required>
<option value=""> Select Session</option>
</select>
<span class="error text-small block"
ng-if="Form.settosessionname.$dirty && Form.settosessionname.$invalid">Session is required</span>
</div>
<div class="col-md-3 form-group"
ng-if="setModel.feesType.Sem_Year=='TC' || setModel.feesType.Sem_Year=='PC' || setModel.feesType.Sem_Year=='DC' || setModel.feesType.Sem_Year=='MC' || setModel.feesType.Sem_Year=='OTHER'">
<label>
Session
</label>
<!--<select class="form-control" name="setsessionname" tabindex="9" id="setsessionname"
ng-model="setModel.feesType.SessionName"
ng-options="sess.SessionID as sess.SessionName for sess in sessionDetails" ng-click="changeBatch(setModel.feesType);" ng-disabled="setModel.feesType.ExistValue=='1' && userType=='R002'"
required>
<option value=""> Not applicable</option>
</select>-->
<input type="text" placeholder="Enter Session Name"
tabindex="9" class="form-control" name="setsessionname"
ng-model="setModel.feesType.SessionName" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" required ng-disabled="setModel.feesType.ExistValue=='1' && userType=='R002'"/>
<span class="error text-small block"
ng-if="Form.setsessionname.$dirty && Form.setsessionname.$error.required">Session name is required</span>
<span class="error text-small block"
ng-if="Form.setsessionname.$dirty && Form.setsessionname.$error.pattern">Invalid session name </span>
<!--<span class="success text-small"-->
<!--ng-if="Form.stopname.$valid">Thank You!</span>-->
ng-model="setModel.feesType.SessionName" ng-readonly="true" />
</div>
<div class="col-md-3 form-group"
<div class="col-md-3 form-group" ng-if="setModel.feesType.ProgramType!='P001' && setModel.feesType.ProgramType!='P002'"
ng-class="{'has-error':Form.setrollNo.$dirty && Form.setrollNo.$invalid}">
<label>
Roll Number
@ -94,6 +128,20 @@
</div>
<div class="row">
<div class="col-md-3 form-group" ng-if="setModel.feesType.ProgramType=='P001' || setModel.feesType.ProgramType=='P002'"
ng-class="{'has-error':Form.setrollNo.$dirty && Form.setrollNo.$invalid}">
<label>
Roll Number
</label>
<input type="text" placeholder="Enter Roll No"
tabindex="10" class="form-control" name="setrollNo"
ng-model="setModel.feesType.RollNo" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" ng-disabled="setModel.feesType.ExistValue=='1' && userType=='R002'"/>
<span class="error text-small block"
ng-if="Form.setrollNo.$dirty && Form.setrollNo.$error.required">Roll no is required</span>
<span class="error text-small block"
ng-if="Form.setrollNo.$dirty && Form.setrollNo.$error.pattern">Invalid roll no </span>
</div>
<div class="col-md-3 form-group"
ng-class="{'has-error':Form.feesAmount.$dirty && Form.feesAmount.$invalid,'has-success':Form.feesAmount.$valid}">
<label>
@ -159,7 +207,7 @@
ng-if="Form.paid.$error.maxlength || Form.paid.$error.pattern">Enter a valid amount</span>
</div>-->
<div class="col-md-3 form-group"
<div class="col-md-3 form-group" ng-if="setModel.feesType.ProgramType!='P001' && setModel.feesType.ProgramType!='P002'"
ng-class="{'has-error':Form.waiver.$dirty && Form.waiver.$invalid}">
<label>
Waiver</span>
@ -178,6 +226,22 @@
</div>
<div class="row">
<div class="col-md-3 form-group" ng-if="setModel.feesType.ProgramType=='P001' || setModel.feesType.ProgramType=='P002'"
ng-class="{'has-error':Form.waiver.$dirty && Form.waiver.$invalid}">
<label>
Waiver</span>
</label>
<input type="text" placeholder="Enter Waiver Amount"
autofocus tabindex="14" class="form-control" name="waiver" id="waiver" ng-maxlength="9"
ng-model="setModel.feesType.Waiver" ng-pattern="/^[0-9]*$/" ng-change="setFeesTotalAmount(setModel.feesType,'2','2');" ng-disabled="setModel.feesType.ExistValue=='1' && userType=='R002'"/>
<span class="error text-small block"
ng-if="Form.waiver.$dirty && Form.waiver.$invalid"
ng-hide="Form.waiver.$error.maxlength || Form.waiver.$error.pattern">Waiver amount is required</span>
<span class="error text-small block"
ng-if="Form.waiver.$error.maxlength || Form.waiver.$error.pattern">Enter a valid amount</span>
</div>
<div class="col-md-3 form-group"
ng-class="{'has-error':Form.total.$dirty && Form.total.$invalid}">
<label>
@ -236,7 +300,7 @@
<input type="text" placeholder="Enter Fees Amount"
autofocus class="form-control" name="amount{{$index}}" id="amount{{$index}}" ng-maxlength="8"
ng-model="n.Amount" ng-pattern="/^[0-9]*$/" ng-disabled="setModel.feesType.ExistValue=='1' && userType=='R002'" required/>
ng-model="n.Amount" ng-pattern="/^[0-9]*$/" ng-disabled="setModel.feesType.ExistValue=='1' && userType=='R002'" ng-readonly="updateMoreItems.length==$index+1" ng-change="changeInstallemtAmt('{{n.Amount}}',n.Amount,$index);" required/>
<span class="error text-small block" ng-if="n.Amount==undefined">Enter a valid amount</span>
</div>
@ -389,7 +453,8 @@
<thead>
<tr>
<th>Fees Name</th>
<th>Session Name</th>
<th ng-if="feesStructureInfo[0].ProgramType=='P001' || feesStructureInfo[0].ProgramType=='P002'">Session From/Session To</th>
<th ng-if="feesStructureInfo[0].ProgramType=='Y001'">Session</th>
<th>Roll Number</th>
<th>Course Fees</th>
<th>STF/WR</th>
@ -402,7 +467,8 @@
<tbody ng-repeat="p in feesStructureInfo|orderBy:sortKey:reverse|filter:search:strict">
<tr ng-if="p.ExistValue=='1'">
<td>{{p.Sem_Year}}</td>
<td>{{p.SessionName}}</td>
<td ng-if="feesStructureInfo[0].ProgramType=='P001' || feesStructureInfo[0].ProgramType=='P002'">{{p.MasterSessionName}}/{{p.MasterToSessionName}}</td>
<td ng-if="feesStructureInfo[0].ProgramType=='Y001'">{{p.MasterSessionName}}</td>
<td>{{p.RollNo}}</td>
<td>{{p.ActualFees}}</td>
<td>{{p.STFOrWR}}</td>

View File

@ -60,8 +60,11 @@
</div>
<div class="col-md-3 form-group"
ng-class="{'has-error':Form.sessionname.$dirty && Form.sessionname.$invalid, 'has-success':Form.sessionname.$valid}">
<label>
Session Name <span class="symbol required"></span>
<label ng-if="updateModel.feesType.ProgramType=='P001' || setModel.feesType.ProgramType=='P002'">
Session From <span class="symbol required"></span>
</label>
<label ng-if="updateModel.feesType.ProgramType=='Y001'">
Session <span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Session Name"
@ -74,6 +77,22 @@
<!--<span class="success text-small"-->
<!--ng-if="Form.stopname.$valid">Thank You!</span>-->
</div>
<div class="col-md-3 form-group"
ng-class="{'has-error':Form.sessionname.$dirty && Form.sessionname.$invalid, 'has-success':Form.sessionname.$valid}" ng-if="updateModel.feesType.ProgramType=='P001' || setModel.feesType.ProgramType=='P002'">
<label>
Session To<span class="symbol required"></span>
</label>
<input type="text" placeholder="Enter Session Name"
tabindex="9" class="form-control" name="sessionname"
ng-model="updateModel.feesType.ToSessionName" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" required readonly/>
<span class="error text-small block"
ng-if="Form.sessionname.$dirty && Form.sessionname.$error.required">Session name is required</span>
<span class="error text-small block"
ng-if="Form.sessionname.$dirty && Form.sessionname.$error.pattern">Invalid session name </span>
<!--<span class="success text-small"-->
<!--ng-if="Form.stopname.$valid">Thank You!</span>-->
</div>
<div class="col-md-3 form-group"
ng-class="{'has-error':Form.rollNo.$dirty && Form.rollNo.$invalid}">
<label>
@ -81,7 +100,7 @@
</label>
<input type="text" placeholder="Enter Roll No"
tabindex="8" class="form-control" name="rollNo"
tabindex="10" class="form-control" name="rollNo"
ng-model="updateModel.feesType.RollNo" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" readonly/>
<!--<span class="error text-small block"
ng-if="Form.rollNo.$dirty && Form.rollNo.$error.required">Roll No is required</span>-->
@ -98,7 +117,7 @@
</label>
<input type="text" placeholder="Enter Fees Amount"
autofocus tabindex="9" class="form-control" name="feesAmount" id="feesAmount" ng-maxlength="9"
autofocus tabindex="11" class="form-control" name="feesAmount" id="feesAmount" ng-maxlength="9"
ng-model="updateModel.feesType.ActualFees" ng-pattern="/^[0-9]*$/" required readonly/>
<span class="error text-small block"
ng-if="Form.feesAmount.$dirty && Form.feesAmount.$invalid"
@ -114,7 +133,7 @@
</label>
<input type="text" placeholder="Enter STF/WR Amount"
autofocus tabindex="10" class="form-control" name="STF" id="STF" ng-maxlength="9"
autofocus tabindex="12" class="form-control" name="STF" id="STF" ng-maxlength="9"
ng-model="updateModel.feesType.STFOrWR" ng-pattern="/^[0-9]*$/" readonly/>
<span class="error text-small block"
ng-if="Form.STF.$dirty && Form.STF.$invalid"
@ -130,7 +149,7 @@
</label>
<input type="text" placeholder="Enter Other Amount"
autofocus tabindex="11" class="form-control" name="others" id="others" ng-maxlength="9"
autofocus tabindex="13" class="form-control" name="others" id="others" ng-maxlength="9"
ng-model="updateModel.feesType.Others" ng-pattern="/^[0-9]*$/" readonly/>
<span class="error text-small block"
ng-if="Form.others.$dirty && Form.others.$invalid"
@ -146,7 +165,7 @@
</label>
<input type="text" placeholder="Enter Waiver Amount"
autofocus tabindex="12" class="form-control" name="waiver" id="waiver" ng-maxlength="9"
autofocus tabindex="14" class="form-control" name="waiver" id="waiver" ng-maxlength="9"
ng-model="updateModel.feesType.Waiver" ng-pattern="/^[0-9]*$/" readonly/>
<span class="error text-small block"
ng-if="Form.waiver.$dirty && Form.waiver.$invalid"
@ -162,7 +181,7 @@
</label>
<input type="text" placeholder="Enter Total Amount"
autofocus tabindex="13" class="form-control" name="total" id="total" ng-maxlength="9"
autofocus tabindex="15" class="form-control" name="total" id="total" ng-maxlength="9"
ng-model="updateModel.feesType.BalanceAmount" ng-pattern="/^[0-9]*$/" readonly/>
<span class="error text-small block"
ng-if="Form.total.$dirty && Form.total.$invalid"
@ -305,7 +324,7 @@
</label>
<input type="text" placeholder="Enter Receipt No"
tabindex="15" class="form-control" name="billno"
tabindex="16" class="form-control" name="billno"
ng-model="updateModel.billNo" ng-pattern="/^[a-zA-Z0-9-./\s]*$/"/>
<!--<span class="error text-small block"
ng-if="Form.billno.$dirty && Form.billno.$error.required">Bill no is required</span>-->
@ -319,7 +338,7 @@
</label>
<input type="text" placeholder="Enter Fees Amount"
autofocus tabindex="16" class="form-control" name="billAmount" id="billAmount" ng-maxlength="9"
autofocus tabindex="17" class="form-control" name="billAmount" id="billAmount" ng-maxlength="9"
ng-model="updateModel.billAmount" ng-pattern="/^[0-9]*$/" required/>
<span class="error text-small block"
ng-if="Form.billAmount.$dirty && Form.billAmount.$invalid"
@ -334,7 +353,7 @@
<label>
Mode Of Payment <span class="symbol required"></span>
</label>
<select class="form-control" name="paymentOn" tabindex="17" id="paymentOn"
<select class="form-control" name="paymentOn" tabindex="18" id="paymentOn"
ng-model="updateModel.paymentOn"
ng-options="payment.paymentOn for payment in paymentOptions"
required>
@ -363,7 +382,7 @@
<label>
Comments For Student <span class="symbol required"></span>
</label>
<textarea placeholder="Enter Comments" tabindex="17"
<textarea placeholder="Enter Comments" tabindex="19"
class="form-control textdsc" name="studcomments"
ng-model="updateModel.studComments" required></textarea>
<span class="error text-small block"
@ -376,7 +395,7 @@
<label>
Comments For Internal <span class="symbol required"></span>
</label>
<textarea placeholder="Enter Comments" tabindex="19"
<textarea placeholder="Enter Comments" tabindex="20"
class="form-control textdsc" name="internalcomments"
ng-model="updateModel.internalComments" required></textarea>
<span class="error text-small block"
@ -400,7 +419,8 @@
<tr>
<th>Fees Name</th>
<th>Course Name</th>
<th>Session Name</th>
<th ng-if="existStudentFeesDetails[0].ProgramType=='P001' || existStudentFeesDetails[0].ProgramType=='P002'">Session From/Session To</th>
<th ng-if="existStudentFeesDetails[0].ProgramType=='Y001'">Session</th>
<th>Roll Number</th>
<th>Course Fees</th>
<th>STF/WR</th>
@ -418,7 +438,10 @@
<tr>
<td>{{p.FeesName}}</td>
<td>{{p.CourseName}}</td>
<td>{{p.SessionName}}</td>
<!--<td>{{p.SessionName}}</td>
<td>{{p.ToSessionName}}</td>-->
<td ng-if="existStudentFeesDetails[0].ProgramType=='P001' || existStudentFeesDetails[0].ProgramType=='P002'">{{p.SessionName}}/{{p.ToSessionName}}</td>
<td ng-if="existStudentFeesDetails[0].ProgramType=='Y001'">{{p.SessionName}}</td>
<td>{{p.RollNo}}</td>
<td>{{p.CourseFees}}</td>
<td>{{p.STFOrWR}}</td>
@ -428,9 +451,9 @@
<td>{{p.PaidBillAmount}}</td>
<td>{{p.BalanceAmount}}</td>
<td><span class="text-extra-large margin-bottom-10 block">
<td ng-click="open(p)"><span class="text-extra-large margin-bottom-10 block">
<a tooltip="{{dynamicTooltip}}">
<i class="fa fa-eye" ng-click="open(p)"></i>
<i class="fa fa-eye" ></i>
</a> </span>
</td>
@ -502,7 +525,8 @@
<tr style="height: 24px;">
<td style="width: 136px; height: 24px;"><strong>Course:</strong>&nbsp;{{items.CourseName}}</td>
<td style="width: 136px; height: 24px;"><strong>Fees Type:</strong>&nbsp;{{items.FeesName}}</td>
<td style="width: 137px; height: 24px;"><strong>Exam Cycle:</strong>&nbsp;{{items.SessionName}}</td>
<td ng-if="items.ToSessionName=='Not Applicale'" style="width: 137px; height: 24px;"><strong>Exam Cycle:</strong>&nbsp;{{items.SessionName}}</td>
<td ng-if="items.ToSessionName!='Not Applicale'" style="width: 137px; height: 24px;"><strong>Exam Cycle:</strong>&nbsp;{{items.SessionName}}/{{items.ToSessionName}}</td>
<td style="width: 137px; height: 24px;"><strong>Univ:</strong>&nbsp;{{items.UniversityName}}</td>
</tr>
<tr style="height: 24px;">