print option for fees details

This commit is contained in:
gandhimathi 2018-08-03 17:37:03 +05:30
parent 3e3f7f97b8
commit 451a3656de
2 changed files with 62 additions and 33 deletions

View File

@ -315,7 +315,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if((svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID) && $scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
if((svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID) && $scope.ExistSessionDate < new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName,
"SessionID":svalues.SessionID,
@ -360,7 +360,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
"SessionID":svalues.SessionID,
});
if($scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
if($scope.ExistSessionDate < new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetailsTo.push({
@ -394,7 +394,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
angular.forEach($scope.masterSessionDetails,function (svalues,skey) {
if((svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID) && $scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
if((svalues.IsActive=='1' || $scope.feesStructureInfo[0].SessionName==svalues.SessionID) && $scope.ExistSessionDate < new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetails.push({
"SessionName":svalues.SessionName ,
"SessionID":svalues.SessionID,
@ -457,7 +457,7 @@ app.controller('feesStatusCtrl', ["$scope","$rootScope","toaster", "$filter", "n
"SessionID":svalues.SessionID,
});
if($scope.ExistSessionDate <= new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
if($scope.ExistSessionDate < new Date(svalues.SessionDate.substring(6,10)+'-'+svalues.SessionDate.substring(3,5)+'-'+svalues.SessionDate.substring(0,2))){
$scope.sessionDetailsTo.push({
@ -2222,7 +2222,7 @@ app.controller('ModalDemoCtrl', ["$scope", "$modal", "$log", function ($scope, $
// Please note that $modalInstance represents a modal window (instance) dependency.
// It is not the same as the $modal service used above.
app.controller('FeesModalInstanceCtrl', ["$scope", "$modalInstance", "items","WordsService", function ($scope, $modalInstance, items,WordsService) {
app.controller('FeesModalInstanceCtrl', ["$scope", "$modalInstance", "$timeout", "items","WordsService", function ($scope, $modalInstance, $timeout, items,WordsService) {
$scope.items = items;
$scope.selected = {
@ -2237,6 +2237,7 @@ app.controller('FeesModalInstanceCtrl', ["$scope", "$modalInstance", "items","Wo
$scope.cancel = function () {
$modalInstance.dismiss('cancel');
};
//show hide function for pdf design
$scope.billNo="";
$scope.receiptNo="";
@ -2250,7 +2251,13 @@ app.controller('FeesModalInstanceCtrl', ["$scope", "$modalInstance", "items","Wo
$scope.BranchAddr = "";
$scope.BranchLogo = "";
$scope.FeesReceiptTitle = "";
$scope.ShowHide = function (pdfValue) {
$scope.myPdfView = '';
$scope.ShowHide = function (pdfValue,print) {
$timeout(()=> {
//alert(this.print);
$scope.printPdf(print);
}, 0);
$scope.myPdfView = pdfValue;
$scope.showButton = true;
$scope.billNo = pdfValue.BillNO;
$scope.paymentType=pdfValue.ModeOfPayment;
@ -2264,32 +2271,46 @@ app.controller('FeesModalInstanceCtrl', ["$scope", "$modalInstance", "items","Wo
$scope.FeesReceiptTitle = pdfValue.FeesReceiptTitle;
$scope.receiptNo=pdfValue.ReceiptNo;
}
$scope.pdfPrint = function (pdf) {
//PDF print
var innerContents = document.getElementById(pdf).innerHTML;
var popupWinindow = window.open('', '_blank', 'width=600,height=700,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,titlebar=no');
//testing for print
$scope.printPdf = function (print) {
var innerContents = document.getElementById(print).innerHTML;
var popupWinindow = window.open('', '_blank', 'width=1200,height=700,scrollbars=no,menubar=no,toolbar=no,location=no,status=no,titlebar=no');
popupWinindow.document.open();
popupWinindow.document.write('<html><head></head><body onload="window.print()">' + innerContents + '</html>');
popupWinindow.document.write('<html>');
popupWinindow.document.write('<style type="text/css">');
//popupWinindow.document.write('.table{border-collapse: collapse; color: black;}');
popupWinindow.document.write('</style>');
popupWinindow.document.write(innerContents);
popupWinindow.document.write('</html>');
popupWinindow.document.close();
popupWinindow.focus();
popupWinindow.print();
popupWinindow.close();
}
$scope.mouseLeave = function(){
$scope.showButton = false;
$scope.billNo="";
$scope.sessionName="";
$scope.paymentType="";
$scope.billDate="";
$scope.amountInWords = "";
$scope.billAmount = "";
$scope.branchName = "";
$scope.ReceivedBy="";
$scope.BranchAddr = "";
$scope.BranchLogo = "";
$scope.FeesReceiptTitle="";
$scope.receiptNo="";
}
// $scope.mouseLeave = function(){
// $scope.showButton = false;
// $scope.billNo="";
// $scope.sessionName="";
// $scope.paymentType="";
// $scope.billDate="";
// $scope.amountInWords = "";
// $scope.billAmount = "";
// $scope.branchName = "";
// $scope.ReceivedBy="";
// $scope.BranchAddr = "";
// $scope.BranchLogo = "";
// $scope.FeesReceiptTitle="";
// $scope.receiptNo="";
// }
}]);
app.directive('visible', function() {

View File

@ -423,7 +423,7 @@
<th style="text-align:center;">Mode of Payment </th>
<th style="text-align:center;">Comments For Student </th>
<th style="text-align:center;">Comments For Internal </th>
<th style="text-align:center;">Print</th>
<th style="text-align:center;">Print</th>
</tr>
</thead>
<tbody>
@ -438,17 +438,18 @@
<td width="10" style="vertical-align:top;text-align:center;">
<a tooltip="Click to print" ng-mouseleave="mouseLeave()" pdf-save-button="{{v.BillNO}}" pdf-name="Billno-{{v.BillNO}}.pdf" class="btn"><i class="fa fa-print" ng-click="ShowHide(v)"></i></a>
<a tooltip="Click to print" class="btn"><i class="fa fa-print" ng-click="ShowHide(v,'print')"></i></a>
</td>
</tr>
</table>
<div id="pdf" pdf-save-content="{{billNo}}" visible='showButton'>
<table style="border-collapse: collapse; color: black;" border="0" width="100%">
<div id="print" after-render="printPdf">
<div ng-if="myPdfView">
<table style="border-collapse: collapse; color: black;" border="0" width="100%">
<tbody>
<tr style="height: 23px;">
<td ng-if="BranchLogo=='' || BranchLogo==null" style="width: 136px; height: 82px; border-right-style: hidden; color: white; background-color: black; font-size: 22px; text-align: center;" rowspan="3">APOLLO</td>
@ -459,7 +460,9 @@
<img flow-img="obj.flow.files[0]" ng-if="obj.flow.files.length">-->
</div>
</td>
<div class="title">
<td style="width: 136px; height: 23px; text-align: center; border-bottom-style: hidden; color: white; background-color: black; font-size: 20px;" colspan="3"><strong><!--APOLLO DISTANCE EDUCATION COLLEGE-->{{FeesReceiptTitle}}</strong>
</div>
</br>
<!--<span style="font-size: 16px;">(A Group of SVE Trust)</span>
</br>-->
@ -516,8 +519,11 @@
<td style="width: 136px; height: 42px; color: white; background-color: black; font-size: 14px;text-align: center;" colspan="4">Note: Terms & Conditions will be applicable as per University norms Fees once paid will not be refunded at any reasons</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@ -533,6 +539,7 @@
</div>
</div>
</div>
@ -547,4 +554,5 @@
</div>
</div>
</form>
<!-- class="editRowTd" -->