From c60a596995d1c4125c63a36f43504335eba9636d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 25 Oct 2017 00:47:07 -0400 Subject: [PATCH] invoice link for charges --- src/app/organization/organizationBillingController.js | 11 ++++++++++- src/app/organization/views/organizationBilling.html | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/app/organization/organizationBillingController.js b/src/app/organization/organizationBillingController.js index 68e72b68c2..d2d25f1239 100644 --- a/src/app/organization/organizationBillingController.js +++ b/src/app/organization/organizationBillingController.js @@ -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; diff --git a/src/app/organization/views/organizationBilling.html b/src/app/organization/views/organizationBilling.html index 70a972c093..40120c6b27 100644 --- a/src/app/organization/views/organizationBilling.html +++ b/src/app/organization/views/organizationBilling.html @@ -201,6 +201,11 @@ +
+ + + + {{charge.date | date: 'mediumDate'}}