App icon indicating copy to clipboard operation
App copied to clipboard

[Due for payment 2026-11-18] [$175] [Exploratory] [Auto] - Report - Missing warning missing merchant when submit violation report

Open applause-bot[bot] opened this issue 1 month ago β€’ 34 comments

If you haven’t already, check out our contributing guidelines for onboarding. To join our Slack channel, fill out this form.


Version Number: v9.5.12-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from BrowserStack: https://test-management.browserstack.com/projects/2219752/test-runs/78955999/folder/57605193/41237119/1866142343?sort=%2Bidentifier Email or phone of affected tester (no customers): [email protected] Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Windows 11/Chrome App Component: Chat Report View

Action Performed:

Preconditions: User has create a report with violation in Workspace

  1. Open the New Dot app
  2. Navigate to SelfDM - Cretae an expense without merchant
  3. Click on the Expense - Report field - Select the report in Workpace
  4. Click Submit button on the report

Expected Result:

Warning missing merchant

Actual Result:

Missing warning about missing merchant

Workaround:

Unknown

Platforms:

  • [x] Android: App
  • [ ] Android: mWeb Chrome
  • [x] iOS: App
  • [ ] iOS: mWeb Safari
  • [ ] iOS: mWeb Chrome
  • [x] Windows: Chrome
  • [ ] MacOS: Chrome Safari

Screenshots/Videos

https://github.com/user-attachments/assets/24dd0c1e-1a22-4f62-8389-72edef80b8a1

View all open jobs on GitHub

Applause Internal Information Exported by: Julia Ponikarchuk Bug ID: 7287800

Upwork Automation - Do Not Edit
Issue OwnerCurrent Issue Owner: @mallenexpensify

applause-bot[bot] avatar Oct 16 '26 05:10 applause-bot[bot]

While Applause doesn't embed attachments for this bug, here are the links for quick view: https://platform.applause.com/services/links/v1/external/654c453b93332b6a81714b6d77db8a0816f3d33c1c619d0b906d669702a9d900

applause-bot[bot] avatar Oct 16 '26 05:10 applause-bot[bot]

Proposal

What is the root cause of that problem?

The "Submit report?" warning only lists violations stored in Onyx. The app never stores a missing merchant as a violation. It works out "Missing merchant" on the fly as a field error, so the warning never includes it.

In the reported flow, the report's existing violation opens the warning. The moved selfDM expense adds nothing to the list, so "Missing merchant" never appears. The warning came from Prevent resubmission until report violations are acknowledged, merged 2026-10-13, which matches v9.5.12-0.

What changes do you think we should make in order to solve the problem?

Update getReportSubmitViolationSummary so it also covers missing required fields:

  1. For each expense, check for missing fields before the if (!transactionViolations) continue; guard. Use the same logic as TransactionPreviewUtils: isExpenseReport(report) && isMerchantMissing(transaction), plus isAmountMissing. Skip expenses that are pending deletion.
  2. Add the result to the summary, for example as a missingRequiredFields set. Include it in hasAnySubmitViolation and mergeReportSubmitViolationSummaries.
  3. In buildSubmitViolationBullets, add bullets using the existing iou.missingMerchant and iou.missingAmount strings.
  4. Leave shouldResolveAcknowledgedViolations unchanged, so "Submit anyway" stays informational.
  5. Add a unit test. An expense report with one expense whose merchant is Expense and that has no violations should produce a "Missing merchant" bullet.

All submit entry points share this helper (the report header, the report preview, and Search bulk submit), so one change fixes them all.

What alternative solutions did you explore? (Optional)

  • Add a missingMerchant violation when the expense moves to a workspace report. This needs backend support, because violations come from the server. That puts it out of scope for an App-only fix.
  • Block submit when the merchant is missing. Field errors never block submit today, so this would be a product change.
Investigation details
  • A manual expense with no merchant gets Expense (DEFAULT_MERCHANT) as its merchant: buildOptimisticTransaction.ts:219. ValidationUtils.ts:849-851 treats '', (none) and Expense all as missing.
  • Moving the expense through the Report field recalculates policy violations (Transaction.ts:1393-1415). CONST.VIOLATIONS has no merchant entry, so nothing is added.
  • Submit runs confirmSubmitViolationsThenProceed, which skips the warning when the summary is empty (SubmitPrimaryAction.tsx:112-166).
  • Side effect to confirm: after this fix, a missing merchant alone (with no other violations) will also open the warning. The current repro only shows the warning because the report already has a violation. Check with the PR #101662 author or reviewers that this is the intended behavior.
  • I confirmed this in code only. I did not reproduce it in the app.

Next Steps for Contributor+ team: To accept: @MelvinBot implement [this](https://github.com/Expensify/App/issues/104185) to create a draft PR. To refine: @MelvinBot <your feedback> To reject: Explain why you are rejecting Melvin's proposal.


view run

MelvinBot avatar Oct 19 '26 12:10 MelvinBot

Triggered auto assignment to Contributor-plus team member for initial proposal review - @TaduJR (External)

melvin-bot[bot] avatar Oct 19 '26 12:10 melvin-bot[bot]

Job added to Upwork: https://www.upwork.com/jobs/~022112158788458478715

melvin-bot[bot] avatar Oct 19 '26 12:10 melvin-bot[bot]

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/~01963a583fd60b304f

Proposal

Please re-state the problem that we are trying to solve in this issue.

When an expense report in a workspace has violations and a submitter attempts to submit the report containing an expense with a missing merchant (e.g. moved from selfDM without a merchant), the "Submit report?" confirmation modal displays server violations but completely omits the warning about the missing merchant.

What is the root cause of that problem?

In src/libs/Violations/getReportSubmitViolationSummary.ts:

  1. The helper getReportSubmitViolationSummary classifies violations to display in the "Submit report?" confirmation dialog.
  2. In lines 48-55, the loop iterates over transactions, but if violationsCollection?.[transactionViolationsKey] is empty/falsy, it immediately skips the transaction:
    const transactionViolations = violationsCollection?.[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction.transactionID}`];
    if (!transactionViolations) {
        continue;
    }
    
  3. A missing merchant is an inherent field validation error evaluated on the client (isExpenseReport(report) && isMerchantMissing(transaction)) and shown in the expense row's Red Brick Road via TransactionPreviewUtils.ts:253-263. However, Expensify backend does not generate a server-side TransactionViolation record for missing merchant.
  4. Because getReportSubmitViolationSummary solely processes transactionViolations and skips field checks:
    • If an expense with a missing merchant has no other violations, it is completely ignored.
    • When the submit confirmation dialog opens, hasMissingMerchant is not captured, so buildSubmitViolationBullets never includes the missing merchant warning bullet.

What changes do you think we should make in order to solve the problem?

  1. In src/libs/Violations/getReportSubmitViolationSummary.ts:

    • Extend ReportSubmitViolationSummary type to track missing required fields:
      type ReportSubmitViolationSummary = {
          hasRejectedExpense: boolean;
          hasReportBeenRejected: boolean;
          hasPendingCardMatch: boolean;
          hasMissingMerchant: boolean;
          otherViolations: Map<ValueOf<typeof CONST.VIOLATIONS>, TransactionViolation>;
      };
      
    • In getReportSubmitViolationSummary: Check for missing merchant on the expense before the transactionViolations guard, filtering out pending deleted transactions:
      for (const transaction of transactions) {
          if (!transaction?.transactionID || isTransactionPendingDelete(transaction)) {
              continue;
          }
          if (isExpenseReport(report) && isMerchantMissing(transaction)) {
              hasMissingMerchant = true;
          }
      
          const transactionViolations = violationsCollection?.[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction.transactionID}`];
          if (!transactionViolations) {
              continue;
          }
          // ... existing violation classification logic ...
      }
      
    • In buildSubmitViolationBullets: Add the missing merchant bullet using the existing localized string iou.missingMerchant:
      if (summary.hasMissingMerchant) {
          bullets.push(translate('iou.missingMerchant'));
      }
      
    • In hasAnySubmitViolation: Include summary.hasMissingMerchant:
      function hasAnySubmitViolation(summary: ReportSubmitViolationSummary): boolean {
          return summary.hasRejectedExpense || summary.hasReportBeenRejected || summary.hasPendingCardMatch || summary.hasMissingMerchant || summary.otherViolations.size > 0;
      }
      
    • In mergeReportSubmitViolationSummaries: Merge hasMissingMerchant:
      hasMissingMerchant ||= summary.hasMissingMerchant;
      
  2. Unit Tests: In tests/unit/Violations/getReportSubmitViolationSummaryTest.ts:

    • Test that getReportSubmitViolationSummary sets hasMissingMerchant: true when a transaction in an expense report has a missing merchant (even without transactionViolations).
    • Test that buildSubmitViolationBullets outputs "Missing merchant" in the generated bullets list.
    • Test that mergeReportSubmitViolationSummaries preserves hasMissingMerchant: true.

