Skip to content

[Due for payment 2026-11-25] [$175] [CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot #106798

Done

Description

@MelvinBot

Problem

NewDot incorrectly displays missing-required-field errors for empty invoice report fields. The supplied screenshots show empty Customer Address and PO Number fields highlighted in red in NewDot, while the same invoice displays those fields without errors in Expensify Classic.

Reported platforms: NewDot web, staging and production.
Version: Not provided.

Steps to reproduce

  1. Open an invoice with empty Customer Address and PO Number invoice report fields in NewDot.
  2. View the invoice's report fields.
  3. Open the same invoice in Expensify Classic and compare.

Expected result

Empty invoice report fields display without missing-required-field errors, consistent with Classic and the invoice exemption described in the report.

Actual result

NewDot highlights the empty fields in red and displays:

  • “Customer Address is required”
  • “PO Number is required”

Classic displays the same empty fields without errors.

Requested frontend fix

Update local report-field validation in src/libs/ReportUtils.ts to respect the invoice exemption:

  • Do not generate missing-required-field errors for empty invoice fields.
  • Preserve required-field validation for expense reports and unrelated validation.
  • Add regression tests covering both report types.

Acceptance criteria

  • Empty Customer Address and PO Number invoice fields do not display required-field errors.
  • Empty required fields on expense reports still display the appropriate errors.
  • Unrelated validation remains unchanged.
  • Regression tests cover invoices and expense reports.

Evidence

Comparison screenshots are available in the source Slack thread. Customer-specific invoice and payment details are omitted from this public issue.

This issue records the reported behavior and requested fix; the code path and backend exemption have not been independently verified.

Slack thread: https://expensify.slack.com/archives/C049HHMV9SM/p1794525278541829

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

Activity

  1. added
    Bug
    on Nov 13, 2026
  2. changed the title [-]Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/-] [+][CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/+] on Nov 13, 2026
  3. trjExpensify commented on Nov 13, 2026

    @trjExpensify
    Contributor

    @MelvinBot write a proposed solution for this.

  4. added
    External
    on Nov 13, 2026
  5. melvin-bot commented on Nov 13, 2026

    @melvin-bot

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

  6. changed the title [-][CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/-] [+][$175] [CFI] Invoices - Empty invoice report fields incorrectly display required-field errors in NewDot[/+] on Nov 13, 2026
  7. melvin-bot commented on Nov 13, 2026

    @melvin-bot
  8. MelvinBot commented on Nov 13, 2026

    @MelvinBot
    ContributorAuthor

    Proposal

    What is the root cause of that problem?

    Local report-field validation treats empty invoice fields like empty expense-report fields, without checking whether the report is an invoice. This generates the reported required-field messages and red highlighting.

    Code evidence

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

    Pass the report into getFieldViolation() and return no missing-required-field violation when isInvoiceReport(report) is true. Update both callers above.

    Keep the existing expense-report value/default checks unchanged. Do not suppress API errors, circular-reference validation, or unrelated report violations.

    Regression coverage:

    • Empty invoice fields—including Customer Address and PO Number—remain visible without required-field errors.
    • Empty required expense-report fields still show errors.
    • Empty invoice fields do not generate report-field warning indicators.
    • Populated values and default-value handling remain unchanged.
    Test locations

    What alternative solutions did you explore? (Optional)

    Skip invoice validation separately in each caller. That would work, but centralizing the exemption avoids duplicated logic and keeps field errors and warning indicators consistent.

    Code-based proposal; no changes or tests were run. Classic/backend behavior was not independently verified.


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


    view run

  9. SrkaLo92 commented on Nov 13, 2026

    @SrkaLo92

    Proposal

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

    Empty invoice report fields (Customer Address, PO Number) show "X is required" in red in NewDot, while Classic shows them without errors.

    What is the root cause of that problem?

    getFieldViolation flags every empty field as required, it doesn't look at the report type or at the field's own required flag at all:

    https://github.com/Expensify/App/blob/d59adfd8/src/libs/ReportUtils.ts#L14498-L14504

    function getFieldViolation(reportField: PolicyReportField): ReportViolationName | undefined {
        ...
        return (reportField.value ?? reportField.defaultValue) ? undefined : CONST.REPORT_VIOLATIONS.FIELD_REQUIRED;
    }

    It's used for the red error under the field in MoneyRequestViewReportFields (L164) and for the RBR in hasVisibleReportFieldViolations (L11218), and that one runs for invoice reports too (isInvoiceReport(report) ? policy?.areInvoiceFieldsEnabled : ...).

    What's interesting is that the edit page already has its own idea of "required". DynamicEditReportFieldPage uses deletable (which is documented in PolicyReportField as "Tells if the field is required or not"):

    https://github.com/Expensify/App/blob/d59adfd8/src/pages/DynamicEditReportFieldPage.tsx#L139

    const isReportFieldDeletable = reportField.deletable && reportField?.fieldID !== CONST.REPORT_FIELD_TITLE_FIELD_ID;
    ...
    isRequired={!isReportFieldDeletable}

    So we have two different rules for the same thing. The view says every empty field is required, the edit page says only !deletable ones are. On top of that neither of them knows about the invoice exemption Classic has.

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

    Add one helper in ReportUtils and use it everywhere we decide if a report field is required:

    function isReportFieldRequired(reportField: PolicyReportField, report: OnyxEntry<Report>): boolean {
        // Invoice fields are never required, same as Classic
        if (isInvoiceReport(report)) {
            return false;
        }
        return reportField.fieldID === CONST.REPORT_FIELD_TITLE_FIELD_ID || !reportField.deletable;
    }
    1. getFieldViolation(reportField, report): return undefined early when !isReportFieldRequired(reportField, report), the rest stays as is. Update the 2 callers (MoneyRequestViewReportFields, hasVisibleReportFieldViolations) to pass the report, both already have it.
    2. DynamicEditReportFieldPage: use isRequired={isReportFieldRequired(reportField, report)} for the text/date/dropdown pages instead of !isReportFieldDeletable, so you can actually clear an invoice field and save it empty without the form error. The Delete menu item logic stays on isReportFieldDeletable, nothing changes there.

    Expense reports keep the same behaviour: fields created in NewDot are deletable: false (ReportField.ts L226) so they are still required, and the title field is unchanged.

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    ReportUtilsTest:

    • empty invoice field -> getFieldViolation returns undefined, hasVisibleReportFieldViolations false
    • empty expense report field with deletable: false -> fieldRequired, RBR true
    • empty expense report field with deletable: true -> no violation
    • field with value or defaultValue -> no violation (both report types)

    UI test for DynamicEditReportFieldPage: saving an empty value on an invoice field doesn't show "This field is required".

    What alternative solutions did you explore? (Optional)

    Only skip invoices inside getFieldViolation. It fixes the red text and the RBR, but the edit page would still refuse an empty value for the same field (and still ignore deletable), so the view and the edit page would keep disagreeing. Having one helper keeps them in sync.

  10. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    📣 @SrkaLo92! 📣
    Hey, it seems we don’t have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork.
    Please follow these steps:

    1. Make sure you've read and understood the contributing guidelines.
    2. Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
    3. Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
    4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
      Screen Shot 2022-11-16 at 4 42 54 PM
      Format:
    Contributor details
    Your Expensify account email: <REPLACE EMAIL HERE>
    Upwork Profile Link: <REPLACE LINK HERE>
    
  11. SrkaLo92 commented on Nov 13, 2026

    @SrkaLo92

    Contributor details
    Your Expensify account email: srdjanmarinkovic31@gmail.com
    Upwork Profile Link: https://www.upwork.com/freelancers/srdjanmarinkovic

  12. melvin-bot commented on Nov 13, 2026

    @melvin-bot

    ✅ Contributor details stored successfully. Thank you for contributing to Expensify!

  13. 20 remaining items

  14. melvin-bot commented on Nov 24, 2026

    @melvin-bot

    @DylanDylann I sent you a Slack DM to connect GitHub. I will continue the original request once you are connected.

  15. MelvinBot commented on Nov 24, 2026

    @MelvinBot
    ContributorAuthor

    The offending PR is Implement invoice fields feature, merged September 9, 2026.

    It exposed invoice fields to existing expense-report validation without adding an invoice exemption:

    • Previously, isReportFieldDisabled() always returned true for invoices. The PR removed that guard.
    • The renderer consequently began calling getFieldViolation() for editable invoice fields.
    • That validator treats empty values without defaults as required-field violations, regardless of report type.

    Historical caveat: The same defect first landed in the original invoice-fields PR on June 10, but was reverted the following day. The September PR reintroduced it and is the relevant attribution for this issue.

    The later inline-editing PR changed the error’s presentation, not the underlying validation behavior.

    Strong code-history evidence; no browser reproduction performed.


    view run

  16. added
    Daily
    Awaiting Payment
    on Nov 24, 2026
  17. expensify-chore-bot commented on Nov 24, 2026

    @expensify-chore-bot

    Triggered auto assignment to @mallenexpensify (Awaiting Payment)

  18. expensify-chore-bot commented on Nov 24, 2026

    @expensify-chore-bot

    Payment Summary

    Resolving PRs:

    BugZero Checklist (@mallenexpensify)

    • I have confirmed assignees, roles, and Upwork contracts look correct
    • I have paid out Upwork contracts / manual NewDot requests
    • [BugZero Assignee] I have created a GH issue for creating/updating the regression test once above steps have been agreed upon
  19. expensify-chore-bot commented on Nov 27, 2026

    @expensify-chore-bot

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

  20. mallenexpensify commented on Nov 30, 2026

    @mallenexpensify
    Contributor

    Matt's AI agent:

    Prep notes for the CM. This is not a payment approval. Do not request payment until the CM posts the final amount.

    Ready.

    Job price: $175.

    • DylanDylann (C+): 100%, via NewDot

    Price basis: standard, no Help Wanted.

    Next: press Caps+Y, then pay.

    Evidence
    • C+ checklist by DylanDylann, 12 steps: comment
    • No TestRail case yet.
    • Resolving PR 107076: MelvinBot, merged 2026-11-17, approved by DylanDylann, carlosmiceli. Videos: author 0/5, C+ 5/5.
    • Offending PR 93317 by ShridharGoel: outside the window.

    PAYPREP v1

  21. mallenexpensify commented on Nov 30, 2026

    @mallenexpensify
    Contributor

    Payment Summary

    Contributor+: @DylanDylann due $175 via NewDot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentBugDailyExternal

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions