MIFOSX-1823: Savings Transaction Receipt can be viewed/printed

This commit is contained in:
MithunKashyap 2015-01-06 15:30:03 +05:30
parent 595223a7e3
commit ff49d71384
4 changed files with 34 additions and 0 deletions

View File

@ -22,6 +22,7 @@
"label.heading.type": "Type",
"label.heading.category": "Category",
"label.heading.balance": "Balance",
"label.heading.viewreceipts":"View Receipt",
"label.heading.savingaccount": "Saving Account",
"label.heading.description": "Description",
"label.heading.shortname": "Short name",

View File

@ -336,6 +336,23 @@
};
scope.viewsavingstransactionreceipts = function (transactionId) {
scope.printbtn = true;
scope.hidePentahoReport = true;
scope.formData.outputType = 'HTML';
scope.baseURL = $rootScope.hostUrl + API_VERSION + "/runreports/" + encodeURIComponent("Savings Transaction Receipt");
scope.baseURL += "?output-type=" + encodeURIComponent(scope.formData.outputType) + "&tenantIdentifier=" + $rootScope.tenantIdentifier+"&locale="+scope.optlang.code;
var reportParams = "";
var paramName = "R_transactionId";
reportParams += encodeURIComponent(paramName) + "=" + encodeURIComponent(transactionId);
if (reportParams > "") {
scope.baseURL += "&" + reportParams;
}
// allow untrusted urls for iframe http://docs.angularjs.org/error/$sce/insecurl
scope.baseURL = $sce.trustAsResourceUrl(scope.baseURL);
};
scope.printReport = function () {
window.print();
window.close();

View File

@ -1178,6 +1178,8 @@ input#search:-ms-input-placeholder {
body * { visibility: hidden; }
#printcontent * { visibility: visible; }
#printcontent { position: absolute; top: 100px; left: 100px; width: 160%;height: 100%;}
#printreceiptcontent * { visibility: visible; }
#printreceiptcontent { position: absolute; top: 100px; left: 100px; width: 160%;height: 100%;}
}
.boldlabel{
font-size: 20px;

View File

@ -286,6 +286,7 @@
<th class="pointer" ng-click="changeTransactionSort('amount')">{{'label.heading.debit' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('amount')">{{'label.heading.credit' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('runningBalance')">{{'label.heading.balance' | translate}}</th>
<th class="pointer" ng-click="changeTransactionSort('runningBalance')">{{'label.heading.viewreceipts' | translate}}</th>
</tr>
</thead>
<tbody>
@ -319,9 +320,22 @@
data-ng-click="routeTo(transaction.accountId,transaction.id,transaction.transfer,transaction.transfer.id)">
{{transaction.runningBalance| number}}
</td>
<td> <a ng-click="viewsavingstransactionreceipts(transaction.id)">
<i class="icon-file-text-o icon-large"></i>
</a>
</td>
</tr>
</tbody>
</table>
<div>
<button ng-show="printbtn" ng-click="printReport()" class="btn btn-primary"><i class="icon-print icon-white">{{'label.button.print' |
translate}}
</i></button>
<div id="printreceiptcontent">
<iframe id="rptLoadingreceiptFrame" ng-src="{{baseURL}}" frameborder="0" width="100%" height="800px"></iframe>
</div>
</div>
</tab>
<tab heading="{{savingdatatable.registeredTableName}}" ng-repeat="savingdatatable in savingdatatables" has-permission='READ_{{savingdatatable.registeredTableName}}'
select="dataTableChange(savingdatatable)">