Remove the transfer flag
A transfer was a second verdict carried alongside the tag: a boolean set by transfer = true in a rule or by x in the TUI, kept in its own pair of rule_ and manual_ columns, whose one real effect was to hold the row out of the report. The rest of it was display -- a T column in the transaction list, in the rules screen and in money ls. Money moved between your own accounts is now tagged like anything else and counts like anything else. The leg leaving checking is an outflow and the leg arriving in savings is an inflow, so a report over the whole data root roughly nets out while one scoped to a single account or month does not. That is the price of one verdict per transaction instead of two. A rule now needs a tag, and one that set only transfer = true is refused by number on load. A leftover transfer key beside a tag is ignored, as unknown TOML keys always were, and an index built by an older binary drops both columns when it is opened. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+2
-13
@@ -39,10 +39,8 @@ type Transaction struct {
|
||||
// transaction, when it reports one. Used to verify the balance chain.
|
||||
BalanceMinor *int64
|
||||
|
||||
RuleTag string
|
||||
ManualTag string
|
||||
RuleTransfer bool
|
||||
ManualTransfer *bool
|
||||
RuleTag string
|
||||
ManualTag string
|
||||
}
|
||||
|
||||
// Tag is the effective category: a manual tag always beats a rule tag.
|
||||
@@ -53,15 +51,6 @@ func (t Transaction) Tag() string {
|
||||
return t.RuleTag
|
||||
}
|
||||
|
||||
// IsTransfer reports whether this line moves money between the user's own
|
||||
// accounts and so must not count as spending. A manual override wins.
|
||||
func (t Transaction) IsTransfer() bool {
|
||||
if t.ManualTransfer != nil {
|
||||
return *t.ManualTransfer
|
||||
}
|
||||
return t.RuleTransfer
|
||||
}
|
||||
|
||||
// FormatAmount renders the amount using the account's minor-unit scale.
|
||||
func (t Transaction) FormatAmount() string {
|
||||
return FormatMinor(t.AmountMinor, t.MinorDigits)
|
||||
|
||||
Reference in New Issue
Block a user