1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-14 02:08:50 +02:00

invoice link for charges

This commit is contained in:
Kyle Spearrin 2017-10-25 00:47:07 -04:00
parent b52ecd8085
commit c60a596995
2 changed files with 15 additions and 1 deletions

View File

@ -2,7 +2,7 @@
.module('bit.organization')
.controller('organizationBillingController', function ($scope, apiService, $state, $uibModal, toastr, $analytics,
appSettings) {
appSettings, tokenService, $window) {
$scope.selfHosted = appSettings.selfHosted;
$scope.charges = [];
$scope.paymentSource = null;
@ -208,6 +208,15 @@
});
};
$scope.viewInvoice = function (charge) {
if ($scope.selfHosted) {
return;
}
var url = appSettings.apiUri + '/organizations/' + $state.params.orgId +
'/billing-invoice/' + charge.invoiceId + '?access_token=' + tokenService.getToken();
$window.open(url);
}
function load() {
apiService.organizations.getBilling({ id: $state.params.orgId }, function (org) {
$scope.loading = false;

View File

@ -201,6 +201,11 @@
<table class="table">
<tbody>
<tr ng-repeat="charge in charges">
<td style="width: 30px">
<a href="#" stop-click ng-click="viewInvoice(charge)" title="Invoice">
<i class="fa fa-file-pdf-o"></i>
</a>
</td>
<td style="width: 200px">
{{charge.date | date: 'mediumDate'}}
</td>