+ {{ i.date | date: "mediumDate" }} |
+
+
+
+ {{ "invoiceNumber" | i18n: i.number }}
+ |
+ {{ i.amount | currency: "$" }} |
+
{{ "paid" | i18n }}
diff --git a/apps/web/src/app/billing/shared/billing-history.component.ts b/apps/web/src/app/billing/shared/billing-history.component.ts
index ac16b3dc72..541edc912c 100644
--- a/apps/web/src/app/billing/shared/billing-history.component.ts
+++ b/apps/web/src/app/billing/shared/billing-history.component.ts
@@ -12,7 +12,10 @@ import {
})
export class BillingHistoryComponent {
@Input()
- invoices: BillingInvoiceResponse[];
+ openInvoices: BillingInvoiceResponse[];
+
+ @Input()
+ paidInvoices: BillingInvoiceResponse[];
@Input()
transactions: BillingTransactionResponse[];
diff --git a/apps/web/src/locales/en/messages.json b/apps/web/src/locales/en/messages.json
index a1ea607f4b..96afa9dd1a 100644
--- a/apps/web/src/locales/en/messages.json
+++ b/apps/web/src/locales/en/messages.json
@@ -2616,8 +2616,11 @@
"invoices": {
"message": "Invoices"
},
- "noInvoices": {
- "message": "No invoices."
+ "noUnpaidInvoices": {
+ "message": "No unpaid invoices."
+ },
+ "noPaidInvoices": {
+ "message": "No paid invoices."
},
"paid": {
"message": "Paid",
diff --git a/libs/common/src/billing/abstractions/account/account-billing-api.service.abstraction.ts b/libs/common/src/billing/abstractions/account/account-billing-api.service.abstraction.ts
index 4b67ce55c3..66f164ce50 100644
--- a/libs/common/src/billing/abstractions/account/account-billing-api.service.abstraction.ts
+++ b/libs/common/src/billing/abstractions/account/account-billing-api.service.abstraction.ts
@@ -4,9 +4,6 @@ import {
} from "@bitwarden/common/billing/models/response/billing.response";
export class AccountBillingApiServiceAbstraction {
- getBillingInvoices: (id: string, startAfter?: string) => Promise;
- getBillingTransactions: (
- id: string,
- startAfter?: string,
- ) => Promise;
+ getBillingInvoices: (status?: string, startAfter?: string) => Promise;
+ getBillingTransactions: (startAfter?: string) => Promise;
}
diff --git a/libs/common/src/billing/abstractions/organizations/organization-billing-api.service.abstraction.ts b/libs/common/src/billing/abstractions/organizations/organization-billing-api.service.abstraction.ts
index 4b3592bb6d..639f1fdb7c 100644
--- a/libs/common/src/billing/abstractions/organizations/organization-billing-api.service.abstraction.ts
+++ b/libs/common/src/billing/abstractions/organizations/organization-billing-api.service.abstraction.ts
@@ -4,7 +4,12 @@ import {
} from "@bitwarden/common/billing/models/response/billing.response";
export class OrganizationBillingApiServiceAbstraction {
- getBillingInvoices: (id: string, startAfter?: string) => Promise;
+ getBillingInvoices: (
+ id: string,
+ status?: string,
+ startAfter?: string,
+ ) => Promise;
+
getBillingTransactions: (
id: string,
startAfter?: string,
diff --git a/libs/common/src/billing/services/account/account-billing-api.service.ts b/libs/common/src/billing/services/account/account-billing-api.service.ts
index ddd5bad02e..f94940ecef 100644
--- a/libs/common/src/billing/services/account/account-billing-api.service.ts
+++ b/libs/common/src/billing/services/account/account-billing-api.service.ts
@@ -8,11 +8,25 @@ import {
export class AccountBillingApiService implements AccountBillingApiServiceAbstraction {
constructor(private apiService: ApiService) {}
- async getBillingInvoices(startAfter?: string): Promise {
- const queryParams = startAfter ? `?startAfter=${startAfter}` : "";
+ async getBillingInvoices(
+ status?: string,
+ startAfter?: string,
+ ): Promise {
+ const params = new URLSearchParams();
+
+ if (status) {
+ params.append("status", status);
+ }
+
+ if (startAfter) {
+ params.append("startAfter", startAfter);
+ }
+
+ const queryString = `?${params.toString()}`;
+
const r = await this.apiService.send(
"GET",
- `/accounts/billing/invoices${queryParams}`,
+ `/accounts/billing/invoices${queryString}`,
null,
true,
true,
diff --git a/libs/common/src/billing/services/organization/organization-billing-api.service.ts b/libs/common/src/billing/services/organization/organization-billing-api.service.ts
index acf12e8320..9bf1e6ee6d 100644
--- a/libs/common/src/billing/services/organization/organization-billing-api.service.ts
+++ b/libs/common/src/billing/services/organization/organization-billing-api.service.ts
@@ -8,11 +8,26 @@ import {
export class OrganizationBillingApiService implements OrganizationBillingApiServiceAbstraction {
constructor(private apiService: ApiService) {}
- async getBillingInvoices(id: string, startAfter?: string): Promise {
- const queryParams = startAfter ? `?startAfter=${startAfter}` : "";
+ async getBillingInvoices(
+ id: string,
+ status?: string,
+ startAfter?: string,
+ ): Promise {
+ const params = new URLSearchParams();
+
+ if (status) {
+ params.append("status", status);
+ }
+
+ if (startAfter) {
+ params.append("startAfter", startAfter);
+ }
+
+ const queryString = `?${params.toString()}`;
+
const r = await this.apiService.send(
"GET",
- `/organizations/${id}/billing/invoices${queryParams}`,
+ `/organizations/${id}/billing/invoices${queryString}`,
null,
true,
true,
|