Thanks for the answer. I think I'll keep it my way as on top of that I need 
to compute the Adjusted Cost Base (ACB) to declare capital gains, so I 
should either have a way to let my script ignore some transactions, or I 
just avoid "virtual" transactions altogether. From an ACB point of view I 
get 20 ACME at 448.80, and from an income point of view I get an extra 20 * 
40 USD at some point in the year.

Cheers,
Damien

Le vendredi 12 décembre 2025 à 20:55:20 UTC-5, [email protected] a 
écrit :

> Numbers are made up, but the syntax is correct:
>
> 2025-06-30 open Assets:Brokerage:ESPP:Q2-2025:ACME ACME
>
> 2025-06-30 txn "ESPP share purchase" ""
>   Assets:Brokerage:ESPP:Q2-2025:ACME      20 ACME {400.88 USD, 2025-06-30}
>   Assets:Brokerage:ESPP
>
> 2025-06-30 * "ESPP share discount" ""
>   Assets:Brokerage:ESPP:Q2-2025:ACME     -20 ACME {400.88 USD, 2025-06-30}
>   Assets:Brokerage:ESPP:Q2-2025:ACME      20 ACME {448.80 USD, 2025-06-30}
>   Income:Acme:Benefits
>
> 2025-07-07 * "Selling Acme Shares" ""
>   confirmation_number: "ABCXYZ876543"
>   Assets:Brokerage:ESPP:Q2-2025:ACME     -20 ACME {448.80 USD, 2025-06-30} 
> @ 450.22 USD
>   Expenses:Fees                                15.00 USD
>   Assets:Brokerage:ESPP:Q2-2025              8989.40 USD
>   Income:Brokerage:Capital-Gains
>
> 2025-07-08 close Assets:Brokerage:ESPP:Q2-2025:ACME
>
>
>
> Sincerely,
> Timothy Jesionowski
>
>
> On Fri, Dec 12, 2025 at 5:35 PM Timothy Jesionowski <
> [email protected]> wrote:
>
>> Anything that leaves you with the right cost basis and puts the income in 
>> the right spot works. I have a similar situation and had one transaction 
>> buy it at the discounted cost basis, another debit (subtract) the stock 
>> units at the discounted price then credit (add) them at FMV while 
>> accounting the difference to my Income:WORK:Benefits account. And a third 
>> for when I sold them accounting the difference between that price and the 
>> FMV purchase price to my P&L.
>>
>> That sounds complicated, but it seemed cleanest to me. I'll send you the 
>> redacted transactions if I ever get to my laptop.
>>
>>
>>
>> Sincerely,
>> Timothy Jesionowski
>>
>> On Fri, Dec 12, 2025, 9:36 AM Damien R. <[email protected]> wrote:
>>
>>> Hello,
>>>
>>> With $WORK, I have access to ESPP. The trick is that I'm located in 
>>> Canada, where the ESPP discount in considered taxable income. So each buy 
>>> event could look like this:
>>>
>>> 2025-12-01 * "ESPP Buy"
>>>   ; the discount is taxed as income, so the cost basis is the FMV on the 
>>> trade date
>>>   Assets:Broker:WORK  10 WORK { 100 USD }
>>>   Assets:Jobs:WORK:EsppFund  -(85 * 10) USD
>>>   Income:Jobs:EsppDiscount  -(15 * 10) USD
>>>
>>> The issue I have is related to my paycheck. This EsppDiscount is spread 
>>> over the course of a few paychecks under "Employer Paid Benefits" as "ESPP 
>>> Gain". For other Employer Paid Benefits, I usually have a Income leg and an 
>>> expense leg:
>>>
>>> 2025-12-15 * "Paycheck"
>>>   Income:Jobs:LifeInsurance -50 CAD
>>>   Expenses:Jobs:LifeInsurance 50 CAD
>>>   ; Here if I add an 'Income' leg, the income would be counted twice
>>>   Expenses:Jobs:EsppGain 100 CAD
>>>
>>>
>>> What I ended up doing is:
>>>
>>> 2025-12-01 * "ESPP Buy"
>>>   Assets:Broker:WORK  10 WORK { 100 USD }
>>>   Assets:Jobs:WORK:EsppFund  -(85 * 10) USD
>>>   Liabilities:Jobs:EsppUntaxedGain  -((15 * 10) * 1.2) CAD @@ -(15 * 10) 
>>> USD
>>>
>>> 2025-12-15 * "First paycheck with an ESPP Gain entry"
>>>   Income:Jobs:EsppDiscount          -50 CAD
>>>   Liabilities:Jobs:EsppUntaxedGain 50 CAD
>>>
>>> ; after a few paychecks, I need the pad directive to account for 
>>> conversion imprecision
>>> ; the exchange rate in the buy event is from Bank of Canada, it's not 
>>> the one the broker/my employer uses
>>> 2026-02-28 pad Liabilities:Jobs:EsppUntaxedGain Equity:Conversion
>>> 2026-02-28 balance Liabilities:Jobs:EsppUntaxedGain 0 CAD
>>>
>>> This lets me track the EsppDiscount in CAD, which is what I need at the 
>>> end of the day for my tax report.
>>>
>>> Is this an okay way to book these transactions?
>>>
>>> Cheers,
>>> -- 
>>> Damien
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Beancount" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion visit 
>>> https://groups.google.com/d/msgid/beancount/160b0057-0e70-462a-b6d9-154d0d2973f0n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/beancount/160b0057-0e70-462a-b6d9-154d0d2973f0n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/beancount/819c847f-afbf-4fdc-aee6-9bf0a9a5dc21n%40googlegroups.com.

Reply via email to