Re: Periodic transactions aligned to started date
> "mg" == matt graham2001 writes: mg> I haven't got much experience in Cpp programming but interested in mg> learning. Can anyone give me a hint as to where to look to try to fix this mg> one myself? Would love to help out. I believe you can use the "ledger period " command to see what Ledger thinks the period is/means, and then check in the code where those debug messages are coming from to discover where the calculation is going wrong. 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
Hi All, I think this is bug #532 on github page https://github.com/ledger/ledger-plan/blob/master/TODO. Having said that, the bug isn't clear that the problem is that it resets the periodic entries to align to the 'start of period'. Ie Sunday for weekly or biweekly (unless you change the default first day of the week) or the first day of the month for monthly etc. For my use case, resetting the day of the week is not a solution - I am using multiple budget line items starting on multiple different days of the week. At the moment I have all the budget transactions listed out in a different account tree (Budget:Expenses:...), using automated transactions to replicate expense postings into the budget tree. Works well, but periodic transactions would be better - a lot easier on entry (I have written scripts to do it, but it gets messy). I haven't got much experience in Cpp programming but interested in learning. Can anyone give me a hint as to where to look to try to fix this one myself? Would love to help out. Thanks, Matt -- --- 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
Hi Rob, Apologies for not replying earlier, got behind in my email again. On Sun, Jan 21, 2018 at 3:54 AM Rob Napierwrote: > On Friday, November 17, 2017 at 10:19:40 PM UTC-5, Scott Payne wrote: >> >> >> I'm still just playing with the periodic transactions for now so I'm not >> sure if I'm going to clash with the current implementation soon or not. >> Given the way I'm reviewing my budget your point about monthly transactions >> might be valid for me sooner rather than later (e.g. I might want to see >> which monthly expenses are due in the next fortnight) but we'll see how we >> go. >> > > How has this turned out? I've been very interested in the forecasting > feature to keep my forecast checking balance between a low- and high-water > mark, but the periodic implementation seems to fight this. All monthly > things seem to be put on the first of the month, and yearly expenses are > all but useless because I think they're all pushed to Jan 1. > I ended up giving up on periodic transactions, I couldn't make it work the way I needed to, for the same reason. What I've done instead is export to a CSV then import that into a Google Sheets template, with some app script to automate matching up accounts with budgeted amounts. Our household was already using Sheets for budgeting so it doing it that way fit our current workflow anyway. If you did get something working I'd be interested to hear what you did, it kind of sucks having to maintain two tools. Cheers, Scott -- --- 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
On Friday, November 17, 2017 at 10:19:40 PM UTC-5, Scott Payne wrote: > > > I'm still just playing with the periodic transactions for now so I'm not > sure if I'm going to clash with the current implementation soon or not. > Given the way I'm reviewing my budget your point about monthly transactions > might be valid for me sooner rather than later (e.g. I might want to see > which monthly expenses are due in the next fortnight) but we'll see how we > go. > How has this turned out? I've been very interested in the forecasting feature to keep my forecast checking balance between a low- and high-water mark, but the periodic implementation seems to fight this. All monthly things seem to be put on the first of the month, and yearly expenses are all but useless because I think they're all pushed to Jan 1. Is there a way to day-by-day forecasting with ledger? What's the intent of the --forecast option? Thanks, -Rob -- --- 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
On Friday, November 17, 2017 at 5:22:50 PM UTC+11, Yuri Khan wrote: > > On Fri, Nov 17, 2017 at 7:30 AM, Scott Payne> wrote: > > > OK, I've just tried using the --start-of-week 4 instead of Thursday and > I > > get the result I expect > > That does not scale well. For one, do you have to remember to pass > this option every time you run ledger? For another, what if you need > two periodic transactions with different days? Also, it may work for > week days but obviously not for month days (--start-of-month 14?) > I agree with the points you've made Yuri, for now though the --start-of-week usage satisfies my use case. WRT remembering to pass the option I'm using direnv in my setup so I can set the LEDGER_START_OF_WEEK environment variable to keep it all automated. I'm still just playing with the periodic transactions for now so I'm not sure if I'm going to clash with the current implementation soon or not. Given the way I'm reviewing my budget your point about monthly transactions might be valid for me sooner rather than later (e.g. I might want to see which monthly expenses are due in the next fortnight) but we'll see how we go. -- --- 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
On Saturday, November 18, 2017 at 4:12:40 AM UTC+11, John Wiegley wrote: > > > "SP" == Scott Paynewrites: > > SP> I can live with that. I tried using the day name as that was suggested > by > SP> the man page. Should I raise a documentation bug or is it a bug in the > SP> implementation? > > Looking at the code, I see this: > > optional string_to_day_of_week(const std::string& > str) > { > if (str == _("sun") || str == _("sunday") || str == "0") > return gregorian::Sunday; > else if (str == _("mon") || str == _("monday") || str == "1") > return gregorian::Monday; > else if (str == _("tue") || str == _("tuesday") || str == "2") > return gregorian::Tuesday; > else if (str == _("wed") || str == _("wednesday") || str == "3") > return gregorian::Wednesday; > else if (str == _("thu") || str == _("thursday") || str == "4") > return gregorian::Thursday; > else if (str == _("fri") || str == _("friday") || str == "5") > return gregorian::Friday; > else if (str == _("sat") || str == _("saturday") || str == "6") > return gregorian::Saturday; > else > return none; > } > > Try lowercase? > > John > D'oh, I should have tried that. Yes, that works. The man page I looked at does give the example "Mon" though which is probably what prompted me to try the capitalised day name. Thanks very much 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
> "SP" == Scott Paynewrites: SP> I can live with that. I tried using the day name as that was suggested by SP> the man page. Should I raise a documentation bug or is it a bug in the SP> implementation? Looking at the code, I see this: optional string_to_day_of_week(const std::string& str) { if (str == _("sun") || str == _("sunday") || str == "0") return gregorian::Sunday; else if (str == _("mon") || str == _("monday") || str == "1") return gregorian::Monday; else if (str == _("tue") || str == _("tuesday") || str == "2") return gregorian::Tuesday; else if (str == _("wed") || str == _("wednesday") || str == "3") return gregorian::Wednesday; else if (str == _("thu") || str == _("thursday") || str == "4") return gregorian::Thursday; else if (str == _("fri") || str == _("friday") || str == "5") return gregorian::Friday; else if (str == _("sat") || str == _("saturday") || str == "6") return gregorian::Saturday; else return none; } Try lowercase? 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
On Fri, Nov 17, 2017 at 7:30 AM, Scott Paynewrote: > OK, I've just tried using the --start-of-week 4 instead of Thursday and I > get the result I expect That does not scale well. For one, do you have to remember to pass this option every time you run ledger? For another, what if you need two periodic transactions with different days? Also, it may work for week days but obviously not for month days (--start-of-month 14?) -- --- 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
OK, I've just tried using the --start-of-week 4 instead of Thursday and I get the result I expect: $ ledger -f budget-test-weekly.ledger reg --budget --start-of-week 4 --no-color 2017-11-02 Budget transaction Expenses:Biweekly $-20 $-20 2017-11-02 Budget transaction Assets $20 0 2017-11-03 Some fortnightly thing Expenses:Biweekly $20$20 Assets $-20 0 2017-11-16 Budget transaction Expenses:Biweekly $-20 $-20 2017-11-16 Budget transaction Assets $20 0 2017-11-16 Corner case Expenses:Biweekly $20$20 Assets $-20 0 I can live with that. I tried using the day name as that was suggested by the man page. Should I raise a documentation bug or is it a bug in the implementation? -- --- 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
On Friday, November 17, 2017 at 10:05:21 AM UTC+11, John Wiegley wrote: > > > "SP" == Scott Paynewrites: > > SP> I've tried "--start-of-week Thursday" but it has no effect. > > Does it have no effect in your report too, or just the period command? > > John > It doesn't seem to have an effect in either the period or register commands. Here's my test ledger file: ~ every 2 weeks from 2017/11/02 Expenses:Biweekly $20 Assets 2017-11-03 Some fortnightly thing Expenses:Biweekly $20 Assets:A Thing 2017-11-16 Corner case Expenses:Biweekly $20 Assets:Another thing Here's the output of running the register report: $ ledger -f budget-test.ledger reg --budget --start-of-week Thursday --no-color 2017-11-02 Budget transaction Expenses:Biweekly $-20 $-20 2017-11-02 Budget transaction Assets $20 0 2017-11-03 Some fortnightly thing Expenses:Biweekly $20$20 Assets $-20 0 2017-11-05 Budget transaction Expenses:Biweekly $-20 $-20 2017-11-05 Budget transaction Assets $20 0 2017-11-16 Corner case Expenses:Biweekly $20$20 Assets $-20 0 Ledger version is 3.1.1-20160111 FWIW. -- --- 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Periodic transactions aligned to started date
> "SP" == Scott Paynewrites: SP> I've tried "--start-of-week Thursday" but it has no effect. Does it have no effect in your report too, or just the period command? 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 ledger-cli+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.