Skip to content

Add a project feature flag for showing invoices in EUR - #6644

Open
jeremyevans wants to merge 1 commit into
mainfrom
jeremy-billing-eur
Open

jeremyevans wants to merge 1 commit into
mainfrom
jeremy-billing-eur

Conversation

@jeremyevans

Copy link
Copy Markdown
Contributor

If the feature flag is set, convert the invoice from USD to EUR at the given eur_rate. When this is done, use the EU bank transfer info, except avoid the Intermediary BIC, because that should only be needed for USD transfers (I think).

While working on this, I found that we were inconsistent in regards to rounding:

  • Invoice#charge: Use rounded value
  • project billing_info pay route: Use floored value (.to_i)

I also found that the implicit rounding when showing the total value could potentially not match the amount charged. This is because of a difference in how Ruby rounds:

  • 1.005.round(2) # => 1.01
  • "%0.02f" % 1.005 # => "1.00"

Both of these seem like bad ideas. It's only a single cent, but the optics of charging a different amount than is displayed (especially when the displayed amount is lower) are quite bad. I decided to be consistent and make the project billing_info pay round use the rounded value as well.

Rounding the amount up at any point feels customer unfriendly. We should consider always rounding down, but this only attempts to make the behavior consistent, it doesn't make that change.

This displays the conversion rate using 4 decimal places, since from my research, that is standard pip.

This marks plain text emails with the UTF-8 charset, now that they can potentially include the euro sign.

If the feature flag is set, convert the invoice from USD to EUR at the
given eur_rate. When this is done, use the EU bank transfer info,
except avoid the Intermediary BIC, because that should only be needed
for USD transfers (I think).

While working on this, I found that we were inconsistent in regards
to rounding:

* Invoice#charge: Use rounded value
* project billing_info pay route: Use floored value (.to_i)

I also found that the implicit rounding when showing the total value
could potentially not match the amount charged. This is because of
a difference in how Ruby rounds:

* `1.005.round(2) # => 1.01`
* `"%0.02f" % 1.005 # => "1.00"`

Both of these seem like bad ideas. It's only a single cent, but the
optics of charging a different amount than is displayed (especially
when the displayed amount is lower) are quite bad.  I decided to be
consistent and make the project billing_info pay round use the rounded
value as well.

Rounding the amount up at any point feels customer unfriendly. We
should consider always rounding down, but this only attempts to
make the behavior consistent, it doesn't make that change.

This displays the conversion rate using 4 decimal places, since from
my research, that is standard pip.

This marks plain text emails with the UTF-8 charset, now that they
can potentially include the euro sign.
@jeremyevans
jeremyevans requested a review from enescakir October 8, 2026 22:05

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant