From 96f92df239d98e8c5f23c178e0ef484ab9db2cbf Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 10 Jan 2018 17:59:10 +0530 Subject: [PATCH 01/14] installment table added in constant --- Apollo/api/application/config/constants.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Apollo/api/application/config/constants.php b/Apollo/api/application/config/constants.php index 158d7fbd..06e68d0a 100755 --- a/Apollo/api/application/config/constants.php +++ b/Apollo/api/application/config/constants.php @@ -127,6 +127,7 @@ defined('DEFAULTACTIVITY') OR define('DEFAULTACTIVITY','T_StatusMaster'); defined('CERTIFICATION_MASTER') OR define('CERTIFICATION_MASTER','T_CertificationMaster'); defined('DAYBOOKMASTER') OR define('DAYBOOKMASTER','T_DayBookMaster'); defined('INCOMEOUTCOMEMASTER') OR define('INCOMEOUTCOMEMASTER','T_Income_Outcome_Master'); +defined('FEES_INSTALLMENT') OR define('FEES_INSTALLMENT','T_Fees_Installments'); From 24d33b8b9309f964184e2f24a9746a2318f9b360 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 10 Jan 2018 18:01:37 +0530 Subject: [PATCH 02/14] course details changes done --- Apollo/assets/views/status-update/fees_status.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Apollo/assets/views/status-update/fees_status.html b/Apollo/assets/views/status-update/fees_status.html index 3bbee40e..673131c0 100755 --- a/Apollo/assets/views/status-update/fees_status.html +++ b/Apollo/assets/views/status-update/fees_status.html @@ -15,6 +15,9 @@ } + a { + color: #007AFF; + } @@ -121,7 +124,7 @@ - + From 320cf96104a7e567a1b6de03917c034c392d6d9d Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 10 Jan 2018 18:02:04 +0530 Subject: [PATCH 03/14] course details changes done --- .../status-update/setFeesForStudent.html | 162 ++++++++++++++++-- 1 file changed, 143 insertions(+), 19 deletions(-) diff --git a/Apollo/assets/views/status-update/setFeesForStudent.html b/Apollo/assets/views/status-update/setFeesForStudent.html index 2ea0b0c7..f4d0a368 100755 --- a/Apollo/assets/views/status-update/setFeesForStudent.html +++ b/Apollo/assets/views/status-update/setFeesForStudent.html @@ -1,3 +1,8 @@ +
@@ -11,12 +16,12 @@ Set Fees For Student
-
- + ng-model="setModel.feesType.RollNo" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" ng-disabled="setModel.feesType.ExistValue=='1' && userType!='R004'"/> Roll no is required Invalid roll no
- - -
-
-
-
+
+ +
-
--> -
-
-
+ +
+
+
+
+

Installment Details

+ + +
+ + + +
+
+ +
+
+ + + + Installment is required + Enter a valid installment +
+
+ + + + Amount is required + Enter a valid amount + +
+
+
+ + + Date is required. + + +
+ +
+
+ +
+
+
+
+ + + + Enter a valid installment +
+
+ + + + Enter a valid amount + +
+
+ + + + Enter a valid date + +
+
+ + +
+
+
+
+
+ +
- - From 54d906b890368fd99f24c0e086e532e8724ee87e Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 10 Jan 2018 18:02:42 +0530 Subject: [PATCH 04/14] course details changes done --- .../assets/js/controllers/feesStatusCtrl.js | 160 ++++++++++++++++-- 1 file changed, 146 insertions(+), 14 deletions(-) diff --git a/Apollo/assets/js/controllers/feesStatusCtrl.js b/Apollo/assets/js/controllers/feesStatusCtrl.js index 6f56a329..02f6558b 100755 --- a/Apollo/assets/js/controllers/feesStatusCtrl.js +++ b/Apollo/assets/js/controllers/feesStatusCtrl.js @@ -34,6 +34,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n $scope.setModel = { "feesType": "", + }; /* * get payment options @@ -274,7 +275,9 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n /* * set fees for student * */ - $scope.submitFeesForStudent = function (myModel, form,updateModel, loading) { + $scope.submitFeesForStudent = function (myModel, form,updateModel, loading,installment) { + + var firstError = null; if (form.$invalid) { var field = null, firstError = null; @@ -291,6 +294,32 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n } angular.element('.ng-invalid[name=' + firstError + ']').focus(); } else { + if(isNaN(installment.date)){ + $scope.pushDueDate1= $rootScope.lastInstallemtDate; + } + else{ + $scope.convertGetDate1=new Date(installment.date).toDateString(); + $scope.pushDueDate1 = $filter('date')(new Date($scope.convertGetDate1), 'dd-MM-yyyy'); + + } + if(installment.ID !='' && installment.ID !==null && installment.ID !=undefined){ + $rootScope.updateMoreItems.push({ + ID: installment.ID, + Name: installment.name, + Amount: installment.amount, + DueDate: $scope.pushDueDate1 + }); + } + else{ + $rootScope.updateMoreItems.push({ + ID: "", + Name: installment.name, + Amount: installment.amount, + DueDate: $scope.pushDueDate1 + }); + } + + $scope.ldloading5 = {}; $scope.ldloading5[loading.replace('-', '_')] = true; @@ -312,9 +341,8 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n other: updateModel.Others, session: updateModel.SessionName, rollNo: updateModel.RollNo, - createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID, - + installmentItems:$rootScope.updateMoreItems } }; @@ -327,12 +355,18 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n /*$scope.setModel = { "feesType": "", };*/ + $scope.myModelInstallemt.ID=""; + $scope.myModelInstallemt.name=""; + $scope.myModelInstallemt.amount=""; + $scope.myModelInstallemt.date=""; + $rootScope.updateMoreItems=[]; form.$setPristine(true); } else { $scope.ldloading5[loading.replace('-', '_')] = false; swal("Failed!", response.data.message, "error"); - $scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID); + $rootScope.updateMoreItems.splice($scope.updateMoreItems.length-1); + // $scope.getStudentSetFees(myModel.ID,myModel.CourseID,myModel.StudentID); } }); @@ -390,6 +424,12 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n $scope.feesStructureInfo=""; $scope.getStudentSetFees = function (ID,courseID,studeID) { $scope.feesStructureInfo=""; + $scope.myModelInstallemt.ID=""; + $scope.myModelInstallemt.name=""; + $scope.myModelInstallemt.amount=""; + $scope.myModelInstallemt.date=""; + $rootScope.lastInstallemtDate=""; + $rootScope.updateMoreItems=[]; var setFees = { method: 'POST', url: apiPoint.url + 'getStudentFeesAssign/', @@ -409,14 +449,12 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n $scope.setModel = { "feesType": "", - }; } else { $scope.feesStructureInfo=""; $scope.setModel = { "feesType": "", - }; @@ -424,22 +462,114 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n }); } - - /* - * set course fees amount - * */ - /* $scope.changeFeesValues = function (model) { - console.log(model); - - }*/ + $scope.cancel = function () { $scope.editId=-1; $scope.studentFeesInfo=""; $scope.existStudentFeesDetails=""; $scope.getFeesUpdateStatus=""; + $scope.viewId=-1; } + /* + * get add more installment array + * created by kms + * */ + + $scope.myModelInstallemt = { + "ID":"", + "amount":"", + "name":"", + "date":"", + + + }; + $rootScope.updateMoreItems=[]; + $rootScope.clickMoreItems = function (model,form,setModel) { + $scope.convertGetDate=''; + var firstError = null; + if (form.$invalid) { + var field = null, firstError = null; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$stop_name; + } + + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + + angular.element('.ng-invalid[name=' + firstError + ']').focus(); + } + + else { + + if(isNaN(model.date)){ + $scope.pushDueDate= $rootScope.lastInstallemtDate; + } + else{ + $scope.convertGetDate=new Date(model.date).toDateString(); + $scope.pushDueDate = $filter('date')(new Date($scope.convertGetDate), 'dd-MM-yyyy'); + + } + if(model.ID !='' && model.ID !==null && model.ID !=undefined){ + $rootScope.updateMoreItems.push({ + ID:model.ID, + Name: model.name, + Amount: model.amount, + DueDate: $scope.pushDueDate + }); + } + else{ + $rootScope.updateMoreItems.push({ + ID:"", + Name: model.name, + Amount: model.amount, + DueDate: $scope.pushDueDate + }); + + } + + + $scope.myModelInstallemt.ID=""; + $scope.myModelInstallemt.name=""; + $scope.myModelInstallemt.amount=""; + $scope.myModelInstallemt.date=""; + } + } + /* + * change installment values + * */ + $scope.changeInstallemt = function (model,form) { + $rootScope.updateMoreItems=[]; + + if(model.InstallmentDetails != ''){ + $scope.myModelInstallemt.ID=model.InstallmentDetails[model.InstallmentDetails.length-1].ID; + + $scope.myModelInstallemt.name=model.InstallmentDetails[model.InstallmentDetails.length-1].Name; + $scope.myModelInstallemt.amount=model.InstallmentDetails[model.InstallmentDetails.length-1].Amount; + $scope.myModelInstallemt.date=model.InstallmentDetails[model.InstallmentDetails.length-1].DueDate; + $rootScope.lastInstallemtDate = $scope.myModelInstallemt.date; + for(var i=0; i < model.InstallmentDetails.length-1; i++){ + $rootScope.updateMoreItems.push(model.InstallmentDetails[i]); + + } + } + else{ + $scope.myModelInstallemt.ID=""; + $scope.myModelInstallemt.name=""; + $scope.myModelInstallemt.amount=""; + $scope.myModelInstallemt.date=""; + $rootScope.lastInstallemtDate=""; + } + + form.$setPristine(true); + + } @@ -476,6 +606,8 @@ app.controller('ModalDemoCtrl', ["$scope", "$modal", "$log", function ($scope, $ $log.info('Modal dismissed at: ' + new Date()); }); }; + + }]); // Please note that $modalInstance represents a modal window (instance) dependency. From 4ed157bf8ef4409229b47100050e035e892e8386 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 10 Jan 2018 18:03:30 +0530 Subject: [PATCH 05/14] course details changes done --- Apollo/api/application/controllers/Fees_Status_Controller.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Apollo/api/application/controllers/Fees_Status_Controller.php b/Apollo/api/application/controllers/Fees_Status_Controller.php index 25984506..62c76882 100755 --- a/Apollo/api/application/controllers/Fees_Status_Controller.php +++ b/Apollo/api/application/controllers/Fees_Status_Controller.php @@ -238,7 +238,9 @@ class Fees_Status_Controller extends REST_Controller { $details['CreatedBy'] = $this->post('createdBy'); $details['CreatedOn'] = $now->format('Y-m-d H:i:s'); - $updateDetails = $this->Fees_model->setFees($details);// Check if the users data store contains users (in case the database result returns NULL) + $jsonInstallmenData = $this->post('installmentItems'); + + $updateDetails = $this->Fees_model->setFees($details,$jsonInstallmenData);// Check if the users data store contains users (in case the database result returns NULL) if ($updateDetails) { $updateDetails['status'] = REST_Controller::HTTP_OK; From faef62c1bb06f7ff2bc067dbe73764cdc2ff9ae6 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 10 Jan 2018 18:04:16 +0530 Subject: [PATCH 06/14] course details changes done --- .../application/models/Fees_status_model.php | 119 +++++++++++++++++- 1 file changed, 114 insertions(+), 5 deletions(-) diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index a7e98de5..20aeb743 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -565,12 +565,13 @@ class Fees_status_model extends CI_Model public function getFeesStructureAssign($student=null){ $this->db->select('ID,CourseID,ProgramType,FeesAmount,Sem_Year'); $this->db->where('CourseID',$student['CourseID']); + $this->db->order_by('ProgramType'); $feesDetails = $this->db->get(COURSE_FEES); if($feesDetails->result()){ $result_array['feesStatus']=true; foreach ($feesDetails->result() as $row){ - $this->db->select('CourseFees, STFOrWR,Waiver,Others,SessionName,RollNo'); + $this->db->select('FeesID,CourseFees, STFOrWR,Waiver,Others,SessionName,RollNo'); $this->db->where('StudentID',$student['StudentID']); $this->db->where('CourseID',$student['CourseID']); $this->db->where('FeesType',$row->ID); @@ -587,6 +588,17 @@ class Fees_status_model extends CI_Model $fetchData['SessionName']=$existData[0]->SessionName; $fetchData['RollNo']=$existData[0]->RollNo; $fetchData['PayableFees']=$existData[0]->CourseFees+$existData[0]->STFOrWR+$existData[0]->Others-$existData[0]->Waiver; + // for installment details + $InstallemtResult = $this->getInstallmentDetails($existData[0]->FeesID); + if($InstallemtResult != false){ + $fetchData['InstallmentDetails']=$InstallemtResult; + } + else{ + + $fetchData['InstallmentDetails']=""; + + + } $CourseFeesArray[]=$fetchData; @@ -603,6 +615,8 @@ class Fees_status_model extends CI_Model $fetchData['SessionName']=""; $fetchData['RollNo']=""; $fetchData['PayableFees']=$row->FeesAmount; + // for installment details + $fetchData['InstallmentDetails']=""; $CourseFeesArray[]=$fetchData; @@ -625,9 +639,25 @@ class Fees_status_model extends CI_Model else{ $result_array['feesStatus']=false; } - return $result_array; + } + /* + * get installment details + * created by kms + * */ + public function getInstallmentDetails($installment=null){ + $this->db->select('ID,FeesID,Name,Amount,DueDate'); + $this->db->where('FeesID',$installment); + $this->db->order_by('ID','ASC'); + $installmentDetails = $this->db->get(FEES_INSTALLMENT); + if($installmentDetails->result()){ + return $installmentDetails->result(); + } + else{ + return false; + } + } /* @@ -657,7 +687,7 @@ class Fees_status_model extends CI_Model // default course fees details in student status foreach ($myArray as $row1){ - $this->db->select('CourseFees,STFOrWR,Waiver,Others,SessionName,RollNo'); + $this->db->select('FeesID,CourseFees,STFOrWR,Waiver,Others,SessionName,RollNo'); $this->db->where('StudentID',$student['StudentID']); $this->db->where('CourseID',$student['CourseID']); $this->db->where('FeesType',$row1['Sem_Year']); @@ -675,7 +705,17 @@ class Fees_status_model extends CI_Model $fetchData['SessionName']=$existData[0]->SessionName; $fetchData['RollNo']=$existData[0]->RollNo; $fetchData['PayableFees']=$existData[0]->CourseFees+$existData[0]->STFOrWR+$existData[0]->Others-$existData[0]->Waiver; + // for installment details + $InstallemtResult = $this->getInstallmentDetails($existData[0]->FeesID); + if($InstallemtResult != false){ + $fetchData['InstallmentDetails']=$InstallemtResult; + } + else{ + $fetchData['InstallmentDetails']=""; + + + } $CourseFeesArray1[]=$fetchData; } @@ -691,9 +731,10 @@ class Fees_status_model extends CI_Model $fetchData['STFOrWR']=""; $fetchData['Waiver']=""; $fetchData['Others']=""; - $fetchData['SessionName']=""; + $fetchData['SessionName']="Nill"; $fetchData['RollNo']=""; $fetchData['PayableFees']=$row1['ActualFees']; + $fetchData['InstallmentDetails']=""; $CourseFeesArray1[]=$fetchData; } @@ -713,7 +754,7 @@ class Fees_status_model extends CI_Model * set fees for student * created by kms * */ - public function setFees($details=null){ + public function setFees($details=null,$jsonData=null){ $this->db->select('FeesID'); $this->db->where('CourseID', $details['CourseID']); $this->db->where('StudentID', $details['StudentID']); @@ -728,6 +769,35 @@ class Fees_status_model extends CI_Model $updateDetails['Others'] = $details['Others']; $updateDetails['UpdatedOn'] = $details['CreatedOn']; $updateDetails['UpdatedBy'] = $details['CreatedBy']; + + $installmentFeesID = $feesId[0]->FeesID; + foreach ($jsonData as $jrow){ + + $insertInstallment['FeesID'] = $installmentFeesID; + $insertInstallment['Name'] = $jrow['Name']; + $insertInstallment['Amount'] = $jrow['Amount']; + $insertInstallment['DueDate'] = $jrow['DueDate']; + $insertInstallment['CreatedBy'] = $details['CreatedBy']; + $insertInstallment['CreatedOn'] = $details['CreatedOn']; + if($jrow['ID'] =='' OR $jrow['ID'] =='undefined'){ + $this->db->insert(FEES_INSTALLMENT, $insertInstallment); + } + else{ + $updateInstallment['FeesID'] = $installmentFeesID; + $updateInstallment['Name'] = $jrow['Name']; + $updateInstallment['Amount'] = $jrow['Amount']; + $updateInstallment['DueDate'] = $jrow['DueDate']; + $updateInstallment['UpdatedBy'] = $details['CreatedBy']; + $updateInstallment['UpdatedOn'] = $details['CreatedOn']; + $this->db->where('ID',$jrow['ID']); + $this->db->update(FEES_INSTALLMENT, $updateInstallment); + + + } + + + } + $this->db->where('FeesID', $feesId[0]->FeesID); $this->db->update(STUDENTS_FEES_STATUS, $updateDetails); $result['setStatus'] = true; @@ -736,6 +806,45 @@ class Fees_status_model extends CI_Model } else{ $this->db->insert(STUDENTS_FEES_STATUS, $details); + + $this->db->select('FeesID'); + $this->db->where('CourseID', $details['CourseID']); + $this->db->where('StudentID', $details['StudentID']); + $this->db->where('FeesType', $details['FeesType']); + $existDb=$this->db->get(STUDENTS_FEES_STATUS)->last_row(); + if($existDb){ + $rowId = $existDb; + $installmentFeesID = $rowId->FeesID; + foreach ($jsonData as $jrow){ + $insertInstallment['FeesID'] = $installmentFeesID; + $insertInstallment['Name'] = $jrow['Name']; + $insertInstallment['Amount'] = $jrow['Amount']; + $insertInstallment['DueDate'] = $jrow['DueDate']; + $insertInstallment['CreatedBy'] = $details['CreatedBy']; + $insertInstallment['CreatedOn'] = $details['CreatedOn']; + if($jrow['ID'] =='' OR $jrow['ID'] =='undefined'){ + $this->db->insert(FEES_INSTALLMENT, $insertInstallment); + } + else{ + $updateInstallment['FeesID'] = $installmentFeesID; + $updateInstallment['Name'] = $jrow['Name']; + $updateInstallment['Amount'] = $jrow['Amount']; + $updateInstallment['DueDate'] = $jrow['DueDate']; + $updateInstallment['UpdatedBy'] = $details['CreatedBy']; + $updateInstallment['UpdatedOn'] = $details['CreatedOn']; + + $this->db->where('ID',$jrow['ID']); + $this->db->update(FEES_INSTALLMENT, $updateInstallment); + + + } + + + } + + + } + $result['setStatus'] = true; $result['message'] = "Successfully fees details is added."; From e6739ee444d99398f6da9cb4c15c0321c8313527 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 10 Jan 2018 19:05:52 +0530 Subject: [PATCH 07/14] course details changes done --- .../application/models/Fees_status_model.php | 153 ++++++++++-------- 1 file changed, 88 insertions(+), 65 deletions(-) diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 20aeb743..cb504c46 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -665,89 +665,112 @@ class Fees_status_model extends CI_Model * created by kms * */ public function defaultCourseFeesDetails($student=null){ - // get default course fees - $this->db->select('CourseID,CourseName,PC,TC,DC,MC,OtherFees'); - $this->db->where('CourseID',$student['CourseID']); - $endFeesDetails = $this->db->get(COURSE); - $myArray = array(); - if($endFeesDetails->result()){ - foreach ($endFeesDetails->result() as $value ){ - $pc_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'PC', 'ActualFees'=>$value->PC); - $tc_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'TC', 'ActualFees'=>$value->TC); - $dc_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'DC', 'ActualFees'=>$value->DC); - $mc_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'MC', 'ActualFees'=>$value->MC); - $other_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'OTHER', 'ActualFees'=>$value->OtherFees); - array_push($myArray,$pc_array); - array_push($myArray,$tc_array); - array_push($myArray,$dc_array); - array_push($myArray,$mc_array); - array_push($myArray,$other_array); - } + // check student fees paid details for get default course fees - // default course fees details in student status - foreach ($myArray as $row1){ - $this->db->select('FeesID,CourseFees,STFOrWR,Waiver,Others,SessionName,RollNo'); - $this->db->where('StudentID',$student['StudentID']); - $this->db->where('CourseID',$student['CourseID']); - $this->db->where('FeesType',$row1['Sem_Year']); - $existFeesDetails = $this->db->get(STUDENTS_FEES_STATUS); + $this->db->select('ifnull(SUM((SFS.CourseFees)),0) as CourseFees'); + $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); + $this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType'); + $this->db->where('SFS.CourseID',$student['CourseID']); + $this->db->where('SFS.StudentID',$student['StudentID']); + $feesAmount = $this->db->get()->result(); + + $this->db->select('ifnull(SUM((SFP.BillAmount)),0) as PaidAmount'); + $this->db->from(STUDENTS_FEES_PAID.' as SFP'); + $this->db->join(STUDENTS_FEES_STATUS.' as SFS', 'SFS.FeesID = SFP.FeesId'); + $this->db->where('SFS.CourseID',$student['CourseID']); + $this->db->where('SFS.StudentID',$student['StudentID']); + $paidAmount = $this->db->get()->result(); + + if($feesAmount[0]->CourseFees <= $paidAmount[0]->PaidAmount){ + // get default course fees + $this->db->select('CourseID,CourseName,PC,TC,DC,MC,OtherFees'); + $this->db->where('CourseID',$student['CourseID']); + $endFeesDetails = $this->db->get(COURSE); + $myArray = array(); + if($endFeesDetails->result()){ + foreach ($endFeesDetails->result() as $value ){ + $pc_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'PC', 'ActualFees'=>$value->PC); + $tc_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'TC', 'ActualFees'=>$value->TC); + $dc_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'DC', 'ActualFees'=>$value->DC); + $mc_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'MC', 'ActualFees'=>$value->MC); + $other_array = array('CourseID'=>$value->CourseID,'Sem_Year'=>'OTHER', 'ActualFees'=>$value->OtherFees); + + array_push($myArray,$pc_array); + array_push($myArray,$tc_array); + array_push($myArray,$dc_array); + array_push($myArray,$mc_array); + array_push($myArray,$other_array); + } + + // default course fees details in student status + foreach ($myArray as $row1){ + $this->db->select('FeesID,CourseFees,STFOrWR,Waiver,Others,SessionName,RollNo'); + $this->db->where('StudentID',$student['StudentID']); + $this->db->where('CourseID',$student['CourseID']); + $this->db->where('FeesType',$row1['Sem_Year']); + $existFeesDetails = $this->db->get(STUDENTS_FEES_STATUS); + + if($existData=$existFeesDetails->result()){ + $fetchData['ExistValue']=1; + $fetchData['ID']=$row1['Sem_Year']; + $fetchData['CourseID']=$row1['CourseID']; + $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['RollNo']=$existData[0]->RollNo; + $fetchData['PayableFees']=$existData[0]->CourseFees+$existData[0]->STFOrWR+$existData[0]->Others-$existData[0]->Waiver; + // for installment details + $InstallemtResult = $this->getInstallmentDetails($existData[0]->FeesID); + if($InstallemtResult != false){ + $fetchData['InstallmentDetails']=$InstallemtResult; + } + else{ + + $fetchData['InstallmentDetails']=""; + + + } + $CourseFeesArray1[]=$fetchData; - if($existData=$existFeesDetails->result()){ - $fetchData['ExistValue']=1; - $fetchData['ID']=$row1['Sem_Year']; - $fetchData['CourseID']=$row1['CourseID']; - $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['RollNo']=$existData[0]->RollNo; - $fetchData['PayableFees']=$existData[0]->CourseFees+$existData[0]->STFOrWR+$existData[0]->Others-$existData[0]->Waiver; - // for installment details - $InstallemtResult = $this->getInstallmentDetails($existData[0]->FeesID); - if($InstallemtResult != false){ - $fetchData['InstallmentDetails']=$InstallemtResult; } else{ - $fetchData['InstallmentDetails']=""; + $fetchData['ExistValue']=0; + $fetchData['ID']=$row1['Sem_Year']; + + $fetchData['CourseID']=$row1['CourseID']; + $fetchData['Sem_Year']=$row1['Sem_Year']; + $fetchData['ActualFees']=$row1['ActualFees']; + $fetchData['STFOrWR']=""; + $fetchData['Waiver']=""; + $fetchData['Others']=""; + $fetchData['SessionName']="Nill"; + $fetchData['RollNo']=""; + $fetchData['PayableFees']=$row1['ActualFees']; + $fetchData['InstallmentDetails']=""; + $CourseFeesArray1[]=$fetchData; } - $CourseFeesArray1[]=$fetchData; - - } - else{ - - $fetchData['ExistValue']=0; - - $fetchData['ID']=$row1['Sem_Year']; - - $fetchData['CourseID']=$row1['CourseID']; - $fetchData['Sem_Year']=$row1['Sem_Year']; - $fetchData['ActualFees']=$row1['ActualFees']; - $fetchData['STFOrWR']=""; - $fetchData['Waiver']=""; - $fetchData['Others']=""; - $fetchData['SessionName']="Nill"; - $fetchData['RollNo']=""; - $fetchData['PayableFees']=$row1['ActualFees']; - $fetchData['InstallmentDetails']=""; - $CourseFeesArray1[]=$fetchData; } + return $CourseFeesArray1; + } + else { + return false; } - - return $CourseFeesArray1; } - else { + else{ return false; } + } /* From 204eb2e0cfc845386eaae291ceefe61ba95d607f Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 11 Jan 2018 13:39:46 +0530 Subject: [PATCH 08/14] course details changes done --- Apollo/api/application/controllers/Fees_Status_Controller.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollo/api/application/controllers/Fees_Status_Controller.php b/Apollo/api/application/controllers/Fees_Status_Controller.php index 62c76882..d4380634 100755 --- a/Apollo/api/application/controllers/Fees_Status_Controller.php +++ b/Apollo/api/application/controllers/Fees_Status_Controller.php @@ -132,7 +132,7 @@ class Fees_Status_Controller extends REST_Controller { $detailsChild['StudentID'] = $this->post('studID'); $detailsChild['FeesId'] = $this->post('feesID'); - $detailsChild['BillNO'] = $this->post('billNO'); + $detailsChild['ReceiptNo'] = $this->post('billNO'); $detailsChild['BillDate'] = $this->post('billDate'); $detailsChild['BillAmount'] = $this->post('billAmount'); $detailsChild['ModeOfPayment'] = $this->post('modeOfPayment'); From d45ba66d633f594ef0ce51184dc73ad3914d8a1b Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 11 Jan 2018 13:40:43 +0530 Subject: [PATCH 09/14] course details changes done --- Apollo/assets/views/status-update/fees_status.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollo/assets/views/status-update/fees_status.html b/Apollo/assets/views/status-update/fees_status.html index 673131c0..163c6e2d 100755 --- a/Apollo/assets/views/status-update/fees_status.html +++ b/Apollo/assets/views/status-update/fees_status.html @@ -124,7 +124,7 @@ - + From 5dcca7b44c04bcba56d916cc2261c21cdaa68cf0 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 11 Jan 2018 13:57:42 +0530 Subject: [PATCH 10/14] course details changes done --- .../views/status-update/updateFeesStatus.html | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Apollo/assets/views/status-update/updateFeesStatus.html b/Apollo/assets/views/status-update/updateFeesStatus.html index b4f1f318..470eafb5 100755 --- a/Apollo/assets/views/status-update/updateFeesStatus.html +++ b/Apollo/assets/views/status-update/updateFeesStatus.html @@ -47,7 +47,7 @@
- Roll No is required + ng-model="updateModel.feesType.RollNo" ng-pattern="/^[a-zA-Z0-9-./\s]*$/" readonly/> + Invalid roll no @@ -299,18 +299,18 @@
+ ng-class="{'has-error':Form.billno.$dirty && Form.billno.$invalid}"> - + ng-model="updateModel.billNo" ng-pattern="/^[a-zA-Z0-9-./\s]*$/"/> + Bill no is required - Invalid bill no + ng-if="Form.billno.$dirty && Form.billno.$error.pattern">Invalid receipt no
@@ -447,6 +447,7 @@ Bill NO Bill Date Bill Amount + Receipt NO Print @@ -455,6 +456,7 @@ {{v.BillNO}} {{v.BillDate}} {{v.BillAmount}} + {{v.ReceiptNo}} @@ -498,7 +500,7 @@ Course: {{items.CourseName}} - Fees Type: {{items.FeesName}} + Fees Name: {{items.FeesName}} Exam Cycle: {{items.SessionName}} Univ: {{items.UniversityName}} From a3990d58f83bccb890242d0495ab8e301ef74edc Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 11 Jan 2018 13:57:57 +0530 Subject: [PATCH 11/14] course details changes done --- .../application/models/Fees_status_model.php | 66 ++++++++++++++++++- 1 file changed, 64 insertions(+), 2 deletions(-) diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index cb504c46..56f6d410 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -266,7 +266,7 @@ class Fees_status_model extends CI_Model } // for get paid bill details - $this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment,BR.BranchName'); + $this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment,ReceiptNo,BR.BranchName'); $this->db->from(STUDENTS_FEES_PAID.' as SFP'); $this->db->join(BRANCH.' as BR','BR.BranchCode = SFP.UpdatedBy','left'); $this->db->where('FeesId',$feeRow->FeesID); @@ -344,7 +344,7 @@ class Fees_status_model extends CI_Model } // for get paid bill details - $this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment,BR.BranchName'); + $this->db->select('ifnull(SUM((BillAmount)),0) as BillAmount,BillNO,BillDate,ModeOfPayment,ReceiptNo,BR.BranchName'); $this->db->from(STUDENTS_FEES_PAID.' as SFP'); $this->db->join(BRANCH.' as BR','BR.BranchCode = SFP.UpdatedBy','left'); $this->db->where('FeesId',$feeRow->FeesID); @@ -370,6 +370,33 @@ class Fees_status_model extends CI_Model public function updateFees($feesPaidDetails=null) { + if($feesPaidDetails['UpdatedBy']=='All'){ + $this->db->select('BranchID'); + $this->db->where('FeesID', $feesPaidDetails['FeesId']); + $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); + $this->db->join(STUDENTCOURSE.' as SC', 'SC.CourseID = SFS.CourseID'); + $getStudentBranch=$this->db->get()->result(); + $feesPaidDetails['UpdatedBy'] = $getStudentBranch[0]->BranchID; + + } + $this->db->select('BillNO'); + $this->db->where('UpdatedBy', $feesPaidDetails['UpdatedBy']); + + $getLastBillNo=$this->db->get(STUDENTS_FEES_PAID)->last_row(); + if($getLastBillNo){ + $strExplode= explode("-", $getLastBillNo->BillNO); + + $n=$strExplode[1]; + $n2 = str_pad($n + 1, 5, 0, STR_PAD_LEFT); + $splitString = substr($feesPaidDetails['UpdatedBy'], 0, 3); + $feesPaidDetails['BillNO']=$splitString.'-'.$n2; + } + else{ + $n='00000'; + $n2 = str_pad($n + 1, 5, 0, STR_PAD_LEFT); + $splitString = substr($feesPaidDetails['UpdatedBy'], 0, 3); + $feesPaidDetails['BillNO']=$splitString.'-'.$n2; + } $this->db->select('BillNO'); $this->db->where('BillNO', $feesPaidDetails['BillNO']); if($this->db->get(STUDENTS_FEES_PAID)->first_row()){ @@ -381,6 +408,11 @@ class Fees_status_model extends CI_Model $result['paidStatus'] = true; $result['message'] = "Successfully fees details added"; // $entryOfCallTrack = $this->updateInCallTrack($trackDetails); + // day book entry + if($feesPaidDetails['ModeOfPayment']=='CASH' AND $feesPaidDetails['BillAmount']!='0'){ + $dayBookEntry = $this->insertDayBookMaster($feesPaidDetails); + } + } else{ @@ -875,6 +907,36 @@ class Fees_status_model extends CI_Model return $result; } + /* + * insert day book master while fees update + * created by kms + * */ + public function insertDayBookMaster($data=null){ + $insertArray['Date'] = $data['BillDate']; + $insertArray['CreatedBy'] = $data['CreatedBy']; + $insertArray['CreatedOn'] = $data['CreatedOn']; + $insertArray['Description'] = $data['InternalComments']; + $insertArray['Amount'] = $data['BillAmount']; + $insertArray['Status'] = 'Pending'; + + $insertArray['BranchCode'] = $data['UpdatedBy']; + + $this->db->select('ID,TypeID'); + $this->db->where('TypeID', 'I002'); + $this->db->where('TypeName', 'FEES'); + $getIncome=$this->db->get(INCOMEOUTCOMEMASTER)->last_row(); + + if($getIncome){ + $insertArray['Name'] = $getIncome->TypeID; + $insertArray['Type'] = $getIncome->ID; + $this->db->insert(DAYBOOKMASTER, $insertArray); + return true; + } + else{ + return true; + } + + } } \ No newline at end of file From 382fddea4901fa9dc2b94a46c292610c184c89a2 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 11 Jan 2018 14:19:09 +0530 Subject: [PATCH 12/14] course details changes done --- Apollo/assets/views/status-update/updateFeesStatus.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Apollo/assets/views/status-update/updateFeesStatus.html b/Apollo/assets/views/status-update/updateFeesStatus.html index 470eafb5..4186ae52 100755 --- a/Apollo/assets/views/status-update/updateFeesStatus.html +++ b/Apollo/assets/views/status-update/updateFeesStatus.html @@ -482,7 +482,7 @@ - FEES RECEIPT + FEES ESTIMATE DOM: {{billNo}} From 1e574a53d46a7f25d3f4acdeb949d75db072682d Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Thu, 11 Jan 2018 14:32:45 +0530 Subject: [PATCH 13/14] course details changes done --- Apollo/assets/views/status-update/updateFeesStatus.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Apollo/assets/views/status-update/updateFeesStatus.html b/Apollo/assets/views/status-update/updateFeesStatus.html index 4186ae52..b5967b9b 100755 --- a/Apollo/assets/views/status-update/updateFeesStatus.html +++ b/Apollo/assets/views/status-update/updateFeesStatus.html @@ -481,7 +481,7 @@ 10/1, First Floor, Old Airport Road, Domlur, Bangalore - 560071. karnataka
Land Mark - Opp to Domlur Bus Stop Ph: 9620214554 - + FEES ESTIMATE DOM: {{billNo}} @@ -500,7 +500,7 @@ Course: {{items.CourseName}} - Fees Name: {{items.FeesName}} + Fees Type: {{items.FeesName}} Exam Cycle: {{items.SessionName}} Univ: {{items.UniversityName}} From 67451fb08a00d0e3ea63874db74d6f8b669a9b7e Mon Sep 17 00:00:00 2001 From: saravanakumar_kandasami Date: Thu, 11 Jan 2018 15:02:20 +0530 Subject: [PATCH 14/14] naming changes and dasboard table entries count --- Apollo/assets/i18n/en.json | 2 +- Apollo/assets/views/dashboard.html | 5 ++++- Apollo/assets/views/daybook/daybook.html | 6 +++--- Apollo/assets/views/daybook/daybookadmin.html | 4 ++-- Apollo/assets/views/daybook/daybooksuperadmin.html | 4 ++-- Apollo/assets/views/student/student_details.html | 2 +- Apollo/assets/views/studentStatusUpdate.html | 2 +- 7 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index da6279f8..069ade4c 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -67,7 +67,7 @@ "EMPLOYEE": "EMPLOYEE DETAILS", "ANNOUNCEMENT": "ANNOUNCEMENT DETAILS", "STATUS": "STATUS DETAILS", - "STUDENTSTATUS": "DEFAULT STUDENT ACTIVITY", + "STUDENTSTATUS": "STUDENT ACTIVITY STATUS", "CERTIFICATETYPE": "CERTIFICATE TYPE", "DAYBOOKMASTER":"DAY BOOK DETAILS" }, diff --git a/Apollo/assets/views/dashboard.html b/Apollo/assets/views/dashboard.html index 57034c99..be1b8cb0 100755 --- a/Apollo/assets/views/dashboard.html +++ b/Apollo/assets/views/dashboard.html @@ -32,6 +32,7 @@
+ @@ -42,7 +43,7 @@ - + @@ -76,6 +77,7 @@
Total Entries :{{todayFolloupDetails.length}}
Tracking ID Lead Name
{{today.TrackingID}} {{today.LeadName}}
+ @@ -121,6 +123,7 @@
Total Entries :{{pendingFolloupDetails.length}}
Tracking ID Lead Name
+ diff --git a/Apollo/assets/views/daybook/daybook.html b/Apollo/assets/views/daybook/daybook.html index 9002526b..35b44148 100755 --- a/Apollo/assets/views/daybook/daybook.html +++ b/Apollo/assets/views/daybook/daybook.html @@ -110,7 +110,7 @@ - - - - -
Total Entries :{{leadDetails.length}}
Tracking ID Lead NameVoucher Number Paid To + Paid To / Received From Type @@ -300,9 +300,9 @@ - - Paid To / Reveived To is required. + Paid To / Reveived From is required.
Voucher Number Paid To + Paid To / Received From Description @@ -252,7 +252,7 @@ Voucher Number Paid To + Paid To / Received From Description diff --git a/Apollo/assets/views/daybook/daybooksuperadmin.html b/Apollo/assets/views/daybook/daybooksuperadmin.html index c90b04d8..f9397a2b 100755 --- a/Apollo/assets/views/daybook/daybooksuperadmin.html +++ b/Apollo/assets/views/daybook/daybooksuperadmin.html @@ -161,7 +161,7 @@ Voucher Number Paid To + Paid To / Received From Description @@ -257,7 +257,7 @@ Voucher Number Paid To + Paid To / Received From Description diff --git a/Apollo/assets/views/student/student_details.html b/Apollo/assets/views/student/student_details.html index a8e2ef49..d595f2c5 100755 --- a/Apollo/assets/views/student/student_details.html +++ b/Apollo/assets/views/student/student_details.html @@ -2,7 +2,7 @@
-

{{ mainTitle }}

+

{{ mainTitle }}

diff --git a/Apollo/assets/views/studentStatusUpdate.html b/Apollo/assets/views/studentStatusUpdate.html index beab8b2c..57f9eb89 100755 --- a/Apollo/assets/views/studentStatusUpdate.html +++ b/Apollo/assets/views/studentStatusUpdate.html @@ -11,7 +11,7 @@
-

+