university
This commit is contained in:
parent
d9c8ba4cef
commit
f23bed5fda
@ -342,6 +342,7 @@ $route['promoteBatchInfomation'] = 'Reregister_Controller/promoteBatchInfomation
|
|||||||
//Reports
|
//Reports
|
||||||
$route['report_status'] = 'Report/status';
|
$route['report_status'] = 'Report/status';
|
||||||
$route['report_filters'] = 'Report/filters';
|
$route['report_filters'] = 'Report/filters';
|
||||||
|
$route['report_filter'] = 'Report/filter';
|
||||||
$route['report_markcard'] = 'Report/markcard';
|
$route['report_markcard'] = 'Report/markcard';
|
||||||
$route['report_certificate'] = 'Report/certificate';
|
$route['report_certificate'] = 'Report/certificate';
|
||||||
$route['report_markcard_certificate'] = 'Report/mark_cert';
|
$route['report_markcard_certificate'] = 'Report/mark_cert';
|
||||||
|
|||||||
@ -368,6 +368,28 @@ class Report extends REST_Controller {
|
|||||||
|
|
||||||
}
|
}
|
||||||
public function filters_post()
|
public function filters_post()
|
||||||
|
{
|
||||||
|
$br = $this->post('branch');
|
||||||
|
$getStatus = $this->report_model->getUniversity($br);
|
||||||
|
//print_r($getStatus);
|
||||||
|
if ($getStatus)
|
||||||
|
{
|
||||||
|
$getStatus['status'] = REST_Controller::HTTP_OK;
|
||||||
|
// Set the response and exit
|
||||||
|
$this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Set the response and exit
|
||||||
|
$this->response([
|
||||||
|
'message' => 'No records found!',
|
||||||
|
'status' => REST_Controller::HTTP_NOT_FOUND
|
||||||
|
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
public function filter_post()
|
||||||
{
|
{
|
||||||
$br = $this->post('branch');
|
$br = $this->post('branch');
|
||||||
$getStatus['Univ'] = $this->report_model->getUniv($br);
|
$getStatus['Univ'] = $this->report_model->getUniv($br);
|
||||||
|
|||||||
@ -140,7 +140,201 @@ app.controller('report_expenseCtrl', ["$scope", "API_POINTS", "$http", "SweetAle
|
|||||||
};
|
};
|
||||||
|
|
||||||
//pdf
|
//pdf
|
||||||
|
$scope.generatePFD = function (datas) {
|
||||||
|
$scope.loadStaring = true;
|
||||||
|
|
||||||
|
var o = {};
|
||||||
|
var intDataSNo = 1;
|
||||||
|
var intDate = 0;
|
||||||
|
|
||||||
|
for(var i = 0 ; i <= datas.length-1; ++i){
|
||||||
|
var element = datas[i];
|
||||||
|
//var element = datas[i-1];
|
||||||
|
console.log('staff or trainee');
|
||||||
|
var value = {};
|
||||||
|
|
||||||
|
value['SLNo'] = element.ORDER_ID;
|
||||||
|
value['Description'] = element.VoucherNumber;
|
||||||
|
value['January'] = element.PaidTo;
|
||||||
|
value['February'] = University;
|
||||||
|
value['March'] = element.Ty;
|
||||||
|
value['April'] = element.ReceiptNo || '-';
|
||||||
|
value['May'] = element.ReceiptNoComments || '-';
|
||||||
|
value['June'] = element.ModeOfPayment || '-';
|
||||||
|
value['July'] = element.Status || '-';
|
||||||
|
value['August'] = element.Status;
|
||||||
|
value['September'] = element.Balance || '-';
|
||||||
|
value['Balance'] = element.Balance || '-';
|
||||||
|
value['Balance'] = element.Balance || '-';
|
||||||
|
value['Balance'] = element.Balance || '-';
|
||||||
|
value['Balance'] = element.Balance || '-';
|
||||||
|
o[intDate] = value;
|
||||||
|
intDate++;
|
||||||
|
intDataSNo++;
|
||||||
|
}
|
||||||
|
|
||||||
|
rows1 = o;
|
||||||
|
var headers = {
|
||||||
|
fila_1: {
|
||||||
|
col_1: { text: 'SNo', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_2: { text: 'Voucher Number Bill Number / DATE', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_3: { text: 'Paid To Received From', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_4: { text: 'University / Course/ Sem', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_5: { text: 'Type', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_6: { text: 'Receipt No', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
//col_7: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_7: { text: 'Mode of Payment', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_8: { text: 'Status', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_9: { text: 'Amount', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_10: { text: 'Balance', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_11: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_12: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_13: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_14: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
col_15: { text: 'Comments', style: 'tableHeader', alignment: 'center', bold: true },
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var body = [];
|
||||||
|
for (var key in headers) {
|
||||||
|
if (headers.hasOwnProperty(key)) {
|
||||||
|
var header = headers[key];
|
||||||
|
var row = new Array();
|
||||||
|
row.push(header.col_1);
|
||||||
|
row.push(header.col_2);
|
||||||
|
row.push(header.col_3);
|
||||||
|
row.push(header.col_4);
|
||||||
|
row.push(header.col_5);
|
||||||
|
row.push(header.col_6);
|
||||||
|
row.push(header.col_7);
|
||||||
|
row.push(header.col_8);
|
||||||
|
row.push(header.col_9);
|
||||||
|
row.push(header.col_10);
|
||||||
|
row.push(header.col_11);
|
||||||
|
row.push(header.col_12);
|
||||||
|
row.push(header.col_13);
|
||||||
|
row.push(header.col_14);
|
||||||
|
row.push(header.col_15);
|
||||||
|
|
||||||
|
body.push(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (var key in rows1) {
|
||||||
|
if (rows1.hasOwnProperty(key)) {
|
||||||
|
var data = rows1[key];
|
||||||
|
var row = new Array();
|
||||||
|
row.push(data.SNo.toString());
|
||||||
|
row.push(data.Date.toString());
|
||||||
|
row.push(data.PaidReceivedToFrom.toString());
|
||||||
|
row.push(data.UnivCourseSem.toString());
|
||||||
|
row.push(data.Type.toString());
|
||||||
|
row.push(data.ReceiptNo.toString());
|
||||||
|
row.push(data.ModeofPayment.toString());
|
||||||
|
row.push(data.Status.toString());
|
||||||
|
row.push(data.Amount.toString());
|
||||||
|
row.push(data.Balance.toString());
|
||||||
|
row.push(data.Comments.toString());
|
||||||
|
row.push(data.Comments.toString());
|
||||||
|
row.push(data.Comments.toString());
|
||||||
|
row.push(data.Comments.toString());
|
||||||
|
row.push(data.Comments.toString());
|
||||||
|
body.push(row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var docDefinition = {
|
||||||
|
pageMargins: [20, 85, 20, 50],
|
||||||
|
pageOrientation: 'landscape',
|
||||||
|
header: function () {
|
||||||
|
return {
|
||||||
|
margin: 0,
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
text: ['Expense Report' ],
|
||||||
|
alignment: 'left', bold: true, margin: [20, 30, 0, 0], fontSize: 18
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
footer: function (currentPage, pageCount) {
|
||||||
|
if (currentPage === pageCount) {
|
||||||
|
return {
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
text: ['Note'],
|
||||||
|
alignment: 'left', margin: [10, 0, 0, 0], fontSize: 8
|
||||||
|
},
|
||||||
|
{ text: ['\n Page ' + currentPage.toString() + ' of ' + pageCount], alignment: 'right', margin: [0, 10, 10, 0], fontSize: 10 }
|
||||||
|
]
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
text: 'Page ' + currentPage.toString() + ' of ' + pageCount, alignment: 'right', margin: [0, 10, 10, 0], fontSize: 10
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
|
content: [
|
||||||
|
{
|
||||||
|
// layout: 'lightHorizontalLines', // optional
|
||||||
|
table: {
|
||||||
|
|
||||||
|
headerRows: 1,
|
||||||
|
keepWithHeaderRows: 0,
|
||||||
|
body: body
|
||||||
|
},
|
||||||
|
layout: {
|
||||||
|
hLineWidth: function (i, node) {
|
||||||
|
return 0.5;
|
||||||
|
},
|
||||||
|
vLineWidth: function (i, node) {
|
||||||
|
// return (i === 0 || i === node.table.widths.length) ? 0 : 40;
|
||||||
|
return 0.5;
|
||||||
|
},
|
||||||
|
hLineColor: function (i, node) {
|
||||||
|
return '#2D4D81';
|
||||||
|
},
|
||||||
|
vLineColor: function (i, node) {
|
||||||
|
return '#2D4D81';
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
styles: {
|
||||||
|
header: {
|
||||||
|
fontSize: 12,
|
||||||
|
bold: true
|
||||||
|
},
|
||||||
|
subheader: {
|
||||||
|
fontSize: 12,
|
||||||
|
bold: true
|
||||||
|
},
|
||||||
|
quote: {
|
||||||
|
italics: true
|
||||||
|
},
|
||||||
|
small: {
|
||||||
|
fontSize: 6
|
||||||
|
},
|
||||||
|
sta: {
|
||||||
|
fontSize: 8,
|
||||||
|
bold: false,
|
||||||
|
alignment: 'justify'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
pdfMake.createPdf(docDefinition).download('Expense Report).pdf', function(res) {
|
||||||
|
if(res === 'success'){
|
||||||
|
$scope.$apply(function(){
|
||||||
|
$scope.loadStaring = false;
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
$scope.$apply(function(){
|
||||||
|
$scope.loadStaring = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
//end of pdf
|
//end of pdf
|
||||||
|
|
||||||
$scope.exportData = function () {
|
$scope.exportData = function () {
|
||||||
|
|||||||
@ -71,7 +71,7 @@ app.controller('report_leadCtrl', ["$scope", "$filter","$rootScope","$modal", "A
|
|||||||
$scope.filters = function () {
|
$scope.filters = function () {
|
||||||
var filterlist = {
|
var filterlist = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: apiPoint.url + 'report_filters/',
|
url: apiPoint.url + 'report_filter/',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
},
|
},
|
||||||
|
|||||||
@ -83,7 +83,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<button pdf-save-button="getpdf" pdf-name="Expense_Report.pdf" class="btn btn-success btn-o">PDF</button>
|
<button pdf-save-button="getpdf" pdf-name="Expense_Report.pdf" class="btn btn-success btn-o">PDF</button>
|
||||||
<button class="btn btn-success btn-o" ng-click="exportData()">Export to Excel</button>
|
<button class="btn btn-success btn-o" ng-click="exportData()">Export to Excel</button>
|
||||||
|
<button ng-disabled="loadStaring" ng-click="generatePFD(datas)" class="btn btn-sm btn-default">
|
||||||
|
Export As PDF
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div pdf-save-content="getpdf" class="table-responsive" style="margin-top: 20px;">
|
<div pdf-save-content="getpdf" class="table-responsive" style="margin-top: 20px;">
|
||||||
<h4 style="text-align:center;">Apollo Distance Education College - {{expense_data[0].branch}}</h4>
|
<h4 style="text-align:center;">Apollo Distance Education College - {{expense_data[0].branch}}</h4>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user