Repository navigation
Conversation
An expense from a GEL card that records its RUB price, or a transfer to an off-budget account whose other leg is in the envelope currency, was valued at the month rate of the account posting. The envelope now keeps the recorded amount. Account postings, funds and month reconciliation stay native; the exchange difference reaches To Be Assigned.
|
@oviron is attempting to deploy a commit to the Alexey Ardov's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Refs #206
An expense from a GEL card often records its original price, for example 91 RUB, in
opOutcome. A RUB envelope still valued it at the month rate of the GEL posting, so the envelope showed a different amount than was actually paid. The same happens with a transfer to an off-budget account whose other leg is in the envelope currency.Now an envelope takes an amount the transaction itself records in the envelope currency, in this order:
opOutcomefor outcomes,opIncomefor incomes), if positive and finite;Only envelope values change: Available, carryover, overspend, goals, the burndown trend and the envelope rows in activity. Account postings, funds, general income, transfer fees and the month reconciliation stay native. The exchange difference ends up in To Be Assigned through
fundsEnd - available, with no extra posting.The envelope amounts are kept next to the native ones (
EnvActivity.envelope), created only when a transaction has a recorded amount. Envelope currencies reach raw activity as a memoized map, so rate refreshes and color or name edits keep the activity references.Independent of #213. Together they remove most of the drift: recorded amounts fix each transaction, saved tables fix the rest.
Tests:
rawActivity.test.tsfor the precedence and invalid alternates;recordedActivity.test.tsfor a GEL card expense in a RUB envelope (funds change stays in GEL), an off-budget transfer both ways, debt repayments staying native, and a keepIncome tag with a sign flip;graph.test.tsfor reference reuse.pnpm verifypasses; storybook tests were not run locally.