Skip to content

Issue 386 Project Stuck In An Old Currency

Ed Mozley edited this page Nov 18, 2026 · 2 revisions

💱 #386 A project created before the currency changed could not move onto the new one

GitHub #386, reported and fixed by @cloudcogsio · Projects · fixed in 5.6.0 (#3002)

What you saw

Projects → Settings → Budget: the currency set to EUR, and Each project may choose its own currency set to No. Create a project, then change the currency to USD.

The project keeps showing EUR. That part is by design: a project keeps the currency it was created in, so changing the setting never relabels an existing budget. But there was then no way to bring the project onto USD. Its Budget tab had no Currency button, and the API refused the change with "Every project uses the install's currency" - which, for a project that wasn't using it, read as a contradiction. The only way out was to switch "may choose" on, change the project, and switch it off again.

What was wrong

Two places assumed that a project could only ever differ from the install's currency if projects may choose:

// includes/services/project_tools.php - setCurrency(), before
if (projectSetting($conn, 'project_currency_per_project') !== '1')
    throw new ServiceError('forbidden', 'forbidden', "Every project uses the install's currency ...");

and projects-budget.js drew the Currency button only while "may choose" was on. A currency change made after a project was created breaks that assumption.

The fix

@cloudcogsio sent the fix on a branch; it is merged with his authorship.

  • The service accepts exactly one currency while projects may not choose: the install's. Every other currency is still refused.

    if (projectSetting($conn, 'project_currency_per_project') !== '1' && $code !== projectInstallCurrency($conn))
        throw new ServiceError('forbidden', ...);
  • The Budget tab shows a Use USD button (the install's currency, whatever it is) beside "Amounts in EUR." when the two differ and you may change the project. It is the same relabel as the Currency button, with the same warning first: amounts are not converted.

  • The settings description and the Budget help say so. The new label and the reworded texts are translated into the 8 other languages.

📁 Files

File Change
🟣 includes/services/project_tools.php setCurrency() allows the install's currency
🟡 assets/js/projects-budget.js The Use {currency} button
⚪ api/projects/tools.php Its comment
⚪ lang/*/projects.php The label, settings and help wording, 9 languages
🟢 tests/project-currency.php 9 checks

How it was verified

Reproduced first with @cloudcogsio's test on a test install, on the old code: 6 passed, 3 failed - the install's currency was refused as forbidden, the project stayed in EUR, and nothing reached its history. With the fix: 9 passed. Then on screen: an install in USD, "may choose" off, a project in EUR - its Budget tab reads Amounts in EUR. with a Use USD button.

What this means for you

Update to 5.6.0. A project left in an old currency after you changed the install's shows Use {currency} on its Budget tab; click it to relabel it. Remember it relabels, it does not convert: €1,000 becomes $1,000.

Related: Projects · Currencies

FreeITSM

Getting Started

Modules

Multi-tenancy (planned)

Responses to feedback

Blue sky thinking

Bugs resolved

Pull requests

Links

Clone this wiki locally