Although I have a pretty hacky work-around.

Start the recurring transaction in the present (so it gets picked up), but 
have a corresponding transaction that cancels out the first one, and have 
that one end where you want the true tx to begin. So to achieve something 
like:

```
~ Yearly from 2025
    Income:Salary                                                   
-$10,000.00
    Assets:Checking
```

which does not work due to this issue, instead write:

```
~ Yearly from this week
    Income:Salary                                                   
-$10,000.00
    Assets:Checking

~ Yearly from this week until 2025
    Income:Salary                                                   
 $10,000.00
    Assets:Checking
```

Now `ledger -f test.dat --forecast "d<[2027-01-01]" balance 
Assets:Checking` returns $20K as expected.

On Sunday, July 21, 2024 at 2:12:38 PM UTC-7 Bob Wilson wrote:

> Thanks Igbanam, but the balance report doesn't work either. Here's an 
> example.
>
> Contents of `test.dat`:
> ```
> ~ Yearly from 2025
>     Income:Salary                                                   
> -$10,000.00
>     Assets:Checking
> ```
> (Note that today is 2024/07/21, so the recurring transaction begins in the 
> future.)
>
> Command: `ledger -f test.dat --forecast "d<[2027-01-01]" balance 
> Assets:Checking` returns nothing. 
>
> I would expect it to show a balance of $20K. Adding --begin and --end 
> flags, with various possible values, continues to return nothing. The 
> example in the link you sent involves a recurring transaction, but the 
> transaction does *not* begin in the future, and so is not affected by this 
> issue.
>
> On Friday, July 5, 2024 at 2:58:22 AM UTC-7 Igbanam Ogbuluijah wrote:
>
>> Rightly so… the reg query does not list postings when the recurring 
>> transaction starts from a future date. My guess is cos ledger does not see 
>> any transactions posted from the date it's being invoked. I phrase it this 
>> way because I tried using the *--begin DATE* option, but still no report.
>>
>> To solve this though, use the balance query. The balance query will 
>> always give you the balance of your savings account at any point in time 
>> when ledger is parsing the transactions against. Unlike the register 
>> report, the balance report respects *--begin* and *--end* options.
>>
>> https://asciinema.org/a/343330 is the best way I've seen this done; and 
>> I've adopted it for my own forecasts as well
>>
>> On Friday 22 March 2024 at 22:46:46 UTC Bob Wilson wrote:
>>
>>> Also, "balance" gives a different answer than "register" in that example.
>>>
>>>
>>> On Mar 22, 2024, at 3:29 PM, Bob Wilson <[email protected]> wrote:
>>>
>>> 
>>>
>>>
>>> I'm having the same issue.
>>>
>>> Example file:
>>> ~ Monthly from 2024/02/15
>>>     Expenses:Rent      $500.00
>>>     Assets
>>>
>>> Command:
>>> $ ledger -f test.dat --forecast "d<[2025]" register Expenses:Rent
>>> 24-Apr-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00          $500.00
>>> 24-May-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00         $1000.00
>>> 24-Jun-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00         $1500.00
>>> 24-Jul-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00         $2000.00
>>> 24-Aug-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00         $2500.00
>>> 24-Sep-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00         $3000.00
>>> 24-Oct-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00         $3500.00
>>> 24-Nov-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00         $4000.00
>>> 24-Dec-01 Forecast transaction         Expenses:Rent                     
>>>         $500.00         $4500.00
>>>
>>> Update example file:
>>> ~ Monthly from 2024/04/15
>>>     Expenses:Rent      $500.00
>>>     Assets
>>>
>>> Same command gives empty output.
>>>
>>> The other thing I'm noticing is the periodic expressions don't respect 
>>> exact dates. If my rent is due on the 15th, and my period expression 
>>> denotes that, I'd expect the forecasted transactions to be on the 15th.
>>>
>>> ledger --version:
>>> Ledger 3.3.2-20230330, the command-line accounting tool
>>> without support for gpg encrypted journals and without Python support
>>>
>>> Copyright (c) 2003-2023, John Wiegley.  All rights reserved.
>>>
>>> This program is made available under the terms of the BSD Public License.
>>> See LICENSE file included with the distribution for details and 
>>> disclaimer.
>>>
>>> On Sunday, September 13, 2020 at 7:01:12 PM UTC-7 Alan Bram wrote:
>>>
>>>> Here's a demo of what I mean. Reading from "sample.dat" produces no 
>>>> output; compare to "another.dat." (Data files attached.)
>>>>
>>>> % ledger --version
>>>> Ledger 3.2.1-20200518, the command-line accounting tool
>>>>
>>>> Copyright (c) 2003-2019, John Wiegley.  All rights reserved.
>>>>
>>>> This program is made available under the terms of the BSD Public 
>>>> License.
>>>> See LICENSE file included with the distribution for details and 
>>>> disclaimer.
>>>> % ledger -f sample.dat --forecast "d<[2022]" reg cash
>>>> % ledger -f another.dat --forecast "d<[2022]" reg cash
>>>> 2020/10/01 Forecast transaction        Assets:Cash                      
>>>>        $-500.00         $-500.00
>>>> 2020/11/01 Forecast transaction        Assets:Cash                      
>>>>        $-500.00        $-1000.00
>>>> 2020/12/01 Forecast transaction        Assets:Cash                      
>>>>        $-500.00        $-1500.00
>>>> 2021/01/01 Forecast transaction        Assets:Cash                      
>>>>        $-500.00        $-2000.00
>>>> 2021/02/01 Forecast transaction        Assets:Cash                      
>>>>        $-500.00        $-2500.00
>>>> 2021/03/01 Forecast transaction        Assets:Cash                      
>>>>        $-500.00        $-3000.00
>>>> 2021/04/01 Forecast transaction        Assets:Cash                      
>>>>        $-500.00        $-3500.00
>>>> %
>>>>
>>>> On Sun, Sep 13, 2020 at 5:53 PM John Wiegley <[email protected]> wrote:
>>>>
>>>>> >>>>> "A" == Alan  <[email protected]> writes:
>>>>>
>>>>> A> Is it correct to glean from this that it doesn't work to give a 
>>>>> "from" date
>>>>> A> in a periodic transaction? I was trying to do so, but I was not 
>>>>> able to
>>>>> A> make it work.
>>>>>
>>>>> I would definitely expect periodic transactions to accept date ranges.
>>>>>
>>>>>     https://www.ledger-cli.org/3.0/doc/ledger3.html#Period-Expressions
>>>>>
>>>>> John
>>>>>
>>>> -- 
>>>
>>> --- 
>>> 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/28cce2ba-9e3d-48ae-9096-8c8e6e6f67e2n%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/ledger-cli/28cce2ba-9e3d-48ae-9096-8c8e6e6f67e2n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>>

-- 

--- 
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/7c78413e-da54-433a-9171-68eb955c36b0n%40googlegroups.com.

Reply via email to