On Sat, Feb 27, 2016 at 8:06 AM, Antonio A. Carrillo Hernández <
[email protected]> wrote:
> Hello.
>
> I'm trying to implement (abuse?) with ledger an inventory system with
> valued goods and I also want to let it 'transform' (kind of manufacturing)
> the commodities while maintaining the correct value. For example, now I can
> do:
>
> 2016/02/20 * In
> Wh:Raw 20 apple @ 1.00 €
> Wh:Raw 30 orange @ 2.00 €
> Vendor
>
> 2016/02/20 * Transform
> Wh:Raw -1 apple @ 1.00 €
> Wh:Raw -1 orange @ 2.00 €
> Wh:Packs 1 pack @ 3.00 €
>
> And it works as expected: I have one pack @ 3.00 € on Wh:Packs and have
> the Raw account decreased accordingly. But doing so I have to be explicit
> about commodity prices on the Transform transaction.
>
> What I want is to let ledger calculate the final 'pack' price based on the
> other commodities involved. For example, I want to write:
>
> 2016/02/20 * Transform
> Wh:Raw -1 apple
> Wh:Raw -1 orange
> Wh:Packs 1 pack
>
> And ledger calculate all of the values automatically or semiautomatically,
> so I don't have to figure out the Raw prices at date and calculate the Pack
> price for every transaction. It can be done as ledger knows the Raw costs.
>
> Any ideas? Thanks.
>
Beancount will eventually support this using cost basis inference.
You would type this:
2016-02-20 * Transform
Wh:Raw -1 apple {1.00 EUR}
Wh:Raw -1 orange {2.00 EUR}
Wh:Packs 1 pack {}
In fact, if you have only a single lot of apples at that date, you'd even
be able to do this:
2016-02-20 * Transform
Wh:Raw -1 apple {}
Wh:Raw -1 orange {2.00 EUR}
Wh:Packs 1 pack {}
The implementation is incomplete , but I've got this type of interpolation
working already.
It still needs more work to reach the stable branch, however, not ready for
prime time yet, needs a few more months of work.
This is work is part of furius.ca/beancount/doc/proposal-booking
Monitor changes on the "booking" branch of Beancount if you're interested.
--
---
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].
For more options, visit https://groups.google.com/d/optout.