> Is there a way to let ledger output its reports showing the accounts
> in the
> more conventional way as debit and credit accounts, instead of having
> a positive or negative saldo?
>
> The reason I am asking is that I have to do the accounting for a small
> non-profit organization and the people here expect to see the reports
> in
> that way.
Can you show me an example of what that kind of report would look like?
John
I too, do all the reporting for a small non profit. I end up
processing ledger selections (custom format) through a simple
flip-sign script prior to report formatting. Perhaps you could
adapt the bash script below for your own use.
Note that it's probably that one of ledgers output options
could multiply by negative 1, but I find flip-sign to be a
little more usefull.
==================================================================
#!/bin/bash
# flip-sign: generic sign flipper/paren adder for w1 style reports
# Account string specific though
reverse() {
# reverse negative signs (cannot do math with commas and periods)
value=-$value # add a minus
value=${value/--/} # replace a *double* minus with nothing (eg: a +)
}
paren() {
# if first char neg sign, sub open_paren for neg_sign, append close_paren
[[ ${value:0:1} = '-' ]] && value=${value/#-/(}')'
}
IFS="|"
while read account type value
do
# strip leading blank
value=${value## } # strip leading blank
# change sign of Income and Liability amounts
[[ ${account%%:*} = Income ]] && reverse && paren
[[ ${account%%:*} = Expense ]] && paren
[[ $account = 'Total Income' ]] && reverse && paren
[[ $account = 'Profit/(Loss)' ]] && reverse && paren
[[ $account = Liability* ]] && paren
[[ $account = 'Change' ]] && paren
[[ $account = 'Bank:Change' ]] && paren
echo $account"|"$type"|"$value
done
# end
==================================================================
You can see part of one report under "Ways & Means" at
http://www.waco-ak.org.
Rgds,
--
Mike Bishop
Willow, Alaska
> Is there a way to let ledger output its reports showing the accounts
> in the
> more conventional way as debit and credit accounts, instead of having
> a positive or negative saldo?
>
> The reason I am asking is that I have to do the accounting for a small
> non-profit organization and the people here expect to see the reports
> in
> that way.
Can you show me an example of what that kind of report would look like?
John
> Note that it's probably that one of ledgers output options
> could multiply by negative 1, but I find flip-sign to be a
> little more usefull.
For a balance report, the figure displayed is controlled by the -T
option. If you want negative totals, for example, you would use "-T -
O".
Although 2.6.1 cannot display negative values surrounded by
parentheses, it will be possible in 3.0 using a construction like this:
--format '%20(total_expr < 0 ? "(" + -total_expr + ")" :
total_expr) %(depth_spacer)%-(partial_account)\n'
This modifies the regular balance report to display negative totals in
parentheses, rather than as negative numbers.
The options are basically unlimited. Plus, with the upcoming tight
Python integration support, you can just write your balance reporting
code in Python, or export it to a script via csv or xml.
John
> Here is one example:
This kind of report will make an excellent example script to
demonstrate the Python extensibility.
> A second point: We need to keep the documents for all the transactions
> and the entries
> in the ledger should refer back to them. This is done by numbering all
> the transactions,
> here called Tr.#. Is this was the (CODE) entry is to be used for?
It's what I use CODE for, yes. We're also going to be supporting
metadata in 3.0.
> Last question: Living in Sweden and having special characters, how is
> it with UTF-8
> support? I saw a small note about it on your webpage that it is not
> quite there yet.
There is an "icu" branch which aims at full Unicode support, but it's
just beginning and does not function yet. There are many
considerations involved.
John