gnidan · GitHub

@gnidan

marked this pull request as ready for review

January 9, 2026 00:25

simonmichael

@simonmichael simonmichael added A-WISH

Some kind of improvement request or proposal.

journal

The journal file format, and its features.

investing

Related to investments, lots, capital gains, etc.

labels

Jan 9, 2026

@gnidan

gnidan added a commit to gnidan/hledger that referenced this pull request

Jan 9, 2026
…nmichael#2522]
Add a new account type Gain with single-letter code G as a subtype of
Revenue, similar to how Cash is a subtype of Asset and Conversion is a
subtype of Equity. This enables tracking capital gains/losses separately
while still including them in income statements and close --retain.
Usage: account revenues:capital  ; type: G
- type:G matches only Gain accounts
- type:R matches both Revenue and Gain (subtype matching)
- Auto-detection from account names matching:
  ^(income|revenue)s?:(capital[- ]?)?(gains?|loss(es)?)(:|$)
  e.g. income:gains, revenue:capital-gains, income:losses

@gnidan

@gnidan

…nmichael#2522]
Add a new account type Gain with single-letter code G as a subtype of
Revenue, similar to how Cash is a subtype of Asset and Conversion is a
subtype of Equity. This enables tracking capital gains/losses separately
while still including them in income statements and close --retain.
Usage: account revenues:capital  ; type: G
- type:G matches only Gain accounts
- type:R matches both Revenue and Gain (subtype matching)
- Auto-detection from account names matching:
  ^(income|revenue)s?:(capital[- ]?)?(gains?|loss(es)?)(:|$)
  e.g. income:gains, revenue:capital-gains, income:losses

@gnidan

@simonmichael

@gnidan

Merged

Read the original on github.com ↗