Skip to content

Commit 58fbafd

Browse files
authored
Merge pull request Expensify#64259 from callstack-internal/feat/waterim/unreport-transaction-v2
Feat: Add ability to unreport transactions v2
2 parents 2555e8f + 1aa5172 commit 58fbafd

19 files changed

Lines changed: 247 additions & 30 deletions

File tree

src/components/MoneyReportHeader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ function MoneyReportHeader({
312312
const isSubmitterSameAsNextApprover = isReportOwner(moneyRequestReport) && nextApproverAccountID === moneyRequestReport?.ownerAccountID;
313313
const optimisticNextStep = isSubmitterSameAsNextApprover && policy?.preventSelfApproval ? buildOptimisticNextStepForPreventSelfApprovalsEnabled() : nextStep;
314314

315-
const shouldShowNextStep = isFromPaidPolicy && !isInvoiceReport && !shouldShowStatusBar;
315+
const shouldShowNextStep = isFromPaidPolicy && !isInvoiceReport && !shouldShowStatusBar && transactions.length > 0;
316316
const bankAccountRoute = getBankAccountRoute(chatReport);
317317
const {nonHeldAmount, fullAmount, hasValidNonHeldAmount} = getNonHeldAndFullAmount(moneyRequestReport, shouldShowPayButton);
318318
const isAnyTransactionOnHold = hasHeldExpensesReportUtils(moneyRequestReport?.reportID);

src/components/TransactionItemRow/DataCells/ChatBubbleCell.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
99
import useStyleUtils from '@hooks/useStyleUtils';
1010
import useTheme from '@hooks/useTheme';
1111
import useThemeStyles from '@hooks/useThemeStyles';
12+
import getNonEmptyStringOnyxID from '@libs/getNonEmptyStringOnyxID';
1213
import {getIOUActionForTransactionID} from '@libs/ReportActionsUtils';
1314
import {isChatThread} from '@libs/ReportUtils';
1415
import variables from '@styles/variables';
@@ -23,7 +24,9 @@ function ChatBubbleCell({transaction, containerStyles, isInSingleTransactionRepo
2324
const theme = useTheme();
2425
const styles = useThemeStyles();
2526
const {shouldUseNarrowLayout} = useResponsiveLayout();
26-
const [iouReportAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${transaction.reportID}`, {
27+
const nonEmptyStringTransactionReportID = getNonEmptyStringOnyxID(transaction.reportID);
28+
29+
const [iouReportAction] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${nonEmptyStringTransactionReportID}`, {
2730
selector: (reportActions) => getIOUActionForTransactionID(Object.values(reportActions ?? {}), transaction.transactionID),
2831
canBeMissing: true,
2932
});
@@ -32,7 +35,7 @@ function ChatBubbleCell({transaction, containerStyles, isInSingleTransactionRepo
3235
canBeMissing: true,
3336
});
3437

35-
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transaction.reportID}`, {
38+
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${nonEmptyStringTransactionReportID}`, {
3639
canBeMissing: false,
3740
});
3841

src/languages/de.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,8 @@ const translations = {
10721072
scanMultipleReceiptsDescription: 'Machen Sie Fotos von all Ihren Belegen auf einmal, dann bestätigen Sie die Details selbst oder lassen Sie SmartScan dies übernehmen.',
10731073
receiptScanInProgress: 'Belegscan läuft',
10741074
receiptScanInProgressDescription: 'Belegscan läuft. Später erneut prüfen oder die Details jetzt eingeben.',
1075+
removeFromReport: 'Ausgabe aus Bericht entfernen',
1076+
moveToPersonalSpace: 'Ausgaben in persönlichen Bereich verschieben',
10751077
duplicateTransaction: ({isSubmitted}: DuplicateTransactionParams) =>
10761078
!isSubmitted
10771079
? 'Mögliche doppelte Ausgaben erkannt. Überprüfen Sie die Duplikate, um die Einreichung zu ermöglichen.'

src/languages/en.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,8 @@ const translations = {
10571057
scanMultipleReceiptsDescription: 'Snap photos of all your receipts at once, then confirm details yourself or let SmartScan handle it.',
10581058
receiptScanInProgress: 'Receipt scan in progress',
10591059
receiptScanInProgressDescription: 'Receipt scan in progress. Check back later or enter the details now.',
1060+
removeFromReport: 'Remove from report',
1061+
moveToPersonalSpace: 'Move expenses to your personal space',
10601062
duplicateTransaction: ({isSubmitted}: DuplicateTransactionParams) =>
10611063
!isSubmitted
10621064
? 'Potential duplicate expenses identified. Review duplicates to enable submission.'

src/languages/es.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1057,6 +1057,8 @@ const translations = {
10571057
scanMultipleReceiptsDescription: 'Tome fotos de todos sus recibos a la vez y confirme los detalles usted mismo o deje que SmartScan se encargue.',
10581058
receiptScanInProgress: 'Escaneado de recibo en proceso',
10591059
receiptScanInProgressDescription: 'Escaneado de recibo en proceso. Vuelve a comprobarlo más tarde o introduce los detalles ahora.',
1060+
removeFromReport: 'Eliminar del informe',
1061+
moveToPersonalSpace: 'Mover gastos a tu espacio personal',
10601062
duplicateTransaction: ({isSubmitted}: DuplicateTransactionParams) =>
10611063
!isSubmitted
10621064
? 'Se han identificado posibles gastos duplicados. Revisa los duplicados para habilitar el envío.'

src/languages/fr.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1073,6 +1073,8 @@ const translations = {
10731073
scanMultipleReceiptsDescription: "Prenez des photos de tous vos reçus en une seule fois, puis confirmez les détails vous-même ou laissez SmartScan s'en charger.",
10741074
receiptScanInProgress: 'Numérisation du reçu en cours',
10751075
receiptScanInProgressDescription: 'Numérisation du reçu en cours. Revenez plus tard ou saisissez les détails maintenant.',
1076+
removeFromReport: 'Supprimer du rapport',
1077+
moveToPersonalSpace: 'Déplacer les dépenses vers votre espace personnel',
10761078
duplicateTransaction: ({isSubmitted}: DuplicateTransactionParams) =>
10771079
!isSubmitted
10781080
? 'Dépenses potentiellement en double identifiées. Vérifiez les doublons pour permettre la soumission.'

src/languages/it.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1068,6 +1068,8 @@ const translations = {
10681068
scanMultipleReceiptsDescription: 'Scatta foto di tutte le tue ricevute in una volta, poi conferma i dettagli tu stesso o lascia che SmartScan se ne occupi.',
10691069
receiptScanInProgress: 'Scansione della ricevuta in corso',
10701070
receiptScanInProgressDescription: 'Scansione della ricevuta in corso. Controlla più tardi o inserisci i dettagli ora.',
1071+
removeFromReport: 'Rimuovi dal rapporto',
1072+
moveToPersonalSpace: 'Sposta spese nello spazio personale',
10711073
duplicateTransaction: ({isSubmitted}: DuplicateTransactionParams) =>
10721074
!isSubmitted
10731075
? "Spese potenzialmente duplicate identificate. Rivedi i duplicati per consentire l'invio."

src/languages/ja.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,6 +1071,8 @@ const translations = {
10711071
scanMultipleReceiptsDescription: 'すべての領収書を一度に撮影し、自分で詳細を確認するか、SmartScanに任せましょう。',
10721072
receiptScanInProgress: '領収書のスキャン中',
10731073
receiptScanInProgressDescription: '領収書のスキャン中です。後で確認するか、今すぐ詳細を入力してください。',
1074+
removeFromReport: '領収書を削除',
1075+
moveToPersonalSpace: '領収書を個人スペースに移動',
10741076
duplicateTransaction: ({isSubmitted}: DuplicateTransactionParams) =>
10751077
!isSubmitted
10761078
? '重複の可能性がある経費が特定されました。提出を有効にするために重複を確認してください。'

src/languages/nl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,6 +1069,8 @@ const translations = {
10691069
scanMultipleReceiptsDescription: "Maak foto's van al je bonnetjes tegelijk, bevestig dan zelf de details of laat SmartScan het afhandelen.",
10701070
receiptScanInProgress: 'Bon scannen bezig',
10711071
receiptScanInProgressDescription: 'Bon scannen bezig. Kom later terug of voer de gegevens nu in.',
1072+
removeFromReport: 'Verwijder uit rapport',
1073+
moveToPersonalSpace: 'Verplaats uitgaven naar persoonlijke ruimte',
10721074
duplicateTransaction: ({isSubmitted}: DuplicateTransactionParams) =>
10731075
!isSubmitted
10741076
? 'Potentiële dubbele uitgaven geïdentificeerd. Controleer duplicaten om indiening mogelijk te maken.'

src/languages/pl.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,6 +1067,8 @@ const translations = {
10671067
scanMultipleReceiptsDescription: 'Zrób zdjęcia wszystkich swoich paragonów naraz, a następnie potwierdź szczegóły samodzielnie lub pozwól, aby SmartScan się tym zajął.',
10681068
receiptScanInProgress: 'Skanowanie paragonu w toku',
10691069
receiptScanInProgressDescription: 'Trwa skanowanie paragonu. Sprawdź później lub wprowadź dane teraz.',
1070+
removeFromReport: 'Usuń z raportu',
1071+
moveToPersonalSpace: 'Przenieś wydatek do przestrzeni osobistej',
10701072
duplicateTransaction: ({isSubmitted}: DuplicateTransactionParams) =>
10711073
!isSubmitted
10721074
? 'Zidentyfikowano potencjalne duplikaty wydatków. Przejrzyj duplikaty, aby umożliwić przesłanie.'

0 commit comments

Comments
 (0)