fee transfer issue no : 1605

This commit is contained in:
venbatechnologies@gmail.com 2019-02-02 15:51:17 +05:30
parent 2344b32c9a
commit c9fdc43d34
6 changed files with 275 additions and 62 deletions

View File

@ -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'])
{

View File

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

View File

@ -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();

View File

@ -237,7 +237,7 @@ $scope.isLoaderTxt = "Loading...";
$rootScope.dataForExamAttendanceAM = "";
$rootScope.dataForExamAttendancePM = "";
rootScope.pdfcenter = "";
$rootScope.pdfcenter = "";
$rootScope.pdfbatch = "";
$rootScope.pdfexamdate = "";
$rootScope.pdfuname = "";

View File

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

View File

@ -28,7 +28,8 @@
<!-- <div ng-if="feedetstatus==true"> -->
<table id="datatable" class="table table-hover">
<thead>
<tr >
<tr>
<th></th>
<th style="font-size: 12px;">BillNO</th>
<th style="font-size: 12px;">BillDate</th>
<th style="font-size: 12px">ModeOfPayment</th>
@ -38,6 +39,11 @@
</thead>
<tbody dir-paginate="p in FeePaidDetails|filter:search:strict|itemsPerPage:10">
<tr>
<td>
<input type="checkbox" ng-checked="" id="{{p.ID}}" name="{{p.ID}}" class="form-control" ng-click="isClick($event)"/>
</td>
<td>{{p.BillNO}}</td>
<td>{{p.BillDate}}</td>
@ -69,10 +75,17 @@
<div class="col-md-3 form-group">
<label>Total Paid Fee</label>
<label>Set Fee Semesters</label>
<input type="text" tabindex="2" class="form-control" name="totalamount"
ng-model="updateModel.totalpaidfee" value="Totalfeepaid" readonly="true" />
<!-- <input type="text" tabindex="2" class="form-control" name="totalamount"
ng-model="updateModel.totalpaidfee" value="Totalfeepaid" readonly="true" /> -->
<select class="form-control" tabindex="3" class="cs-select cs-skin-elastic" name="totalamount" ng-model="myModel.totalpaidfee"
n>
<option value="" selected>Select</option>
<option ng-repeat="fee in Totalfeepaid|unique:'FeesID'" value="{{fee.FeesID}}">{{fee.Sem_Year}}</option>
</select>
</div>
@ -100,6 +113,68 @@
<div>
<table id="datatable" class="table table-hover">
<thead>
<tr>
<th style="font-size: 12px;">BillNO</th>
<th style="font-size: 12px;">BillDate</th>
<th style="font-size: 12px">ModeOfPayment</th>
<th style="font-size: 12px;">Total Amount</th>
<th style="font-size: 12px;">Amount Paid</th>
<th style="font-size: 12px;">Sem/Year<span ng-if="p.balpayable >=0"></th>
</tr>
</thead>
<tbody dir-paginate="p in Totalfeepaid|filter:search:strict|itemsPerPage:10">
<tr>
<td>
<span ng-if="p.BillNO !=null">{{p.BillNO}}</span>
<span ng-if="p.BillNO == null">No data</span>
</td>
<td>
<span ng-if="p.BillDate !=null"> {{p.BillDate}}</span>
<span ng-if="p.BillDate ==null"> No Data</span>
</td>
<td>
<span ng-if="p.ModeOfPayment !=null">{{p.ModeOfPayment}}</span>
<span ng-if="p.ModeOfPayment ==null">No Data</span>
</td>
<td>
<span ng-if="p.CourseFees !=null">{{p.CourseFees}}</span>
<span ng-if="p.CourseFees ==null">No Data</span>
</td>
<td>
<span ng-if="p.BillAmount !=null">{{p.BillAmount}}</span>
<span ng-if="p.BillAmount ==null">No Data</span>
</td>
<td>
<span ng-if="p.Sem_Year !=null">{{p.Sem_Year}}</span>
<span ng-if="p.Sem_Year ==null">No Data</span>
</td>
</tr>
</tbody>
</table>
</div>