What alternative solutions did you explore? (Optional)

  • Generating a synthetic server violation in Onyx upon moving an expense: Rejected because transactionViolations are owned and emitted by the backend API. Client-side field validations (isMerchantMissing) should be aggregated directly into getReportSubmitViolationSummary alongside other submit-blocking warnings.

Testing

  1. Create a workspace with a policy requiring merchant.
  2. In SelfDM, create a manual expense without entering a merchant (merchant defaults to 'Expense').
  3. Navigate to the expense > Report field > Move it to the workspace report.
  4. Click the "Submit" button on the workspace report.
  5. Verify that the "Submit report?" confirmation modal appears and includes "Missing merchant" in the list of bullet points.
  6. Verify that regular reports with complete merchants submit smoothly without unnecessary warnings.

pranav440 avatar Oct 20 '26 04:10 pranav440

βœ… Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 20 '26 04:10 melvin-bot[bot]

βœ… Contributor details stored successfully. Thank you for contributing to Expensify!

melvin-bot[bot] avatar Oct 21 '26 03:10 melvin-bot[bot]

@TaduJR Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

melvin-bot[bot] avatar Oct 22 '26 21:10 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

After moving an expense without a merchant from Self DM to a workspace report, submitting that report does not include Missing merchant in the confirmation. An existing receipt/policy violation can open the modal, but the merchant warning is absent even though the expense row identifies the missing field.

What is the root cause of that problem?

The submit summary aggregates transaction violations, while the missing-merchant warning is a client-derived required-field error. These are separate sources of information.

In getReportSubmitViolationSummary, each transaction is skipped when its transactionViolations_<id> entry is absent; when the entry exists, only its violation objects are classified. Neither branch evaluates required fields. An empty array also produces no merchant warning, so merely removing the early continue cannot fix the problem.

By contrast, TransactionPreviewUtils first computes hasMissingSmartscanFields(transaction, iouReport), then uses isExpenseReport(iouReport) && isMerchantMissing(transaction) to choose iou.missingMerchant. The shared helpers matter:

  • isMerchantMissing respects modifiedMerchant and the existing invalid-merchant placeholders, including Expense and (none); checking only !transaction.merchant is insufficient.
  • hasMissingSmartscanFields excludes distance requests and receipts currently being scanned. A missing field while SmartScan is still working must not become a new submission warning.
  • Merchant-required behavior here is determined by the expense-report context, not a new policy.isMerchantRequired condition.

There is no CONST.VIOLATIONS.MISSING_MERCHANT in the inspected CONST.VIOLATIONS. Also, changeTransactionsReport already recalculates policy violations with ViolationsUtils.getViolationsOnyxData when moving an expense to a workspace. Repeating that call, waiting for a server refresh, or inserting a fabricated TransactionViolation would not repair this missing aggregation.

What changes do you think we should make in order to solve the problem?

Add a dedicated hasMissingMerchant: boolean to ReportSubmitViolationSummary and handle it throughout the existing summary pipeline. This keeps required-field information separate from backend violation names and fixes the shared submit flow without changing transaction storage.

  1. In the transaction loop, before the missing-violations early return, accumulate the merchant flag using the same field-error eligibility as the expense preview, excluding transactions pending deletion:

    if (
        !isTransactionPendingDelete(transaction) &&
        isExpenseReport(report) &&
        hasMissingSmartscanFields(transaction, report) &&
        isMerchantMissing(transaction)
    ) {
        hasMissingMerchant = true;
    }
    

    Keep the existing transaction-ID guard and server-violation processing. Do not add a blanket !isPartialTransaction(transaction) check: an empty or (none) merchant can itself make a transaction partial, and that would exclude expenses this fix needs to warn about.

  2. Return the flag, include it in hasAnySubmitViolation, and combine it with logical OR in mergeReportSubmitViolationSummaries. Otherwise, a missing merchant alone still bypasses the dialog, or the warning disappears in bulk submission.

  3. In buildSubmitViolationBullets, add translate('iou.missingMerchant') once when the flag is true, in a deterministic position alongside the existing informational bullets. Preserve the full receipt/policy messages and their existing deduplication.

  4. Keep shouldResolveAcknowledgedViolations unchanged. Submit anyway must still submit; acknowledging a missing merchant must not edit the merchant, clear real violations, or set the rejected-expense resolution flag. The shared helper then covers report-header, report-preview, and Search/bulk submission consumers.

I would extend the existing tests/unit/getReportSubmitViolationSummaryTest.ts and submit-confirmation tests with:

  • The reported combination: a missing merchant plus an existing receipt violation produces both bullets.
  • Missing merchant with an absent violations collection, an absent entry, and an empty array; also missing merchant as the only warning, to exercise hasAnySubmitViolation.
  • '', Expense, and (none), plus a valid modifiedMerchant overriding a placeholder and an invalid modified value overriding a valid original merchant.
  • Active SmartScan, distance requests, Self DM/IOU reports, and pending deletion produce no new merchant warning; a failed/completed scan missing its merchant follows the existing field-error rules.
  • Multiple transactions/reports produce one merchant bullet; bulk merge preserves it. Cancel does not submit, while Submit anyway leaves merchant data unchanged and preserves rejection/card-match behavior.

What alternative solutions did you explore? (Optional)

  • Create a synthetic merchant violation or modify the move action: this mixes two data models, invents a violation constant, and introduces unnecessary Onyx/backend reconciliation work.
  • Check only isMerchantMissing: simpler, but misses the preview's SmartScan/distance eligibility rules and can introduce premature warnings.
  • Add all missing-field warnings in the same change: possible as a separate extension, but amount/date handling has different eligibility rules. The focused fix addresses this issue without broadening submission behavior beyond missing merchant.

