diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index a80e8ccca749..ff41222a5083 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -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', @@ -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; diff --git a/src/languages/de.ts b/src/languages/de.ts index a635269d3926..e3cef8302b0c 100644 --- a/src/languages/de.ts +++ b/src/languages/de.ts @@ -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', diff --git a/src/languages/en.ts b/src/languages/en.ts index 113077be6470..429e804395be 100644 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -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', diff --git a/src/languages/es.ts b/src/languages/es.ts index 684672e3ceac..bd313001648f 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -8852,6 +8852,7 @@ ${amount} para ${merchant} - ${date}`, details: { title: 'Datos de suscripción', annual: 'Suscripción anual', + creditBalance: 'Saldo de crédito', taxExempt: 'Solicitar estado de exención de impuestos', taxExemptEnabled: 'Exento de impuestos', taxExemptStatus: 'Estado de exención de impuestos', diff --git a/src/languages/fr.ts b/src/languages/fr.ts index fe8ce38694dc..22fbe95dfd03 100644 --- a/src/languages/fr.ts +++ b/src/languages/fr.ts @@ -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', diff --git a/src/languages/it.ts b/src/languages/it.ts index fbc6e64601dd..ede96433cd9c 100644 --- a/src/languages/it.ts +++ b/src/languages/it.ts @@ -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', diff --git a/src/languages/ja.ts b/src/languages/ja.ts index 5f1f5c7a99bf..18a27b6a7977 100644 --- a/src/languages/ja.ts +++ b/src/languages/ja.ts @@ -8516,6 +8516,7 @@ ${reportName} details: { title: 'サブスクリプションの詳細', annual: '年額サブスクリプション', + creditBalance: 'クレジット残高', taxExempt: '非課税扱いを申請', taxExemptEnabled: '非課税', taxExemptStatus: '非課税ステータス', diff --git a/src/languages/nl.ts b/src/languages/nl.ts index 6ad319bdc44c..3b47812bf083 100644 --- a/src/languages/nl.ts +++ b/src/languages/nl.ts @@ -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', diff --git a/src/languages/pl.ts b/src/languages/pl.ts index 289aabbdb253..02e89f272524 100644 --- a/src/languages/pl.ts +++ b/src/languages/pl.ts @@ -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', diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts index 8b0adb49517d..a3b65df48b0d 100644 --- a/src/languages/pt-BR.ts +++ b/src/languages/pt-BR.ts @@ -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', diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts index 8a6d58a492b4..319d5b4f0da8 100644 --- a/src/languages/zh-hans.ts +++ b/src/languages/zh-hans.ts @@ -8370,6 +8370,7 @@ ${reportName} details: { title: '订阅详情', annual: '年度订阅', + creditBalance: '积分余额', taxExempt: '申请免税状态', taxExemptEnabled: '免税', taxExemptStatus: '免税状态', diff --git a/src/pages/settings/Subscription/SubscriptionSettings/index.tsx b/src/pages/settings/Subscription/SubscriptionSettings/index.tsx index 4386da60d98e..58056ca7b34a 100644 --- a/src/pages/settings/Subscription/SubscriptionSettings/index.tsx +++ b/src/pages/settings/Subscription/SubscriptionSettings/index.tsx @@ -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'; @@ -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'; @@ -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); @@ -328,6 +331,14 @@ function SubscriptionSettings() { } /> )} + {!!freebieCredits && freebieCredits > 0 && ( + + )}