emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: Eric S Fraga <e.fraga@ucl.ac.uk>
Cc: Uwe Brauer <oub@mat.ucm.es>, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: accounting
Date: Tue, 05 Jan 2021 16:35:06 +0100	[thread overview]
Message-ID: <878s972y8l.fsf@mat.ucm.es> (raw)
In-Reply-To: <87r1mzkb7u.fsf@disroot.org>

[-- Attachment #1: Type: text/plain, Size: 2875 bytes --]


> On Monday,  4 Jan 2021 at 21:01, Uwe Brauer wrote:

> Yes.

> Sorry I was brief: I cut and pasted something from one of my files while
> in a rush!

> Basically, you could do:

> #+begin_src ledger :cmdline -V --format "%-20A %14T\n" bal --flat assets 
> 2010/01/01 * Starting balance
>   assets:bank:savings  1300.00
>   income:starting balances
> 2010/07/22 * Got paid
>   assets:bank:chequing  1000.00
>   income:salary
> #+end_src

> and you would get, as output,

> #+results:
> : assets:bank:chequing           1000
> : assets:bank:savings            1300
> :                                2300


Thanks. I figured out that I have to read a bit accounting again (I
don't want to  use gnucash again, I prefer an org solution). I think
ledger is a reasonable solution (I cannot install currently beancount)


> I'm not saying that this is much prettier than the default but simply
> that you have total control over the formatting of the output so you may
> be able to achieve what you wish.


Yeah, your solution does not work for the example I had in mind
but I realize now what I miss: the output should be an org table


#+name: test
#+begin_src ledger 
2010/01/01 * Starting balance
  assets:bank:savings  0
  income:starting balances
2010/07/23 ChristmasTree
  expenses:Brother:ChristmasTree  40.00
  income:Brother:Card
2010/07/24 Jacket
  expenses:BigBrother:Jacket  150.00
  income:BigBrother:Card
2010/07/24 Schuhe
  expenses:BigBrother:Shoes  20
  income:BigBrother:Card
2010/07/23 BigBrother 
  expenses:Brother:BigBrother  130
  income:Brother:Card
#+end_src

#+RESULTS: test
#+begin_example
                 340  expenses
                 170    BigBrother
                 150      Jacket
                  20      Shoes
                 170    Brother
                 130      BigBrother
                  40      ChristmasTree
                -340  income
                -170    BigBrother:Card
                -170    Brother:Card
--------------------
                   0
#+end_example


But I rather prefer to have

|  340 | expenses |                 |               |
|  170 |          | BigBrother      |               |
|  150 |          |                 | Jacket        |
|   20 |          |                 | Shoes         |
|  170 |          | Brother         |               |
|  130 |          |                 | BigBrother    |
|   40 |          |                 | ChristmasTree |
| -340 | income   |                 |               |
| -170 |          | BigBrother:Card |               |
| -170 |          | Brother:Card    |               |
|      |          |                 |               |
|------+----------+-----------------+---------------|
|    0 |          |                 |               |


Any idea how to achieve this?

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5673 bytes --]

  parent reply	other threads:[~2021-01-05 15:36 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04  8:54 accounting Uwe Brauer
2021-01-04  9:31 ` accounting Eric S Fraga
2021-01-04 10:19 ` accounting Dr. Arne Babenhauserheide
2021-01-04 12:43   ` accounting Uwe Brauer
2021-01-04 14:00     ` accounting Eric S Fraga
2021-01-04 20:01       ` accounting Uwe Brauer
     [not found]         ` <87r1mzkb7u.fsf@disroot.org>
2021-01-05 15:35           ` Uwe Brauer [this message]
2021-01-05 16:02             ` [A solution of sorts] (was: accounting) Uwe Brauer
2021-01-05 16:09               ` [A solution of sorts] Eric S Fraga
2021-01-06 17:02                 ` Uwe Brauer
2021-01-05 16:03             ` accounting Eric S Fraga
2021-01-06  2:49               ` accounting Ihor Radchenko
2021-01-04 11:13 ` accounting Daniele Nicolodi
2021-01-04 20:04   ` accounting Uwe Brauer
2021-01-04 21:17     ` accounting Samuel Wales
2021-01-05  0:08     ` accounting Daniele Nicolodi
2021-01-05  7:50       ` accounting Uwe Brauer
2021-01-04 12:52 ` accounting Charles Millar
2021-01-05 15:44   ` accounting Uwe Brauer

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=878s972y8l.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=e.fraga@ucl.ac.uk \
    --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).