shilo1979jk avatar Oct 26 '26 14:10 shilo1979jk

@TaduJR 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

melvin-bot[bot] avatar Oct 26 '26 21:10 melvin-bot[bot]

@TaduJR Now this issue is 8 days overdue. Are you sure this should be a Daily? Feel free to change it!

melvin-bot[bot] avatar Oct 28 '26 21:10 melvin-bot[bot]

@TaduJR this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks!

melvin-bot[bot] avatar Oct 30 '26 21:10 melvin-bot[bot]

@TaduJR 10 days overdue. I'm getting more depressed than Marvin.

melvin-bot[bot] avatar Oct 30 '26 21:10 melvin-bot[bot]

@MelvinBot implement this, but please use the src and tests diffs below.

Your root cause is right. The diffs differ from your proposal in these ways:

  • Extra check on the field errors: both fields also have to pass hasMissingSmartscanFieldsForRBR. Otherwise distance expenses, receipts still being scanned and expenses being deleted get a false warning.
  • Amount uses isFailedScanAmountPlaceholder, not isAmountMissing: expense reports allow a zero amount, so a failed scan's placeholder is the only real case. It happens when the user enters only the merchant on a failed scan: the server removes smartscanFailed, and the row says "Missing amount" while the modal says nothing.
  • Held expenses: skipped unless the policy has a dynamic external workflow, because submitting moves them to a new draft report.
  • Failed scans: skipped per expense when that expense already has smartscanFailed, so one problem doesn't get two bullets.

Please keep these out of this PR:

  • Modal copy: "This report has policy violations" stays as it is for now.
  • Search data: the Expenses tab row, bulk submit of individually selected expenses, and Search report rows only pass part of the report. Violations have the same limit on main, so this will be a follow-up.
