Re: Long/short term tx splitting

2024-10-17 Thread Red S
I needed pretty much the same thing recently. Here’s a gist 

 to 
build up capital gains data from Beancount, and output it in any format 
desired. The gist assumes a certain account structure to determine which 
the taxable accounts are.

The interesting thing is not the gist itself, but the fact that the code 
was almost completely written by GPT-4o. And I didn't even have to put in 
that much effort into the prompts. Whenever you need something like this, 
GPT is the answer now!

On Friday, August 23, 2024 at 11:15:59 PM UTC-7 erical...@gmail.com wrote:

> On Fri, Aug 23, 2024 at 10:22 PM Red S  wrote:
>
>> Why bother splitting it into two transactions? Why not just query by 
>> postings with the held: "long" metadata?
>>
> For 8949, you're supposed to report the acquisition cost, disposal 
> proceeds, and the delta (gain/loss).  Separately for long-term holdings, 
> and separately for short-term holdings.  So I need the Assets:Bank leg 
> split into two, to get the long and short term disposal proceeds separately.
>
> At this point, I think, we've got ST/LT acquisition legs, ST/LT disposal 
> legs, and ST/LT gains/loss legs.  So...the work is done, it's just a simple 
> mechanical transformation to call that ST/LT transactions, each with 
> acquisition, disposal, and gain/loss legs.
>
> The rest of my pipeline already handles long-term-only and short-term-only 
> disposal transactions for generating 8949-style PDFs, so even if I got one 
> transaction, with all legs segregated into ST/LT status, I'd probably still 
> query and transform into segregated transactions to pass down to report 
> generation.
>
>
>> On Friday, August 23, 2024 at 1:41:35 PM UTC-7 erical...@gmail.com wrote:
>>
>> 8949 annoyingly completely segregates short term and long term sales into 
>> separate tables.  So if you had a sale like in the example, you're supposed 
>> to split it into two sales, one which sells only the assets held for a 
>> short term, and the other which only sells the assets held for long term.
>>
>> I have a wrapper script already which loads the ledger, so yeah if the 
>> plugin tagged the legs I might be able to back it out into two 
>> transactions, although I feel I'd be duplicating some imputation logic in 
>> order to split up the Assets:Bank leg.
>>
>> Hmm
>>
>> -- 
>>
> 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 beancount+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/244e1f43-c3b2-4ccb-8a0d-1fe16a8558a1n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/4ad35480-151f-4c7d-a7e4-54b6f17530bbn%40googlegroups.com.


Re: Long/short term tx splitting

2024-10-17 Thread Red S
I needed something very similar recently. Here’s a gist 

 to 
build up capital gains data from Beancount, and output it in any format 
desired. The code was almost completely written by GPT.

On Friday, August 23, 2024 at 11:15:59 PM UTC-7 erical...@gmail.com wrote:

> On Fri, Aug 23, 2024 at 10:22 PM Red S  wrote:
>
>> Why bother splitting it into two transactions? Why not just query by 
>> postings with the held: "long" metadata?
>>
> For 8949, you're supposed to report the acquisition cost, disposal 
> proceeds, and the delta (gain/loss).  Separately for long-term holdings, 
> and separately for short-term holdings.  So I need the Assets:Bank leg 
> split into two, to get the long and short term disposal proceeds separately.
>
> At this point, I think, we've got ST/LT acquisition legs, ST/LT disposal 
> legs, and ST/LT gains/loss legs.  So...the work is done, it's just a simple 
> mechanical transformation to call that ST/LT transactions, each with 
> acquisition, disposal, and gain/loss legs.
>
> The rest of my pipeline already handles long-term-only and short-term-only 
> disposal transactions for generating 8949-style PDFs, so even if I got one 
> transaction, with all legs segregated into ST/LT status, I'd probably still 
> query and transform into segregated transactions to pass down to report 
> generation.
>
>
>> On Friday, August 23, 2024 at 1:41:35 PM UTC-7 erical...@gmail.com wrote:
>>
>> 8949 annoyingly completely segregates short term and long term sales into 
>> separate tables.  So if you had a sale like in the example, you're supposed 
>> to split it into two sales, one which sells only the assets held for a 
>> short term, and the other which only sells the assets held for long term.
>>
>> I have a wrapper script already which loads the ledger, so yeah if the 
>> plugin tagged the legs I might be able to back it out into two 
>> transactions, although I feel I'd be duplicating some imputation logic in 
>> order to split up the Assets:Bank leg.
>>
>> Hmm
>>
>> -- 
>>
> 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 beancount+...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/beancount/244e1f43-c3b2-4ccb-8a0d-1fe16a8558a1n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/c6db43b2-c13b-45d0-b049-93fc88826cf8n%40googlegroups.com.


