From c9fdc43d346da4b026d5bde4821564948893afb5 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Sat, 2 Feb 2019 15:51:17 +0530 Subject: [PATCH] fee transfer issue no : 1605 --- .../controllers/DataCorrection_Controller.php | 4 +- .../application/models/Data_correction.php | 153 ++++++++++++------ .../application/models/Hallticket_model.php | 7 + .../js/controllers/examAttendanceCtrl.js | 2 +- .../assets/js/controllers/feetransferCtrl.js | 88 ++++++++-- Apollo/assets/views/edit_transferfee.html | 83 +++++++++- 6 files changed, 275 insertions(+), 62 deletions(-) diff --git a/Apollo/api/application/controllers/DataCorrection_Controller.php b/Apollo/api/application/controllers/DataCorrection_Controller.php index a4c8fad3..b19c7472 100644 --- a/Apollo/api/application/controllers/DataCorrection_Controller.php +++ b/Apollo/api/application/controllers/DataCorrection_Controller.php @@ -275,8 +275,10 @@ class DataCorrection_Controller extends REST_Controller { $search['studentId'] = $this->post('studentId'); $search['Act_CourseId'] = $this->post('act_courseId'); $search['DeAct_CourseId'] = $this->post('de_actcourseId'); + $search['SetFeeId'] = $this->post('SemSetID'); + $selectFeeIDs = $this->post('FeeIDs'); - $updatefeedetails['transferstatus'] = $this->Data_correction->UpdateFeePaidDetails($search); + $updatefeedetails['transferstatus'] = $this->Data_correction->UpdateFeePaidDetails($search,$selectFeeIDs); if($updatefeedetails['transferstatus']) { diff --git a/Apollo/api/application/models/Data_correction.php b/Apollo/api/application/models/Data_correction.php index c2721f82..d6a270e9 100644 --- a/Apollo/api/application/models/Data_correction.php +++ b/Apollo/api/application/models/Data_correction.php @@ -334,91 +334,120 @@ where sfp.StudentID='".$search['studentId']."' and sfs.CourseID='".$search['Cour } + + + public function UpdateFeePaidDetails($search,$selectFeeIDs) + { + // print_r($search); + // print_r($selectFeeIDs); + + + foreach ($selectFeeIDs as $keyy => $vvalue) + { + //echo $vvalue; + + $time = date('Y-m-d H:i:s'); + $dateTime = $time; + + $feearr['FeesId']= $search['SetFeeId']; + $feearr['InternalComments'] = 'Fee Paid by Fee Transfer'; + $feearr['UpdatedOn'] = $dateTime; + + + //$this->db->where('StudentID',$search['studentId']); + $this->db->where('ID',$vvalue); + $this->db->update('T_Students_Fees_PaidDetails', $feearr); + + } + + return true; + } - public function UpdateFeePaidDetails($search) - { - $this->db->select('FeesID'); - $this->db->from('T_Students_Fees_Status sfs'); - $this->db->where('sfs.StudentID',$search['studentId']); - $this->db->where('sfs.CourseID',$search['Act_CourseId']); + // public function UpdateFeePaidDetails($search,$selectFeeIDs) + // { + // $this->db->select('FeesID'); + // $this->db->from('T_Students_Fees_Status sfs'); + // $this->db->where('sfs.StudentID',$search['studentId']); + // $this->db->where('sfs.CourseID',$search['Act_CourseId']); - $getAct_CourseFeeId = $this->db->get(); + // $getAct_CourseFeeId = $this->db->get(); - $getAct_CourseFeeId = $getAct_CourseFeeId->result(); + // $getAct_CourseFeeId = $getAct_CourseFeeId->result(); - //print_r($this->db->last_query());die(); + // //print_r($this->db->last_query());die(); - // print_r($getAct_CourseFeeId );die(); + // // print_r($getAct_CourseFeeId );die(); - $newfeeId = ''; + // $newfeeId = ''; - // foreach($getAct_CourseFeeId as $fi) - // { + // // foreach($getAct_CourseFeeId as $fi) + // // { - // $newfeeId = $fi[0]->FeesID; - // } + // // $newfeeId = $fi[0]->FeesID; + // // } - $newfeeId = $getAct_CourseFeeId[0]->FeesID; + // $newfeeId = $getAct_CourseFeeId[0]->FeesID; - //echo $newfeeId;die(); + // //echo $newfeeId;die(); - $this->db->select('sfs.FeesID,BillAmount'); - $this->db->from('T_Students_Fees_Status sfs'); - $this->db->join('T_Students_Fees_PaidDetails sfp','sfs.FeesID=sfp.FeesId'); - $this->db->where('sfs.StudentID',$search['studentId']); - $this->db->where('sfs.CourseID',$search['DeAct_CourseId']); + // $this->db->select('sfs.FeesID,BillAmount'); + // $this->db->from('T_Students_Fees_Status sfs'); + // $this->db->join('T_Students_Fees_PaidDetails sfp','sfs.FeesID=sfp.FeesId'); + // $this->db->where('sfs.StudentID',$search['studentId']); + // $this->db->where('sfs.CourseID',$search['DeAct_CourseId']); - $getDeAct_CourseFeeId = $this->db->get(); + // $getDeAct_CourseFeeId = $this->db->get(); - $getDeAct_CourseFeeId = $getDeAct_CourseFeeId->result(); + // $getDeAct_CourseFeeId = $getDeAct_CourseFeeId->result(); - $oldfeeId = ''; + // $oldfeeId = ''; - foreach($getDeAct_CourseFeeId as $fi) - { + // foreach($getDeAct_CourseFeeId as $fi) + // { - $oldfeeId = $fi->FeesID; - //} + // $oldfeeId = $fi->FeesID; + // //} - // print_r($this->db->last_query());die(); + // // print_r($this->db->last_query());die(); - $time = date('Y-m-d H:i:s'); - $dateTime = $time; + // $time = date('Y-m-d H:i:s'); + // $dateTime = $time; - $feearr['FeesId']= $newfeeId; - $feearr['InternalComments'] = 'Fee Paid by Fee Transfer'; - $feearr['UpdatedOn'] = $dateTime; + // $feearr['FeesId']= $newfeeId; + // $feearr['InternalComments'] = 'Fee Paid by Fee Transfer'; + // $feearr['UpdatedOn'] = $dateTime; - $this->db->where('StudentID',$search['studentId']); - $this->db->where('FeesId',$oldfeeId); - $this->db->update('T_Students_Fees_PaidDetails', $feearr); + // $this->db->where('StudentID',$search['studentId']); + // $this->db->where('FeesId',$oldfeeId); + // $this->db->update('T_Students_Fees_PaidDetails', $feearr); - } + // } - return true; + // return true; - } + // } public function GetFeePaidDetails($search) { - $this->db->select('SUM(BillAmount) as Total_fee'); - $this->db->from('T_Students_Fees_PaidDetails sfp'); - $this->db->join('T_Students_Fees_Status sfs','sfs.FeesID= sfp.FeesId'); - $this->db->where('sfp.StudentID',$search['studentId']); + $this->db->select('sfs.FeesID,CourseFees,BillNO,BillDate,BillAmount,ModeOfPayment,Sem_Year'); + $this->db->from('T_Students_Fees_Status sfs'); + $this->db->join('T_Students_Fees_PaidDetails sfp','sfp.FeesId= sfs.FeesID','left'); + $this->db->join('T_Course_Fees_Details cfd','cfd.ID= sfs.FeesType'); + $this->db->where('sfs.StudentID',$search['studentId']); $this->db->where('sfs.CourseID',$search['CourseID']); $getAllFeeSum = $this->db->get(); @@ -439,8 +468,40 @@ where sfp.StudentID='".$search['studentId']."' and sfs.CourseID='".$search['Cour $result_array['totalpaiddetails'] = 'No Records Found'; } - // print_r($this->db->last_query());die(); + //print_r($this->db->last_query());die(); return $result_array; } + + + // public function GetFeePaidDetails($search) + // { + // $this->db->select('*'); + // $this->db->from('T_Students_Fees_PaidDetails sfp'); + // $this->db->join('T_Students_Fees_Status sfs','sfs.FeesID= sfp.FeesId'); + // $this->db->where('sfp.StudentID',$search['studentId']); + // $this->db->where('sfs.CourseID',$search['CourseID']); + + // $getAllFeeSum = $this->db->get(); + + // $getAllFeeSum = $getAllFeeSum->result(); + + // if($getAllFeeSum) + // { + + // $result_array['feepaiStatus'] = true; + // $result_array['totalpaiddetails'] = $getAllFeeSum; + + // } + + // else + // { + // $result_array['feepaiStatus'] = false; + // $result_array['totalpaiddetails'] = 'No Records Found'; + // } + + // // print_r($this->db->last_query());die(); + + // return $result_array; + // } } \ No newline at end of file diff --git a/Apollo/api/application/models/Hallticket_model.php b/Apollo/api/application/models/Hallticket_model.php index 30fbb4f6..124858ad 100644 --- a/Apollo/api/application/models/Hallticket_model.php +++ b/Apollo/api/application/models/Hallticket_model.php @@ -974,6 +974,7 @@ $studetdetails['CourseName'] = $r->CourseName; JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + group by T_Batch_Schedule_Child.SubjectID order by T_Batch_Schedule_Child.ScheduleDate"; $res = $this->db->query($sql,array($UID['universityID'],$loopcourseID,$ind['SemID'],$branchId,$UID['universityID'],$loopcourseID,$branchId)); //$id['FeeDetails'][$key2] = $res->result(); @@ -997,6 +998,7 @@ $studetdetails['CourseName'] = $r->CourseName; JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + group by T_Batch_Schedule_Child.SubjectID order by T_Batch_Schedule_Child.ScheduleDate"; $res = $this->db->query($sql,array($UID['universityID'],$loopcourseID,$i,$branchId,$UID['universityID'],$loopcourseID,$branchId)); //$id['FeeDetails'][$key2] = $res->result(); @@ -1019,6 +1021,7 @@ $studetdetails['CourseName'] = $r->CourseName; JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + group by T_Batch_Schedule_Child.SubjectID order by T_Batch_Schedule_Child.ScheduleDate"; $res = $this->db->query($sql,array($UID['universityID'],$loopcourseID,$j,$branchId,$UID['universityID'],$loopcourseID,$branchId)); //$id['FeeDetails'][$key2] = $res->result(); @@ -1041,6 +1044,7 @@ $studetdetails['CourseName'] = $r->CourseName; JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + group by T_Batch_Schedule_Child.SubjectID order by T_Batch_Schedule_Child.ScheduleDate"; $res = $this->db->query($sql,array($UID['universityID'],$loopcourseID,$k,$branchId,$UID['universityID'],$loopcourseID,$branchId)); //$id['FeeDetails'][$key2] = $res->result(); @@ -1063,6 +1067,7 @@ $studetdetails['CourseName'] = $r->CourseName; JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + group by T_Batch_Schedule_Child.SubjectID order by T_Batch_Schedule_Child.ScheduleDate"; $res = $this->db->query($sql,array($UID['universityID'],$loopcourseID,$l,$branchId,$UID['universityID'],$loopcourseID,$branchId)); //$id['FeeDetails'][$key2] = $res->result(); @@ -1086,6 +1091,7 @@ $studetdetails['CourseName'] = $r->CourseName; JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + group by T_Batch_Schedule_Child.SubjectID order by T_Batch_Schedule_Child.ScheduleDate"; $res = $this->db->query($sql,array($UID['universityID'],$loopcourseID,$m,$branchId,$UID['universityID'],$loopcourseID,$branchId)); //$id['FeeDetails'][$key2] = $res->result(); @@ -1107,6 +1113,7 @@ $studetdetails['CourseName'] = $r->CourseName; JOIN T_SemSubMap_Master on T_SemSubMap_Child.MapID = T_SemSubMap_Master.MapID and T_SemSubMap_Master.UniversityID = ? and T_SemSubMap_Master.CourseID = ? and T_SemSubMap_Master.SemesterID = ? and T_SemSubMap_Master.BranchCode = ? and T_SemSubMap_Child.IsActive = 1 JOIN T_Batch_Schedule_Master on T_Batch_Schedule_Master.UniversityID = ? and T_Batch_Schedule_Master.CourseID = ? and T_Batch_Schedule_Master.BranchCode = ? JOIN T_Batch_Schedule_Child on T_Batch_Schedule_Master.SchId = T_Batch_Schedule_Child.SchId and T_SemSubMap_Child.SubjectID = T_Batch_Schedule_Child.SubjectID and T_Batch_Schedule_Child.IsActive = 1 + group by T_Batch_Schedule_Child.SubjectID order by T_Batch_Schedule_Child.ScheduleDate"; $res = $this->db->query($sql,array($UID['universityID'],$loopcourseID,$i,$branchId,$UID['universityID'],$loopcourseID,$branchId)); //$id['FeeDetails'][$key2] = $res->result(); diff --git a/Apollo/assets/js/controllers/examAttendanceCtrl.js b/Apollo/assets/js/controllers/examAttendanceCtrl.js index 13ceed55..ff0dbe05 100644 --- a/Apollo/assets/js/controllers/examAttendanceCtrl.js +++ b/Apollo/assets/js/controllers/examAttendanceCtrl.js @@ -237,7 +237,7 @@ $scope.isLoaderTxt = "Loading..."; $rootScope.dataForExamAttendanceAM = ""; $rootScope.dataForExamAttendancePM = ""; - rootScope.pdfcenter = ""; + $rootScope.pdfcenter = ""; $rootScope.pdfbatch = ""; $rootScope.pdfexamdate = ""; $rootScope.pdfuname = ""; diff --git a/Apollo/assets/js/controllers/feetransferCtrl.js b/Apollo/assets/js/controllers/feetransferCtrl.js index 766323ac..7a0294a6 100644 --- a/Apollo/assets/js/controllers/feetransferCtrl.js +++ b/Apollo/assets/js/controllers/feetransferCtrl.js @@ -191,7 +191,7 @@ app.controller('feetransferCtrl', ["$scope","$rootScope","toaster", "$filter", " $scope.updateModel = { - "transferamount": "", + "transferamount": '', "totalpaidfee":'', }; @@ -230,7 +230,7 @@ $scope.TransferAmt=0; if (response.data.status==200 && response.data.feeStatus) { $scope.FeePaidDetails = response.data.feepaiddetails; - // console.log($scope.FeePaidDetails); + //sconsole.log($scope.FeePaidDetails); $scope.feedetstatus=true; @@ -241,7 +241,7 @@ $scope.TransferAmt=0; }); - $scope.updateModel.transferamount=$scope.TransferAmt; + $scope.updateModel.transferamount=0; } else { $scope.FeePaidDetails = ''; @@ -263,20 +263,33 @@ $scope.TransferAmt=0; $scope.getTransferFee=function(myModel,p,updateModel) { - // console.log(myModel); - // console.log(p); - // console.log(updateModel); - + // console.log(myModel); + // console.log(p); + // console.log(updateModel); + // console.log($scope.selectedfeeID); + console.log(myModel.totalpaidfee); + // return false; // console.log(myModel.Activecourse); + + if($scope.selectedfeeID.length == 0) + { + swal('Select Fee to Be transfered','','warning');return false; + } + + if((myModel.totalpaidfee == '0') ||(myModel.totalpaidfee =='')||(myModel.totalpaidfee == undefined)) + { + swal('Select Sem to Be transfered','','warning');return false; + } - if((updateModel.transferamount!='')&& (myModel.Activecourse != undefined) &&(updateModel.transferamount!='')) + if((updateModel.transferamount!='')&& (myModel.Activecourse != undefined) &&(updateModel.transferamount!='')&&(updateModel.transferamount!='0')) { - // alert('im');die(); + alert('im');die(); var act_courseId = myModel.Activecourse; var deact_courseId = myModel.deActivecourse; var studentId = p.StudentID; + var selectedSem = myModel.totalpaidfee; var updatefeedetails = { method: 'POST', @@ -288,6 +301,8 @@ $scope.TransferAmt=0; studentId: studentId, act_courseId: act_courseId, de_actcourseId: deact_courseId, + FeeIDs:$scope.selectedfeeID, + SemSetID:selectedSem, requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID, branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, @@ -326,7 +341,7 @@ $scope.TotalAmt=0; $scope.feedetstatus=true; $scope.getTotalFeePaid=function(myModel,p) { - console.log(myModel) + //console.log(myModel) var CourseID = myModel.Activecourse; var studentId = p.StudentID; @@ -360,6 +375,9 @@ $scope.feedetstatus=true; $scope.feedetstatus=true; $scope.Totalfeepaid=response.data.totalpaiddetails; + + console.log($scope.Totalfeepaid) + angular.forEach(($scope.Totalfeepaid),function(Feedata,key) { // console.log(Feedata.totalpaiddetails); @@ -393,6 +411,56 @@ $scope.feedetstatus=true; +$scope.total_click = 0; + +$scope.selectedfeeID=[]; + $scope.isClick = function(e) + { + //console.log(e.target); + var ide = e.target; + var val = (ide.checked ? true : false); + var sid = e.target.id; + var pos = $scope.selectedfeeID.indexOf(sid); + + //console.log(sid) + // var total =0; + if(val == true) + { + angular.forEach($scope.FeePaidDetails,function(value,key){ + if(sid == value.ID) + { + $scope.total_click = parseFloat($scope.total_click )+parseFloat(value.BillAmount); + $scope.selectedfeeID.push(sid); + } + }); + } + + + if(val == false) + { + angular.forEach($scope.FeePaidDetails,function(value,key){ + if(sid == value.ID) + { + $scope.total_click = parseFloat($scope.total_click )-parseFloat(value.BillAmount); + $scope.selectedfeeID.splice(pos,1); + } + }); + } + + + //console.log($scope.selectedfeeID ; + //return false; + + // updateModel.transferamount. = $scope.total_click ; + $scope.updateModel.transferamount=$scope.total_click ; + + // console.log($scope.total_click); + + + } + + + }]); diff --git a/Apollo/assets/views/edit_transferfee.html b/Apollo/assets/views/edit_transferfee.html index abfc7b4f..ca3c4301 100644 --- a/Apollo/assets/views/edit_transferfee.html +++ b/Apollo/assets/views/edit_transferfee.html @@ -28,7 +28,8 @@ - + + @@ -38,6 +39,11 @@ + + @@ -69,10 +75,17 @@
- + - + + +
@@ -100,6 +113,68 @@ + +
+ +
BillNO BillDate ModeOfPayment
+ + + {{p.BillNO}} {{p.BillDate}}
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
BillNOBillDateModeOfPaymentTotal AmountAmount PaidSem/Year
+ {{p.BillNO}} + No data + + + {{p.BillDate}} + No Data + + {{p.ModeOfPayment}} + No Data + + {{p.CourseFees}} + No Data + + {{p.BillAmount}} + No Data + + {{p.Sem_Year}} + No Data +
+ + + + +