pc to ppc

This commit is contained in:
venbatechnologies@gmail.com 2018-10-22 15:06:13 +05:30
parent 6ed86962aa
commit df217d5013
3 changed files with 47 additions and 8 deletions

View File

@ -93,6 +93,8 @@ class Fees_Status_Controller extends REST_Controller {
$student['StudentID'] = $this->post('studentID');
$student['BranchCode'] = $this->post('branchCode');
$getStudentFeesDetails = $this->Fees_model->getStudentFeesStructure($student);
if ($getStudentFeesDetails)
{
$getStudentFeesDetails['status'] = REST_Controller::HTTP_OK;

View File

@ -94,6 +94,8 @@ class Fees_status_model extends CI_Model
$this->db->where('BA.BranchCode',$student['BranchCode']);
$this->db->order_by('SFS.FeesID','DESC');
$enrolledFeesDetails = $this->db->get();
//print_r($enrolledFeesDetails->result());die();
if($enrolledFeesDetails->result()){
$result_array['feesStatus']=true;
foreach ($enrolledFeesDetails->result() as $row) {
@ -130,24 +132,37 @@ class Fees_status_model extends CI_Model
else{
$fetchData['BalanceAmount']=$fetchData['PayableFees'] - $paidBillAmount[0]->PaidBillAmount;
}
$fetchData['PC'] = $row->PC;
$fetchData['PPC'] = $row->PC;
$fetchData['TC'] = $row->TC;
$fetchData['DC'] = $row->DC;
$fetchData['MC'] = $row->MC;
$fetchData['OtherFees'] = $row->OtherFees;
$CourseFeesArray[]=$fetchData;
}
$getDefaultCourseFees = $this->getDefaultCourseFees($student);
// print_r($getDefaultCourseFees);die();
if($getDefaultCourseFees!=false){
$result_array['feesDetails']=array_merge($getDefaultCourseFees,$CourseFeesArray);
}
else{
$result_array['feesDetails']=$CourseFeesArray;
}
// print_r($result_array['feesDetails']);die();
// $result_array['getFeesUpdateStatus']=$this->getFeesUpdateStatus(FEESUPDATE);
$result_array['getExistStudentFeesDetails']=$this->existStudentFeesDetails($student);
@ -183,7 +198,7 @@ class Fees_status_model extends CI_Model
* */
public function getDefaultCourseFees($student=null)
{
$serachArray = ["PC","TC","DC","MC","OTHER"];
$serachArray = ["PPC","TC","DC","MC","OTHER"];
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.CourseID,SFS.CourseFees,SFS.STFOrWR,SFS.Comments,SFS.Waiver,SFS.Others,SFS.SessionName,SFS.RollNo,CU.PC,CU.TC,CU.DC,CU.MC,CU.OtherFees');
$this->db->from(STUDENTS_FEES_STATUS . ' as SFS');
@ -224,7 +239,7 @@ class Fees_status_model extends CI_Model
} else {
$fetchData['BalanceAmount'] = $fetchData['PayableFees'] - $paidBillAmount[0]->PaidBillAmount;
}
$fetchData['PC'] = $row->PC;
$fetchData['PPC'] = $row->PC;
$fetchData['TC'] = $row->TC;
$fetchData['DC'] = $row->DC;
$fetchData['MC'] = $row->MC;
@ -368,7 +383,7 @@ class Fees_status_model extends CI_Model
* */
public function existStudentCourseDefaultFees($student=null){
$serachArray = ["PC","TC","DC","MC","OTHER"];
$serachArray = ["PPC","TC","DC","MC","OTHER"];
$this->db->distinct();
$this->db->select('SFS.FeesID,SFS.FeesType,SFS.Comments,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,US.UniversityShortName');
$this->db->from(STUDENTS_FEES_PAID.' as SFP');
@ -456,7 +471,11 @@ class Fees_status_model extends CI_Model
}
// print_r($mergeResult);
return $mergeResult;
}
else {
return false;

View File

@ -892,10 +892,10 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
$http(getFees).then(function (response) {
if (response.data.status==200 && response.data.feesStatus) {
$scope.studentFeesInfo=response.data.feesDetails;
//console.log( $scope.studentFeesInfo);
//console.log($scope.studentFeesInfo);
$scope.existStudentFeesDetails = response.data.getExistStudentFeesDetails;
$scope.getFeesUpdateStatus = response.data.getFeesUpdateStatus;
console.log($scope.existStudentFeesDetails);
$scope.updateModel = {
"feesType": $scope.studentFeesInfo[0],
//User wants to manually enter fees amount
@ -1282,8 +1282,11 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
* */
$scope.changeInstallemt = function (model,form) {
//alert('in')
if(model.Sem_Year!='TC' && model.Sem_Year!='PPC' && model.Sem_Year!='DC' && model.Sem_Year!='MC' && model.Sem_Year!='OTHER'){
$scope.BatchDetails=[];
$rootScope.updateMoreItems=[];
angular.forEach(model.batchDetails,function (values,key) {
@ -1349,9 +1352,13 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
}
$scope.setFeesTotalAmount(model,'1',model,'1');
}
else{
$scope.setFeesTotalAmount(model,'3',model,'1');
}
// form.$setPristine(true);
@ -1390,8 +1397,12 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
* get set fees total amount
* */
$scope.setFeesTotalAmount = function (values,type,beforeValues,from) {
if(type==3 || values.Sem_Year=='TC' || values.Sem_Year=='PC' || values.Sem_Year=='DC' || values.Sem_Year=='MC' || values.Sem_Year=='OTHER'){
//alert('set fee')
if(type==3 || values.Sem_Year=='TC' || values.Sem_Year=='PPC' || values.Sem_Year=='DC' || values.Sem_Year=='MC' || values.Sem_Year=='OTHER'){
//alert('if')
if(values.Valid=='0'){
swal("", "Course fees are not paid so unable to set course fees", "warning");
@ -1424,11 +1435,16 @@ 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 = "Not applicable";
$scope.setModel.feesType.SessionName = "Not applicable";
$scope.setModel.feesType.BatchName = "Not applicable";
$rootScope.updateMoreItems=[];
$scope.BatchDetails='';
}
else{
if($scope.setTotalAmount=='' || $scope.setTotalAmount==null || $scope.setTotalAmount==0){
$scope.beforeSetTotalAmount=0;
}
@ -1497,6 +1513,8 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
else{
if(values.ActualFees=='' || values.ActualFees==null || values.ActualFees==undefined){
$scope.actFees=0;
}