diff --git a/Apollo/api/application/config/constants.php b/Apollo/api/application/config/constants.php index 7554fb19..194a6e65 100755 --- a/Apollo/api/application/config/constants.php +++ b/Apollo/api/application/config/constants.php @@ -171,3 +171,14 @@ defined('RE_REGISTRATION_CONST') OR define('RE_REGISTRATION_CONST','Re-registrat //encripted password -> md5 defined('ENCR_PASSWORD') OR define('ENCR_PASSWORD','e99a18c428cb38d5f260853678922e03'); //end of encripted password + +//transaxtion methods +defined('CASH') OR define('CASH','CASH'); +defined('CHEQUE') OR define('CHEQUE','CHEQUE'); +defined('REFERRAL') OR define('REFERRAL','REFERRAL'); +defined('ONLINETRANSACTION') OR define('ONLINETRANSACTION','ONLINE TRANSACTION'); +defined('WAIVER') OR define('WAIVER','WAIVER'); +defined('CreditDebitCard') OR define('CreditDebitCard','Credit/Debit Card'); + +//end of transaction + diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index 09952634..d43f6524 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -196,6 +196,8 @@ $route['update_DayBookDetails'] = 'DayBook_Controller/update_DayBookDetailsData' $route['AllgetUniversity'] = 'Report/getAllUniversity'; $route['NewregDetails'] = 'Report/NewregDetails'; +$route['feepaidDetails'] = 'Report/feepaidDetails'; + /* Add New Contact Group */ $route['addNewGroup'] = 'Broadcast_Controller/addNewGroup'; $route['getGroups'] = 'Broadcast_Controller/getGroups'; diff --git a/Apollo/api/application/controllers/Report.php b/Apollo/api/application/controllers/Report.php index e61fc126..0f8c0b51 100755 --- a/Apollo/api/application/controllers/Report.php +++ b/Apollo/api/application/controllers/Report.php @@ -439,6 +439,32 @@ class Report extends REST_Controller { ], REST_Controller::HTTP_NOT_FOUND); } } + + + + + public function feepaidDetails_post() + { + $det['from'] = $this->post('from'); + $det['to'] = $this->post('to'); + $det['university'] = $this->post('university'); + + $feelist = $this->report_model->GetFeePaidDetails($det); + + if($feelist) + { + $feelist['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($feelist, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); + } + } diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 43f90401..4a60560d 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -862,5 +862,69 @@ $query = $this->db->query($subQuery,array(NEWREGISTRATION_CONST,'%d-%m-%Y',$from } + + + + public function GetFeePaidDetails($det) + { + + $start_date= $det['from']; + $end_date = $det['to']; + + //echo $det['university'];die() ; + + $this->db->select('T_Student_CourseDetails.UniversityID,UniversityName, + SUM(IF(ModeOfPayment ="CASH", BillAmount, 0)) AS Cash, + SUM(IF(ModeOfPayment ="CHEQUE",BillAmount, 0)) AS Cheque, + SUM(IF(ModeOfPayment ="REFERRAL", BillAmount, 0)) AS Referal, + SUM(IF(ModeOfPayment ="ONLINE TRANSACTION",BillAmount, 0)) AS Onlinec, + SUM(IF(ModeOfPayment ="WAIVER",BillAmount, 0)) AS WAIVER, + SUM(IF(ModeOfPayment ="Credit/Debit Card",BillAmount, 0)) AS Card, + SUM(T_Students_Fees_PaidDetails.BillAmount) AS Total'); + $this->db->from('T_Students_Fees_PaidDetails'); + $this->db->join('T_Student_CourseDetails','T_Student_CourseDetails.StudentID=T_Students_Fees_PaidDetails.StudentID'); + $this->db->join('T_UniversityMaster','T_UniversityMaster.UniversityID=T_Student_CourseDetails.UniversityID'); + // $this->db->where('T_Students_Fees_PaidDetails.CreatedOn BETWEEN "'.date('Y-m-d', strtotime($start_date)). '" and "'. date('Y-m-d', strtotime($end_date)).'"'); + + + $this->db->where('T_Students_Fees_PaidDetails.CreatedOn>=',date('Y-m-d', strtotime($start_date))); + + $this->db->where('T_Students_Fees_PaidDetails.CreatedOn>=',date('Y-m-d', strtotime($end_date))); + // $this->db->where(' BillDate <= str_to_date("'.$end_date.'",%d-%m-%Y)'); + + + + $this->db->where('T_Students_Fees_PaidDetails.IsActive','1'); + + if($det['university']!='') + { + $this->db->where('T_Student_CourseDetails.UniversityID',$det['university']); + } + + $this->db->group_by('UniversityID'); + + $feeDetails = $this->db->get()->result(); + +// print_r( $this->db->last_query()); +// die(); + + // print_r($feeDetails); +if($feeDetails) + { + + //print_r($searchDetails->result()); + $result_array['searchst'] = true; + $result_array['details'] = $feeDetails; + } + else + { + $result_array['searchst'] = false; + $result_array['details'] = "No records found!"; + } + + + return $result_array; + + } } \ No newline at end of file diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index 43b1900a..0eb26179 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -92,7 +92,8 @@ "examfee": "EXAM WRITING FEE REPORT", "balfee": "FEE BALANCE REPORT", "lead": "LEAD TRACKING REPORT", - "newreg":"NEW REG REPORT" + "newreg":"NEW REG REPORT", + "feeCollect":"FEE COLLECTED" }, "student": { diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index d0574559..ec23adc5 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -142,7 +142,9 @@ app.constant('JS_REQUIRES', { 'newreg_reportCtrl': 'assets/js/controllers/newreg_reportCtrl.js', /* - + * */ + 'FeeCollected_reportCtrl': 'assets/js/controllers/FeeCollected_reportCtrl.js', + /* * student status updation diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index afab87b3..05809016 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -194,6 +194,14 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com ncyBreadcrumb: { label: 'newreg' }, + }).state('app.reports.feeCollect', { + url: '/feeCollect', + templateUrl: "assets/views/feecollected.html", + resolve: loadSequence('FeeCollected_reportCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'feeCollect', + ncyBreadcrumb: { + label: 'feeCollect' + }, }).state('app.master.studentStatusUpdate', { url: '/default activity', templateUrl: "assets/views/studentStatusUpdate.html", diff --git a/Apollo/assets/js/controllers/FeeCollected_reportCtrl.js b/Apollo/assets/js/controllers/FeeCollected_reportCtrl.js new file mode 100644 index 00000000..68724f7c --- /dev/null +++ b/Apollo/assets/js/controllers/FeeCollected_reportCtrl.js @@ -0,0 +1,261 @@ +'use strict'; +/*** controller***/ +app.controller('FeeCollected_reportCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage" ,"$http", "$state","$modal","$log", + function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http,ipCookie ,$state,$modal,$log){ + + //function ($scope, apiPoint, $http, SweetAlert, $state,$modal, md5, ipCookie, $window, dateListDescService) { + + // DataTables configurable options + + + $scope.filters = { + + "from_date": "", + "to_date": "", + + }; + + + var localDetails = JSON.parse(localStorage.getItem('localObj')); + //var localDetails = ipCookie('cookiechk'); + + //console.log(localDetails); + + + // $scope.initHead = function() { +//console.log('rfd'); + var logcheck = JSON.parse(localStorage.getItem('localObj')); + + const LOCALTYPE = logcheck.localType; + if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' || LOCALTYPE == 'R002' || LOCALTYPE == 'R005')) { + console.log("if"); + }else { + if(logcheck != null && LOCALTYPE !='R001') { + console.log("else if"); + $state.go('app.dashboard'); + } else { + + console.log("else else"); + //ipCookie.remove('cookiechk'); + window.localStorage.clear(); + $state.go('login.signin'); + } + } + + // } + $scope.universitySearchData = ''; + + $scope.init = function() + { + + // alert() + var getuniv = { + method: 'POST', + url: apiPoint.url + 'AllgetUniversity/', + headers: { + 'Content-Type': 'application/json' + }, + + data: { + + branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, + } + + }; + + $http(getuniv).then(function (response) { + + if(response.status == 200) + { + $scope.universitySearchData=response.data.details; + } + + }); + + + }; + + + + + + +//$scope.opinctotal=''; +$scope.newreglist=''; +$scope.isLoaderShow =''; +$scope.load = ''; +$scope.isShow= ''; +$scope.fromd=''; +$scope.tod=''; +$scope.universityId=''; +$scope.getDetails = function (form,myModel) +{ + + +var firstError = null; + if (form.$invalid) { + var field = null, firstError = null; + $scope.show = true; + for (field in form) { + if (field[0] != '$') { + if (firstError === null && !form[field].$valid) { + firstError = form[field].$batch; + } + if (form[field].$pristine) { + form[field].$dirty = true; + } + } + } + angular.element('.ng-invalid[batch=' + firstError + ']').focus(); + } + + else + { + var from = $scope.filters.from_date; + var to = $scope.filters.to_date; + +if(myModel === undefined) +{ + $scope.universityId=''; +} +else +{ + + $scope.universityId = myModel.myUnivSearch; +} + +var f = new Date(from), +month = '' + (f.getMonth() + 1), +day = '' + f.getDate(), +year = f.getFullYear(); + +if (month.length < 2) month = '0' + month; +if (day.length < 2) day = '0' + day; + +var from_dt = [day, month ,year].join('-'); + + + +var t = new Date(to), +month = '' + (t.getMonth() + 1), +day = '' + t.getDate(), +year = t.getFullYear(); + +if (month.length < 2) month = '0' + month; +if (day.length < 2) day = '0' + day; + +var to_dt = [day, month ,year].join('-'); + + +$scope.fromd = from_dt; +$scope.tod = to_dt; + + + var getstudentdetails = { + + method: 'POST', + url: apiPoint.url + 'feepaidDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + university: $scope.universityId, + from : $scope.fromd , + to : $scope.tod + + } + } + + $http(getstudentdetails).then(function (response) { + + if(response.data.status == 200 && response.data.searchst==true) + { + + //console.log(response.data); + $scope.newreglist = response.data.details; + $scope.isShow=true; + $scope.isLoaderShow=false; + + console.log($scope.newreglist); + + } + + else + { + $scope.isLoaderShow=true; + $scope.isShow=false; + } + + + }); + } + +} + + + + + + + + + $scope.exportData = function () + { + //alert() + + $scope.sam = 'Fee Paid list from '+$scope.fromd+' to '+$scope.tod; + + + var mystyle = { + sheetid:$scope.sam, + headers: true, + caption: { + title: $scope.sam, + width: '1000px', + style:'font-size:50px;bold:true' + }, + // style:'background:#00FF00', + column: { + style:'font-size:12px' + }, + + }; + console.log(mystyle); + + alasql('SELECT UniversityName,Cash,Cheque,Referal,Onlinec as OnlineTransaction,WAIVER,Card as CardTransaction,Total INTO XLS("Fee Paid List report.xls",?) FROM ?',[mystyle,$scope.newreglist]); + + }; + + + $scope.OpenWindowStatus = false; + $scope.editId = -1; + $scope.setEditId = function (P) + { + //alert(P); + $scope.editId = P; + + } + + $scope.close = function () + { + + $scope.editId = -1; + + } + + +$scope.fdate =''; +$scope.tdate =''; +//$scope.Subtypes = ''; + + + + + + + + }]); + + + + diff --git a/Apollo/assets/views/feecollected.html b/Apollo/assets/views/feecollected.html new file mode 100644 index 00000000..e2c12846 --- /dev/null +++ b/Apollo/assets/views/feecollected.html @@ -0,0 +1,210 @@ + + + + + + +
+
+
+

Fee Collected Report

+
+ +
+
+ + +
+
+
+
+
+
+ + +
+
+ +
+ + + +
+
+ + +
+ +
+ + + +
+
+ + +
+ + + +
+ + + + + +
+
+ + + +
+
+
+ + + +
+
+
+ +
+ +
+
+ +
+ + + + + + +
+ +
+
+

No Records Found !!

+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
UniversityCashChequeReferralOnline TransactionWaiverCredit/Debit CardTotal
{{p.UniversityName}}{{p.Cash}}{{p.Cheque}}{{p.Referal}}{{p.Onlinec}}{{p.WAIVER}}{{p.Card}}{{p.Total}}
+
+
+ + + + +
+ + + +
+
+ + diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index 4d46a744..65b18287 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -490,6 +490,12 @@ New Registration + +
  • + + Fee Collected + +
  • @@ -974,7 +980,14 @@ New Registration - + + + +
  • + + Report For Fees Collection + +