> On Apr 26, 2024, at 12:32 PM, Chary Chary <[email protected]> wrote:
>
> On Wednesday, April 24, 2024 at 11:24:23 PM UTC+2 Ben Gerdemann wrote:
>
>> Question 2: The documentation says:
>>
>> • Transaction dates: Each posting can have its own date, allowing
>> transactions to balance even if individual postings have different dates.
>> This helps with common issues when transferring money between accounts where
>> withdrawal and deposit dates differ.
>>
>> How do you achieve this, if initially the database is created by importing
>> beancount file, which has only one date per transaction?
>
>
> On import into the database, we assign the beancount transaction date to each
> posting. On export to a beancount file, since beancount doesn't support dated
> postings, we use the date of the first posting for the transaction date.
>
> I hope this answers your questions. If you have more queries or need further
> clarification, I'm happy to help.
>
> Best regards,
> Ben
>
> Thanks for the answer. but I am not sure I understand the workflow
>
> 1) You create a beancount file normal way
> 2) You import beancount file into the beanpost database.
> 3)Then you do some manipulations on the entries inside the beanpost which
> create the situation, equivalent of the beancount having different dates on
> postings, which belong to the same transaction.
> Is this correct?
> Or do you you create new entries, which are not coming from beancount?
Yes, your understanding of the workflow is correct. The database schema used by
Beanpost allows each posting in a transaction to have its own date. No new
entries are created—this flexibility works fine within the Beanpost database.
However, when exporting the database back to a Beancount file, which does not
support individual dates for postings, we arbitrarily use the date of the first
posting as the transaction date.
In general, I tried to keep the Beanpost data schema as close as possible to
the Beancount format. However, when I wrote queries for the custom functions, I
found it more natural to assign dates to postings rather than transactions, as
it reduces the number of SQL joins needed. This approach also had the added
benefit of addressing a long-standing feature request in Beancount to allow
postings to have their own dates.
One of the advantages of using a database over a plain text file is that schema
changes like this are relatively simple. In contrast, adding this feature to
Beancount itself would require modifying the Beancount file syntax, which could
be more complicated and involve careful consideration of backward
compatibility, among other things.
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/981D5534-2FFB-45BA-9157-DA29CAF4F7E6%40gerdemann.org.