Re: scheduling bi-weekly transactions in ledger-mode

2014-07-10 Thread Ra Wa
I use a little shell script to add my fortnightly salary payment to ledger 
with the aid of 'ledger xact' (requires that your system has the gnu 
version of the date command).   It will figure out the last time it was run 
and generate enough transactions to get up to date.

TODAY=$(date '+%s')
LAST_PAY=$(ledger --sort=d csv Salary | tail -1 | cut -d, -f1 | tr -d '')
NEXT_PAY=$(date -d $LAST_PAY + 2 weeks +'%Y/%m/%d' )

while [  $( date -d $NEXT_PAY '+%s')  -le $TODAY  ]
do
  #echo Next payday $(date -d $NEXT_PAY '+%d/%m/%Y')
  ledger xact $NEXT_PAY Salary $LEDGER_FILE
  echo $LEDGER_FILE
  NEXT_PAY=$(date -d $NEXT_PAY + 2 weeks +'%Y/%m/%d' )
done


-Ra




On Wednesday, 9 July 2014 05:15:47 UTC+9:30, Richard Cobbe wrote:

 I'm in the process of transitioning from Gnucash to Ledger (as keeping 
 Gnucash working consistently on MacOS is challenging, despite the best 
 efforts of the MacPorts folks).

 I will miss Gnucash's support for scheduled transactions, though, if I 
 can't figure out a good way to do this in Ledger.  That is, I'd like to be 
 able to set up a transaction that automatically charges a specific amount 
 to my credit card every month on the 13th, say.  From the ledger-mode 
 manual, I see that ledger-mode at least has some support for this, but this 
 section is still a work in progress.

 I've played around with the feature, and I see how to make it work for 
 transactions that always occur on the same day of the month.  One question, 
 though: is there support for scheduling transactions to occur, for example, 
 every 2 weeks?  I don't see an obvious way to work that into the 
 generalized date notation [*/*/13].  I took a look at ledger-schedule.el, 
 and the definition of ledger-schedule-descriptor-regex appears to allow 
 more sophisticated specifications than that, but it's going to take me a 
 while to puzzle out exactly what's going on here.  A very superficial 
 reading of ledger-schedule-constrain-day and related functions suggests 
 that not all of the features allowed in the regex are currently supported.

 (Ledger 3.0.3-20140608, MacOS 10.9.4, for what it's worth.)

 Thanks!

 Richard


-- 

--- 
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: scheduling bi-weekly transactions in ledger-mode

2014-07-10 Thread Martin Blais
I don't understand how you guys are using this.
What's the use case?

My process goes like this:
- I download an OFX or CSV file from my checking account.
- I extract transactions from the downloaded file (using a script, see
LedgerHub).
- When I see a salary payment, I move the incomplete, imported entry to a
section that has all of my employer stuff.
- I cut-n-paste the previous postings I matched the previous deposit
against (they're all quite similar, but some of the numbers always vary a
tiny bit, they're never completely regular).
- I look at my pay stub and I check and update all the numbers.

I *never* need to synthesize a new transaction. Cut-n-past works fine.

Why do you need this?
Why isn't cut-n-paste enough?
What are you doing differently from me?




On Thu, Jul 10, 2014 at 3:32 AM, Ra Wa rw950...@gmail.com wrote:

 I use a little shell script to add my fortnightly salary payment to ledger
 with the aid of 'ledger xact' (requires that your system has the gnu
 version of the date command).   It will figure out the last time it was run
 and generate enough transactions to get up to date.

 TODAY=$(date '+%s')
 LAST_PAY=$(ledger --sort=d csv Salary | tail -1 | cut -d, -f1 | tr -d '')
 NEXT_PAY=$(date -d $LAST_PAY + 2 weeks +'%Y/%m/%d' )

 while [  $( date -d $NEXT_PAY '+%s')  -le $TODAY  ]
 do
   #echo Next payday $(date -d $NEXT_PAY '+%d/%m/%Y')
   ledger xact $NEXT_PAY Salary $LEDGER_FILE
   echo $LEDGER_FILE
   NEXT_PAY=$(date -d $NEXT_PAY + 2 weeks +'%Y/%m/%d' )
 done


 -Ra





 On Wednesday, 9 July 2014 05:15:47 UTC+9:30, Richard Cobbe wrote:

 I'm in the process of transitioning from Gnucash to Ledger (as keeping
 Gnucash working consistently on MacOS is challenging, despite the best
 efforts of the MacPorts folks).

 I will miss Gnucash's support for scheduled transactions, though, if I
 can't figure out a good way to do this in Ledger.  That is, I'd like to be
 able to set up a transaction that automatically charges a specific amount
 to my credit card every month on the 13th, say.  From the ledger-mode
 manual, I see that ledger-mode at least has some support for this, but this
 section is still a work in progress.

 I've played around with the feature, and I see how to make it work for
 transactions that always occur on the same day of the month.  One question,
 though: is there support for scheduling transactions to occur, for example,
 every 2 weeks?  I don't see an obvious way to work that into the
 generalized date notation [*/*/13].  I took a look at ledger-schedule.el,
 and the definition of ledger-schedule-descriptor-regex appears to allow
 more sophisticated specifications than that, but it's going to take me a
 while to puzzle out exactly what's going on here.  A very superficial
 reading of ledger-schedule-constrain-day and related functions suggests
 that not all of the features allowed in the regex are currently supported.

 (Ledger 3.0.3-20140608, MacOS 10.9.4, for what it's worth.)

 Thanks!

 Richard

  --

 ---
 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.


-- 

--- 
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: scheduling bi-weekly transactions in ledger-mode

2014-07-10 Thread Craig Earls
I forecast the next two weeks.  As the transactions are realized I
edit the amount on the predicted transaction, which is usually very
close.  I have a CSV importer that handles the rest.  The real reason
is that I can predict how much I can spend on the extras.  I don't
budget everything, I have a preset amount that goes into savings, I
know what my regular expenses are, those are in the ledger-schedule
file I keep.  I run a cleared report to see how much isn't obligated
in the next two weeks, and that is fun money.

As I said I wrote this thing for myself and I don't know if anyone
else will use it.  It has been in place for almost two years and this
is the first question on it.

Mostly that is spurring me to finish the last ten percent.

On Thu, Jul 10, 2014 at 6:21 AM, Martin Blais bl...@furius.ca wrote:
 On Thu, Jul 10, 2014 at 9:12 AM, Douglas Philips douglas.phil...@gmail.com
 wrote:

 On 7/10/14 8:59 AM, Martin Blais wrote:
  I *never* need to synthesize a new transaction. Cut-n-past works fine.
 
  Why do you need this?
  Why isn't cut-n-paste enough?
  What are you doing differently from me?

 Predicting the future?


 Forecasting is the only use case there that makes sense to me so far.
 Do you delete the forecast entries when they become realized?

 Are there any non-forecast use cases?




 --

 ---
 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.



-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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: scheduling bi-weekly transactions in ledger-mode

2014-07-10 Thread Douglas Philips
On 7/10/14 9:21 AM, Martin Blais wrote:
 Forecasting is the only use case there that makes sense to me so far.
 Do you delete the forecast entries when they become realized?
 
 Are there any non-forecast use cases?

In my case, the realized and the forecast are the same, as I have
committed $n / month to a specific thing,
so I know exactly what it will be and when it will be.
If I cancel the subscription, I will delete the entries,
otherwise they don't change.

I use -e (something) to get a landscape out as far or near as I need it.
Typically 2-4 weeks unless I have a trip or vacation planned...

-=Doug

-- 

--- 
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.


scheduling bi-weekly transactions in ledger-mode

2014-07-08 Thread Richard Cobbe
I'm in the process of transitioning from Gnucash to Ledger (as keeping 
Gnucash working consistently on MacOS is challenging, despite the best 
efforts of the MacPorts folks).

I will miss Gnucash's support for scheduled transactions, though, if I 
can't figure out a good way to do this in Ledger.  That is, I'd like to be 
able to set up a transaction that automatically charges a specific amount 
to my credit card every month on the 13th, say.  From the ledger-mode 
manual, I see that ledger-mode at least has some support for this, but this 
section is still a work in progress.

I've played around with the feature, and I see how to make it work for 
transactions that always occur on the same day of the month.  One question, 
though: is there support for scheduling transactions to occur, for example, 
every 2 weeks?  I don't see an obvious way to work that into the 
generalized date notation [*/*/13].  I took a look at ledger-schedule.el, 
and the definition of ledger-schedule-descriptor-regex appears to allow 
more sophisticated specifications than that, but it's going to take me a 
while to puzzle out exactly what's going on here.  A very superficial 
reading of ledger-schedule-constrain-day and related functions suggests 
that not all of the features allowed in the regex are currently supported.

(Ledger 3.0.3-20140608, MacOS 10.9.4, for what it's worth.)

Thanks!

Richard

-- 

--- 
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.