emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeffrey Brent McBeth <mcbeth@broggs.org>
To: emacs-orgmode@gnu.org
Subject: Re: Tips for using orgmode + ledger to record events?
Date: Fri, 1 Mar 2013 09:17:29 -0500	[thread overview]
Message-ID: <20130301141728.GI14738@broggs.org> (raw)
In-Reply-To: <87y5e72rj4.fsf@pinto.chemeng.ucl.ac.uk>

On Fri, Mar 01, 2013 at 01:11:59PM +0000, Eric S Fraga wrote:
> Harum Budi <harumbudi@gmail.com> writes:
> 
> > I was not being clear at all, sorry. Let me rephrase, but bear with me as
> > English is my secondary language.
> 
> That's fine!
> 
> I think I understand what you want.  My view would be to avoid having
> two files, an org one and a ledger one, and instead combine them into an
> org file.  You could create log capture templates for different kinds of
> activities and one of these could be financial.  This latter one could
> create a ledger src block that is automatically tangled to the full
> ledger file consisting of all such entries.  This is why I showed the
> ledger src blocks in my previous email.
> 
> A financial entry could be
> 
> ,----
> | * [2013-03-01 Fri] Bought a sandwich  :food:
> |   #+begin_src ledger :tangle "finances.ledger"
> |   2013/03/01 Bought a sandwich
> |     expenses  £3.50
> |     cash
> |   #+end_src
> `----
> 
> or something similar...  You could still grep on headings but actually
> tag searching would be better of course.

I'm doing something rather similar with Ledger, and it all works really well unless I want to export to HTML, in which case I've had to increase the max lisp eval depth about once a week lately
(setq max-lisp-eval-depth 2400)

I'm assuming I'm doing something wrong there.  The datetree is not exported, but reports are (I have an example of a report below):

#+name: savingscheckingsummary
#+begin_src ledger :cmdline balance esl:check savings -p "until tomorrow" :nowe$
<<budget>>
<<checking>>
<<savings>>
<<anotheraccount>>
<<creditcard>>
#+end_src

I find the noweb tangling to work really well for my purposes, and in particular subsetting which bits I want exported to Ledger.

I've also included an example capture template

(setq org-capture-templates
  (append '(("l" "Ledger entries")
            ("lc" "Bank:Checking" plain
                 (file+datetree+prompt "~/Documents/Ledger.org")
"
#+name: checking
#+begin_src ledger
%(org-read-date) * %^{Payee}
    Expenses:%^{Account}  %^{Amount}
    Assets:Bank:Checking
#+end_src
"))))



-- 
"The man who does not read good books has no advantage over 
 the man who cannot read them."
 -- Mark Twain

  reply	other threads:[~2013-03-01 14:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-27 10:29 Tips for using orgmode + ledger to record events? Harum Budi
2013-03-01  8:47 ` Eric S Fraga
2013-03-01 10:09   ` Harum Budi
2013-03-01 13:11     ` Eric S Fraga
2013-03-01 14:17       ` Jeffrey Brent McBeth [this message]
2013-03-01 20:13       ` Viktor Rosenfeld
2013-03-04  8:52         ` Eric S Fraga
2013-03-04 21:06           ` Viktor Rosenfeld
2013-03-05  8:44             ` Eric S Fraga
2013-03-05 18:25               ` Viktor Rosenfeld

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130301141728.GI14738@broggs.org \
    --to=mcbeth@broggs.org \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).