Repository navigation
Add a project feature flag for showing invoices in EUR - #6644
Open
jeremyevans wants to merge 1 commit into
Open
jeremyevans wants to merge 1 commit into
jeremyevans wants to merge 1 commit into
Conversation
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.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.