Re: Are there any plans to migrate beangrow and fava to v3?

2024-10-17 Thread Red S
Great! Thank you for all the work you put in to develop, maintain, and 
bring us Fava, yagebu!

On Thursday, October 17, 2024 at 2:10:13 PM UTC-7 ma...@jakobschnitzer.de 
wrote:

Yep, I'm working on the PR that Mariano linked to support both Beancount v2 
and v3 in parallel - I'll probably merge that to main in the coming days, 
then this can see some wider testing :)

Mariano Draghi schrieb am Sonntag, 22. September 2024 um 02:03:17 UTC+2:

yagebu seems to be working as of last week on a version of Fava that would 
be compatible with both Beancount v2 and v3, using the standalone beanquery 
package.

* meta-issue tracking the work: 
https://github.com/beancount/fava/issues/1860
* the (currently WIP) PR: https://github.com/beancount/fava/pull/1859

-- 
Mariano 

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/47a556da-268a-4989-aaa7-d6ae7364206fn%40googlegroups.com.


Re: Are there any plans to migrate beangrow and fava to v3?

2024-10-17 Thread ma...@jakobschnitzer.de
Yep, I'm working on the PR that Mariano linked to support both Beancount v2 
and v3 in parallel - I'll probably merge that to main in the coming days, 
then this can see some wider testing :)

Mariano Draghi schrieb am Sonntag, 22. September 2024 um 02:03:17 UTC+2:

> yagebu seems to be working as of last week on a version of Fava that would 
> be compatible with both Beancount v2 and v3, using the standalone beanquery 
> package.
>
> * meta-issue tracking the work: 
> https://github.com/beancount/fava/issues/1860
> * the (currently WIP) PR: https://github.com/beancount/fava/pull/1859
>
> -- 
> Mariano  
>
> El Saturday, September 21, 2024 a la(s) 5:16:04 PM UTC-3, 
> c79m...@gmail.com escribió:
>
>> I tried using using beanquery with Fava, and wasn't able to get anywhere 
>> about 4 months ago.  I'm not much of a programmer, but Fava appears to be 
>> pretty tightly coupled to V2's beanquery interface, and would need some 
>> decent reworking to use the seperated out beanquery of V3.   Unfortunately, 
>> I don't have the skills, or time to do that. :-( (I was interested in 
>> using a couple of new beanquery features to generate a report, but wound up 
>> just kludging the data together in python to get the same end result. )
>>
>> Cameron Murphy
>>
>> On Friday, September 13, 2024 at 5:45:45 AM UTC-6 Brian Lalor wrote:
>>
>>> Adding Jakob, who’s been actively working on Fava.  Jakob, anything we 
>>> can do to get v3 support pulled in?
>>>
>>> — 
>>> Brian Lalor (he/him)
>>> bla...@bravo5.org
>>>
>>> On Sep 13, 2024, at 2:45 AM, Stefano Zacchiroli  
>>> wrote:
>>>
>>> On Thu, Sep 12, 2024 at 03:41:13PM -0700, Red S wrote:
>>>
>>> This is the only related issue 
>>>  I could find at Fava’s 
>>> github page. Perhaps making a request over at github might get their 
>>> attention?
>>>
>>>
>>> There is also https://github.com/beancount/fava/issues/1824 (referenced
>>> from the previous one), but the underlying issue is likely the same.
>>>
>>> Cheers
>>> -- 
>>> Stefano Zacchiroli . za...@upsilon.cc . https://upsilon.cc/zack  _. ^ ._
>>> Full professor of Computer Science  o o   o \/|V|\/
>>> Télécom Paris, Polytechnic Institute of Paris o o o   <\>
>>> Co-founder & CTO Software Heritageo o o o   /\|^|/\
>>> https://twitter.com/zacchiro . https://mastodon.xyz/@zacchiro   '" V "'
>>>
>>> -- 
>>> 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 beancount+...@googlegroups.com.
>>>
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/beancount/20240913064514.3norhoeiggxunjuf%40upsilon.cc
>>> .
>>>
>>>
>>>

-- 
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 beancount+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/75f6c78f-6343-4d12-9eb5-007156412353n%40googlegroups.com.