Individual posting date different from transaction date

143 views
Skip to first unread message

Oscar & Alejandra

unread,
Sep 26, 2024, 12:04:30 PM9/26/24
to bean...@googlegroups.com
I noticed there's some conversations about having individual posting dates different from the transaction date.

Here a question that was left unanswered:
https://groups.google.com/g/beancount/c/V06NuhD-V0o/m/uk8QaI-1oJMJ

And here it is mentioned that this is a feature that is planned:
https://groups.google.com/g/beancount/c/0QeXy8h6fA8

I am using Beancount v3 from PyPI. Has this feature been implemented yet? Or do I need to use a plugin or the 'Holdings' method like explained here:
https://github.com/redstreet/beancount_reds_plugins/tree/main/beancount_reds_plugins/effective_date#readme

Thanks!

Oscar & Alejandra
ma...@aleyoscar.com

Chary Chary

unread,
Sep 26, 2024, 3:17:38 PM9/26/24
to Beancount
I know this is slightly off topic to your question, but I have a feeling, that   such feature would conflict with  double entry accounting, because the  fundamental idea of double entry that all postings happen exactly on the same moment, hence debit and credit (plus and minus in PTA terms) are always equal.

The situations, for which such feature was often requested that for instance you transfer money from Bank A to Bank B, but transfer takes a couple of days can be implemented with 2 transactions

E.g.

2024-01-01 * "Transfer from Bank A to B initiated"
   Assets:BankA                        -1000 USD
   Assets:Funds-InTransfer         1000 USD

2024-01-03 * "Transfer from Bank A to B received"
   Assets:BankB                          1000 USD
   Assets:Funds-InTransfer        -1000 USD

Oscar & Alejandra

unread,
Sep 26, 2024, 3:42:57 PM9/26/24
to bean...@googlegroups.com
That definitely makes sense, which is what redstreet's plugin does which I referenced earlier. You put metadata on a posting of it's 'effective date', and it creates those two transactions for you. For example:

2014-12-15 * "Annual Insurance payment for 2015"
  Liabilities:Credit-Card   100 USD
  Expenses:Insurance
    effective_date: 2015-01-01

Gets rewritten as:

2014-12-15 * "Annual Insurance payment for 2015" ^edate-141215-xlu
  Liabilities:Credit-Card   100 USD
  Assets:Hold:Insurance
    effective_date: 2015-01-01

2015-01-01 * "Annual Insurance payment for 2015" ^edate-141215-xlu
  original_date: 2014-12-15
  Assets:Hold:Insurance    -100 USD
  Expenses:Insurance

I am totally OK with using redstreet's plugin if this has not and/or will not be implemented into the offical beancount, but I was just wondering if it was already a feature.

For my use case it is helpful for me to see an overview of my monthly expenses for budgeting purposes, but I get paid bi-weekly and many times I pay bills as soon as I get paid, which is frequently the month prior to when my bill is actually due. By being able to specify when the 'expense' is tracked vs when the money actually leaves my account I am able to both budget on a monthly basis and do a balance check when my bank statements come out.
--

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 beancount+...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/32a86d3c-374d-47e5-9ad8-91845316b377n%40googlegroups.com.


Oscar & Alejandra Camorlinga
ma...@aleyoscar.com

Chary Chary

unread,
Sep 26, 2024, 4:57:52 PM9/26/24
to Beancount
On Thursday, September 26, 2024 at 9:42:57 PM UTC+2 Oscar & Alejandra wrote:


For my use case it is helpful for me to see an overview of my monthly expenses for budgeting purposes, but I get paid bi-weekly and many times I pay bills as soon as I get paid, which is frequently the month prior to when my bill is actually due. By being able to specify when the 'expense' is tracked vs when the money actually leaves my account I am able to both budget on a monthly basis and do a balance check when my bank statements come out.


I think what you are talking about is called an accrual accounting

You can still can do it now

2024-01-20 * "Advance payment for a Electricity bill for Feb"
    Assets:Bank                          -100 USD
    Assets:Advanced-Payments:Electricity  100 USD

2024-02-01 * "Payment for Electricity bill for Feb"
    Assets:Advanced-Payments:Electricity -100 USD
    Expenses:Electricity                  100 USD


Though I agree, this is a bit manual

You would probably want to write it like this:

2024-01-20 * "Payment for a Electricity bill for Feb"
    Assets:Bank                          -100 USD
    Expenses:Electricity                  100 USD
       accrual_date: "2024-02-01"

and then have a plugin to turn it to a 2 transactions as above
 

Chary Chary

unread,
Sep 26, 2024, 5:53:02 PM9/26/24
to Beancount
I am just thinking aloud here on your question.

I would probably go even a step further in compare to what I just proposed. I would live the initial transaction intact and would add another 2 to delay appearing of Expense


2024-01-20 * "Payment for a Electricity bill for Feb"
    Assets:Bank                          -100 USD
    Expenses:Electricity                  100 USD
       accrual_date: "2024-02-01"



2024-01-20 * "Accural correction part 1"
    Expenses:Electricity                    -100 USD
    Assets:Accural-corrections:Electricity   100 USD

2024-02-01 * "Accural correction part 2"
    Expenses:Electricity                      100 USD
    Assets:Accural-corrections:Electricity   -100 USD

This is definitely quite a simple plugin. I will not be surprised, if somebody has already created something like this 

You can also do it now, without any plugin, but manually. Probably the best thing is to create a separate file accural_corrections.bean and then include it from the mail file.

In this way you can switch off and on these accrual corrects by simply commenting out the include directive. 

Oscar & Alejandra

unread,
Sep 26, 2024, 6:59:54 PM9/26/24
to bean...@googlegroups.com

2024-01-20 * "Advance payment for a Electricity bill for Feb"
    Assets:Bank                          -100 USD
    Assets:Advanced-Payments:Electricity  100 USD

2024-02-01 * "Payment for Electricity bill for Feb"
    Assets:Advanced-Payments:Electricity -100 USD
    Expenses:Electricity                  100 USD


Thanks for the input! The 'two transaction' way seems cleaner to me, and I can understand what's going on.

Someone has made a plugin already that does something similar, I mentioned it previously, but I'm actually having trouble with it, beanquery keeps throwing an error about not finding the module. Doing it manually though runs fine and I get the desired results. I will be sticking with this manual method for now, thanks!

What would be the advantages/disadvantages to doing it with the three transactions vs two?
--

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 beancount+...@googlegroups.com.

Red S

unread,
Sep 27, 2024, 3:04:21 AM9/27/24
to Beancount
Someone has made a plugin already that does something similar, I mentioned it previously, but I'm actually having trouble with it, beanquery keeps throwing an error about not finding the module. Doing it manually though runs fine and I get the desired results. I will be sticking with this manual method for now, thanks!

Pasting from this thread which I assume was yours:

This would likely be a configuration issue at your end. beancount_reds_plugins is a standard python package, and neither does anything special nor requires anything other than a regular environment.

Run this from a python shell from the same environment you’re running bean-query from:

import beancount_reds_plugins.effective_date

It should load fine (no errors). I suspect it doesn’t, and it’ll tell you what the issue is.


Chary Chary

unread,
Sep 27, 2024, 6:34:43 AM9/27/24
to Beancount
Great! The beancount_reds_plugins.effective_date does exactly what we discussed above with the "two transactions approach", plus has some extra perks!

 

Chary Chary

unread,
Sep 27, 2024, 6:42:48 AM9/27/24
to Beancount
On Friday, September 27, 2024 at 12:59:54 AM UTC+2 Oscar & Alejandra wrote:


What would be the advantages/disadvantages to doing it with the three transactions vs two?



The 3 transaction approach keeps the initial transaction intact.
So, if you do it manually, you can keep all  what I called accrual correction transactions in a separate file (e.g. accural_corrections.bean) and include it from the main one with the include directive

include "accural_corrections.bean"

Then you can switch the accrual accounting  on and off by simply commenting this line out.

Any way, with the beancount_reds_plugins.effective_date you can switch this on and off easy as well, by just commenting the plugin line in your code

 

Oscar & Alejandra

unread,
Sep 27, 2024, 10:41:25 AM9/27/24
to bean...@googlegroups.com
Yes that was me! Got it figured out though, I was using pipx to install beancount and the plugin but I really needed to have everything in it's own virtual environment to properly use the plugin. You can mark as solved.
--

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 beancount+...@googlegroups.com.

Oscar & Alejandra

unread,
Sep 27, 2024, 12:23:29 PM9/27/24
to bean...@googlegroups.com
I like the idea, thanks Chary!
--

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 beancount+...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages