Hi Martin,

Thanks for your feedback, and thanks for maintaining Beancount. Your work 
has made it such a great tool for so many of us.

I wanted to clarify that Beanpost does support multiple currencies using a 
custom PostgreSQL type and custom aggregator functions. I apologize for not 
making that clearer in my initial message. For example, the query SELECT 
sum(amount) FROM posting will return a summed inventory of all the 
currencies for the postings, allowing you to work with different 
commodities.

Regarding cost-basis, I haven't personally needed it yet, so that's why 
it's not implemented. However, I do import the cost and price information 
for each posting, which would be the basis for the calculation. I would 
need to review the documentation about how to calculate cost-basis 
accurately, but my basic idea is to write custom PostgreSQL functions to 
perform different cost-basis calculations. I'll also need to think about 
how to represent the matching of lots in SQL. Perhaps using foreign keys to 
link back to the matching lots could be a potential solution.

Thanks again for your guidance and insights.

Best regards,

Ben

On Tuesday, April 23, 2024 at 12:12:57 AM UTC-3 [email protected] wrote:

> Thanks for sharing, Ben,
> Broadly speaking this approach will work if you don't have to match cost 
> basis and if you have only a single currency.
> Note that export to SQL has existed for a while, but I think to be able to 
> most generally replace the functionality from Beancount one would need a 
> custom aggregator implementation (to accumulate positions with a variety of 
> commodities and track individual lots, i.e., the Inventory class).
>
>
>
>
>
> On Mon, Apr 22, 2024 at 2:46 PM Ben Gerdemann <[email protected]> wrote:
>
>> Hi Everyone,
>>
>> I hope this email finds you well. I've been using Beancount for many 
>> years. It's been an amazing tool, and I'm grateful to this community and 
>> especially to Martin Blais for maintaining such a fantastic project.
>>
>> I'm sharing a project I've been working on called Beanpost, which you can 
>> find on GitHub at https://github.com/gerdemb/beanpost. This started as 
>> an experiment to see if I could recreate plain text accounting 
>> functionality using a PostgreSQL database, and it turned out more 
>> successful than I expected. I thought the Beancount community might find it 
>> useful and interesting.
>>
>> Beanpost consists of a PostgreSQL schema and import/export commands that 
>> let you transfer data between a beancount file and a PostgreSQL database. 
>> Much of Beancount's functionality is implemented using custom PostgreSQL 
>> functions, allowing for complex queries and data manipulation. This setup 
>> provides a flexible backend that can integrate with other tools like web 
>> apps or reporting systems.
>>
>> One of the reasons I created Beanpost was to build a mobile-friendly 
>> custom front-end. Fava is a fantastic tool, but it's not very 
>> mobile-friendly, isn't intuitive for beginners, and is hard to customize. 
>> With Beanpost, you have more flexibility to create a custom front-end that 
>> suits your needs.
>>
>> The included functionality is as follows:
>>
>>    - Functions to calculate account balances or changes over a specific 
>>    period.
>>    - Support for calculations on individual accounts or account 
>>    hierarchies (e.g., "Assets").
>>    - Check balance assertions.
>>    - Verify that transactions balance.
>>    - Support for explicit precisions for each currency to use for 
>>    balance tolerances.
>>    - Display the running balance of an account by posting.
>>    - Convert between currencies, including converting baskets of 
>>    currencies.
>>    - Store documents as byte-data in the database.
>>
>> I'm curious to hear your thoughts on this approach. Would love to hear 
>> any feedback. I think I've implemented the majority of the required 
>> features, but maybe I'm missing a few things?
>>
>> Maybe we could call this "database-based accounting" instead of "plain 
>> text accounting." 🙂
>>
>> Thank you for your time, and I look forward to hearing from you.
>>
>> Best regards,
>>
>> Ben
>>
>> -- 
>> 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 on the web visit 
>> https://groups.google.com/d/msgid/beancount/143e6263-3db3-4532-ae0e-eac6d7e6ffebn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/beancount/143e6263-3db3-4532-ae0e-eac6d7e6ffebn%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 on the web visit 
https://groups.google.com/d/msgid/beancount/f21a8c28-d129-4afe-ab4e-3bc62a218069n%40googlegroups.com.

Reply via email to