Repository navigation
Leave cash that only passed through the card out of spending - #16
Merged
Merged
Conversation
Every cash withdrawal counted as spending. Someone who puts tens of millions a month on the card from another bank and takes it out as cash had all of it counted as spent: a year of spending in the hundreds of millions and a financial independence target in the billions. Now money put on the card that is not income (own money from another bank, an ATM or terminal deposit, money from a person) and taken out as cash within a week only passes through: the withdrawal is not spending, and the part of a top-up from a person that left as cash is not money from people either. It is decided in Go over the ledger rows (analytics.MarkPassThrough) for SQLite, ClickHouse and the insights alike. A withdrawal counts only when such money covers it whole; one the person gave a category stays spending. Salary and income sources never pay for it. The rule is on by default and can be turned off per account on the operations page filtered to cash, which also skips a period's cash withdrawals by hand and undoes it. The analytics, income and net worth pages say how much was left out, with a link to review it; such withdrawals carry a "passed through" tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
Every cash withdrawal counted as spending. A person who tops the card up with tens of millions a month from another bank and cashes it out had all of it counted as spent, so a year of spending came out in the hundreds of millions and the financial independence target came out in the billions.
What changed
analytics.MarkPassThrough). Money put on the card that is not income (own money from another bank, an ATM or terminal deposit, money from a person) and taken out as cash within 7 days is marked as passing through. Such a withdrawal is not spending (IsSpend). The part of a top-up from a person that left as cash also no longer counts as money from people in the cash flow.kvkeycash_pass_through). It is on the operations page when that page is filtered to cash (m=#cashor the Cash category).ignored, questions dropped) and can count them again (back toreview, as on import).Checks
gofmt -l .prints nothing;go vet ./...passes;go test -race ./...passes;CLICKHOUSE_TEST_URL=… go test ./...passes;golangci-lint run ./...reports 0 issues.TestMarkPassThrough: covered, same-day, salary, from a person (partial), not covered, too old, categorised, income source, totals and drill-downs.TestSkipWithdrawalsand the default of the switch.TestPassThroughCash(web): notes on every page, the switch, skip and count, a bad period.TestPagesRender.🤖 Generated with Claude Code