Skip to content

[Due for payment 2026-01-29] [$250] Report - Total amount shown as "0,00" when splitting expense offline after currency change #78814

Closed

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 9.2.91-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/TR-2626/folder/13176791/41237176/1103226528
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 / Chrome (Hybrid app) - Windows 11 / Chrome
App Component: Money Requests

Action Performed:

Prerequisite: Account has at least one workspace.
Prerequisite 2: Default currency is not USD.

  1. Open the staging.new.expensify.com website.
  2. Open any workspace chat.
  3. Create a manual expense.
  4. Open the just created expense.
  5. Tap on "Amount" field.
  6. Edit the currency to "USD"
  7. Return to report.
  8. Turn off internet connection.
  9. Tap on "More" > "Split"
  10. Save the splits amount
  11. Once redirected to report, note that total amount above expenses is shown as "0,00".

Expected Result:

After splitting an expense, amount on report should still show the correct total of all the expenses.

Actual Result:

After splitting expenses while in offline mode, total amount is displayed as "0,00" if expense currency was previously changed.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari

Screenshots/Videos

Bug7040686_1767374555996.Currency.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022008463684077245289
  • Upwork Job ID: 2008463684077245289
  • Last Price Increase: 2026-01-06
Issue OwnerCurrent Issue Owner: @sonialiap

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Jan 3, 2026
  2. melvin-bot commented on Jan 3, 2026

    @melvin-bot

    Triggered auto assignment to @sonialiap (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

  3. TaduJR commented on Jan 3, 2026

    @TaduJR
    Contributor

    Proposal

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

    When splitting an expense offline after changing its currency, the category subtotal displays as "0,00" instead of the correct amount.

    What is the root cause of that problem?

    The root cause is a two-part issue in the split expense flow:

    1. convertedAmount is omitted when creating split transactions:

    if (isSplitExpense && existingTransaction) {
    const {convertedAmount: omittedConvertedAmount, ...existingTransactionWithoutConvertedAmount} = existingTransaction;
    optimisticTransaction = fastMerge(existingTransactionWithoutConvertedAmount, optimisticTransaction, false);
    }

    When splitting, the original transaction's convertedAmount is completely discarded. This was intentionally done to fix issue #76078 (doubled totals), but it removes crucial currency conversion data needed for subtotal calculations.

    2. calculateGroupTotal skips transactions without convertedAmount when currencies differ:

    function calculateGroupTotal(transactionList: Transaction[], reportCurrency: string): number {
    let total = 0;
    for (const transaction of transactionList) {
    if (isTransactionPendingDelete(transaction)) {
    continue;
    }
    const transactionCurrency = getCurrency(transaction);
    if (transactionCurrency === reportCurrency) {
    total += getAmount(transaction, true, false, true);
    } else if (transaction.convertedAmount) {
    total += getConvertedAmount(transaction);
    }
    }
    return total;
    }

    When transactionCurrency !== reportCurrency and convertedAmount is undefined, the transaction is skipped entirely, resulting in a total of 0.

    Root Cause Flow:

    1. User creates expense in workspace with default currency EUR
    2. User edits expense, changes currency to USD - backend calculates convertedAmount (USD value in EUR)
    3. User goes offline and splits the expense
    4. Split transactions are created at:

    if (isSplitExpense && existingTransaction) {
    const {convertedAmount: omittedConvertedAmount, ...existingTransactionWithoutConvertedAmount} = existingTransaction;
    optimisticTransaction = fastMerge(existingTransactionWithoutConvertedAmount, optimisticTransaction, false);
    }

    1. convertedAmount is omitted, split transactions have currency: USD, convertedAmount: undefined
    2. In calculateGroupTotal:

    const transactionCurrency = getCurrency(transaction);
    if (transactionCurrency === reportCurrency) {
    total += getAmount(transaction, true, false, true);
    } else if (transaction.convertedAmount) {
    total += getConvertedAmount(transaction);
    }

    1. transactionCurrency (USD) !== reportCurrency (EUR) - first condition fails
    2. transaction.convertedAmount is undefined - second condition fails
    3. Transaction is skipped, total = 0

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

    Instead of completely discarding convertedAmount, calculate a proportional value for each split transaction based on the original conversion rate.

    File: src/libs/actions/IOU/index.ts

    Location:

    if (isSplitExpense && existingTransaction) {
    const {convertedAmount: omittedConvertedAmount, ...existingTransactionWithoutConvertedAmount} = existingTransaction;
    optimisticTransaction = fastMerge(existingTransactionWithoutConvertedAmount, optimisticTransaction, false);
    }

    Change:

        if (isSplitExpense && existingTransaction) {
    -       const {convertedAmount: omittedConvertedAmount, ...existingTransactionWithoutConvertedAmount} = existingTransaction;
    +       const {convertedAmount: originalConvertedAmount, ...existingTransactionWithoutConvertedAmount} = existingTransaction;
            optimisticTransaction = fastMerge(existingTransactionWithoutConvertedAmount, optimisticTransaction, false);
    +
    +       // Calculate proportional convertedAmount for the split based on the original conversion rate
    +       const originalAmount = existingTransaction.modifiedAmount ?? existingTransaction.amount;
    +       const splitAmount = optimisticTransaction.modifiedAmount ?? optimisticTransaction.amount;
    +       if (originalConvertedAmount && originalAmount && splitAmount) {
    +           optimisticTransaction.convertedAmount = Math.round((originalConvertedAmount * splitAmount) / originalAmount);
    +       }
        }

    This preserves the exchange rate from the original transaction and applies it proportionally to each split, ensuring subtotals display correctly in the report currency.

  4. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jan 6, 2026
  5. changed the title [-]Report - Total amount shown as "0,00" when splitting expense offline after currency change[/-] [+][$250] Report - Total amount shown as "0,00" when splitting expense offline after currency change[/+] on Jan 6, 2026
  6. melvin-bot commented on Jan 6, 2026

    @melvin-bot
  7. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jan 6, 2026
  8. melvin-bot commented on Jan 6, 2026

    @melvin-bot

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

  9. twinkle-react commented on Jan 6, 2026

    @twinkle-react

    **Proposal

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

    When a user edits the currency of an expense and then creates split transactions while offline, the report totals become incorrect. This happens because the conversion from the expense currency to the report currency is not available locally, so the locally-created splits cannot correctly calculate their convertedAmount.


    What is the root cause of that problem?

    The server-provided report-currency conversion is not cached on the original transaction. When offline split transactions are created, there is no reliable rate to compute convertedAmount, leading to mismatched report totals.


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

    We propose caching the last known report-currency conversion on the original transaction and reusing it when creating offline split transactions:

    1. Cache conversion metadata on currency/amount edit

      • In updateMoneyRequestAmountAndCurrency (src/libs/actions/IOU/index.ts):

        const reportCurrency = transactionThreadReport?.currency ?? parentReport?.currency;
        const existingConverted = existingTransaction?.convertedAmount;
        const cachedReportConversionRate =
            reportCurrency && existingConverted && existingTransaction?.amount
                ? existingConverted / existingTransaction.amount
                : undefined;
        
        const transactionChanges = {
            amount,
            currency,
            taxCode,
            taxAmount,
            cachedReportCurrency: reportCurrency,
            cachedReportConversionRate,
        };
      • Merge these fields into the transaction Onyx entry so they persist offline.

    2. Apply cached conversion to optimistic split transactions

      • In updateSplitTransactions (src/libs/actions/IOU/index.ts):

        const cachedRate = originalTransaction?.cachedReportConversionRate;
        const cachedCurrency = originalTransaction?.cachedReportCurrency ?? expenseReport?.currency;
        const convertWithCachedRate = (amt: number) =>
            cachedRate && cachedCurrency === expenseReport?.currency ? Math.round(amt * cachedRate) : undefined;
        
        const splits: SplitTransactionSplitsParam = splitExpenses.map((split) => {
            const convertedAmount = convertWithCachedRate(split.amount ?? 0);
            return {
                amount: split.amount,
                convertedAmount, // preserves report total offline
                transactionID: split.transactionID,
                comment: {comment: currentDescription},
                // ...keep existing fields...
            };
        });
    3. Add typed fields and helper

      • Extend the Transaction type in src/types/onyx/Transaction.ts:

        cachedReportCurrency?: string;
        cachedReportConversionRate?: number;
      • Optional accessor in TransactionUtils or IOU/index.ts:

        function getCachedReportConversion(transaction: Transaction) {
            return {
                currency: transaction.cachedReportCurrency,
                rate: transaction.cachedReportConversionRate,
            };
        }

    Rationale:

    • Ownership of cached conversion stays with the transaction Onyx entry.
    • Using the last server-provided conversion locally ensures split transactions have accurate convertedAmount offline.
    • Avoids forcing report totals or triggering UI refresh hacks.

    What alternative solutions did you explore? (Optional)

    • Override report totals manually: Rejected because it breaks standard report accounting and adds unnecessary UI hacks.
  10. suneox commented on Jan 7, 2026

    @suneox
    Contributor

    Thank for all proposals! I'll take a look at this one today

  11. 18 remaining items

  12. changed the title [-][$250] Report - Total amount shown as "0,00" when splitting expense offline after currency change[/-] [+][Due for payment 2026-01-29] [$250] Report - Total amount shown as "0,00" when splitting expense offline after currency change[/+] on Jan 22, 2026
  13. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    Reviewing label has been removed, please complete the "BugZero Checklist".

  14. melvin-bot commented on Jan 22, 2026

    @melvin-bot

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

    If no regressions arise, payment will be issued on 2026-01-29. 🎊

    For reference, here are some details about the assignees on this issue:

    • @suneox requires payment through NewDot Manual Requests
    • @TaduJR requires payment (Needs manual offer from BZ)
  15. melvin-bot commented on Jan 22, 2026

    @melvin-bot

    @suneox @sonialiap The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero 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]

  16. suneox commented on Jan 28, 2026

    @suneox
    Contributor

    BugZero Checklist:

    • [Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.

      Link to comment: https://github.com/Expensify/App/pull/76253/changes#r2737687626

    • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.

      Link to discussion: N/A

    • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

      N/A: It isn't an impactful bug since it only affects optimistic data

  17. melvin-bot commented on Jan 29, 2026

    @melvin-bot

    Payment Summary

    Upwork Job

    • Reviewer: @suneox owed $250 via NewDot
    • ROLE: @TaduJR paid $(AMOUNT) via Upwork (LINK)

    BugZero Checklist (@sonialiap)

    • (if NewFeature) I have created a PR for any necessary HelpDot updates, or I confirmed no updates are necessary.
    • I have verified the correct assignees and roles are listed above and updated the necessary manual offers
    • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants/2008463684077245289/hired)
    • I have verified the PR was not reverted
    • I have applied any discounts due to bugs/regressions introduced by this PR
    • I have paid out the Upwork contracts or cancelled the ones that are incorrect
    • I have verified the payment summary above is correct
  18. sonialiap commented on Feb 2, 2026

    @sonialiap
    Contributor

    apologies for the delay! I was OOO

  19. sonialiap commented on Feb 2, 2026

    @sonialiap
    Contributor

    Payment summary:

    @suneox $250 please request in NewDot
    @TaduJR $250 paid in upwork

  20. trjExpensify commented on Feb 3, 2026

    @trjExpensify
    Contributor

    approved $250 for @suneox.

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions