This doesn't work as for the given example I expect Assets to be reported as $90 not $55. The reason being, after spending 1 ACM we have 6 ACM left in assets and the current price of ACM is $15. So 6 ACM should be reported as $90. Surprisingly in this example the Expenses is reported as $15 which matches the expectation.
On Saturday 18 May 2024 at 20:43:10 UTC+5:30 Igbanam Ogbuluijah wrote: > Ah! I see what it is. — There's pricing information, but ledger doesn't > know what to do with it. > > I modified the ledger to add some transactions after the pricing > information changed. > > > > > > > *2024/04/01 * Acme Assets 7 ACM @ $10 Tax 3 ACM @ = $10 > Income * > > > > *P 2024/04/04 ACM $152024/04/04 ACM Spend Expenses 1 ACM Assets* > > With this, when you run the balance report with *ledger -f file.ledger > balance -X $*, you see the price is used in the next transaction. > > > > > > > * $55 Assets $15 Expenses > $-100 Income $30 Tax-------------------- > 0* > > Again, if there's some way to see the realtime value of a commodity, I > don't currently know this. But I've just realized if there's a transaction > after the pricing information, ledger will use that most recent pricing > information. > > Hope this helps clarify. > > > - Igbanam > > On Friday 5 April 2024 at 05:33:24 UTC+1 Pranshu Goyal wrote: > >> Let's consider this posting for a company's stock grant: >> >> *2024/04/01 * Acme* >> >> * Assets >> 7 ACM @ $10* >> >> * Tax >> 3 ACM @ = $10* >> >> * Income >> -$100* >> >> >> >> *P 2024/04/04 ACM $15* >> >> >> Here, the intention is to fix the price of stock used to pay tax, so >> balance reports in future report the same tax amount in dollar values even >> after stock price changes. >> >> Hence the command after price changes to $15: >> >> *ledger bal Tax -V* >> >> gives: >> >> *$30 Tax * >> >> >> Which follows the expectation. Now lets look at balance report for Assets >> asked after the price changed on 4th April 2024: >> >> *ledger bal Assets -V* >> >> this produces >> >> *$70 Assets* >> >> >> This in my opinion is unexpected behavior. I used fixed lot price syntax >> to fix the price for Tax but not for Assets, but it also fixed the price >> for assets. I'm not sure if I'm doing something wrong here or if it is a >> bug. >> >> Pranshu Goyal >> >> -- --- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ledger-cli/7cef13d0-c442-4ea7-8b0f-d04879057264n%40googlegroups.com.
