feecollected report

This commit is contained in:
venbatechnologies@gmail.com 2018-08-23 10:32:06 +05:30
parent 5549ffa782
commit 746c3174e7
10 changed files with 601 additions and 3 deletions

View File

@ -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

View File

@ -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';

View File

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

View File

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

View File

@ -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": {

View File

@ -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

View File

@ -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",

View File

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

View File

@ -0,0 +1,210 @@
<style type="text/css">
.pad {
background-color: #eee;
padding: 4px;
}
.fif {
/* background-color: #ddd;*/
display: inline-block;
margin: 0 175px 0 0;
padding: 8px 8px;
text-align: left;
width: 200px;
}
.right {
/* background-color: #ddd;*/
display: inline-block;
/*margin: 0 25px 0 0;*/
padding: 1px 1px;
text-align: right;
}
.rightac {
/* background-color: #ddd;*/
display: inline-block;
margin: 0 175px 0 0;
padding: 8px 8px;
text-align: left;
width: 200px;
}
.a {
word-spacing: 9cm;
}
</style>
<section id="page-title">
<div class="row">
<div class="col-sm-8">
<h1 class="mainTitle">Fee Collected Report</h1>
</div>
<!-- <div ncy-breadcrumb></div> -->
</div>
</section>
<style>
/* .sort-icon {
font-size: 9px;
margin-left: 5px;
}
th {
cursor: pointer;
} */
</style>
<script type="text/javascript" src="bower_components/ng-table-excel-export/ng-table-excel-export.min.js">
</script>
<div class="container-fluid container-fullw bg-white">
<div ng-controller="FeeCollected_reportCtrl" data-ng-init="init()">
<form name="Form" id="form" novalidates method="post">
<fieldset>
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-3">
<!--<pre>{{searchData.date}}</pre>-->
<div data-ng-controller="DatepickerDemoCtrl">
<label>
From Date
</label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="filters.from_date"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
placeholder="Select Date" close-text="Close" required="required" ng-change="changeDate()"
show-button-bar="true" />
</div>
</div>
<div class="col-md-3">
<!--<pre>{{searchData.date}}</pre>-->
<div data-ng-controller="DatepickerDemoCtrl">
<label>
To Date
</label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="filters.to_date"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
placeholder="Select Date" close-text="Close" required="required" ng-change="changeToDate()"
show-button-bar="true" />
</div>
</div>
<div class="col-md-3" >
<label for="form-field-select-2">
University
</label>
<select class="form-control" tabindex="3" class="cs-select cs-skin-elastic" name="university" ng-model="myModel.myUnivSearch"
ng-click="getEmployeeList()">
<option value="" disabled selected>Select University</option>
<option ng-repeat="item in universitySearchData" value="{{item.UniversityID}}">{{item.UniversityName}}</option>
</select>
</div>
<div class="col-md-2" style="padding-top: 2.3%;">
<div class="pull-right">
<button type="submit" class="btn btn-success btn-o" ng-click="getDetails(Form,myModel);" tabindex="8">
Submit
</button>
</div>
</div>
</div>
</div>
</div>
</fieldset>
</form>
<!-- <pre>{{statusr | json}}</pre> -->
<div class="row" style="text-align: right;">
<div class="col-md-4">
<!-- <input class="form-control" type="text" ng-model="search" id="searchIn" autofocus tabindex="2" placeholder="Search" /> -->
</div>
<button class="btn btn-success btn-o" ng-click="exportData()">Export to Excel</button>
<!-- <button type="button" ladda="ldloading1.zoom_in" tabindex="5" class="btn btn-success btn-o" data-style="zoom-in" ng-click="changeSem(myModel.universityName,myModel.courseName);">Generate PDF</button> -->
<!-- <button class="btn btn-success" id="print" ng-click="generatePDF();">Print</button></div> -->
</div>
<div>
<div ng-if="isLoaderShow">
<center> <h1>No Records Found !!</h1> </center>
</div>
<div class="col-md-12" ng-if="isShow">
<div class="table-responsive">
<table id="datatable" class="table table-hover">
<thead>
<tr >
<th style="font-size: 12px;">University</th>
<th style="font-size: 12px;">Cash</th>
<th style="font-size: 12px;">Cheque</th>
<th style="font-size: 12px">Referral</th>
<th style="font-size: 12px;">Online Transaction</th>
<th style="font-size: 12px;">Waiver</th>
<th style="font-size: 12px;">Credit/Debit Card</th>
<th style="font-size: 12px;">Total</th>
<!-- <th style="font-size: 12px;">Amount</th>
<th style="font-size: 12px;">Action</th> -->
</tr>
</thead>
<tbody dir-paginate="p in newreglist|filter:search:strict|itemsPerPage:10">
<tr>
<td>{{p.UniversityName}}</td>
<td>{{p.Cash}}</td>
<td>{{p.Cheque}}</td>
<td>{{p.Referal}}</td>
<td>{{p.Onlinec}}</td>
<td>{{p.WAIVER}}</td>
<td>{{p.Card}}</td>
<td>{{p.Total}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<!-- <div ng-if="load=0">
<b><h1 style="color:black;"><center> No Records Found</h1></center></b>
</div> -->
<!-- <dir-pagination-controls direction-links="true" boundary-links="true">
</dir-pagination-controls> -->
</div>
</div>

View File

@ -490,6 +490,12 @@
<span class="title" translate="sidebar.nav.report.newreg">New Registration</span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="app.reports.feeCollect" ng-click="checkSuperAdmin()">
<span class="title" translate="sidebar.nav.report.feeCollect">Fee Collected</span>
</a>
</li>
@ -974,7 +980,14 @@
<span class="title" translate="sidebar.nav.report.newreg">New Registration</span>
</a>
</li>
<li ui-sref-active="active">
<a ui-sref="app.reports.feeCollect" ng-click="checkSuperAdmin()">
<span class="title" translate="sidebar.nav.report.feeCollect">Report For Fees Collection</span>
</a>
</li>
</ul>