The problem with this method is that one has to manually compute and insert the aggregate cost basis on every reduction.
(FWIW, I intended to automate this in Beancount, and did all the changes to support various booking methods (e.g. FIFO) and they work... but I ran out of steam and left a single method yet to implement... and that's the one: average cost booking. It aims to do precisely what's described here -- whenever a lot reduction occurs or the user specifies a '*' flag in the cost, the costs are averages and the lots merged at that point.) On Thu, Oct 26, 2017 at 6:43 PM, Martin Michlmayr <t...@cyrius.com> wrote: > As far as I can tell, ledger can handle such transactions without any > problems. However, the syntax might be a bit unexpected. This is > imho due to a reported bug. The bug tracker is down right now but > I can send a link later. > > In any case, the following works for me: > > 2002/03/20 Buy Actions > Assets:BrokerA 10.00 Foo {5.00 EUR} > Assets:Checking -50.00 EUR > > 2002/03/25 Buy Actions > Assets:BrokerA 15.00 Foo {10.00 EUR} > Assets:Checking -150.00 EUR > > 2002/03/25 Price adjustment > Assets:BrokerA 25.00 Foo {8.00 EUR} @ 8.00 EUR > Assets:BrokerA -10.00 Foo {5.00 EUR} @ 5.00 EUR > Assets:BrokerA -15.00 Foo {10.00 EUR} @ 10.00 EUR > > 2002/05/15 Buy Actions > Assets:BrokerB 10.00 Foo {50.00 EUR} > Assets:Checking -500.00 EUR > > 2002/05/25 Buy Actions > Assets:BrokerB 15.00 Foo {100.00 EUR} > Assets:Checking -1500.00 EUR > > 2002/05/25 Price adjustment > Assets:BrokerB 25.00 Foo {80.00 EUR} @ 80.00 EUR > Assets:BrokerB -10.00 Foo {50.00 EUR} @ 50.00 EUR > Assets:BrokerB -15.00 Foo {100.00 EUR} @ 100.00 EUR > > -- > Martin Michlmayr > http://www.cyrius.com/ > > -- > > --- > You received this message because you are subscribed to the Google Groups > "Ledger" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to ledger-cli+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- --- You received this message because you are subscribed to the Google Groups "Ledger" group. To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.