src diff
diff --git a/src/hooks/useConfirmSubmitReportViolations.ts b/src/hooks/useConfirmSubmitReportViolations.ts
index 51959d5425f..11a0e541af1 100644
--- a/src/hooks/useConfirmSubmitReportViolations.ts
+++ b/src/hooks/useConfirmSubmitReportViolations.ts
@@ -25,7 +25,7 @@ type UseConfirmSubmitReportViolationsParams = {
 
 /**
  * Hook that returns a callback to confirm any report violations (rejected expenses, pending RTER
- * card-match, and other policy violations) before proceeding with a report submission.
+ * card-match, a missing merchant or amount, and other policy violations) before proceeding with a report submission.
  */
 function useConfirmSubmitReportViolations({
     reportID,
diff --git a/src/libs/Violations/getReportSubmitViolationSummary.ts b/src/libs/Violations/getReportSubmitViolationSummary.ts
index 6857fb1af8e..c0dd445cbef 100644
--- a/src/libs/Violations/getReportSubmitViolationSummary.ts
+++ b/src/libs/Violations/getReportSubmitViolationSummary.ts
@@ -3,8 +3,18 @@ import type {LocaleContextProps} from '@components/LocaleContextProvider';
 import type {CurrencyListActionsContextType} from '@hooks/useCurrencyList';
 
 import Parser from '@libs/Parser';
-import {hasReportBeenRejectedToSubmitter} from '@libs/ReportUtils';
-import {hasPendingRTERViolation, hasTransactionBeenRejected, isPendingRTERViolation, shouldShowViolation} from '@libs/TransactionUtils';
+import {hasDynamicExternalWorkflow} from '@libs/PolicyUtils';
+import {hasReportBeenRejectedToSubmitter, isExpenseReport} from '@libs/ReportUtils';
+import {
+    hasMissingSmartscanFieldsForRBR,
+    hasPendingRTERViolation,
+    hasTransactionBeenRejected,
+    isFailedScanAmountPlaceholder,
+    isMerchantMissing,
+    isOnHold,
+    isPendingRTERViolation,
+    shouldShowViolation,
+} from '@libs/TransactionUtils';
 
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
@@ -21,14 +31,38 @@ type ReportSubmitViolationSummary = {
     /** The whole report was rejected to the submitter (report-level nextStep, no per-transaction violation to resolve) */
     hasReportBeenRejected: boolean;
     hasPendingCardMatch: boolean;
+    /** An expense on the report has no merchant. The server never sends a violation for this, so it comes from the expense's own fields. */
+    hasMissingMerchant: boolean;
+    /** An expense on the report still has a failed scan's placeholder amount. Like a missing merchant, this comes from the expense's own fields. */
+    hasMissingAmount: boolean;
     /** First-seen violation instance per violation name, so the full message (with amounts/thresholds) can be built later */
     otherViolations: Map<ValueOf<typeof CONST.VIOLATIONS>, TransactionViolation>;
 };
 
+/** Whether the "Submit report?" modal should warn about the required fields this expense has left empty. */
+function shouldWarnAboutMissingFields(transaction: Transaction, transactionViolations: OnyxEntry<TransactionViolations>, report: OnyxEntry<Report>, policy: OnyxEntry<Policy>): boolean {
+    // These warnings are only for expense reports, where the merchant is required.
+    if (!isExpenseReport(report)) {
+        return false;
+    }
+
+    // Submitting moves a held expense to a new draft report, except on a dynamic external workflow, so it isn't part of this submission.
+    if (isOnHold(transaction) && !hasDynamicExternalWorkflow(policy)) {
+        return false;
+    }
+
+    // The smartscanFailed bullet already tells the submitter to enter this expense's missing details.
+    if (transactionViolations?.some((violation) => violation.name === CONST.VIOLATIONS.SMARTSCAN_FAILED)) {
+        return false;
+    }
+
+    // Distance expenses, receipts still being scanned and expenses being deleted can have placeholder values that aren't errors.
+    return hasMissingSmartscanFieldsForRBR(transaction, report);
+}
+
 /**
- * Classifies a report's transaction violations into the four buckets shown by the "Submit report?" confirmation
- * modal: a rejected expense, a whole-report rejection, a pending RTER/card-match, or everything else (informational
- * only).
+ * Classifies what the "Submit report?" confirmation modal shows for a report: a rejected expense, a whole-report
+ * rejection, a pending RTER/card-match, a missing merchant or amount, or any other violation (informational only).
  */
 function getReportSubmitViolationSummary(
     transactions: Array<OnyxEntry<Transaction>>,
@@ -40,6 +74,8 @@ function getReportSubmitViolationSummary(
 ): ReportSubmitViolationSummary {
     let hasRejectedExpense = false;
     let hasPendingCardMatch = false;
+    let hasMissingMerchant = false;
+    let hasMissingAmount = false;
     const otherViolations = new Map<ValueOf<typeof CONST.VIOLATIONS>, TransactionViolation>();
 
     for (const transaction of transactions) {
@@ -47,6 +83,14 @@ function getReportSubmitViolationSummary(
             continue;
         }
         const transactionViolations = violationsCollection?.[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transaction.transactionID}`];
+
+        // These fields have no violation, so this has to run before the check below skips expenses without violations.
+        if (shouldWarnAboutMissingFields(transaction, transactionViolations, report, policy)) {
+            hasMissingMerchant ||= isMerchantMissing(transaction);
+            // Expense reports allow a zero amount, so only a failed scan's placeholder counts as a missing amount.
+            hasMissingAmount ||= isFailedScanAmountPlaceholder(transaction);
+        }
+
         if (!transactionViolations) {
             continue;
         }
@@ -79,7 +123,7 @@ function getReportSubmitViolationSummary(
         }
     }
 
-    return {hasRejectedExpense, hasReportBeenRejected: hasReportBeenRejectedToSubmitter(report), hasPendingCardMatch, otherViolations};
+    return {hasRejectedExpense, hasReportBeenRejected: hasReportBeenRejectedToSubmitter(report), hasPendingCardMatch, hasMissingMerchant, hasMissingAmount, otherViolations};
 }
 
 type BuildSubmitViolationBulletsParams = {
@@ -90,7 +134,7 @@ type BuildSubmitViolationBulletsParams = {
 };
 
 /**
- * Builds the modal's bullet copy, in a fixed order: other violations first, then report/expense rejection, then
+ * Builds the modal's bullet copy, in a fixed order: other violations first, then a missing merchant and amount, then report/expense rejection, then
  * pending card match. Other violations use the same full message (with amounts/thresholds) shown elsewhere in the
  * app (e.g. the RBR message under an expense row), via ViolationsUtils.getViolationTranslation, rather than the
  * short label - so e.g. a receipt-required violation says "Receipt required over $25.00" instead of just "Expense
@@ -105,6 +149,12 @@ function buildSubmitViolationBullets({summary, translate, dateFnsLocale, convert
         // personal-card reconnect link); stripped to plain text here so an admin never sees a raw `<a href="...">`.
         bullets.push(Parser.htmlToText(ViolationsUtils.getViolationTranslation({violation, translate, dateFnsLocale, convertToDisplayString})));
     }
+    if (summary.hasMissingMerchant) {
+        bullets.push(translate('iou.missingMerchant'));
+    }
+    if (summary.hasMissingAmount) {
+        bullets.push(translate('iou.missingAmount'));
+    }
     if (summary.hasReportBeenRejected) {
         bullets.push(translate('iou.confirmSubmitReportViolations.reportRejected'));
     }
@@ -120,7 +170,14 @@ function buildSubmitViolationBullets({summary, translate, dateFnsLocale, convert
 
 /** Whether the summary has anything for the "Submit report?" modal to show. */
 function hasAnySubmitViolation(summary: ReportSubmitViolationSummary): boolean {
-    return summary.hasRejectedExpense || summary.hasReportBeenRejected || summary.hasPendingCardMatch || summary.otherViolations.size > 0;
+    return (
+        summary.hasRejectedExpense ||
+        summary.hasReportBeenRejected ||
+        summary.hasPendingCardMatch ||
+        summary.hasMissingMerchant ||
+        summary.hasMissingAmount ||
+        summary.otherViolations.size > 0
+    );
 }
 
 /**
@@ -142,11 +199,15 @@ function mergeReportSubmitViolationSummaries(summaries: ReportSubmitViolationSum
     let hasRejectedExpense = false;
     let hasReportBeenRejected = false;
     let hasPendingCardMatch = false;
+    let hasMissingMerchant = false;
+    let hasMissingAmount = false;
 
     for (const summary of summaries) {
         hasRejectedExpense ||= summary.hasRejectedExpense;
         hasReportBeenRejected ||= summary.hasReportBeenRejected;
         hasPendingCardMatch ||= summary.hasPendingCardMatch;
+        hasMissingMerchant ||= summary.hasMissingMerchant;
+        hasMissingAmount ||= summary.hasMissingAmount;
         for (const [violationName, violation] of summary.otherViolations) {
             if (!otherViolations.has(violationName)) {
                 otherViolations.set(violationName, violation);
@@ -154,7 +215,7 @@ function mergeReportSubmitViolationSummaries(summaries: ReportSubmitViolationSum
         }
     }
 
-    return {hasRejectedExpense, hasReportBeenRejected, hasPendingCardMatch, otherViolations};
+    return {hasRejectedExpense, hasReportBeenRejected, hasPendingCardMatch, hasMissingMerchant, hasMissingAmount, otherViolations};
 }
 
 export {getReportSubmitViolationSummary, buildSubmitViolationBullets, hasAnySubmitViolation, shouldResolveAcknowledgedViolations, mergeReportSubmitViolationSummaries};
tests diff
diff --git a/tests/unit/getReportSubmitViolationSummaryTest.ts b/tests/unit/getReportSubmitViolationSummaryTest.ts
index 58fccf2dfbd..a83a1732305 100644
--- a/tests/unit/getReportSubmitViolationSummaryTest.ts
+++ b/tests/unit/getReportSubmitViolationSummaryTest.ts
@@ -1,10 +1,16 @@
 import type {LocaleContextProps} from '@components/LocaleContextProvider';
 
-import {buildSubmitViolationBullets, getReportSubmitViolationSummary} from '@libs/Violations/getReportSubmitViolationSummary';
+import {
+    buildSubmitViolationBullets,
+    getReportSubmitViolationSummary,
+    hasAnySubmitViolation,
+    mergeReportSubmitViolationSummaries,
+    shouldResolveAcknowledgedViolations,
+} from '@libs/Violations/getReportSubmitViolationSummary';
 
 import CONST from '@src/CONST';
 import ONYXKEYS from '@src/ONYXKEYS';
-import type {Report, Transaction, TransactionViolation} from '@src/types/onyx';
+import type {Policy, Report, Transaction, TransactionViolation} from '@src/types/onyx';
 
 import createMock from '../utils/createMock';
 
@@ -33,6 +39,29 @@ function createMockViolation(name: TransactionViolation['name'], data?: Transact
     return createMock<TransactionViolation>({name, data});
 }
 
+function createMockExpenseReport(): Report {
+    return createMock<Report>({type: CONST.REPORT.TYPE.EXPENSE});
+}
+
+function createMockTransactionWithMerchant(merchant: string, overrides?: Partial<Transaction>): Transaction {
+    return createMock<Transaction>({transactionID: '1', merchant, ...overrides});
+}
+
+function createMockFailedScan(overrides?: Partial<Transaction>): Transaction {
+    return createMock<Transaction>({
+        transactionID: '1',
+        merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT,
+        amount: 0,
+        iouRequestType: CONST.IOU.REQUEST_TYPE.SCAN,
+        receipt: {state: CONST.IOU.RECEIPT_STATE.SCAN_FAILED},
+        ...overrides,
+    });
+}
+
+function createEmptySummary() {
+    return {hasRejectedExpense: false, hasReportBeenRejected: false, hasPendingCardMatch: false, hasMissingMerchant: false, hasMissingAmount: false, otherViolations: new Map()};
+}
+
 function createMockRejectedReport(): Report {
     return createMock<Report>({
         stateNum: CONST.REPORT.STATE_NUM.OPEN,
@@ -47,7 +76,7 @@ describe('getReportSubmitViolationSummary', () => {
 
         // When the summary is built
         // Then the "Submit report?" modal has nothing to show, so every bucket must be empty
-        expect(summary).toEqual({hasRejectedExpense: false, hasReportBeenRejected: false, hasPendingCardMatch: false, otherViolations: new Map()});
+        expect(summary).toEqual(createEmptySummary());
     });
 
     it('flags a rejected expense violation', () => {
@@ -150,7 +179,7 @@ describe('getReportSubmitViolationSummary', () => {
 
         // When the summary is built
         // Then it must not throw or treat the missing key as a violation, so a report just isn't flagged instead of crashing
-        expect(summary).toEqual({hasRejectedExpense: false, hasReportBeenRejected: false, hasPendingCardMatch: false, otherViolations: new Map()});
+        expect(summary).toEqual(createEmptySummary());
     });
 
     it('flags a report-level rejection separately from a transaction-level rejected-expense violation', () => {
@@ -186,24 +215,474 @@ describe('getReportSubmitViolationSummary', () => {
         // Then it must not treat the report as currently rejected, since stateNum no longer reflects the rejected-and-reopened state
         expect(summary.hasReportBeenRejected).toBe(false);
     });
+
+    describe('missing merchant', () => {
+        it.each([
+            ['empty', ''],
+            ['the partial placeholder', CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT],
+            ['the default placeholder', CONST.TRANSACTION.DEFAULT_MERCHANT],
+        ])('flags an expense on an expense report whose merchant is %s', (_description, merchant) => {
+            // Given an expense whose merchant is a value the expense row treats as missing, with no violations entry,
+            // because the server never sends a violation for a missing merchant
+            const summary = getReportSubmitViolationSummary([createMockTransactionWithMerchant(merchant)], {}, createMockExpenseReport(), undefined, '', 0);
+
+            // When the summary is built
+            // Then it must flag the merchant, otherwise the report submits with no warning while the expense row shows an error
+            expect(summary.hasMissingMerchant).toBe(true);
+        });
+
+        it('flags a missing merchant when the expense has an empty violations list', () => {
+            // Given an expense with no merchant whose violations are known to be empty, a different Onyx state from an absent entry
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT)],
+                {[getViolationsKey('1')]: []},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then the merchant must still be flagged, since it doesn't depend on the expense having violations
+            expect(summary.hasMissingMerchant).toBe(true);
+        });
+
+        it('lists the missing merchant alongside the violations of other expenses on the report', () => {
+            // Given a report like the one in the bug report: one expense with a policy violation, and another with no
+            // merchant that also has a violation of its own
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant('Merchant', {transactionID: '1'}), createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {transactionID: '2'})],
+                {
+                    [getViolationsKey('1')]: [createMockViolation(CONST.VIOLATIONS.OVER_CATEGORY_LIMIT)],
+                    [getViolationsKey('2')]: [createMockViolation(CONST.VIOLATIONS.MISSING_CATEGORY)],
+                },
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the bullets are built from the summary
+            const bullets = buildSubmitViolationBullets({summary, translate, dateFnsLocale, convertToDisplayString});
+
+            // Then the modal must show the merchant as well as both violations, since the bug was that the violations hid it
+            expect(bullets).toHaveLength(3);
+            expect(bullets).toContain('iou.missingMerchant');
+        });
+
+        it('does not flag a placeholder merchant that a valid modified merchant has replaced', () => {
+            // Given an expense created with the placeholder merchant and then edited to a real one, which is stored in modifiedMerchant
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {modifiedMerchant: 'Merchant'})],
+                {},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not warn, since the user has already fixed the merchant
+            expect(summary.hasMissingMerchant).toBe(false);
+        });
+
+        it('flags a valid merchant that has been replaced by a placeholder modified merchant', () => {
+            // Given an expense whose modified merchant takes priority over its original merchant and is a placeholder
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant('Merchant', {modifiedMerchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT})],
+                {},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must warn, because the expense row reads the same modified merchant and shows the error
+            expect(summary.hasMissingMerchant).toBe(true);
+        });
+
+        it.each([
+            ['a distance expense', {iouRequestType: CONST.IOU.REQUEST_TYPE.DISTANCE}],
+            ['a receipt waiting to be scanned', {receipt: {state: CONST.IOU.RECEIPT_STATE.SCAN_READY}}],
+            ['a receipt being scanned', {receipt: {state: CONST.IOU.RECEIPT_STATE.SCANNING}}],
+            ['an expense being deleted', {pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE}],
+        ])('does not flag %s', (_description, overrides: Partial<Transaction>) => {
+            // Given an expense with a placeholder merchant that the expense row doesn't treat as an error
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant(CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, overrides)],
+                {},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not warn, otherwise the modal would report a problem that no other screen shows
+            expect(summary.hasMissingMerchant).toBe(false);
+        });
+
+        it('does not flag a placeholder merchant on an IOU report, even when another required field is empty', () => {
+            // Given an IOU, where a merchant is optional, with a zero amount that makes hasMissingSmartscanFields true by itself
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {amount: 0})],
+                {},
+                createMock<Report>({type: CONST.REPORT.TYPE.IOU}),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not warn about the merchant, since only expense reports require one
+            expect(summary.hasMissingMerchant).toBe(false);
+        });
+
+        it('does not flag a held expense, because submitting moves it to a new draft report', () => {
+            // Given a clean expense and a held expense with no merchant, on a workflow that splits held expenses out when submitting
+            const summary = getReportSubmitViolationSummary(
+                [
+                    createMockTransactionWithMerchant('Merchant', {transactionID: '1'}),
+                    createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {transactionID: '2', comment: {hold: '123'}}),
+                ],
+                {},
+                createMockExpenseReport(),
+                createMock<Policy>({approvalMode: CONST.POLICY.APPROVAL_MODE.BASIC}),
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not warn, since nothing that is actually being submitted lacks a merchant
+            expect(summary.hasMissingMerchant).toBe(false);
+        });
+
+        it('flags a held expense on a dynamic external workflow, because held expenses stay on the report there', () => {
+            // Given a held expense with no merchant on a dynamic external workflow, which doesn't split held expenses out
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {comment: {hold: '123'}})],
+                {},
+                createMockExpenseReport(),
+                createMock<Policy>({approvalMode: CONST.POLICY.APPROVAL_MODE.DYNAMICEXTERNAL}),
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must warn, because this expense is submitted along with the rest of the report
+            expect(summary.hasMissingMerchant).toBe(true);
+        });
+
+        it('flags an expense that is not held when another expense on the report is held', () => {
+            // Given two expenses with no merchant, where only one is held
+            const summary = getReportSubmitViolationSummary(
+                [
+                    createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {transactionID: '1', comment: {hold: '123'}}),
+                    createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {transactionID: '2'}),
+                ],
+                {},
+                createMockExpenseReport(),
+                createMock<Policy>({approvalMode: CONST.POLICY.APPROVAL_MODE.BASIC}),
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must warn, since the expense that isn't held is still being submitted without a merchant
+            expect(summary.hasMissingMerchant).toBe(true);
+        });
+
+        it('does not add a second bullet for a failed scan that already has a smartscanFailed violation', () => {
+            // Given a failed scan with no merchant, whose smartscanFailed message already tells the submitter to enter the details
+            const summary = getReportSubmitViolationSummary(
+                [
+                    createMockTransactionWithMerchant(CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, {
+                        iouRequestType: CONST.IOU.REQUEST_TYPE.SCAN,
+                        receipt: {state: CONST.IOU.RECEIPT_STATE.SCAN_FAILED},
+                    }),
+                ],
+                {[getViolationsKey('1')]: [createMockViolation(CONST.VIOLATIONS.SMARTSCAN_FAILED, {missingFields: ['merchant']})]},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the bullets are built from the summary
+            const bullets = buildSubmitViolationBullets({summary, translate, dateFnsLocale, convertToDisplayString});
+
+            // Then only the scan failure is listed, because a separate merchant bullet would report the same problem twice
+            expect(summary.hasMissingMerchant).toBe(false);
+            expect(bullets).toHaveLength(1);
+            expect(bullets).not.toContain('iou.missingMerchant');
+        });
+
+        it('flags a different expense with no merchant on the same report as a failed scan', () => {
+            // Given a failed scan with a smartscanFailed violation, next to a separate manual expense with no merchant
+            const summary = getReportSubmitViolationSummary(
+                [
+                    createMockTransactionWithMerchant(CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT, {
+                        transactionID: '1',
+                        iouRequestType: CONST.IOU.REQUEST_TYPE.SCAN,
+                        receipt: {state: CONST.IOU.RECEIPT_STATE.SCAN_FAILED},
+                    }),
+                    createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {transactionID: '2'}),
+                ],
+                {[getViolationsKey('1')]: [createMockViolation(CONST.VIOLATIONS.SMARTSCAN_FAILED)]},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then the manual expense must still be flagged, because the scan failure only covers its own expense
+            expect(summary.hasMissingMerchant).toBe(true);
+        });
+
+        it('flags a failed scan with no merchant once its smartscanFailed violation is gone', () => {
+            // Given a failed scan with no merchant whose smartscanFailed violation was removed after the user entered the amount
+            const summary = getReportSubmitViolationSummary([createMockFailedScan({modifiedAmount: -1000})], {[getViolationsKey('1')]: []}, createMockExpenseReport(), undefined, '', 0);
+
+            // When the summary is built
+            // Then it must warn about the merchant only, since nothing else now tells the submitter it's missing and the amount has been entered
+            expect(summary.hasMissingMerchant).toBe(true);
+            expect(summary.hasMissingAmount).toBe(false);
+        });
+
+        it('does not flag a placeholder merchant when the report is not available', () => {
+            // Given a report that hasn't loaded, so there is no way to tell whether a merchant is required
+            const summary = getReportSubmitViolationSummary([createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT)], {}, undefined, undefined, '', 0);
+
+            // When the summary is built
+            // Then it must not warn, rather than interrupt a submission over a merchant that may be optional
+            expect(summary.hasMissingMerchant).toBe(false);
+        });
+    });
+
+    describe('missing amount', () => {
+        it('flags a failed scan whose amount was never entered, once the merchant is fixed and smartscanFailed is gone', () => {
+            // Given a failed scan where the user entered only the merchant, which makes the server remove smartscanFailed while the amount stays 0
+            const summary = getReportSubmitViolationSummary(
+                [createMockFailedScan({modifiedMerchant: 'Merchant'})],
+                {[getViolationsKey('1')]: []},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the bullets are built from the summary
+            const bullets = buildSubmitViolationBullets({summary, translate, dateFnsLocale, convertToDisplayString});
+
+            // Then the amount must be listed, because the expense row shows this error and nothing else in the modal would mention it
+            expect(summary.hasMissingAmount).toBe(true);
+            expect(summary.hasMissingMerchant).toBe(false);
+            expect(bullets).toEqual(['iou.missingAmount']);
+        });
+
+        it('flags both fields when a failed scan has neither and smartscanFailed is gone', () => {
+            // Given a failed scan with no merchant and no amount, and no smartscanFailed violation to mention them
+            const summary = getReportSubmitViolationSummary([createMockFailedScan()], {[getViolationsKey('1')]: []}, createMockExpenseReport(), undefined, '', 0);
+
+            // When the bullets are built from the summary
+            const bullets = buildSubmitViolationBullets({summary, translate, dateFnsLocale, convertToDisplayString});
+
+            // Then both are listed, since the submitter has to fix each one
+            expect(bullets).toEqual(['iou.missingMerchant', 'iou.missingAmount']);
+        });
+
+        it('does not add a second bullet when the failed scan still has its smartscanFailed violation', () => {
+            // Given a failed scan whose smartscanFailed message already names the missing amount
+            const summary = getReportSubmitViolationSummary(
+                [createMockFailedScan()],
+                {[getViolationsKey('1')]: [createMockViolation(CONST.VIOLATIONS.SMARTSCAN_FAILED, {missingFields: ['amount']})]},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not flag the amount, because that would report the same problem twice
+            expect(summary.hasMissingAmount).toBe(false);
+        });
+
+        it('does not flag a manual expense with a zero amount', () => {
+            // Given a manual expense for 0 on an expense report, which is a valid amount there
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant('Merchant', {amount: 0, iouRequestType: CONST.IOU.REQUEST_TYPE.MANUAL})],
+                {},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not warn, otherwise a clean report with a zero amount would stop submitting immediately
+            expect(summary.hasMissingAmount).toBe(false);
+            expect(hasAnySubmitViolation(summary)).toBe(false);
+        });
+
+        it('flags only the merchant on a manual expense with a zero amount and no merchant', () => {
+            // Given a manual expense for 0, a valid amount on an expense report, whose missing merchant makes it pass the required fields check
+            const summary = getReportSubmitViolationSummary(
+                [createMockTransactionWithMerchant(CONST.TRANSACTION.DEFAULT_MERCHANT, {amount: 0, iouRequestType: CONST.IOU.REQUEST_TYPE.MANUAL})],
+                {},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not also report a missing amount, because only a failed scan's placeholder counts as one
+            expect(summary.hasMissingMerchant).toBe(true);
+            expect(summary.hasMissingAmount).toBe(false);
+        });
+
+        it('does not flag a failed scan once the amount has been entered', () => {
+            // Given a failed scan where the user has entered the amount, which is stored in modifiedAmount
+            const summary = getReportSubmitViolationSummary(
+                [createMockFailedScan({modifiedMerchant: 'Merchant', modifiedAmount: -1000})],
+                {[getViolationsKey('1')]: []},
+                createMockExpenseReport(),
+                undefined,
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not warn, since the user has already fixed the amount
+            expect(summary.hasMissingAmount).toBe(false);
+        });
+
+        it('does not flag a held failed scan, because submitting moves it to a new draft report', () => {
+            // Given a held failed scan on a workflow that splits held expenses out when submitting
+            const summary = getReportSubmitViolationSummary(
+                [createMockFailedScan({modifiedMerchant: 'Merchant', comment: {hold: '123'}})],
+                {},
+                createMockExpenseReport(),
+                createMock<Policy>({approvalMode: CONST.POLICY.APPROVAL_MODE.BASIC}),
+                '',
+                0,
+            );
+
+            // When the summary is built
+            // Then it must not warn, since this expense isn't part of the submission
+            expect(summary.hasMissingAmount).toBe(false);
+        });
+
+        it('does not flag a failed scan on an IOU report', () => {
+            // Given a failed scan on an IOU, which this warning doesn't cover
+            const summary = getReportSubmitViolationSummary([createMockFailedScan({modifiedMerchant: 'Merchant'})], {}, createMock<Report>({type: CONST.REPORT.TYPE.IOU}), undefined, '', 0);
+
+            // When the summary is built
+            // Then it must not warn, because only expense reports go through these checks
+            expect(summary.hasMissingAmount).toBe(false);
+        });
+    });
+});
+
+describe('hasAnySubmitViolation', () => {
+    it('returns true when a missing merchant is the only thing to show', () => {
+        // Given a summary with no violations of any kind, only a missing merchant
+        const summary = {...createEmptySummary(), hasMissingMerchant: true};
+
+        // When deciding whether to show the modal
+        // Then the modal must open, otherwise the warning would only appear when an unrelated violation happens to exist
+        expect(hasAnySubmitViolation(summary)).toBe(true);
+    });
+
+    it('returns true when a missing amount is the only thing to show', () => {
+        // Given a summary with no violations of any kind, only a missing amount
+        const summary = {...createEmptySummary(), hasMissingAmount: true};
+
+        // When deciding whether to show the modal
+        // Then the modal must open, otherwise an expense with no amount would be submitted with no warning
+        expect(hasAnySubmitViolation(summary)).toBe(true);
+    });
+
+    it('returns false when the summary is empty', () => {
+        // Given a summary with nothing in any bucket
+        // When deciding whether to show the modal
+        // Then a clean report must keep submitting immediately, with no extra prompt
+        expect(hasAnySubmitViolation(createEmptySummary())).toBe(false);
+    });
+});
+
+describe('shouldResolveAcknowledgedViolations', () => {
+    it('does not resolve anything when a missing merchant is the only thing acknowledged', () => {
+        // Given a summary whose only entry is a missing merchant
+        const summary = {...createEmptySummary(), hasMissingMerchant: true};
+
+        // When the user confirms "Submit anyway"
+        // Then the flag must stay false, since acknowledging the modal doesn't fix the merchant and there is no rejected expense to resolve
+        expect(shouldResolveAcknowledgedViolations(summary)).toBe(false);
+    });
+
+    it('does not resolve anything when a missing amount is the only thing acknowledged', () => {
+        // Given a summary whose only entry is a missing amount
+        const summary = {...createEmptySummary(), hasMissingAmount: true};
+
+        // When the user confirms "Submit anyway"
+        // Then the flag must stay false, since acknowledging the modal doesn't fix the amount and there is no rejected expense to resolve
+        expect(shouldResolveAcknowledgedViolations(summary)).toBe(false);
+    });
+});
+
+describe('mergeReportSubmitViolationSummaries', () => {
+    it('keeps the missing merchant flag when only one of the selected reports has it', () => {
+        // Given a bulk submit where one report has a missing merchant and another is clean
+        const summaries = [createEmptySummary(), {...createEmptySummary(), hasMissingMerchant: true}];
+
+        // When the summaries are merged into the single modal for the selection
+        // Then the flag must survive, otherwise the warning would disappear in bulk submit
+        expect(mergeReportSubmitViolationSummaries(summaries).hasMissingMerchant).toBe(true);
+    });
+
+    it('keeps the missing amount flag when only one of the selected reports has it', () => {
+        // Given a bulk submit where one report has a missing amount and another is clean
+        const summaries = [createEmptySummary(), {...createEmptySummary(), hasMissingAmount: true}];
+
+        // When the summaries are merged into the single modal for the selection
+        // Then the flag must survive, otherwise the warning would disappear in bulk submit
+        expect(mergeReportSubmitViolationSummaries(summaries).hasMissingAmount).toBe(true);
+    });
+
+    it('leaves the missing merchant and amount flags off when no selected report has them', () => {
+        // Given a bulk submit of clean reports
+        const summaries = [createEmptySummary(), createEmptySummary()];
+
+        // When the summaries are merged
+        const merged = mergeReportSubmitViolationSummaries(summaries);
+
+        // Then both flags must stay false, so a clean bulk submit doesn't open the modal
+        expect(merged.hasMissingMerchant).toBe(false);
+        expect(merged.hasMissingAmount).toBe(false);
+    });
 });
 
 describe('buildSubmitViolationBullets', () => {
     it('returns an empty list when there is nothing to report', () => {
         // Given a summary where every bucket is empty
-        const summary = {hasRejectedExpense: false, hasReportBeenRejected: false, hasPendingCardMatch: false, otherViolations: new Map()};
+        const summary = createEmptySummary();
 
         // When the bullets are built
         // Then there is nothing for the modal to show, so the list must be empty
         expect(buildSubmitViolationBullets({summary, translate, dateFnsLocale, convertToDisplayString})).toEqual([]);
     });
 
-    it('orders bullets: other violations first, then report rejection, then expense rejection, then pending-card-match', () => {
+    it('orders bullets: other violations first, then a missing merchant and amount, then report rejection, then expense rejection, then pending-card-match', () => {
         // Given a summary with every kind of violation present at once
         const summary = {
             hasRejectedExpense: true,
             hasReportBeenRejected: true,
             hasPendingCardMatch: true,
+            hasMissingMerchant: true,
+            hasMissingAmount: true,
             otherViolations: new Map([[CONST.VIOLATIONS.OVER_CATEGORY_LIMIT, createMockViolation(CONST.VIOLATIONS.OVER_CATEGORY_LIMIT)]]),
         };
 
@@ -214,6 +693,8 @@ describe('buildSubmitViolationBullets', () => {
         // bullet must use the full violation message (with the interpolated amount), not the short label
         expect(bullets).toEqual([
             'violations.overCategoryLimit(0 USD)',
+            'iou.missingMerchant',
+            'iou.missingAmount',
             'iou.confirmSubmitReportViolations.reportRejected',
             'iou.confirmSubmitReportViolations.rejectedExpense',
             'iou.confirmSubmitReportViolations.pendingCardMatch',
@@ -224,9 +705,7 @@ describe('buildSubmitViolationBullets', () => {
         // Given a receipt-required violation whose data carries the policy's no-receipt amount threshold (e.g. $25)
         const receiptRequiredViolation = createMockViolation(CONST.VIOLATIONS.RECEIPT_REQUIRED, {amount: 2500, currency: 'USD'});
         const summary = {
-            hasRejectedExpense: false,
-            hasReportBeenRejected: false,
-            hasPendingCardMatch: false,
+            ...createEmptySummary(),
             otherViolations: new Map([[CONST.VIOLATIONS.RECEIPT_REQUIRED, receiptRequiredViolation]]),
         };
 
@@ -248,9 +727,7 @@ describe('buildSubmitViolationBullets', () => {
         const htmlTranslate = jest.fn(() => 'Bank connection broken. <a href="undefined">Reconnect to match receipt</a>') as unknown as LocaleContextProps['translate'];
         const rterViolation = createMockViolation(CONST.VIOLATIONS.RTER, {brokenBankConnection: true, isAdmin: true});
         const summary = {
-            hasRejectedExpense: false,
-            hasReportBeenRejected: false,
-            hasPendingCardMatch: false,
+            ...createEmptySummary(),
             otherViolations: new Map([[CONST.VIOLATIONS.RTER, rterViolation]]),
         };
 
diff --git a/tests/unit/hooks/useConfirmSubmitReportViolations.test.ts b/tests/unit/hooks/useConfirmSubmitReportViolations.test.ts
index 8530c56c937..5437064a3ef 100644
--- a/tests/unit/hooks/useConfirmSubmitReportViolations.test.ts
+++ b/tests/unit/hooks/useConfirmSubmitReportViolations.test.ts
@@ -232,6 +232,56 @@ describe('useConfirmSubmitReportViolations', () => {
         expect(getShowConfirmModalOption('buttonVariant')).toBe(CONST.BUTTON_VARIANT.DANGER);
     });
 
+    describe('when a missing merchant is the only problem', () => {
+        const expenseReport = createMock<Report>({type: CONST.REPORT.TYPE.EXPENSE});
+        const transactionWithoutMerchant = createMock<Transaction>({transactionID: '1', merchant: CONST.TRANSACTION.DEFAULT_MERCHANT});
+
+        it('opens the modal with the missing merchant bullet instead of submitting immediately', () => {
+            // Given an expense report with no violations and one expense without a merchant
+            const {result} = renderHook(() =>
+                useConfirmSubmitReportViolations({
+                    reportID: expenseReport.reportID,
+                    report: expenseReport,
+                    policy: undefined,
+                    transactions: [transactionWithoutMerchant],
+                    violationsCollection: {},
+                }),
+            );
+            const onProceed = jest.fn();
+
+            // When the caller tries to submit
+            result.current(onProceed);
+
+            // Then the user must see the warning first, since the server accepts the submission without one
+            expect(mockShowConfirmModal).toHaveBeenCalledTimes(1);
+            expect(getPromptViolations()).toEqual(['iou.missingMerchant']);
+            expect(onProceed).not.toHaveBeenCalled();
+        });
+
+        it('calls onProceed(false) when the user confirms', async () => {
+            // Given the same report, where the warning is only informational
+            const {result} = renderHook(() =>
+                useConfirmSubmitReportViolations({
+                    reportID: expenseReport.reportID,
+                    report: expenseReport,
+                    policy: undefined,
+                    transactions: [transactionWithoutMerchant],
+                    violationsCollection: {},
+                }),
+            );
+            const onProceed = jest.fn();
+
+            // When the user confirms "Submit anyway"
+            result.current(onProceed);
+            resolveShowConfirmModal({action: MockModalActions.CONFIRM});
+
+            // Then the submission must go ahead without asking the backend to resolve anything
+            await waitFor(() => {
+                expect(onProceed).toHaveBeenCalledWith(false);
+            });
+        });
+    });
+
     it('shows the report-rejected bullet (not the rejected-expense one) when the whole report was rejected to the submitter', () => {
         // Given a report with no transaction-level violations, but rejected in full (nextStep.messageKey is
         // REJECTED_REPORT, report reopened to OPEN) - a report-level state, not a TransactionViolations entry

TaduJR avatar Nov 02 '26 09:11 TaduJR

πŸ€– Draft PR created: Warn about a missing merchant or amount in the Submit report modal Please mark it as "Ready for review" or ask me to do that for you when it is ready for review.

I applied your src and tests diffs exactly as given. All four changed files match the target blob hashes in your diffs. The modal copy and the Search flows are not changed.

Checks run:

  • Unit tests for getReportSubmitViolationSummaryTest.ts and useConfirmSubmitReportViolations.test.ts: 59/59 passed
  • npm run typecheck, npm run lint-changed and npm run spell-changed: passed
  • Not run: the oxfmt format check (blocked in my sandbox), the full Jest suite and the Storybook smoke test

I couldn't push to your fork, so the branch is on upstream. To move it to your fork:

git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-warnMissingMerchantOnSubmitReport
git checkout -b claude-warnMissingMerchantOnSubmitReport upstream/claude-warnMissingMerchantOnSubmitReport
git push -u origin claude-warnMissingMerchantOnSubmitReport

MelvinBot avatar Nov 02 '26 09:11 MelvinBot

Melvin Proposal LGTM!

πŸŽ€πŸ‘€πŸŽ€ C+ Reviewed.

TaduJR avatar Nov 02 '26 10:11 TaduJR

Triggered auto assignment to @amyevans, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Nov 02 '26 10:11 melvin-bot[bot]

πŸ“£ @TaduJR πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Nov 02 '26 10:11 melvin-bot[bot]

@TaduJR

The solution for this issue has been :rocket: deployed to production :rocket: in version 9.5.32-7 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:

  • https://github.com/Expensify/App/pull/105605

If no regressions arise, payment will be issued on 2026-11-13. :confetti_ball:

The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the Contributor+ Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]. If no checklist is needed for this issue, you can click: [no checklist button]

melvin-bot[bot] avatar Nov 06 '26 09:11 melvin-bot[bot]

Proposal

Please re-state the problem that we are trying to solve in this issue.

When submitting an expense report that has violations (triggering the "Submit report?" confirmation modal with a summary of violations on the report) and one of the expenses is also missing a required merchant ("Missing merchant"), the "Submit report?" warning modal lists the Onyx transaction violations (such as "Missing category") but omits "Missing merchant".

What is the root cause of that problem?

In src/libs/Violations/getReportSubmitViolationSummary.ts (lines 45–80), the function builds the list of violation summary items for the "Submit report?" modal by iterating solely over transactionViolations stored in ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS, and skips any transaction where violations.length === 0 (lines 50–52).

However, in New Expensify, a missing merchant on a workspace expense is not stored as a TransactionViolation entry in ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS; instead, it is computed dynamically as a required-field error via areRequiredFieldsEmpty / isMerchantMissing (src/libs/TransactionUtils/index.ts and ReportUtils.ts). Because getReportSubmitViolationSummary never checks isMerchantMissing(transaction) (when the workspace requires a merchant on cash/card expenses), "Missing merchant" is never included in the submit warning summary.

What changes do you think we should make in order to solve the problem?

In src/libs/Violations/getReportSubmitViolationSummary.ts (around lines 45–80):

  1. In addition to reading transactionViolations for each transaction on the report, check whether the transaction is missing a required merchant (areRequiredFieldsEmpty(transaction, report) / isMerchantMissing(transaction) when the report is a policy expense report and the transaction is not a distance/per-diem request or pending scan).
  2. When a required merchant is missing on a transaction, include the "Missing merchant" violation entry (translate('violations.missingMerchant') / CONST.VIOLATIONS.MISSING_MERCHANT) in the summary count and list returned by getReportSubmitViolationSummary.
  3. Add unit tests in tests/unit/getReportSubmitViolationSummaryTest.ts verifying that an expense with a missing merchant is included in the submit warning summary.

What alternative solutions did you explore? (Optional)

We considered writing a synthetic missingMerchant violation into ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS on every merchant edit, but TRANSACTION_VIOLATIONS mirrors server violation objects; checking areRequiredFieldsEmpty / isMerchantMissing directly inside getReportSubmitViolationSummary matches how MoneyRequestView and TransactionPreview surface the missing merchant error.

jeffrey-graham avatar Nov 07 '26 09:11 jeffrey-graham