Skip to content

Commit cc6fec5

Browse files
authored
Merge pull request #98234 from Expensify/blimpich-travelBillingOverdueBanner
[NO QA] Show a banner when a Consolidated Travel Billing invoice is past due
2 parents 0539aaf + 970bf55 commit cc6fec5

20 files changed

Lines changed: 288 additions & 39 deletions

File tree

src/ONYXKEYS.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,9 @@ const ONYXKEYS = {
333333
/** The end date (epoch timestamp) of the workspace owner’s grace period after the free trial ends. */
334334
NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END: 'nvp_private_billingGracePeriodEnd',
335335

336+
/** The end date (epoch timestamp) of the workspace owner’s grace period for an overdue Consolidated Travel Billing invoice. */
337+
NVP_PRIVATE_OWNER_TRAVEL_BILLING_GRACE_PERIOD_END: 'nvp_private_travelBillingGracePeriodEnd',
338+
336339
/** The NVP containing the target url to navigate to when deleting a transaction */
337340
NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL: 'nvp_deleteTransactionNavigateBackURL',
338341

@@ -1751,6 +1754,7 @@ type OnyxValuesMapping = {
17511754
[ONYXKEYS.NVP_PRIVATE_FREEBIE_CREDITS]: number;
17521755
[ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED]: number;
17531756
[ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END]: number;
1757+
[ONYXKEYS.NVP_PRIVATE_OWNER_TRAVEL_BILLING_GRACE_PERIOD_END]: number;
17541758
[ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL]: string | undefined;
17551759
[ONYXKEYS.NVP_RECONNECT_APP_IF_FULL_RECONNECT_BEFORE]: string;
17561760
[ONYXKEYS.NVP_PRIVATE_FIRST_POLICY_CREATED_DATE]: string;

src/hooks/useAccountIndicatorChecks.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ function useAccountIndicatorChecks(): AccountIndicatorChecksResult {
3232
const [billingStatus] = useOnyx(ONYXKEYS.NVP_PRIVATE_BILLING_STATUS);
3333
const [amountOwed = 0] = useOnyx(ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED);
3434
const [ownerBillingGracePeriodEnd] = useOnyx(ONYXKEYS.NVP_PRIVATE_OWNER_BILLING_GRACE_PERIOD_END);
35+
const [ownerTravelBillingGracePeriodEnd] = useOnyx(ONYXKEYS.NVP_PRIVATE_OWNER_TRAVEL_BILLING_GRACE_PERIOD_END);
3536
const [session] = useOnyx(ONYXKEYS.SESSION);
3637
const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT);
3738
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
@@ -54,6 +55,7 @@ function useAccountIndicatorChecks(): AccountIndicatorChecksResult {
5455
billingStatus,
5556
amountOwed,
5657
ownerBillingGracePeriodEnd,
58+
ownerTravelBillingGracePeriodEnd,
5759
),
5860
[CONST.INDICATOR_STATUS.HAS_REIMBURSEMENT_ACCOUNT_ERRORS]: Object.keys(reimbursementAccount?.errors ?? {}).length > 0,
5961
[CONST.INDICATOR_STATUS.HAS_LOGIN_LIST_ERROR]: !!loginList && hasLoginListError(loginList),
@@ -77,6 +79,7 @@ function useAccountIndicatorChecks(): AccountIndicatorChecksResult {
7779
billingStatus,
7880
amountOwed,
7981
ownerBillingGracePeriodEnd,
82+
ownerTravelBillingGracePeriodEnd,
8083
),
8184
[CONST.INDICATOR_STATUS.HAS_PARTIALLY_SETUP_BANK_ACCOUNT_INFO]: hasPartiallySetupBankAccount(bankAccountList) || hasPersonalBankAccountMissingInfo(bankAccountList),
8285
};

src/languages/de.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10052,6 +10052,11 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
1005210052
subtitle: (days: number, hours: number, minutes: number, seconds: number) =>
1005310053
`Fordere innerhalb von ${days > 0 ? `${days}T :` : ''}${hours}Std : ${minutes}Min : ${seconds}Sek an`,
1005410054
},
10055+
travelInvoiceOverdue: {
10056+
title: 'Ihre Reiserechnung ist überfällig',
10057+
subtitle: (date: string) => `Bezahlen Sie Ihre Reise-Rechnung bis zum ${date}, um weiterhin Reisen buchen zu können.`,
10058+
},
10059+
travelInvoiceOverdueLocked: {title: 'Reisebuchung ist pausiert', subtitle: 'Ihre Reiseabrechnung ist überfällig. Bezahlen Sie sie, um wieder Reisen buchen zu können.'},
1005510060
},
1005610061
cardSection: {
1005710062
title: 'Zahlung',

src/languages/el.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10287,6 +10287,14 @@ ${reportName}`,
1028710287
onboardingChatTitle: (discountType: number) => `Προσφορά περιορισμένου χρόνου: ${discountType}% έκπτωση για τον πρώτο σας χρόνο!`,
1028810288
subtitle: (days: number, hours: number, minutes: number, seconds: number) => `Διεκδικήστε μέσα σε ${days > 0 ? `${days}η :` : ''}${hours}ώ : ${minutes}λ : ${seconds}δ`,
1028910289
},
10290+
travelInvoiceOverdue: {
10291+
title: 'Το τιμολόγιο του ταξιδιού σας είναι ληξιπρόθεσμο',
10292+
subtitle: (date: string) => `Πληρώστε το τιμολόγιο ταξιδιού σας έως ${date} για να συνεχίσετε να κλείνετε ταξίδια.`,
10293+
},
10294+
travelInvoiceOverdueLocked: {
10295+
title: 'Η κράτηση ταξιδιών έχει τεθεί σε παύση',
10296+
subtitle: 'Το τιμολόγιο ταξιδιού σας έχει λήξει. Πληρώστε το για να μπορείτε να κλείνετε ξανά ταξίδια.',
10297+
},
1029010298
},
1029110299
cardSection: {
1029210300
title: 'Πληρωμή',

src/languages/en.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10143,6 +10143,14 @@ const translations = {
1014310143
title: 'Your payment info is outdated',
1014410144
subtitle: 'Your payment is past due. Please pay your invoice.',
1014510145
},
10146+
travelInvoiceOverdue: {
10147+
title: 'Your travel invoice is past due',
10148+
subtitle: (date: string) => `Pay your travel invoice by ${date} to keep booking travel.`,
10149+
},
10150+
travelInvoiceOverdueLocked: {
10151+
title: 'Travel booking is paused',
10152+
subtitle: 'Your travel invoice is past due. Pay it to start booking travel again.',
10153+
},
1014610154
billingDisputePending: {
1014710155
title: 'Your card couldn’t be charged',
1014810156
subtitle: (amountOwed: number, cardEnding: string) =>

src/languages/es.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10251,6 +10251,8 @@ El plan Controlar empieza en 9 $ por miembro activo al mes.`,
1025110251
onboardingChatTitle: (discountType) => `Oferta por tiempo limitado: ¡${discountType}% de descuento en tu primer año!`,
1025210252
subtitle: (days, hours, minutes, seconds) => `Solicítala en ${days > 0 ? `${days}d : ` : ''}${hours}h : ${minutes}m : ${seconds}s`,
1025310253
},
10254+
travelInvoiceOverdue: {title: 'Tu factura de viaje está vencida', subtitle: (date: string) => `Paga tu factura de viaje antes del ${date} para seguir reservando viajes.`},
10255+
travelInvoiceOverdueLocked: {title: 'La reserva de viajes está en pausa', subtitle: 'Tu factura de viaje está vencida. Págala para volver a reservar viajes.'},
1025410256
},
1025510257
cardSection: {
1025610258
title: 'Pago',

src/languages/fr.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10085,6 +10085,14 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
1008510085
onboardingChatTitle: (discountType: number) => `Offre limitée : ${discountType} % de réduction sur votre première année !`,
1008610086
subtitle: (days: number, hours: number, minutes: number, seconds: number) => `Réclamer dans ${days > 0 ? `${days}j :` : ''}${hours}h : ${minutes}m : ${seconds}s`,
1008710087
},
10088+
travelInvoiceOverdue: {
10089+
title: 'Votre facture de voyage est en retard de paiement',
10090+
subtitle: (date: string) => `Payez votre facture de voyage avant le ${date} pour continuer à réserver des voyages.`,
10091+
},
10092+
travelInvoiceOverdueLocked: {
10093+
title: 'La réservation de voyages est en pause',
10094+
subtitle: 'Votre facture de voyage est en retard de paiement. Payez-la pour pouvoir à nouveau réserver des voyages.',
10095+
},
1008810096
},
1008910097
cardSection: {
1009010098
title: 'Paiement',

src/languages/it.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10023,6 +10023,11 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
1002310023
onboardingChatTitle: (discountType: number) => `Offerta a tempo limitato: ${discountType}% di sconto sul primo anno!`,
1002410024
subtitle: (days: number, hours: number, minutes: number, seconds: number) => `Richiedi entro ${days > 0 ? `${days}g :` : ''}${hours}h : ${minutes}m : ${seconds}s`,
1002510025
},
10026+
travelInvoiceOverdue: {
10027+
title: 'La tua fattura di viaggio è scaduta',
10028+
subtitle: (date: string) => `Paga la tua fattura di viaggio entro il ${date} per continuare a prenotare viaggi.`,
10029+
},
10030+
travelInvoiceOverdueLocked: {title: 'La prenotazione dei viaggi è in pausa', subtitle: 'La tua fattura di viaggio è scaduta. Pagala per poter ricominciare a prenotare viaggi.'},
1002610031
},
1002710032
cardSection: {
1002810033
title: 'Pagamento',

src/languages/ja.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9889,6 +9889,11 @@ ${reportName}`,
98899889
onboardingChatTitle: (discountType: number) => `期間限定オファー:初年度が${discountType}%オフ!`,
98909890
subtitle: (days: number, hours: number, minutes: number, seconds: number) => `${days > 0 ? `${days}日:` : ''}${hours}時間以内に請求:${minutes}分:${seconds}秒`,
98919891
},
9892+
travelInvoiceOverdue: {title: '出張請求書のお支払い期限が過ぎています', subtitle: (date: string) => `${date}までに旅行の請求書を支払って、旅行の予約を続けてください。`},
9893+
travelInvoiceOverdueLocked: {
9894+
title: '出張予約は一時停止されています',
9895+
subtitle: '旅行の請求書のお支払い期限が過ぎています。お支払いを完了して、再度旅行の予約を開始してください。',
9896+
},
98929897
},
98939898
cardSection: {
98949899
title: '支払い',

src/languages/nl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9992,6 +9992,8 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
99929992
onboardingChatTitle: (discountType: number) => `Aanbieding voor beperkte tijd: ${discountType}% korting op je eerste jaar!`,
99939993
subtitle: (days: number, hours: number, minutes: number, seconds: number) => `Dien in binnen ${days > 0 ? `${days}d :` : ''}${hours}u : ${minutes}m : ${seconds}s`,
99949994
},
9995+
travelInvoiceOverdue: {title: 'Je reisfactuur is verlopen', subtitle: (date: string) => `Betaal je reissfactuur vóór ${date} om reizen te blijven boeken.`},
9996+
travelInvoiceOverdueLocked: {title: 'Reisboeking is gepauzeerd', subtitle: 'Je reisfactuur is verlopen. Betaal deze om weer reizen te kunnen boeken.'},
99959997
},
99969998
cardSection: {
99979999
title: 'Betaling',

0 commit comments

Comments
 (0)