Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ const ONYXKEYS = {
/** ID associated with the payment card added by the user. */
NVP_BILLING_FUND_ID: 'nvp_expensify_billingFundID',

/** The user's freebie credits balance (in cents). */
NVP_PRIVATE_FREEBIE_CREDITS: 'nvp_private_freebieCredits',

/** The amount owed by the workspace’s owner. */
NVP_PRIVATE_AMOUNT_OWED: 'nvp_private_amountOwed',

Expand Down Expand Up @@ -1475,6 +1478,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: string;
[ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: string;
[ONYXKEYS.NVP_BILLING_FUND_ID]: number;
[ONYXKEYS.NVP_PRIVATE_FREEBIE_CREDITS]: number;
[ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED]: number;
[ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END]: number;
[ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL]: string | undefined;
Expand Down
1 change: 1 addition & 0 deletions src/languages/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8637,6 +8637,7 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
details: {
title: 'Abonnementdetails',
annual: 'Jahresabonnement',
creditBalance: 'Guthaben',
taxExempt: 'Steuerbefreiungsstatus beantragen',
taxExemptEnabled: 'Steuerbefreit',
taxExemptStatus: 'Steuerbefreiungsstatus',
Expand Down
1 change: 1 addition & 0 deletions src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8623,6 +8623,7 @@ const translations = {
details: {
title: 'Subscription details',
annual: 'Annual subscription',
creditBalance: 'Credit balance',
taxExempt: 'Request tax exempt status',
taxExemptEnabled: 'Tax exempt',
taxExemptStatus: 'Tax exempt status',
Expand Down
1 change: 1 addition & 0 deletions src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8852,6 +8852,7 @@ ${amount} para ${merchant} - ${date}`,
details: {
title: 'Datos de suscripción',
annual: 'Suscripción anual',
creditBalance: 'Saldo de crédito',

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taxExempt: 'Solicitar estado de exención de impuestos',
taxExemptEnabled: 'Exento de impuestos',
taxExemptStatus: 'Estado de exención de impuestos',
Expand Down
1 change: 1 addition & 0 deletions src/languages/fr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8658,6 +8658,7 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
details: {
title: 'Détails de l’abonnement',
annual: 'Abonnement annuel',
creditBalance: 'Solde créditeur',
taxExempt: 'Demander le statut d’exonération fiscale',
taxExemptEnabled: 'Exonéré d’impôt',
taxExemptStatus: 'Statut d’exonération fiscale',
Expand Down
1 change: 1 addition & 0 deletions src/languages/it.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8624,6 +8624,7 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
details: {
title: 'Dettagli dell’abbonamento',
annual: 'Abbonamento annuale',
creditBalance: 'Saldo del credito',
taxExempt: 'Richiedi esenzione fiscale',
taxExemptEnabled: 'Esente da imposte',
taxExemptStatus: 'Stato di esenzione fiscale',
Expand Down
1 change: 1 addition & 0 deletions src/languages/ja.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8516,6 +8516,7 @@ ${reportName}
details: {
title: 'サブスクリプションの詳細',
annual: '年額サブスクリプション',
creditBalance: 'クレジット残高',
taxExempt: '非課税扱いを申請',
taxExemptEnabled: '非課税',
taxExemptStatus: '非課税ステータス',
Expand Down
1 change: 1 addition & 0 deletions src/languages/nl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8598,6 +8598,7 @@ Voeg meer bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
details: {
title: 'Abonnementsgegevens',
annual: 'Jaarabonnement',
creditBalance: 'Creditsaldo',
taxExempt: 'Vrijstelling van belasting aanvragen',
taxExemptEnabled: 'Vrijgesteld van belasting',
taxExemptStatus: 'Belastingvrijstellingstatus',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8584,6 +8584,7 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
details: {
title: 'Szczegóły subskrypcji',
annual: 'Abonament roczny',
creditBalance: 'Saldo kredytowe',
taxExempt: 'Poproś o status zwolnienia z podatku',
taxExemptEnabled: 'Zwolnione z podatku',
taxExemptStatus: 'Status zwolnienia z podatku',
Expand Down
1 change: 1 addition & 0 deletions src/languages/pt-BR.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8591,6 +8591,7 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
details: {
title: 'Detalhes da assinatura',
annual: 'Assinatura anual',
creditBalance: 'Saldo de crédito',
taxExempt: 'Solicitar isenção de impostos',
taxExemptEnabled: 'Isento de impostos',
taxExemptStatus: 'Status de isenção de impostos',
Expand Down
1 change: 1 addition & 0 deletions src/languages/zh-hans.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8370,6 +8370,7 @@ ${reportName}
details: {
title: '订阅详情',
annual: '年度订阅',
creditBalance: '积分余额',
taxExempt: '申请免税状态',
taxExemptEnabled: '免税',
taxExemptStatus: '免税状态',
Expand Down
15 changes: 13 additions & 2 deletions src/pages/settings/Subscription/SubscriptionSettings/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {hasSeenTourSelector} from '@selectors/Onboarding';
import React from 'react';
import React, {useMemo} from 'react';
import type {StyleProp, TextStyle} from 'react-native';
import {View} from 'react-native';
import {useDelegateNoAccessActions, useDelegateNoAccessState} from '@components/DelegateNoAccessModalProvider';
Expand Down Expand Up @@ -30,7 +30,7 @@ import useTheme from '@hooks/useTheme';
import useThemeIllustrations from '@hooks/useThemeIllustrations';
import useThemeStyles from '@hooks/useThemeStyles';
import {openLink} from '@libs/actions/Link';
import {convertToShortDisplayString} from '@libs/CurrencyUtils';
import {convertToDisplayString, convertToShortDisplayString} from '@libs/CurrencyUtils';
import {isPolicyAdmin} from '@libs/PolicyUtils';
import {getSubscriptionPrice, isSubscriptionTypeOfInvoicing} from '@libs/SubscriptionUtils';
import type {SkeletonSpanReasonAttributes} from '@libs/telemetry/useSkeletonSpan';
Expand Down Expand Up @@ -70,6 +70,9 @@ function SubscriptionSettings() {
const {accountID: currentUserAccountID} = useCurrentUserPersonalDetails();
const isAnnual = privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL;
const [privateTaxExempt] = useOnyx(ONYXKEYS.NVP_PRIVATE_TAX_EXEMPT);
const [freebieCredits] = useOnyx(ONYXKEYS.NVP_PRIVATE_FREEBIE_CREDITS);
const [fundList] = useOnyx(ONYXKEYS.FUND_LIST);
const defaultCard = useMemo(() => Object.values(fundList ?? {}).find((card) => card.accountData?.additionalData?.isBillingCard), [fundList]);
const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const [betas] = useOnyx(ONYXKEYS.BETAS);
Expand Down Expand Up @@ -328,6 +331,14 @@ function SubscriptionSettings() {
}
/>
)}
{!!freebieCredits && freebieCredits > 0 && (
<MenuItemWithTopDescription
description={translate('subscription.details.creditBalance')}
title={convertToDisplayString(freebieCredits, defaultCard?.accountData?.currency ?? CONST.CURRENCY.USD)}
interactive={false}
wrapperStyle={styles.sectionMenuItemTopDescription}
/>
)}
<MenuItemWithTopDescription
description={privateTaxExempt ? translate('subscription.details.taxExemptStatus') : undefined}
shouldShowRightIcon
Expand Down
Loading