From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eike Subject: Re: simple expense tracking with org Date: Sat, 20 Sep 2014 15:35:41 +0200 Message-ID: <8761giv1yd.fsf@ithaka.home> References: <877g0yv402.fsf@ithaka.home> <87y4tejurs.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVL2H-0003Ox-8A for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 09:49:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XVL2B-0001cD-Sz for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 09:49:13 -0400 Received: from ns.km31707.keymachine.de ([87.118.120.70]:46230 helo=eknet.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVL2B-0001YX-MI for emacs-orgmode@gnu.org; Sat, 20 Sep 2014 09:49:07 -0400 In-reply-to: <87y4tejurs.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Tory S. Anderson" Cc: "emacs-orgmode@gnu.org" Sure. An "expense item" is a headline with a property drawer that has a property where the key is some currency code (other headlines are ignored). Then tags can be applied to this headline. A category is either specified via CATEGORY property or the parent headline is used (if present). The org files may look like this * some headline that is a category by default ** expense item 1 :atag: :PROPERTIES: :CHF: 25.00 :date: [2014-09-20] :END: ** expense item 2 :anothertag: :PROPERTIES: :CHF: 21.00 :date: [2014-09-20] :CATEGORY: :END: The "expense view" gives a summary of these items and the items itself as a org table (there also is a screenshot https://github.com/eikek/org-expenses/blob/master/screenshot.png): #+TITLE: Expenses [2014-08-01 Fr] - [2014-08-31 So] #+STARTUP: showeverything Search: ~(:date "2014-08")~ Showing *7* items * Overview ** Summary | Curr. | sum | max | min | count | avg | |-------+--------+--------+-------+-------+-------| | CHF | 532.98 | 349.99 | 10.00 | 6 | 88.83 | | EUR | 15.99 | 15.99 | 15.99 | 1 | 15.99 | ** Categories | | sum | max | min | count | avg | |---------------+--------+--------+-------+-------+--------| | B=C3=BCcher CHF | 49.99 | 39.99 | 10.00 | 2 | 25.00 | | B=C3=BCcher EUR | 15.99 | 15.99 | 15.99 | 1 | 15.99 | | Sonstiges CHF | 426.49 | 349.99 | 20.00 | 3 | 142.16 | | Work CHF | 56.50 | 56.50 | 56.50 | 1 | 56.50 | ** Monthly | | sum | max | min | count | avg | |-------------+--------+--------+-------+-------+-------| | 2014/08 CHF | 532.98 | 349.99 | 10.00 | 6 | 88.83 | | 2014/08 EUR | 15.99 | 15.99 | 15.99 | 1 | 15.99 | * Items | :item | :category | :date | :CHF | :EUR | |-----------+-----------+-----------------+--------+-------| | Buch1 | B=C3=BCcher | [2014-08-31 So] | | 15.99 | | Cellphone | Sonstiges | [2014-08-30 Sa] | 349.99 | | | Pizza | Sonstiges | [2014-08-29 Fr] | 20.00 | | | Buch2 | B=C3=BCcher | [2014-08-26 Di] | 10.00 | | | Cablecom | Sonstiges | [2014-08-25 Mo] | 56.50 | | | Cablecom | Work | [2014-08-25 Mo] | 56.50 | | | Buch2 | B=C3=BCcher | [2014-08-01 Fr] | 39.99 | | It's just counting and summing the items, nothing more. It's not doing accounting or anythingmore complicated, if you had this in mind. Regard, Eike Tory S. Anderson writes: > Could you give a few snippets of examples -- what the org files with tags= look like, what the result looks like? I'm interested because I also use O= rg to do my budgeting and finances. > > Eike writes: > >> Hello there, >> >> I thought to share a little elisp thingy that I wrote to track my >> expenses with org. I use the org's capture mechanism to add expense >> items to some files and the following code only searches through all >> these files and creates summaries of all found expenses. It is possible >> to search by date, tags etc. >> >> You can have a look here: https://github.com/eikek/org-expenses >> >> >> Regards, >> Eike >> >> -- >> gpg: AD7AC35E >> finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E -- gpg: AD7AC35E finger print: 137F BB0B 1639 D25F DC5D E59C B412 C5F5 AD7A C35E