Re: Tracking Short Sales

2020-03-13 Thread Jostein Berntsen
On 13.03.20,02:31, Brandon Olivares wrote:
> Sorry for another question but having trouble with this.
> 
> As I said in my last message I’m using ledger to track my portfolio. I have 
> it down pretty well, but one thing I can’t figure out is short sales.
> 
> It seems simple up front: just something like:
> 
> 2020/03/13 Sell Short
> Assets:Portfolio:AAPL  -8 AAPL @ $250.00
> Assets:Portfolio:Cash  $2,000.00
> 
> Then if I view balance by cost basis, I see Assets:Portfolio:Cash is up by 
> $2,000 and Assets:Portfolio:AAPL is -$2,000.
> 
> But say I have 5 different stocks, 4 are long and 1 is short. I’d like to 
> calculate the percent of each stock in the portfolio.
> 
> But if one is negative, there’s no easy way to calculate that.
> 
> I was thinking of transferring out of cash the collateral that is held for 
> the stock, but it seems to overcomplicate things.
> 
> Imagine this file for example:
> 
> 2020/03/13 Initial Deposit
> Assets:Portfolio:Cash $10,000.00
> Equity:Opening Balances
> 
> 2020/03/13 Buy Facebook
> Assets:Portfolio:FB13 FB @ $155.00
> Assets:Portfolio:Cash
> 
> 2020/03/13 Short Apple
> Assets:Portfolio:AAPL-8 AAPL @ $250.00
> Assets:Portfolio:Cash
> 
> 2020/03/12 Buy Amazon
> Assets:Portfolio:AMZN 1 AMZN @ $1,700.00
> Assets:Portfolio:Cash
> 
> 2020/03/13 Buy Netflix
> Assets:Portfolio:NFLX 7 NFLX @ $315.00
> Assets:Portfolio:Cash
> 
> 2020/03/13 Buy Google
> Assets:Portfolio:GOOGL   2 GOOGL @ $1,100.00
> Assets:Portfolio:Cash
> 
> Running balance on this looks like:
> 
> $ ledger -f portfolio.dat -B balance ^Assets
>   $10,000.00  Assets:Portfolio
>   $-2,000.00AAPL
>$1,700.00AMZN
>$3,880.00Cash
>$2,015.00FB
>$2,200.00GOOGL
>$2,205.00NFLX
> 
>   $10,000.00
> 
> So each stock is roughly 20% (give or take) of the portfolio. But cash looks 
> like it is nearly 40% while AAPL is of course negative by -$2,000.
> 
> Just would like a nicer way of looking at this. Ideas? Couldn’t find
> any resources out there about this.

Would it work to move Cash out of the Portfolio category to something 
like Assets:Stock:Cash instead? 

Jostein



-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20200313074956.GB27739%40jostein.


Re: Autocompletion for Vim

2020-03-08 Thread Jostein Berntsen
On 07.03.20,10:11, Toby wrote:
> Hi,
> 
> I am just curious to know if there is a tab completion for Vim as there is 
> for Emacs. 
> Also curious to know if there is a functionality like 
> company-mode(autocompletion) for Vim. 
>

You have this plugin for vim:

ledger/vim-ledger: Vim plugin for Ledger

https://github.com/ledger/vim-ledger

https://justyn.io/blog/automatically-sort-and-align-ledger-transactions-in-vim/


Jostein

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20200308151757.GA4299%40jostein.


Re: Balance question / puzzle

2019-12-11 Thread Jostein Berntsen
On 09.10.19,18:30, Remco Rijnders wrote:
> Hi all,
> 
> I am working on some tax returns, and am seeing something which, to my
> amateur eyes, seems strange. When I run a balance report for my entire
> ledger that covers multiple years, I come to one amount. However, when I
> then run balances for the individual years, the balances don't add up
> together.
> 
> Please see below an example of what I did for the "income" account which
> consists of several sub accounts and I also have multiple currencies. In
> order to not reveal confidential information, I have introduced a random
> currency 'RND' with a single fixed exchange rate to my normal reporting
> currency.
> 
> $ ledger bal -f balance-question.ledger income -e 2017-01-01 -X RND | head 
> -1; ledger bal -f balance-question.ledger income -b 2017-01-01 -e 2018-01-01 
> -X RND | head -1; ledger bal -f balance-question.ledger income -b 2018-01-01 
> -e 2019-01-01 -X RND | head -1; echo; ledger bal -f balance-question.ledger 
> income -e 2019-01-01 -X RND | head -1
>  RND -261127,97  income
>  RND -174407,32  income
>  RND -226957,44  income
> 
>  RND -661750,74  income
> 
> Adding these numbers up, I would expect a total balance of RND -662492,73
> instead of the total balance of -661750,74 I find now. This poses an issue
> for me as I determine my profit by subtracting my yearly expenses from my
> yearly income and I expect the profit of year 1, plus year 2, plus year 3,
> to be equal to my total profit over the years.
> 
> Can someone else see a similar issue with their own balances? Or am I
> misunderstanding something as to how balances should align with each other?
> When I run a register report for these 3 periods and for the 1 total period
> instead of a balance report, I get the same numbers for both.
> 
> I wonder if it can somehow be explained by the exchange rates / commodity
> values that are selected when including date criteria?
> 
> Any ideas?
> 

Can you run the commands with the --historical option and see if that 
makes a difference?


Jostein

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20191211101059.GD29912%40jostein.


Re: expr not working as expected with latest version

2019-12-11 Thread Jostein Berntsen
On 30.11.19,22:50, dim wrote:
> With Ledger version 3.1.1-20160111 (installed from trisquel packages)
> 
> = expr 'tag("VAT") == "bla"'
> Assets:Whatever   ((amount * _myvat) - amount)
> Liabilities:Something(-((amount * _myvat) - amount))
> 
> 
> would match entries with *; VAT: bla only*
> 
> With version 3.1.3-20190331 (compiled from github) the above expression 
> matches *everything*
> 
> Any thoughts?
> 

Have you check with the latest, stable release 3.1.3?

https://github.com/ledger/ledger/releases/tag/v3.1.3


Jostein

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20191211095406.GC29912%40jostein.


Re: How to get all the amount in the register to be in a straight line?

2019-12-10 Thread Jostein Berntsen
On 05.12.19,10:30, Oscar wrote:
> hi,
> whenever i run register the amounts/balance in the amount are not justified 
> in one straight line but rather go left and right depending on the payee 
> description. I have tried to adjust the payee width parameters but still 
> cant get it in a straight line.
> I would deeply appreciate if someone can help with this. Is there any way 
> to force the amount/balance to be in a straight line?
>  thanks
> 

You can use the --register-format option to set this if you use a narrow 
width terminal.  Enter one of those options in your ~/.ledgerrc file:

Output entries on separate lines:

--register-format %(date)  %(payee)\n \t%-.38(account) %22.108(amount) 
%22.132(total)\n

All on one line, truncated Payee width:

--register-format %(date)  %-.35(payee) \t%-.38(account) 
%10.100(amount) %15.100(total)\n


Jostein





-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20191211000932.GB29912%40jostein.


Re: any script to order transactions by date

2019-12-10 Thread Jostein Berntsen
On 06.12.19,12:19, Christian Pinedo Zamalloa wrote:
> Hi!
> I would like to know if you have any shell, awk... script to sort the
> order of ledger transactions by date.
> 
> Initially I tried to sort transactions per date by using "ledger
> print", however I suffered some issues with the output generated by
> "ledger print" command:
> - some lot data disappears
> - lot dates are translated to a format not valid (it seems to be
> solved in this commit
> https://github.com/ledger/ledger/commit/95237941b66931978953fadb390e1b442ed63175
> )
> 
> I am a vim user, so I don't use the emacs' mode for ledger.
> 

I have made a perl script last year which has an option to sort the 
transaction file by dates without changing it and one for changing the 
file. I will see if I can upload this to github if this is useful. 

Jostein

-- 

--- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20191210230455.GA29912%40jostein.


Re: Printing checks with ledger??

2018-06-14 Thread Jostein Berntsen
On 15.06.18,01:04, Jostein Berntsen wrote:
> On 13.06.18,13:55, Matthew Sewell wrote:
> > I'm wondering if anyone has ever used ledger for check printing. I used to 
> > use my banks bill pay but then they sent a large American Express payment 
> > to the wrong account and I never got the money back. It was an $1,800 
> > payment so I've vowed to never use it again and since then, I've been hand 
> > writing all my business checks after I enter the transaction into ledger.
> > 
> > Has anyone ever printed checks from entries in ledger? It doesn't seem like 
> > it would be too difficult to make a checks report that could be exported in 
> > pdf and then printed. This would save me hours of time. Just wondering if 
> > anyone has thought of this or done this before? 
> > 
> > I found this program written in php that does a good job of generating the 
> > checks but of course, it doesn't talk to Ledger:
> > https://github.com/aaronpk/checks
> > 
> > I'm willing to develop this if needed but thought I'd see if there's any 
> > other ideas out there.
> > 
> 
> Check how to import a text file which contains the output from ledger 
> with the verbatim and fancyvrb package into LaTex here:
> 
> https://tex.stackexchange.com/questions/85200/include-data-from-a-txt-verbatim
> 
> Setup for checks with LaTex:
> 
> https://tex.stackexchange.com/questions/70480/printing-checks-with-latex
> 
> Then export the tex file to pdf for printing:
> 
> http://www.andy-roberts.net/writing/latex/pdfs
> 
> 

Another more quick way might be to import your ledger output to a 
libreoffice calc file and use a template for checks like this:

http://jimkaness.com/engineering/checktemplate.html


Jostein

-- 

--- 
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: Monthly balance position

2018-05-11 Thread Jostein Berntsen
On 11.05.18,10:58, Jostein Berntsen wrote:
> On 25.04.18,13:31, Jostein Berntsen wrote:
> > On 17.04.18,19:30, Richard Lawrence wrote:
> > > John Wiegley <jwieg...@gmail.com> writes:
> > > 
> > > > > > > > > "RL" == Richard Lawrence <wyle...@gmail.com> writes:
> > > > 
> > > > RL> I don't think so, at least not with regular ledger. I'd be happy to
> > > > be RL> proven wrong, though! I have also wanted this feature.
> > > > 
> > > > You can use:
> > > > 
> > > > ledger --group-by 'format_date(date, "%Y/%m")' bal
> > > 
> > > Ah, that's helpful!  Thanks!
> > > 
> > > -- 
> > > Best,
> > > Richard
> > > 
> > 
> > You also have this as a useful command for weekly overview:
> > 
> > ledger --group-by 'format_date(date, "%Y/%W")' bal expenses
> > 
> > You can refine it more:
> > 
> > ledger bal --group-by 'format_date(date, "%Y-%m")' --depth 2 expenses and 
> > not jobb or tag Regning and not assets
> > 
> > 
> 
> When running these group-by commands for monthly or weekly output these 
> gives output including April and week 18 as the end month/week, but they 
> don't include May and week 19. Is there a way to get these included as 
> well? 
> 

Sorry, I saw that I had an error in my dat file, so these commands are 
working as expected. 


Jostein


-- 

--- 
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: Monthly balance position

2018-05-11 Thread Jostein Berntsen
On 25.04.18,13:31, Jostein Berntsen wrote:
> On 17.04.18,19:30, Richard Lawrence wrote:
> > John Wiegley <jwieg...@gmail.com> writes:
> > 
> > > > > > > > "RL" == Richard Lawrence <wyle...@gmail.com> writes:
> > > 
> > > RL> I don't think so, at least not with regular ledger. I'd be happy to
> > > be RL> proven wrong, though! I have also wanted this feature.
> > > 
> > > You can use:
> > > 
> > > ledger --group-by 'format_date(date, "%Y/%m")' bal
> > 
> > Ah, that's helpful!  Thanks!
> > 
> > -- 
> > Best,
> > Richard
> > 
> 
> You also have this as a useful command for weekly overview:
> 
> ledger --group-by 'format_date(date, "%Y/%W")' bal expenses
> 
> You can refine it more:
> 
> ledger bal --group-by 'format_date(date, "%Y-%m")' --depth 2 expenses and not 
> jobb or tag Regning and not assets
> 
> 

When running these group-by commands for monthly or weekly output these 
gives output including April and week 18 as the end month/week, but they 
don't include May and week 19. Is there a way to get these included as 
well? 

Jostein

-- 

--- 
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: Display the total balance of multiple accounts (net income)

2018-05-03 Thread Jostein Berntsen
On 02.05.18,16:12, Shane wrote:
> Unfortunately, this still doesn't solve my issue with having multiple lines 
> per day for some of reports. Example of trying to plot my net worth:
> 
> led reg ^ass ^lia --market --collapse --total-data
> 
> ...
> 2018-03-08 3183.86
> 2018-03-08 3162.64
> 2018-03-09 3158.05
> 2018-03-09 3148.87
> 2018-03-09 3099.16
> 2018-03-10 3085.49
> 2018-03-10 3072.22
> ...
> 
> The desired output:
> 
> ...
> 2018-03-08 3162.64
> 2018-03-09 3099.16
> 2018-03-09 3072.22
> ...
> 
> On Wednesday, May 2, 2018 at 3:03:49 PM UTC-7, Chris Berkhout wrote:
> >
> > On 2 May 2018 at 20:37, Shane  wrote:
> >
> >> I'm trying to plot my net income (income - taxes):
> >>
> >> led bal -e 2018-04-30 bal inc 2018 --collapse
> >>
> >
> > To plot it over time you would use the reg command:
> >
> > ledger reg -e 2018-04-30 inc 2018 -J
> >

What about this reg command?

ledger reg -e 2018-04-30 inc 2018 --subtotal -J

or this group-by bal command?

ledger --group-by 'format_date(date, "%Y/%m")' bal inc 2018 --collapse -J 


Jostein


-- 

--- 
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: Shared transactions multiple files

2018-05-02 Thread Jostein Berntsen
On 01.05.18,07:33, Johann Höchtl wrote:
> 
> 
> On 2018-05-01 01:54, Jostein Berntsen wrote:
> > On 30.04.18,02:22, Johann Höchtl wrote:
> > You might look at the comment in this post regarding problem with
> > balancing with assertions and multiple files:
> > 
> > https://felixcrux.com/blog/ledger-practices-separate-your-journals
> > 
> > It might work better if you keep your transacations in one file here,
> > the result seems more like you expect.
> Thank you for the pointer which will help me to understand how to structure
> files.
> 
> Meanwhile I identified the underlying problem. The definition for automated
> shared transactions is in both files as I would like to keep them separated
> and usable on their own. However if they are combined with multiple -f
> specifications on the command line these automated transactions become
> defined and applied twice.
> 
> Ideally some sort of #idef ...  #define   #endif functionality to
> prevent the semantically same second definition of an automated transaction
> to be defined would be a solution.
> 
> Maybe I could get around with a
> 
> define variable=true
> 
> or like functionality?
> > 

You can have a header file with your accounts and automated transactions 
there and use the include statement for your transaction files:

; Header file ledger.dat

= /^Expenses:/
[Share]1
[Share:Person:A]   -0.5
[Share:Person:B]  -0.5

= /^Person:/
[Share:$account]  -1
[Share]1


include ~/ledger/transacationA.dat
include ~/ledger/transacationB.dat


Jostein


-- 

--- 
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: Display the total balance of multiple accounts (net income)

2018-05-02 Thread Jostein Berntsen
On 02.05.18,11:37, Shane wrote:
> I'm trying to plot my net income (income - taxes):
> 
> led bal -e 2018-04-30 bal inc 2018 --collapse
> 
> The output looks like:
> 
> 1,000.00 USD  exp
>-4,000.00 USD  inc
> 
>-3,000.00 USD
> 
> When I want to generate a format for gnuplot (by adding the -J argument), 
> the output still shows all three lines.
> 
> led bal -e 2018-04-30 bal inc 2018 --collapse -J
> 
> 2018-04-21 1,000.00
> 2018-04-21 -4,000.00
> 2018-04-21 -3,000.00
> 
> How do I only display the *total*--the -3,000.00 USD?
> 

The --collapse command should work here, but it seems like you have the 
bal commend two times in your command above. Can you check if this works 
for you instead? 

ledger bal -e 2018-04-30 inc --collapse -J


Jostein

-- 

--- 
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: Shared transactions multiple files

2018-04-30 Thread Jostein Berntsen
On 30.04.18,02:22, Johann Höchtl wrote:
> Bump.
> 
> The interesting thing is that the balance amount for account "Share" varies 
> depending on the order I call the two ledger files.
> 
> What is the underlying problem / offending statement? Do I need to extract 
> the automated transactions from the two files into one additional external 
> file?
> 
> Thank you!
> 

You might look at the comment in this post regarding problem with 
balancing with assertions and multiple files:

https://felixcrux.com/blog/ledger-practices-separate-your-journals

It might work better if you keep your transacations in one file here, 
the result seems more like you expect. 


Jostein

-- 

--- 
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: Fixing lot price confusion

2018-03-18 Thread Jostein Berntsen
On 15.03.18,18:54, Sanel Zukan wrote:
> Hi guys,
> 
> I'm using ledger for tracking car expenses [1] and I'm getting confused
> with fixing lot prices.
> 
> Let's say I have this example (L is for liters):
> 
>  2018/03/13 * Fuel
>Expenses:Car:Fuel  23.700 L @ EUR 2.10
>(Expenses:Car:Mileage) = 11 km
>Assets:Wallet  EUR -49.77
> 
> and when I use command:
> 
>  ledger -X EUR reg
> 
> it will correctly calculate liter price and show in euro currency. In my
> country we also have tax on fuel, calculated by formula 'N L * 0.01'. If
> I add this as:
> 
>  2018/03/13 * Fuel
>Expenses:Car:Fuel  23.700 L @ EUR 2.10
>  Expenses:Car:Fuel:Tax  23.700 L @ EUR 0.01
>(Expenses:Car:Mileage) = 11 km
>Assets:Wallet  EUR -50.01
> 
> now ledger register report looks like this:
> 
> 18-Mar-13 Fuel   Expenses:Car:Fuel   EUR 0.24   EUR 0.24
>  EUR -0.01  EUR 0.23
>  Expenses:Car:Fuel:Tax   EUR 0.24   EUR 0.47
>  (Expenses:Car:Mileage)  km11   EUR 0.47
> km11
>  Assets:Wallet   EUR -50.01 EUR -49.54
> km11
> 
> which is kind of wrong - it is starting to use last value to calculate 
> EUR/Liter.
> 
> After catching [2], I've tried to fix price (although I'd like to keep
> fluctuating capability of this comodity so I could handle case: "how
> much all my spent fuel would cost in year ") with this, omitting
> mileage:
> 
>  2018/03/13 * Fuel
>Expenses:Car:Fuel  23.700 L {=EUR 2.10}
>  Expenses:Car:Fuel:Tax  23.700 L {=EUR 0.01}
>Assets:Wallet  EUR -50.01
> 
> and ledger started to complain with this report:
> 
> -
> Unbalanced remainder is:
>   EUR -50.01
> 23.700 L {=EUR 0.01}
> 23.700 L {=EUR 2.10}
> Amount to balance against:
> 23.700 L {=EUR 0.01}
> 23.700 L {=EUR 2.10}
> Error: Transaction does not balance
> -
> 
> However, if I change {=EUR ...} to =EUR ... like here:
> 
>  2018/03/13 * Fuel
>Expenses:Car:Fuel  23.700 L @ =EUR 2.10
>  Expenses:Car:Fuel:Tax  23.700 L @ =EUR 0.01
>Assets:Wallet  EUR -50.01
> 
> register report is doing proper calculation and balancing.
> 
> Anyone has any idea what is going on here? If I'm getting documentation
> from [2] correct, my last two examples should be equal and valid, but
> obviously they are not for ledger.
> 

Can you add the time entry as a tag instead? 

Jostein

-- 

--- 
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: Fixing lot price confusion

2018-03-15 Thread Jostein Berntsen
On 15.03.18,18:54, Sanel Zukan wrote:
> Hi guys,
> 
> I'm using ledger for tracking car expenses [1] and I'm getting confused
> with fixing lot prices.
> 
> Let's say I have this example (L is for liters):
> 
>  2018/03/13 * Fuel
>Expenses:Car:Fuel  23.700 L @ EUR 2.10
>(Expenses:Car:Mileage) = 11 km
>Assets:Wallet  EUR -49.77
> 
> and when I use command:
> 
>  ledger -X EUR reg
> 
> it will correctly calculate liter price and show in euro currency. In my
> country we also have tax on fuel, calculated by formula 'N L * 0.01'. If
> I add this as:
> 
>  2018/03/13 * Fuel
>Expenses:Car:Fuel  23.700 L @ EUR 2.10
>  Expenses:Car:Fuel:Tax  23.700 L @ EUR 0.01
>(Expenses:Car:Mileage) = 11 km
>Assets:Wallet  EUR -50.01
> 
> now ledger register report looks like this:
> 
> 18-Mar-13 Fuel   Expenses:Car:Fuel   EUR 0.24   EUR 0.24
>  EUR -0.01  EUR 0.23
>  Expenses:Car:Fuel:Tax   EUR 0.24   EUR 0.47
>  (Expenses:Car:Mileage)  km11   EUR 0.47
> km11
>  Assets:Wallet   EUR -50.01 EUR -49.54
> km11
> 
> which is kind of wrong - it is starting to use last value to calculate 
> EUR/Liter.
> 
> After catching [2], I've tried to fix price (although I'd like to keep
> fluctuating capability of this comodity so I could handle case: "how
> much all my spent fuel would cost in year ") with this, omitting
> mileage:
> 
>  2018/03/13 * Fuel
>Expenses:Car:Fuel  23.700 L {=EUR 2.10}
>  Expenses:Car:Fuel:Tax  23.700 L {=EUR 0.01}
>Assets:Wallet  EUR -50.01
> 
> and ledger started to complain with this report:
> 
> -
> Unbalanced remainder is:
>   EUR -50.01
> 23.700 L {=EUR 0.01}
> 23.700 L {=EUR 2.10}
> Amount to balance against:
> 23.700 L {=EUR 0.01}
> 23.700 L {=EUR 2.10}
> Error: Transaction does not balance
> -
> 
> However, if I change {=EUR ...} to =EUR ... like here:
> 
>  2018/03/13 * Fuel
>Expenses:Car:Fuel  23.700 L @ =EUR 2.10
>  Expenses:Car:Fuel:Tax  23.700 L @ =EUR 0.01
>Assets:Wallet  EUR -50.01
> 
> register report is doing proper calculation and balancing.
>
> Anyone has any idea what is going on here? If I'm getting documentation
> from [2] correct, my last two examples should be equal and valid, but
> obviously they are not for ledger.
> 
> Best regards,
> Sanel
> 
> [1] https://groups.google.com/forum/#!msg/ledger-cli/Ojl0Rk96zqg/cGp8ArG_AAAJ
> [2] https://www.ledger-cli.org/3.0/doc/ledger3.html#Fixated-prices-and-costs
> 

Will this work for you instead?

=/Fuel/
 Expenses:Car:Fuel:Tax  0.1 
 Assets:Wallet -0.1

2018/03/13 * Fuel
 Expenses:Car:Fuel  23.700 L @ EUR 2.10
 (Expenses:Car:Mileage) = 11 km
 Assets:Wallet  


Jostein

-- 

--- 
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: Any way to reference an account outside of current "apply account" scope?

2018-03-06 Thread Jostein Berntsen
On 06.03.18,00:47, Rick Mann wrote:
> If I have `apply account foo` in effect in a transaction, is there any way to 
> reference another account `bar` next to or above `foo`, short of ending the 
> apply?
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 

Could you give an example from your dat file on how your entries look 
here?


Jostein

-- 

--- 
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: Multiple journal files?

2018-03-06 Thread Jostein Berntsen
On 05.03.18,23:59, Rick Mann wrote:
> I'd like to use Ledger to keep track of both my personal and LLC finances. 
> But I'm frequently moving money between them (usually personal into the 
> LLC), and I'm weighing the pros and cons of keeping them all in one 
> journal, so that I don't have to duplicate the transactions between them.
> 
> Ideally, I could do this with two journal files, one for personal and one 
> for the LLC, and have it read in both files each time I run ledger. But I 
> don't seem to be able to specify multiple files.
> 
> I'd like to do the same to break up journal files into years or even 
> months, so they don't grow too large.
> 
> Is that possible?
> 

This article gives some input on how to do this:

https://felixcrux.com/blog/ledger-practices-separate-your-journals


Jostein

-- 

--- 
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: Automated transactions with parantheses inside regex

2018-02-28 Thread Jostein Berntsen
On 28.02.18,05:26, Radoslaw Jurga wrote:
> Hi. I'm trying to do some automated transactions using the following regex:
> 
> /^Assets:(?=Livret A|LinXea)/
> >
> 
> The expression I would like to get to work is 
> 
> = expr account =~ /^Assets:(?=Livret A|LinXea)/ and amount > 0.0
> >
> 
> However this gives the following error:
> 
> While parsing value expression:
> >   account =~ /^Assets:(?=Livret A|LinXea
> >
> > While parsing automated transaction:
> > > = expr account =~ /^Assets:(?=Livret A|LinXea)/ and amount > 0.0
> > Error: Missing '/' 
> >
> 
> Here are alternatives that work, but do not achieve what I am looking to do:
> 
> = expr account =~ /^Assets:Livret A/ and amount > 0.0
> >
> This only triggers for one of the accounts. 
>  
> 
> > = /^Assets:(?=Livret A|LinXea)/
> 
> This does not trigger for positive amounts only, but for negative too.
> 
> I guess I can split it up in two automated transactions with each a simpler 
> regex. But I would like to see if there is a better solution?
> 

Will this expression work for you?

= expr account =~ /^Assets:?=Livret A or ^Assets:LinXea/ and amount > 0.0


Jostein

-- 

--- 
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: Virtual postings and balance assertion

2018-02-26 Thread Jostein Berntsen
On 26.02.18,16:43, Ryan Nowakowski wrote:
> I'm not sure how virtual postings and balance assertions are supposed to
> work together.  Here's my sample ledger file without virtual postings:
> 
> 2018/2/25 Initial balance
> Assets  $100
> Equity
> 
> 2018/2/26 Buy something
> Assets  $-10
> Expenses
> 
> 2018/2/26 Balance assertion
> Assets  $0 = $90
> 
> Running: ledger -f test.dat bal
> ...works as expected:
> 
>  $90  Assets
>$-100  Equity
>  $10  Expenses
> 
>0
> 
> Then the same ledger file with an additional virtual posting transaction:
> 
> 2018/2/25 Initial balance
> Assets  $100
> Equity
> 
> 2018/2/26 Buy something
> Assets  $-10
> Expenses
> 
> 2018/2/26 virtual stuff
>[Assets]$-10
>[Expenses]
> 
> 2018/2/26 Balance assertion
> Assets  $0 = $90
> 
> 
> When I run: ledger -f test.dat bal
> 
> While parsing file "/tmp/test.dat", line 14:
> While parsing posting:
>   Assets  $0 = $90
>   ^^^
> Error: Balance assertion off by $10 (expected to see $80)
> 
> ...which seems ok since the virtual posting should make the balance $80
> instead of $90.  However if I use --real I'd expect the balance
> assertion to succeed: ledger -f test.dat bal --real
> 
> But it doesn't:
> 
> 
> While parsing file "/tmp/test.dat", line 14:
> While parsing posting:
>   Assets  $0 = $90
>   ^^^
> Error: Balance assertion off by $10 (expected to see $80)
> 
> Is my expectation incorrect here?  Is there any documentation on how
> virtual postings and balance assertion are supposed to interact?
> 

This works in my ledger setup with version 3.1.1, both with an without 
--real.  Which version are you using?


Jostein

-- 

--- 
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: Scheduled Transactions

2018-02-25 Thread Jostein Berntsen
On 25.02.18,13:34, Jostein Berntsen wrote:
> Some more in this in a previous thread:
> 
> https://groups.google.com/forum/#!topic/ledger-cli/MZwjYEp2rjU
> 

This functionality would be useful to have in ledger cli as well. 

Jostein


> 
> On 25.02.18,19:38, Matt Graham wrote:
> > Thank you! I had completely missed the emacs part. I have been using ledger 
> > just in the windows command prompt.
> > 
> > Thanks and regards,
> > 
> > Matt
> > 
> > From: Ismael Bouya
> > Sent: Sunday, 25 February 2018 7:35 PM
> > To: ledger-cli@googlegroups.com
> > Subject: Re: Scheduled Transactions
> > 
> > (Sun, Feb 25, 2018 at 07:31:46PM +1100) Matt Graham :
> > > Definitely missed that...
> > > So I should crate a file that only has that scheduled transaction in it? 
> > > Unfortunately this produced the same error (now on line 2)...
> > > 
> > > >From re-reading that passage of the manual about 4 times, my 
> > > >understanding is that I should have a file with scheduled transactions 
> > > >in it, and then a different file with my normal transactions (and 
> > > >automated transactions in it). You then use -f twice to specify both 
> > > >files.
> > > 
> > >  Is that the correct interpretation?
> > 
> > No, you have your regular transactions in the main file, scheduled
> > transactions in another, and then in emacs (you’re in the ledger-mode
> > documentation) you need to setup the schedule file:
> > (setq ledger-schedule-file "~/ledger-scheduled")
> > and *while editing the main file*, you hit C-c C-u and the scheduled
> > version will pop with the dates correctly formatted and ready to copy to
> > the main file.
> > 
> > So the scheduled transaction is handled by emacs and not at all by
> > ledger.
> > 
> > -- 
> > Ismael
> > 
> > -- 
> > 
> > --- 
> > You received this message because you are subscribed to a topic in the 
> > Google Groups "Ledger" group.
> > To unsubscribe from this topic, visit 
> > https://groups.google.com/d/topic/ledger-cli/MDntkMrUkc8/unsubscribe.
> > To unsubscribe from this group and all its topics, 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.
> 
> -- 
> 
> --- 
> 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: Scheduled Transactions

2018-02-25 Thread Jostein Berntsen
Some more in this in a previous thread:

https://groups.google.com/forum/#!topic/ledger-cli/MZwjYEp2rjU

Jostein

On 25.02.18,19:38, Matt Graham wrote:
> Thank you! I had completely missed the emacs part. I have been using ledger 
> just in the windows command prompt.
> 
> Thanks and regards,
> 
> Matt
> 
> From: Ismael Bouya
> Sent: Sunday, 25 February 2018 7:35 PM
> To: ledger-cli@googlegroups.com
> Subject: Re: Scheduled Transactions
> 
> (Sun, Feb 25, 2018 at 07:31:46PM +1100) Matt Graham :
> > Definitely missed that...
> > So I should crate a file that only has that scheduled transaction in it? 
> > Unfortunately this produced the same error (now on line 2)...
> > 
> > >From re-reading that passage of the manual about 4 times, my understanding 
> > >is that I should have a file with scheduled transactions in it, and then a 
> > >different file with my normal transactions (and automated transactions in 
> > >it). You then use -f twice to specify both files.
> > 
> >  Is that the correct interpretation?
> 
> No, you have your regular transactions in the main file, scheduled
> transactions in another, and then in emacs (you’re in the ledger-mode
> documentation) you need to setup the schedule file:
> (setq ledger-schedule-file "~/ledger-scheduled")
> and *while editing the main file*, you hit C-c C-u and the scheduled
> version will pop with the dates correctly formatted and ready to copy to
> the main file.
> 
> So the scheduled transaction is handled by emacs and not at all by
> ledger.
> 
> -- 
> Ismael
> 
> -- 
> 
> --- 
> You received this message because you are subscribed to a topic in the Google 
> Groups "Ledger" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/ledger-cli/MDntkMrUkc8/unsubscribe.
> To unsubscribe from this group and all its topics, 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.

-- 

--- 
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: Ledger tabular report

2018-02-25 Thread Jostein Berntsen
On 20.02.18,22:04, Scott Carpenter wrote:
> My ledgerbil python program is somewhat limited to my own usage, but I'm 
> pleased with this "grid" report:
> 
> $ ledgerbil grid expenses
>   2017  
> 2018 total
> expenses: car: gas  $ 0.00   $ 
> 17.37   $ 17.37
> expenses: car: maintenance  $ 0.00$ 
> 6.50$ 6.50
> expenses: food: dining out  $ 0.00   $ 
> 42.17   $ 42.17
> expenses: food: groceries  $ 34.63   $ 
> 57.40   $ 92.03
> expenses: healthcare: medical insurance   $ 463.78$ 
> 0.00  $ 463.78
> expenses: home: stuff: in  $ 10.00$ 
> 0.00   $ 10.00
> expenses: taxes: federal  $ 342.92$ 
> 0.00  $ 342.92
> expenses: taxes: medicare  $ 60.90$ 
> 0.00   $ 60.90
> expenses: taxes: social security  $ 260.40$ 
> 0.00  $ 260.40
> expenses: taxes: state$ 253.32$ 
> 0.00  $ 253.32
>     
>   
> $ 1,425.95  $ 
> 123.44$ 1,549.39
> 
> https://github.com/scarpent/ledgerbil/blob/master/ledgerbil/ledgershell/grid.py
> 

This looks very nice. Do you have examples for other use cases for your 
ledgerbil program like the sort feature? 


Jostein



-- 

--- 
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: Scheduled Transactions

2018-02-25 Thread Jostein Berntsen
On 25.02.18,00:04, matt.graham2...@gmail.com wrote:
> Forgot to add the file. Here it is.
> 
> Matt

It works if you remove the brackets from the date in line 9 and set a 
real date like 2018/01/01.


Jostein


> 
> On Sunday, February 25, 2018 at 7:03:39 PM UTC+11, matt.gr...@gmail.com 
> wrote:
> >
> > Hello!
> >
> > I'm trying to test scheduled transactions as shown in the manual: 
> > https://www.ledger-cli.org/3.0/doc/ledger-mode.html#Scheduling-Transactions
> >
> > My test file is attached.
> >
> > For some reason, it keeps telling me that it has unexpected whitespace at 
> > the line below the scheduled transaction's date (currently line 10, but 
> > that moves if I move the scheduled transaction around).
> >
> > I have double, triple, and quadruple checked for any whitespace out of 
> > place...
> > Deleting the square brackets and changing it to a valid date removes the 
> > error and the file processes as you would expect.
> >
> > Googling, I can't seem to find anything about this error, or about 
> > scheduled transactions not working for others.
> >
> > Anyone know what is going on here?
> >
> > Thanks,
> > Matt
> >
> 
> -- 
> 
> --- 
> 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.

> ;ALWAYS IMPORT THE BUDGET FILE IN BEFORE THE TX FILE. THE AUTOMATED STUFF IS 
> RUN BEFORE THE OTHER
> ;FILE IS PROCESSED, SO THE AUTOMATIONS WONT HAPPEN IF YOU GO THE OTHER WAY.
> 
> = /^Expenses:/
>   * [Budget:$account] -1.0
>   * [Assets:Budgeted Money]   1.0
> 
> ;Try a scheduled Transaction
> [2018/*/1]BudgetAllocation
>   [Budget:Expenses:Food]  $100
>   [Assets:Budgeted Money]
> 
> 2018/01/01 * Opening Balance
>   Assets:Fake Account $1000
>   Equity:Opening Balance
> 
> 2018/01/02 * Fake KFC
>   Expenses:Food   $50
>   Assets:Fake Account
> 
> 2018/01/10 * "Fake McDonalds"
>   Expenses:Food   $10
>   Assets:Fake Account
> 
> 2018/02/05 * Fake KFC
>   Expenses:Food   $50
>   Assets:Fake Account
> 
> 2018/03/10 * Fake KFC
>   Expenses:Food   $50
>   Assets:Fake Account
> 

-- 

--- 
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: --collapse behavior

2018-02-19 Thread Jostein Berntsen
On 19.02.18,06:47, Scott Carpenter wrote:
> Thank you, Jostein. I don't  have a ~/.ledgerrc file but created an empty 
> one. Any suggested settings?
> 

Here is my ledgerrc settings:

--file ~/ledger/jbfinans-2018.dat
--pager more
--no-color
--empty
--wide
--date-format=%Y-%m-%d
LEDGER_BASE_CURRENCY: NOK
LEDGER_PRICE_DATE_FORMAT: %Y-%m-%d


Jostein


> Experimenting a bit more, if I add other other commodities, e.g. this entry:
> 
> 2017/11/15 zombie investments
> a: 401k: big co 500 idx 1.745 abcdx @  
>  $81.23
> a: 401k: bonds idx  2.357 lmnop @  
>  $20.05
> a: 401k: cash   $-189
> 
> Then I get output for --collapse, but only for that entry.
> 
> 17-Nov-15 zombie investments$-189.00
> 1.745 abcdx
> 2.357 lmnop
>  $-189.00
>  1.745 
> abcdx
>  2.357 
> lmnop
> 
> I get other stuff if specifying `reg '^e'`:
> 
> 17-Nov-01 food and stuff  $32.87  
>  $32.87
> 17-Dec-05 food and stuffe: food: groceries   $11.76  
>  $44.63
> 18-Jan-03 gas n go$23.87  
>  $68.50
> 18-Jan-05 food and stuffe: food: groceries   $57.40  
> $125.90
> 
> Thanks again. For my purposes this isn't really getting in the way but 
> would be good to understand why this happens. (Especially if ledger is 
> reporting incorrectly.)
> 
> 
> 
> On Monday, February 19, 2018 at 8:01:09 AM UTC-6, Jostein Berntsen wrote:
> >
> > On 18.02.18,10:26, Scott Carpenter wrote: 
> > > Trying to use --collapse and it comes up empty on this data set: 
> > > 
> > > 2017/11/01 food and stuff 
> > > e: food: groceries 
> > > e: home: stuff: in  $10 
> > > l: credit card: mega$-32.87 
> > > 
> > > 2017/12/05 food and stuff 
> > > e: food: groceries 
> > > a: checking out $-11.76 
> > > 
> > > 2018/01/03 gas n go 
> > > e: car: gas 
> > > e: car: maintenance $6.5 
> > > l: credit card: mega$-23.87 
> > > 
> > > 2018/01/05 food and stuff 
> > > e: food: groceries 
> > > l: credit card: mega$-57.4 
> > > 
> > > 
> > > Running: ledger -f  reg --collapse 
> > > 
> > > (Wanting to run it with --yearly, but empty either way when --collapse 
> > is 
> > > added.) 
> > > 
> > > Works as expected with a larger "real" dataset. 
> > > 
> > > Any ideas or wisdom? Thank you! 
> > > 
> >
> > It seems to work correctly with the bal and --collapse command, but not 
> > with reg and --collapse. 
> >
> > Another similar thread from previously: 
> >
> > https://groups.google.com/forum/#!msg/ledger-cli/zwGRSJO376s/XpBUQbbmBAAJ 
> >
> > Can you check your ledgerrc settings, or copy one to ~ if you have no rc 
> > file? 
> >
> >
> >
> > Jostein 
> >
> >
> 
> -- 
> 
> --- 
> 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: --collapse behavior

2018-02-19 Thread Jostein Berntsen
On 18.02.18,10:26, Scott Carpenter wrote:
> Trying to use --collapse and it comes up empty on this data set:
> 
> 2017/11/01 food and stuff
> e: food: groceries
> e: home: stuff: in  $10
> l: credit card: mega$-32.87
> 
> 2017/12/05 food and stuff
> e: food: groceries
> a: checking out $-11.76
> 
> 2018/01/03 gas n go
> e: car: gas
> e: car: maintenance $6.5
> l: credit card: mega$-23.87
> 
> 2018/01/05 food and stuff
> e: food: groceries
> l: credit card: mega$-57.4
> 
> 
> Running: ledger -f  reg --collapse 
> 
> (Wanting to run it with --yearly, but empty either way when --collapse is 
> added.)
> 
> Works as expected with a larger "real" dataset.
> 
> Any ideas or wisdom? Thank you!
> 

It seems to work correctly with the bal and --collapse command, but not 
with reg and --collapse. 

Another similar thread from previously:

https://groups.google.com/forum/#!msg/ledger-cli/zwGRSJO376s/XpBUQbbmBAAJ

Can you check your ledgerrc settings, or copy one to ~ if you have no rc 
file?



Jostein

-- 

--- 
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: Future budgets ignored in time-limited forecasting?

2018-01-27 Thread Jostein Berntsen
On 08.12.17,11:54, Colin Dean wrote:
> I'm trying to capture budgets that change over time. It may start with 
> simply a ~ Monthly transaction but, over time, I want to "retire" old 
> budget amounts as well as document future budget changes, e.g. stepped 
> payment plans on rent, student loans, etc.
> 
> I had something like this in test.ledger, but ended up reducing it down to 
> just this when I found that my future budgets were simply ignored:
> 
> ~ Monthly
>   Expenses:Rent:Office700.00 USD
>   Assets
> 
> ~ Monthly from 2018-01-01
>   Expenses:Rent:Expansion 2100.00 USD
>   Assets
> 
> ~ Monthly from 2019-07-01
>   Expenses:Rent:Expansion 500.00 USD
>   Assets
> 
> ~ Monthly from 2020-02-01
>   Expenses:Rent:Expansion 500.00 USD
>   Assets
> 
> When I run 
> 
> ledger -f test.ledger --forecast "d<[2021-02-01]" register 
> 
> I expect to see a 700.00 USD transaction for December 2017, a 2800.00 USD 
> transaction (or total) for January 2018, 3300.00 USD total starting July 
> 2019, and so on. Instead, I only see the result of the first budget 
> transaction, the 700.00 USD monthly.
> 
>  https://groups.google.com/forum/#!topic/ledger-cli/nu5t9dFOOH4 led me to 
> believe that I need to actually include some transactions with the account 
> in order to make it appear. I ditched the second account and made some 
> other changes, such as setting explicit dates on the budget items:
> 
> ~ Monthly until 2021-02-28
>   Expenses:Rent:Office700.00 USD
>   Assets
> 
> ~ Monthly from 2018-01-01 until 2021-02-28
>   Expenses:Rent:Office 2100.00 USD
>   Assets
> 
> ~ Monthly from 2019-07-01 until 2021-02-28
>   Expenses:Rent:Office 500.00 USD
>   Assets
> 
> ~ Monthly from 2020-02-01 until 2021-02-28
>   Expenses:Rent:Office 500.00 USD
>   Assets
> 
> 2017-12-01 Rent
>   Expenses:Rent:Office700.00 USD
>   Expenses:Rent:Expansion   0.00 USD
>   Assets
> 
> but ledger still disregards the other monthly budget transactions when 
> executing the same command,
> 
> ledger -f test.ledger --forecast "d<[2021-02-01]" register 
> 
> What am I doing wrong? This is a powerful feature that I know I've probably 
> got something slightly off.
> 
> Here's an example output appending --yearly --columns 80 to the above in 
> order to keep this message a little shorter.
> 
> 17-Jan-01 - 17-Dec-31   Assets  -700.00 USD  
> -700.00 USD
> Expenses:Rent:Office 700.00 USD
> 0
> 18-Jan-01 - 18-Dec-31   Assets -8400.00 USD 
> -8400.00 USD
> Expenses:Rent:Office8400.00 USD
> 0
> 19-Jan-01 - 19-Dec-31   Assets -8400.00 USD 
> -8400.00 USD
> Expenses:Rent:Office8400.00 USD
> 0
> 20-Jan-01 - 20-Dec-31   Assets -8400.00 USD 
> -8400.00 USD
> Expenses:Rent:Office8400.00 USD
> 0
> 21-Jan-01 - 21-Dec-31   Assets -1400.00 USD 
> -1400.00 USD
> Expenses:Rent:Office1400.00 USD
> 0
> 
> 2017 is correct but 2018 should be 33600.00 USD, 2019 should be 36600.00 
> USD, 2020 should be 37200.00 USD, and 2021 should be 6200.00 USD.
> 
> If I add something like this *after* the first budget transaction:
> 
> ~ Monthly
>   Expenses:Accountant999.00 USD
>   Assets
> 
> It will show up in the forecast. If I put a *from* or *since *date spec on 
> the budget transaction, it won't. If I put an *until *or* to *on it, it 
> does get included.
> 
> What's up here? Did I find a bug or am I doing something wrong?
> 

Did you find out more on this one? Would be interesting to know the 
solution here.

Jostein

-- 

--- 
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: Floating point exception on future entry

2018-01-23 Thread Jostein Berntsen
On 23.01.18,19:15, Jostein Berntsen wrote:
> On 22.01.18,18: 15, John Wiegley wrote:
> > >>>>> "JB" == Jostein Berntsen <jber...@broadpark.no> writes:
> 
> > 
> > JB> It seems like bugs.ledger-cli.org is not working. Would it be useful to
> > JB> activate the issues feature at the ledger github site so bugs can be
> > JB> reported and tracked? Now it seems it's only active for pull requests.
> > 
> > OK, issues are enabled.
> > 
> > We have over a 1,000 issues still stuck in the MySQL dump from
> > bugs.ledger-cli.org. I wonder if anyone would be willing to help extract
> > details from the important ones? I'm fine with ditching Bugzilla.
> > 
> 
> Thanks. One possible way could be to create an XLM dump of the most 
> actual bugs from the bugzilla DB and use this script to import all 
> issues to github?
> 
> https://github.com/rowanj/BugzillaMigrate
> 
> 

Another recent article:

Notes on successfully migrating 4900 bug reports from Bugzilla to GitHub 
issues - Théo Zimmermann

https://www.theozimmermann.net/2017/10/bugzilla-to-github/


Jostein


-- 

--- 
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: Floating point exception on future entry

2018-01-22 Thread Jostein Berntsen
On 22.01.18,07:00, Rob Napier wrote:
> The following ledger file generates a floating point exception on the 
> following command:
> 
> *x.ledger*
> 
> 2018/01/19 * Transfer to X  ; Date in the past
> Transfer:X   $1000
> Assets:Checking
> 
> 
> 2018/01/23 Transfer to Y  ; Date in the future
> Transfer:Y   $1000
> Assets:Checking
> 
> 
> *command*
> ledger -f x.ledger --no-pager -X $ reg assets
> Floating point exception: 8
> 
> This crash occurs when the final transaction is in the future (so this 
> is run on Jan 22).
> 
> * Adding --current will avoid the crash.
> * Removing "assets" will avoid the crash.
> * Removing -X $ will avoid the crash
> * Removing the first entry will avoid the crash
> 
> I can't find http://bugs.ledger-cli.org. Has it been taken down?
> 

It seems like bugs.ledger-cli.org is not working. Would it be useful to 
activate the issues feature at the ledger github site so bugs can be 
reported and tracked? Now it seems it's only active for pull requests.


Jostein

-- 

--- 
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: Forecast balance

2017-10-03 Thread Jostein Berntsen
On 03.10.17,11:46, Artyom Boyko wrote:
> Hi!
> 
> I have example journal like this
> 
> ~ Monthly
>   Expenses:Food$50.00
>   Assets
> 
> 
> ~ Monthly
> Assets $300
> Income:Salary
> 
> 
> 2009/11/01 Sample
>   Expenses:Food:Coffee $1.00
>   Assets
> 
> 
> I'm trying to forecast my balance in the future. When I'm doing command 
> like this
> 
> ledger -f example.dat --forecast "d<[2018/05/01]" register
> 
> 
> Everything works perfectly. I can see future transactions. But If I'm doing 
> this:
> 
> ledger -f example.dat --forecast "d<[2018/05/01]" balance
> 
> 
>$14999.00  Assets
> $3001.00  Expenses:Food
>$1.00Coffee
>   $-18000.00  Income:Salary
> 
>0
> 
> 
> And no matter what I do, I can't change the date of my future balance.
> 

>From the ledger manual it says this on using forecasting with balance:

2.9.2 Forecasting

Sometimes it's useful to know what your finances will look like in the 
future, such as determining when an account will reach zero. Ledger 
makes this easy to do, using the same period entries as are used for 
budgeting. An example forecast report can be generated with:

 ledger --forecast "T>{\$-500.00}" register ^assets ^liabilities

This report continues outputting transactions until the running 
total is greater than $-500.00. A final transaction is always 
output, to show you what the total afterwards would be.

Forecasting can also be used with the balance report, but by date 
only, and not against the running total:

ledger --forecast "d<[2010]" bal ^assets ^liabilities


Jostein

-- 

--- 
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: Forecast balance

2017-10-03 Thread Jostein Berntsen
On 03.10.17,11:46, Artyom Boyko wrote:
> Hi!
> 
> I have example journal like this
> 
> ~ Monthly
>   Expenses:Food$50.00
>   Assets
> 
> 
> ~ Monthly
> Assets $300
> Income:Salary
> 
> 
> 2009/11/01 Sample
>   Expenses:Food:Coffee $1.00
>   Assets
> 
> 
> I'm trying to forecast my balance in the future. When I'm doing command 
> like this
> 
> ledger -f example.dat --forecast "d<[2018/05/01]" register
> 
> 
> Everything works perfectly. I can see future transactions. But If I'm doing 
> this:
> 
> ledger -f example.dat --forecast "d<[2018/05/01]" balance
> 
> 
>$14999.00  Assets
> $3001.00  Expenses:Food
>$1.00Coffee
>   $-18000.00  Income:Salary
> 
>0
> 
> 
> And no matter what I do, I can't change the date of my future balance.
> 

>From the ledger manual it says this on using forecasting with balance:

2.9.2 Forecasting

Sometimes it's useful to know what your finances will look like in the 
future, such as determining when an account will reach zero. Ledger 
makes this easy to do, using the same period entries as are used for 
budgeting. An example forecast report can be generated with:

 ledger --forecast "T>{\$-500.00}" register ^assets ^liabilities

This report continues outputting transactions until the running 
total is greater than $-500.00. A final transaction is always 
output, to show you what the total afterwards would be.

Forecasting can also be used with the balance report, but by date 
only, and not against the running total:

ledger --forecast "d<[2010]" bal ^assets ^liabilities


Jostein

-- 

--- 
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: Can I specify a default currency?

2017-05-29 Thread Jostein Berntsen

On 29.05.17,07:08, Klauss Hass wrote:

As far as I know this is possible on hledger and beancountw, on Ledger it's
not possible.

On May 28, 2017 21:10, "Peter McArthur"  wrote:


Is there a way to set a default currency / commodity? Something like this:

year 2017
currency £

05/29 Asda
  ; No commodity / currency specified, so default to £
  expenses:groceries   -5.37
  liabilities:credit card   5.37

(Typing £ signs on a Japanese keyboard gets old fast.)

The D directive does something similar to what I want, but it only affects
xact transactions.



There was a thread on this from some time back:

https://groups.google.com/forum/#!topic/ledger-cli/MojlS_l3xxU


Jostein

--

--- 
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: Resetting a balance is illegal?

2016-05-21 Thread Jostein Berntsen

On 20.05.16,07:45, Adrian Whitfield wrote:

Hi can I bump this topic please?

The error seems to be deeper than the OP's example case.  Consider my
attached file.

The error occurs when the *difference* between the actual and the reset
balance is zero.  In the attached file the resetting transaction is equal
to the actual balance at that point (-300 P).

This presents a problem for my use case.  I am trading currencies and my
ledger file is built automatically.  I was hoping to end the file with the
current broker balances of these currencies and adjusting any differences
into broker fees, which aren't reported in my transactions currently.

Can someone please revisit this and perhaps report it as a bug (unless
there's a good work around that is).  Bugzilla isn't allowing me to login
or register for some reason.



Might be a bug?

https://groups.google.com/forum/#!topic/ledger-cli/84Af4QA5MFA


Jostein

--

--- 
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: Problem with compiling Ledger on Arch Linux

2016-05-12 Thread Jostein Berntsen

On 12.05.16,21:00, Marcin Borkowski wrote:

Hi everybody,

I tried to compile Ledger on newly installed Arch Linux, but I couldn't.
./acprep dependencies says:

acprep: INFO: Invoking primary phase: dependencies
acprep: INFO: Executing phase: dependencies
acprep: INFO: Installing Ledger's build dependencies ...


And ./acprep make gives this:

acprep: INFO: Invoking primary phase: make
acprep: INFO: Executing phase: make
acprep: INFO: Executing phase: config
acprep: INFO: Executing phase: configure
acprep: INFO: System type is => Linux
acprep: INFO: Setting up build flavor => debug
[  1%] Generating ../system.hh.gch
In file included from /usr/include/c++/6.1.1/bits/stl_algo.h:59:0,
from /usr/include/c++/6.1.1/algorithm:62,
from /home/mbork/others-works/ledger/system.hh:90:
/usr/include/c++/6.1.1/cstdlib:75:25: fatal error: stdlib.h: No such file
or directory
#include_next 
^
compilation terminated.
src/CMakeFiles/libledger.dir/build.make:61: recipe for target
'system.hh.gch' failed
make[2]: *** [system.hh.gch] Error 1
CMakeFiles/Makefile2:124: recipe for target
'src/CMakeFiles/libledger.dir/all' failed
make[1]: *** [src/CMakeFiles/libledger.dir/all] Error 2
Makefile:160: recipe for target 'all' failed
make: *** [all] Error 2
acprep: ERROR: Execution failed: make


Any hints?

Best,



Can you run "./acprep update" instead?


Jostein

--

--- 
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: Automated transaction and account balance assertion

2016-05-03 Thread Jostein Berntsen

On 03.05.16,03:34, Sébastien Gross wrote:

Hi Jostein,

Yes I tried something like:

--8<--
2016/03/31 * Bob
   Assets:Bank:Invests:Plan 100.00 EUR
   Equity:Invests:Plan-100.00 EUR
--8<--

Event I tried:
--8<--

2016/03/31 * Bob
   Assets:Bank:Invests:Plan 100.00 EUR =291.00 EUR
   Equity:Invests:Plan-100.00 EUR
--8<--

But still this does not work, following error is yield:

--8<--
While parsing posting:
 Assets:Bank:Invests:Plan 100.00 EUR =291.00 EUR
  ^^
Error: Balance assertion off by -9.00 EUR (expected to see 200.00 EUR)
--8<--

The following ledger file works:

--8<--

= /^(?:Assets:Bank:Invests:Plan$)/ and not %/^noauto$/ and expr date >=
[2016/01/01]
   $account-1
   $account  0.97
   Expenses:Bank:Invests:Plan0.03


2016/01/31 * Bob
   Assets:Bank:Invests:Plan 100.00 EUR
   Equity:Invests:Plan -100.00 EUR

2016/02/29 * Bob
   Assets:Bank:Invests:Plan 100.00 EUR
   Equity:Invests:Plan-100.00 EUR

2016/03/31 * Bob
   Assets:Bank:Invests:Plan 100.00 EUR = 200.00 EUR   ;; The
assertion is ALSO correct with 100.00 EUR = 300.00 EUR  How can this be
correct?
   Equity:Invests:Plan-100.00 EUR
--8<--

But this is an error since on March 31st the  Assets:Bank:Invests:Plan IS
291,00 EUR not 200 EUR neither 300 EUR.



My assumption is that ledger does the following:
- Read the file
- computes all accounts and run assertion BEFORE and AFTER account is
modified, yield and error if either one or the other assertion failed.
- apply automated xacts.

BTW I use Ledger 3.1.1-20160111, the command-line accounting tool brew
version on macosx.



There is a similar thead on this from February this year. Seems to be a bug:

https://groups.google.com/forum/#!topic/ledger-cli/OHTX8fNkteM

Jostein

--

--- 
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: Automated transaction and account balance assertion

2016-05-02 Thread Jostein Berntsen

On 26.04.16,08:08, Sébastien Gross wrote:

Hi,

Every months I put some money (100 EUR) on a saving account. My bank is
charging 3% for that.

My ledger file looks like:

--8<--
#!/usr/bin/env ledger -f

= /^(?:Assets:Bank:Invests:Plan$)/ and not %/^noauto$/ and expr date >=
[2016/01/01]
   $account-1
   $account  0.97
   Expenses:Bank:Invests:Plan0.03


2016/01/31 * Bob
   Assets:Bank:Invests:Plan 100.00 EUR
   Equity:Invests:Plan

2016/02/29 * Bob
   Assets:Bank:Invests:Plan 100.00 EUR
   Equity:Invests:Plan

2016/03/31 * Bob
   Assets:Bank:Invests:Plan 100.00 EUR
   Equity:Invests:Plan

--8<--

The balance is correct:

./automated-bug.ledger bal -E
 291.00 EUR  Assets:Bank:Invests:Plan
-300.00 EUR  Equity:Invests:Plan
   9.00 EUR  Expenses:Bank:Invests:Plan

  0


Now I want to add some assertion to reconcile against my bank statements:

--8<--
2016/04/01 * Check Invest total
   ; ;noauto;
   (Assets:Bank:Invests:Plan) 0 EUR = 291EUR

--8<--

Now it yields:

While parsing posting:
 (Assets:Bank:Invests:Plan) 0 EUR = 291EUR
^^
Error: Balance assertion off by -9.00 EUR (expected to see 300.00 EUR)


It seems that the balance assertion is done BEFORE any of the automated
transaction are done. Is there a way Am I missing something here?



Have you tried entering this like in the manual to check if that works
better?

2012-03-10 KFC
   Expenses:Food$20.00
   Assets:Cash $-20.00 = $500.00


Jostein

--

--- 
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: Using ledger for shared expenses

2016-04-21 Thread Jostein Berntsen

On 19.04.16,07:52, Sébastien Gross wrote:

Hi there,

This might be an ultra-classic use-case of ledger here I am facing.

Let's plot the scene:


- They have their own bank account (Alice and Bob) and a Join account

- Alice and Bob rent a flat ($1500/mo), which for some reasons is paid
 by Bob from his own account (not for the Join one).

- Every month Alice wires half the rent ($750) to Bob's checking account
- Every month wire the rent to the owner


For clean readability I always use the following scheme:
 (Assets|Income|Expenses|Liabilities|Equity):(Alice|Bob|Join):Account


I assume the following opening balances:

 2016/01/01 * Opening balance
 Assets:Bob:Bank:Checking$12345
 Equity:Bob:Bank:Checking

 2016/01/01 * Opening balance
 Assets:Join:Bank:Checking $123
 Equity:Join:Bank:Checking


This can be written as follow:


 2016/01/01 Alice
 Assets:Bob:Bank:Checking  $750
 Income:Bob:Alice:Rent

 2016/01/01 Owner
 Assets:Bob:Bank:Checking
 Expenses:Bob:Rent$1500

The balance is then:

 $ ./test.ledger bal
   $11718  Assets
   $11595Bob:Bank:Checking
 $123Join:Bank:Checking
  $-12468  Equity
  $-12345Bob:Bank:Checking
$-123Join:Bank:Checking
$1500  Expenses:Bob:Rent
$-750  Income:Bob:Alice:Rent
 
0

This is good and works fine but hides a few things:

a) Who pays the rent
b) If Alice made a mistake in the wire there is no way to check it
c) An extra income is shown for Bob which should disappear after bob
  paid the rent


I would do this:

Make a separate file for each of the accounts including join with their
own euqity, assests, liabilities setup. Ledger can query all these as
one file. Then when Alice transfers money to Bob from her account it
should be visible as an Expense in her account. Then also use tags for
the transfers to describe what happens, like for Bob:

; Rent: Transfer from Alice March 2016

You can then separate what you need in your queries. 


Jostein

--

--- 
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: ledgible: a web interface for ledger-cli (with data entry!)

2016-04-18 Thread Jostein Berntsen

On 18.04.16,04:32, Ankur Kothari wrote:

On Monday, 18 April 2016 15:40:17 UTC+10, Jostein Berntsen wrote:


How to use app.py in the CGI setup.



You configure your web server to execute the app.py file. It depends on
which server you decide to use since they all have different configuration.
Do you have a particular web server that you want to use?

As an example, using lighttpd you might add something to it's configuration
like:

server.modules += ( "mod_cgi" )
cgi.assign = ( ".py"  => "/usr/bin/python2" )



Thanks. I was checking out the nginx server here. It seems like there
was something wrong with the FastCGI installation so I will check that.

Jostin

--

--- 
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: ledgible: a web interface for ledger-cli (with data entry!)

2016-04-17 Thread Jostein Berntsen

On 17.04.16,16:56, Ankur Kothari wrote:


On Monday, 18 April 2016 08:10:18 UTC+10, Jostein Berntsen wrote:



This looks interesting. Do you have some more details on how to set it up?



The necessary steps are in the "Installation" section in
<https://github.com/lipidity/ledgible>

Which part would you like more details about?



How to use app.py in the CGI setup. 



Jostein

--

--- 
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: ledgible: a web interface for ledger-cli (with data entry!)

2016-04-17 Thread Jostein Berntsen

On 10.03.16,01:03, Ankur Kothari wrote:


John Wiegley wrote:

Very cool!  Thanks for sharing that, I enjoyed seeing it.


Thanks for making ledger :)



This looks interesting. Do you have some more details on how to set it up?

Jostein

--

--- 
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: Getting Started With Ledger - a free (upcoming) introductory book on Ledger

2016-04-14 Thread Jostein Berntsen

On 07.02.16,10:35, Rolf Schröder wrote:

Dear All,

I've had far more people contacting me than expected! I was happy to get
some positive feedback, too.
The book is now online and available for everyone to download from here:

https://github.com/rolfschr/GSWL-book

I'll hope you enjoy it :)

Best,
Rolf


This book is very good. It's useful to have this documenation of
ledger presented in an easy to read format. Should it be linked to from
http://www.ledger-cli.org/ and https://github.com/ledger/ledger/wiki?

Do you plan to add more stuff? (It's also an interesting use of date 
in chapter 3.4.1: Jan 1st 2042) :)



Jostein





On Saturday, January 23, 2016 at 8:57:19 PM UTC+1, Rolf Schröder wrote:


Dear All,

my 2015's resolution was to write a small book about Ledger that I call
"Getting Started With Ledger". The book is an introduction to Ledger's base
functionalities and also describes of my personal Ledger workflow. I have
decoupled my actual private data from the scripts/environment I use to
handle it and made the latter publicly available. This allows any new user
to use Ledger without starting from scratch. It took me quite some time to
get a polished working environment which I believe other people could take
inspiration from.

The book covers:

- The basics of (double entry) accounting.
- Installing & running basic Ledger.
- Setting up a fully automatic environment for production use.
- Integrating external data (CSV from banks etc.) into the journal.
- Generating the usual reports about one's financial situation
automatically.
- Advanced topics like automated transactions (briefly).

The book will be freely available. I would love to have some feedback
before providing it to the general public. Mainly because I would like to
make sure things work in other other environments. But of course also to
find some typos ;)

Contact me via rolf dot schr at gmail dot com and I'll send you a copy.
The code presented in the book is already available here
https://github.com/rolfschr/GSWL-ecosystem.

Best,
Rolf




--

---
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: Help understanding --budget reports

2016-04-14 Thread Jostein Berntsen

On 30.12.15,09:33, Leonardo Melo wrote:

Hi John,

I don't really know what you mean by "Jump to bottom" but I alternate
between emacs (great automation on input) and Sublime (editor I use on my
day job) for Ledger.

What I managed to do was to just include every file manually, they will
never be more than twelve anyway.

I remembered that there was an issue posted here a while ago where someone
tried to use dir/**/* to include and it was mentioned that wildcard doesn't
work really well with Ledger.

On a side note, I'm using a settings.ldgr file that I use to add my
periodic transactions and define a bucket account. Is there such a thing as
a .ledgerrc (config) file? If so, is there any documentation as to what can
I do with it to automate things a little bit? I find it a little annoying
to have to define -f /path/to/file every time I run ledger.

Thanks for the tips =D



Put something like this in a file called ~/.ledgerrc

--input-date-format %Y-%m-%d
--date-format %a %Y-%m-%d
--start-of-week monday
--wide
--file ~/Documents/Finans/ledger/project.dat
--no-pager



Jostein

--

--- 
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: Interesting uses of Ledger

2016-04-14 Thread Jostein Berntsen


On Friday, November 20, 2015 at 5:14:01 AM UTC+1, Chris Bennett wrote:
>
> Hi all, 
>
> I've started a new thread related to Andrew Maffei's query about using 
> Ledger for recording scientific data (to avoid derailing that thread). 
>
> But I've always wanted to see what others are doing with Ledger that 
> is not your standard bookkeeping/accounting. 
>
>   John Wiegley wrote: 
>   "since Ledger isn't really about accounting, after all. :)" 
>
> Personally I use Ledger for: 
>   - personal & business finance/bookkeeping 
>   - time accounting (billable hours) 
>   - Health Insurance / Fund extras tracking 
>   - Credit card reward points & conversion to gift cards etc 
>   - Daily calorie counting/recording 
>   - Comparing Energy companies annual contracts for value based on 
> average used kW-h & MJ per quarter, factoring in different prace 
> brackets for units consumed. 
>   - Pricing up & planning holidays (flights, accommodation, 
> activities) by keying in different choices in the account 
> structure for easily comparison. 
>   - Experimenting with Quantified Self practices by trying to record 
> every minute/hour/day (within reason) as time entries. 
>
> Sometimes I feel a little crazy (mis)using Ledger for some of these 
> purposes, and nobody else seems to get it, but I like it :) 
>
> So I'm curious what other interesting uses people have found for the 
> Ledger & it's variants. 
>
> Regards, 
>
> Chris 
>

I posted a Project accounting example by using ledger some time back:

https://groups.google.com/forum/#!searchin/ledger-cli/jostein$20project/ledger-cli/EoYTM8g9Kmg/IT5aGDbflRkJ

Another way I use it for in my work is to keep a separate account for my 
commuting costs to work, including expenses for lunch and related costs. 
This is useful to get an overview to plan for different periods and align 
with travel discounts and more. 

Jostein

-- 

--- 
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: Can't compile ledger on Linux Slackware

2016-02-08 Thread Jostein Berntsen

On 07.02.16,08:10, Gwenhael Le Moine wrote:

I just built the 'next' branch on the latest slackware-current with no
issue using my own SlackBuild script [
https://github.com/cycojesus/slackbuilds/blob/master/ap/ledger/ledger.SlackBuild
]



Check also this if you run Slackware Current:

http://slackblogs.blogspot.no/2016/01/help-testing-sbo-scripts-for-upcoming.html

ledger installs nicely with "sbopkg -i ledger" from the updated repo.


Jostein



2016-02-07 0:03 GMT+01:00 Ivanov Dmitry :


I downloaded the fresh source code of ledger from git.

I wanted to compile it on my Slackware machine. But seems that Boost C++
library installed on my machine is too new: 1.54.0 to compile it.

The error when I try to compile:

bash-4.2$ ./acprep update

...
[  1%] Generating ../system.hh.gch
In file included from /usr/include/boost/range/begin.hpp:24:0,
 from /usr/include/boost/algorithm/string/trim.hpp:16,
 from /usr/include/boost/algorithm/string.hpp:19,
 from /home/dima/opt/ledger/system.hh:174:
/usr/include/boost/range/iterator.hpp:19:37: fatal error:
boost/range/range_fwd.hpp: No such file or directory
compilation terminated.
make[2]: *** [system.hh.gch] Error 1
make[1]: *** [src/CMakeFiles/libledger.dir/all] Error 2
make: *** [all] Error 2


What do I need to do to compile & install the program? I don't want to
uninstall the new version - it can break other installed programs.

--

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


--

--- 
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: Can't compile ledger on Linux Slackware

2016-02-08 Thread Jostein Berntsen

On 08.02.16,08:42, Ivanov Dmitry wrote:

Tried to use 1.59 version. Got another error:

/tmp/SBo/ledger-3.1/src/item.h: In member function ‘virtual bool
ledger::item_t::has_date() const’:
/tmp/SBo/ledger-3.1/src/item.h:199:3: warning: control reaches end of
non-void function [-Wreturn-type]
make[2]: *** [src/CMakeFiles/libledger.dir/stats.cc.o] Error 1
make[1]: *** [src/CMakeFiles/libledger.dir/all] Error 2
make: *** [all] Error  
acprep: ERROR: Execution failed: make




What is the output of this command?

ls /var/log/packages/boos*

Remove your /tmp/SBo/ledger-3.1 directory by "rm -rf dir". Then close
your terminal, and open a new one and try to install ledger by sbopkg
again. Check that you have done the steps here before you install:

http://slackblogs.blogspot.no/2016/01/help-testing-sbo-scripts-for-upcoming.html


Jostein

--

--- 
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: Getting Started With Ledger - a free (upcoming) introductory book on Ledger

2016-01-26 Thread Jostein Berntsen

On 23.01.16,08:57, Rolf Schröder wrote:

Dear All,

my 2015's resolution was to write a small book about Ledger that I call
"Getting Started With Ledger". The book is an introduction to Ledger's base
functionalities and also describes of my personal Ledger workflow. I have
decoupled my actual private data from the scripts/environment I use to
handle it and made the latter publicly available. This allows any new user
to use Ledger without starting from scratch. It took me quite some time to
get a polished working environment which I believe other people could take
inspiration from.

The book covers:

- The basics of (double entry) accounting.
- Installing & running basic Ledger.
- Setting up a fully automatic environment for production use.
- Integrating external data (CSV from banks etc.) into the journal.
- Generating the usual reports about one's financial situation
automatically.
- Advanced topics like automated transactions (briefly).

The book will be freely available. I would love to have some feedback
before providing it to the general public. Mainly because I would like to
make sure things work in other other environments. But of course also to
find some typos ;)

Contact me via rolf dot schr at gmail dot com and I'll send you a copy. The
code presented in the book is already available here
https://github.com/rolfschr/GSWL-ecosystem.


Great stuff, I am also in for reviewing the book. jber...@broadpark.no

Jostein

--

--- 
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: Ledger Invoicing

2015-01-22 Thread Jostein Berntsen
On 20.01.15,15:05, Simon Michael (sm) wrote:
 ...some time passes...
 
 Hey, this is a really nice complete example of one way to generate 
 invoices. Definitely worth updating (-s obsolete ?) and presenting it 
 nicely somewhere it'll be found.
 

Could be cool to see this updated to a beta version, and maybe added to
contrib?

Jostein

 
 
 On Friday, February 6, 2009 at 9:19:58 AM UTC-8, Russell Adams wrote:
 
  I've put together a tentative method for creating invoices from
  billable hours. Included are a quick howto, chart of accounts, and a
  shell script that generates nice PDF invoices via latex using ledger
  data. A sample PDF is included.
 
  Not yet a project, just a branch:
 
  http://code.launchpad.net/~rladams/+junk/LedgerInvoicingExample
 
  This is way alpha, but I'll be tweaking it to use in my business in
  the coming months. If there is additional interest I'll see about
  rolling it into a proper project.
 
  I had some comments on IRC, yes the output is totally
  customizable. The shell script supports new headers, logos, etc. The
  output can be completely customized in latex.
 
  Feedback is welcome.
 
  Thanks.
 
  
 
 -- 
 
 --- 
 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: Experimental feature: SELECT-ish style queries

2015-01-22 Thread Jostein Berntsen
On 18.06.14,01:35, Jostein Berntsen wrote:
 
 
 On Tuesday, March 13, 2012 4:41:06 PM UTC+1, John Wiegley wrote:
 
  Many thanks to Alexandre Rademaker for suggesting the following idea.
 
  Ledger now has an experimental (i.e., not to be published until 3.1, and 
  won't
  hold up release) feature: SELECT-style queries.  The syntax is very simple,
  you state what columns you want, what table you want them from, and what
  your query is.  For example:
 
ledger select 'date, account, amount from posts where account =~ 
  /Expenses/'
 
 ...
  John
 
 
 This looks like a very useful feature. Are there more examples on how this 
 can be used? Anyone using this now?
 

Any more plans for this? And some documentation on how it works? :)

Jostein

-- 

--- 
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: DocTests failure

2015-01-14 Thread Jostein Berntsen
On 14.01.15,15:21, Alexis wrote:
 Hi,
 I just fired up my Debian Wheezy VirtualBox and updated it
 to 7.8. I have Python 2.7.3 installed, compiled
 the master and next branch from ledger, and ran:
 % ctest --output-on-failure -R DocTests
 % python test/DocTests.py -l ./build/ledger -f doc/ledger3.texi
 
 Both commands ran successfully. Who else is using Debian Wheezy
 and would like to test this potential issue?
 
 

I use Slackware 14.1 and if I run the ctest command I get this:

jostein:~/dw/ledger2$ vim Val-1496.dat
jostein:~/dw/ledger2$ ctest --output-on-failure -R DocTests
Test project /home/jostein/dw/ledger2
Start 1: DocTestsTest_ledger3
1/2 Test #1: DocTestsTest_ledger3 .   Passed3.47 sec
Start 2: DocTestsTest_ledger-mode
2/2 Test #2: DocTestsTest_ledger-mode .   Passed0.03 sec

100% tests passed, 0 tests failed out of 2

Total Test time (real) =   3.52 sec

When I run the python test command:

jostein:~/dw/ledger2$ python test/DocTests.py -l ./build/ledger -f 
doc/ledger3.texi
EE

The following examples failed:
  1071890
  Val-2514
  Val-7310
  Val-1260
  Val-3199
  8C7295F
  Val-2745
  Val-3823
  Val-4135
  Val-1746
  C371854
  Val-2849
  Val-2593
  Val-2192
  Val-3026
  AECD64E
  Val-6246
  Val-8978
  E2AF6AD
  Val-2356
  Val-3735
  Val-2731
  Val-1143
  Val-3613
++


Jostein

-- 

--- 
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: Selling commodities in other commodities

2014-09-22 Thread Jostein Berntsen
On 21.09.14,21:22, Mike Charlton wrote:
 Hello.  I'm new to accounting, ledger and this mailing list :-)  So far I'm
 finding it all fascinating!  Thank you very much for such a great piece of
 software.  Like many people, I tried out GnuCash and would have stuck with
 it except that a friend suggested that I try Ledger.  I am now convinced
 that CLI accounting is the only sane way of doing it.
 
 Anyway, I ran into a problem that I think might be a bug/feature deficiency
 in Ledger.  First I will describe something that works currently and then
 modify it to show my problem.  I am using the example of buying and selling
 houses in Peter Slinger's tutorial on currency trading accounts.
 
 01/01 Opening Balance
   Assets:CAD CAD 50
   Capital
 
 02/01 Buy House A
   Assets:HOU HOU 1 @ CAD 10
   Assets:CAD
 
 03/01 Buy House B
   Assets:HOU HOU 1 @ CAD 12
   Assets:CAD
 
 As you can see, I start with $500,000 and buy one house for $100,000 and
 the other for $120,000.  I can sell the house and realize the capital gains
 with:
 
 05/01 Sell House A
   Assets:HOU-HOU 1
   Assets:CAD CAD 105000
   Income:Gains  -CAD 5000
 
 I was impressed that Ledger even figures out the cost of the house and
 removes the correct lot price when I inspect the balance with
 --lot-prices!  So far so good.
 
 But let's say that someone wants to buy my house for USD.  Ideally I would
 like this to work
 
 05/01 Sell House A
   Assets:HOU-HOU 1
   Assets:CAD USD 10 @ CAD 1.05
   Income:Gains  -CAD 5000
 
 Unfortunately, this does not balance.  Even the following does not balance:
 
 05/01 Sell House A
   Assets:HOU-HOU 1 {CAD 10}
   Assets:CAD USD 10 @ CAD 1.05
   Income:Gains  -CAD 5000
 
 The only thing that appears to work is:
 
 05/01 Sell House A
   Assets:HOU-HOU 1 {CAD 10} @@ USD 10
   Assets:CAD USD 10 @ CAD 1.05
   Income:Gains  -CAD 5000
 
 (at which point you can let Ledger calculate the Income:Gains).
 
 I'm guessing this is a bug.  I often have to deal with multiple currencies
 and I have to buy one with the other.  For example, my main currency is
 JPY, but I have CAD, GBP and EUR and will buy GBP with CAD or EUR with GBP,
 for example.  As I am new to accounting, it's very possible I am
 misunderstanding how I should calculate capital gains.  Does anyone one
 else do this?
 

Which bal command are you using? Have you tried to add the -V option to
balance the values?

Jostein


-- 

--- 
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: Ledger Atta[boy|girl]

2014-08-08 Thread Jostein Berntsen
On 06.08.14,14:09, Scott Carpenter wrote:
 I think there's a healthy enough community here and you don't really need 
 encouragement from me, but I just wanted to say how much I'm loving ledger, 
 and to thank John and others for your efforts.
 
 I've been meticulously tracking my finances for years, starting with MS 
 Money in 1995, moving to KMyMoney in 2008, and then to Ledger CLI in 2013. 
 I hope never to have to switch again. I'm really happy with keeping my 
 ledger in Sublime Text with my own custom syntax highlighting, and a Python 
 scheduler program. (With git for versioning, of course!)
 
 This thing is so solid, and while I need to learn more, I can do just about 
 everything I need/want to, and am so happy with the freedom and power of 
 it. I guess I'm posting because I want you to know there are a lot of quiet 
 and happy users of ledger, and you're really contributing something 
 valuable to the world. Your work is greatly appreciated.
 
 Great job, guys, and please keep it up!
 
 Thank you!
 
 Scott

Good words there, Scott! No doubt that Ledger is incredibly useful and
versatile. I plan to use for my next project as well from next week after
some testing for this specific use. I don't use twitter, so it would be
nice to a have some kind of regular tips or wiki site as well.

Jostein

-- 

--- 
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: Proper way to download stock quotes

2014-07-31 Thread Jostein Berntsen
On 30.07.14,22:22, Dave Wells wrote:
 Some more detail: I use the command
 
 $ ledger bal assets:investments:stocks -VQ
 
 and the following is appended to my price database:
 
 P 2014/07/30 22:16:43 AAPL $98.150
 P 2014/07/30 22:16:43 F $17.460
 P 2014/07/30 22:16:43 VALE $14.380
 P 2014/07/30 22:16:44 F $17.460
 P 2014/07/30 22:16:45 AAPL $98.150
 P 2014/07/30 22:16:45 F $17.460
 P 2014/07/30 22:16:46 VALE $14.380
 P 2014/07/30 22:16:46 F $17.460
 
 My Assets:Investments:Stocks account has not sub-accounts. If I run the 
 balance command on something higher up in the hierarchy, like Assets, then 
 I get a lot more duplicates (17 entries for three stocks and a mutual 
 fund.) Any tips?
 

Have you checked what happens if you just use it like this?

ledger bal assets:investments:stocks --download

Jostein


-- 

--- 
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: payee limiting question

2014-07-30 Thread Jostein Berntsen
On 30.07.14,17:13, Eric Abrahamsen wrote:
 For the longest time I haven't been able to use payee limiting in
 reports in any convenient way, and I'm finally getting around to
 bringing it up here. I am using git ledger, built on archlinux. Here's
 the basic problem:
 
 [eric@pellet ~]$ ledger reg assets:receivable --limit 'payee=~/CBI/'
 14-May-03 CBI  Assets:Receivable   2,000.00 RMB  2,000.00 RMB
 14-Jun-18 CBI  Assets:Receivable  -2,000.00 RMB 0
 
 [eric@pellet ~]$ ledger reg assets:receivable and CBI
 [eric@pellet ~]$ ledger reg assets:receivable @CBI
 {displays all postings for assets:receivable}
 
 According to the docs and whatnot, one of the shorter forms ought to
 work. The longer one is horrible to type!
 
 Am I doing something wrong, or are the docs incorrect, or is this a bug
 of some sort?
 

This works for me:

ledger assets:receivable and /CBI/


Jostein




-- 

--- 
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: Tracking contributions to an account

2014-07-21 Thread Jostein Berntsen
On 21.07.14,06:45, Nathan Grigg wrote:
 On Jul 20, 2014, at 10:45 PM, Martin Michlmayr t...@cyrius.com wrote:
 
  Yes, you can match tags:
   ledger -f d reg tag(Taxes) =~ /^HSA*/'
 
 For me, this is matching everything with the “Taxes” tag, regardless of what 
 I use for the regular expression.

This should work:

ledger reg tag taxes=HSA.*


Jostein


-- 

--- 
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: Building on FreeBSD 10.0

2014-07-08 Thread Jostein Berntsen
On 05.07.14,05:20, y2s1982 . wrote:
 Thank you everyone for taking a stab at this problem.  Pity it wasn't
 resolved :(
 
 I've tried to make acprep update to at least begin compiling and following
 changes helped me get there, though I still ran into the same problem while
 compiling output.cc as Chris mentioned.
 
 First, looking at the following site: https://wiki.freebsd.org/NewC++Stack
 I've changed the CMakeLists.txt like the following:
 before: add_definitions(-std=c++11)
 after: add_definitions(-stdlib=libc++ -std=c++11)
 
 That let me start compiling... and fail right away on account that
 editline/readline.h doesn't exist.
 Well, turns out, in FreeBSd,
 http://www.freebsd.org/cgi/man.cgi?query=readlineapropos=0sektion=3manpath=FreeBSD+10.0-RELEASEarch=defaultformat=html
 the file exists in readline/readline.h
 So, I've changed system.hh by changing #include editline/readline.h to
 #include readline/readline.h
 
 That allowed me to continue further until output.cc error occurs.
 
 As for boost regex, that also exists in the system, though I do get the
 error message mentioned before. I did find the boost/regex/icu.hpp. I've
 tried forcing the system to use the boost/regex/icu by editing system.hh,
 but I still had the same problem with output.cc
 
 Any other suggestions?  I'm still willing to work with clang if possible.
 Does OS X still use the gcc extension or are they making it to work with
 clang?
 
 

Could you try compiling with acprep and before this change the
add_definitions line in CMakeLists.txt to this instead?

add_definitions(-stdlib=libstdc++ -std=c++11)

Or try the solutions from Ronald Ip in this previous post?

https://groups.google.com/d/msg/ledger-cli/Yn_d8qO3iBM/f288sE0kQrIJ

Jostein


-- 

--- 
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: How to record and keep track of stock share ?

2014-06-27 Thread Jostein Berntsen
On 24.06.14,22:08, Rick F wrote:
 Allowing the cost to show up in
 
   both places would break the accounting equation; this transaction must 
 balance.
 
 
 So I've been thinking about this and I think that is the fundamental problem. 
  Technically, commission (at least in the U.S.) isn't an expense, it's an 
 asset.  It sounds strange, but think about it.  In the U.S., the commission 
 counts toward the cost basis and the cost basis is recorded with the asset.  
 It's the whole depreciate vs. expense issue in accounting.
 
 
 I'm not sure how, but I think the solution is somewhere down that road.  
 Maybe creating a fake asset that is the commission per share, maybe a 
 sub-asset.
 
 
 The thing is, this isn't a new problem.  This isn't a ledger problem so much 
 as an accounting problem.  Accountants (in the U.S. at least) already have to 
 deal with this situation.  Does anyone know how accountants deal with this 
 currently?
 
 
 Rick
 
 
 On Saturday, June 14, 2014 10:50:32 AM UTC-7, Martin Blais wrote:
 

Would this then be the best way to calculate it?

; Initial openings at 2014/01/012014-01-01 Opening Balance
  Assets:Bank:Check Account  5000,00 €
  Equity:Opening Balance


; Details of shares at 2014/01/01
;P 2014-01-01 00:00:00   ShareA 20 €
;P 2014-01-01 00:00:00   ShareB 100 €
2014-01-01 Details for shares
  Equity:Opening Balance:Initial Investments
  Assets:Investments:Stocks:ShareA15 ShareA @ 20 €
  Assets:Investments:Stocks:ShareB5 ShareB @ 100 €

; Details of shares at 2014/04/01
P 2014-04-01 00:00:00   ShareA 30 €
P 2014-04-01 00:00:00   ShareB 120 €

; Selling 2 ShareB at 2014/04/01
2014-04-01 Selling 2 ShareB
Assets:Investments:Stocks:ShareB   -2 ShareB @ 100 €
Assets:Commission-9,90 €
Assets:Cash2 ShareB @ 120 € 
 Income:Investment Gains

; Details of shares at 2014/05/02
P 2014-05-01 00:00:00   ShareA 70 €
P 2014-05-01 00:00:00   ShareB 120 €

Selling 2 ShareA at 2014/05/01
2014-04-02 Selling 4 ShareA
Assets:Investments:Stocks:ShareA -4 ShareA @ 20 €
Assets:Commission   -9,90 €
Assets:Cash   2 ShareA @ 120 € 
 Income:Investment Gains  


Jostein


-- 

--- 
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: Building on FreeBSD 10.0

2014-06-26 Thread Jostein Berntsen


On Tuesday, June 24, 2014 8:30:38 PM UTC+2, Chris Leyon wrote:

 I'm having difficulties compiling the latest Ledger code on FreeBSD 
 10.0 (well, PC-BSD actually) with clang and Boost 1.55.0.  I followed 
 some suggested commands, step 2 from Thierry on 2014-05-04 in message 
 a48ef73e-b08c-4e28-bfb9-69d1e1711...@googlegroups.com javascript:. I 
 include the 
 output below.  If anyone has any suggestions for fixing this bug or 
 compiling on FreeBSD I would be very happy to hear them.  Until then, 
 my ledgering is out of commission for a while. 

 Thanks for any help, 
 Chris 


 --888-- 

 cleyon@rosso:ledger-2014-06-24$ rm -rf ledger/ 

 cleyon@rosso:ledger-2014-06-24$ git clone git://
 github.com/ledger/ledger.git 
 Cloning into 'ledger'... 
 remote: Reusing existing pack: 32431, done. 
 remote: Total 32431 (delta 0), reused 0 (delta 0) 
 Receiving objects: 100% (32431/32431), 14.13 MiB | 5.33 MiB/s, done. 
 Resolving deltas: 100% (24322/24322), done. 
 Checking connectivity... done. 

 cleyon@rosso:ledger-2014-06-24$ cd ledger/ 

 cleyon@rosso:ledger$ git submodule update --init 
 Submodule 'lib/utfcpp' (http://github.com/ledger/utfcpp.git) 
 registered for path 'lib/utfcpp' 
 Cloning into 'lib/utfcpp'... 
 remote: Reusing existing pack: 37, done. 
 remote: Total 37 (delta 0), reused 0 (delta 0) 
 Unpacking objects: 100% (37/37), done. 
 Checking connectivity... done. 
 Submodule path 'lib/utfcpp': checked out 
 '2233ec933f5661c7050b94d3b14f5f9f51ae3d55' 

 cleyon@rosso:ledger$ cmake . -DUSE_DOXYGEN=1 -DUSE_PYTHON=1 
 -- The C compiler identification is Clang 3.3.0 
 -- The CXX compiler identification is Clang 3.3.0 
 -- Check for working C compiler: /usr/bin/cc 
 -- Check for working C compiler: /usr/bin/cc -- works 
 -- Detecting C compiler ABI info 
 -- Detecting C compiler ABI info - done 
 -- Check for working CXX compiler: /usr/bin/CC 
 -- Check for working CXX compiler: /usr/bin/CC -- works 
 -- Detecting CXX compiler ABI info 
 -- Detecting CXX compiler ABI info - done 
 -- Found PythonInterp: /usr/local/bin/python (found version 2.7.6) 
 -- Found PythonLibs: /usr/local/lib/libpython2.7.so (found version 
 2.7.6) 
 -- Boost version: 1.55.0 
 -- Found the following Boost libraries: 
 --   date_time 
 --   filesystem 
 --   system 
 --   iostreams 
 --   regex 
 --   unit_test_framework 
 --   python 
 -- Looking for access 
 -- Looking for access - found 
 -- Looking for realpath 
 -- Looking for realpath - found 
 -- Looking for getpwuid 
 -- Looking for getpwuid - found 
 -- Looking for getpwnam 
 -- Looking for getpwnam - found 
 -- Looking for isatty 
 -- Looking for isatty - found 
 -- Performing Test UNIX_PIPES_COMPILES 
 -- Performing Test UNIX_PIPES_COMPILES - Success 
 -- Performing Test BOOST_REGEX_UNICODE_RUNS 
 -- Performing Test BOOST_REGEX_UNICODE_RUNS - Failed 
 -- Looking for readline in edit 
 -- Looking for readline in edit - found 
 -- Found Doxygen: /usr/local/bin/doxygen (found version 1.8.3.1) 
 -- Configuring done 
 -- Generating done 
 -- Build files have been written to: 
 /usr/home/cleyon/tmp/ledger-2014-06-24/ledger 

 cleyon@rosso:ledger$ make 
 Scanning dependencies of target libledger 
 [  1%] Building CXX object src/CMakeFiles/libledger.dir/stats.cc.o 
 [  2%] Building CXX object src/CMakeFiles/libledger.dir/generate.cc.o 
 [  4%] Building CXX object src/CMakeFiles/libledger.dir/csv.cc.o 
 [  5%] Building CXX object src/CMakeFiles/libledger.dir/convert.cc.o 
 [  6%] Building CXX object src/CMakeFiles/libledger.dir/draft.cc.o 
 [  8%] Building CXX object src/CMakeFiles/libledger.dir/emacs.cc.o 
 [  9%] Building CXX object src/CMakeFiles/libledger.dir/org.cc.o 
 [ 10%] Building CXX object src/CMakeFiles/libledger.dir/ptree.cc.o 
 [ 12%] Building CXX object src/CMakeFiles/libledger.dir/print.cc.o 
 [ 13%] Building CXX object src/CMakeFiles/libledger.dir/output.cc.o 
 /usr/home/cleyon/tmp/ledger-2014-06-24/ledger/src/output.cc:294:48: 
 error: no viable conversion from 
   '__map_iterator__tree_iteratorunion std::__1::mapclass 
 ledger::account_t *, unsigned long, struct ledger::account_compare, 
   class std::__1::allocatorstruct std::__1::pairclass 
 ledger::account_t *const, unsigned long  ::__value_type, class 
   std::__1::__tree_nodeunion std::__1::mapclass 
 ledger::account_t *, unsigned long, struct ledger::account_compare, 
 class 
   std::__1::allocatorstruct std::__1::pairclass 
 ledger::account_t *const, unsigned long  ::__value_type, void * *, 
   [...]' to '__map_iterator__tree_iteratorunion 
 std::__1::mapclass ledger::account_t *, unsigned long, struct 
   std::__1::lessclass ledger::account_t *, class 
 std::__1::allocatorstruct std::__1::pairclass ledger::account_t 
 *const, 
   unsigned long  ::__value_type, class 
 std::__1::__tree_nodeunion std::__1::mapclass ledger::account_t *, 
 unsigned long, 
   struct std::__1::lessclass ledger::account_t *, class 

Re: Building on FreeBSD 10.0

2014-06-25 Thread Jostein Berntsen


On Tuesday, June 24, 2014 9:12:29 PM UTC+2, Chris Leyon wrote:

 Jostein, 

 Thank you for suggestion.  I tried the new add_definitions line as you 
 indicated but there was no change - the same errors occur as before. 

 Chris 



  
Is there a boost package included with FreeBSD or in their repositories? 
Can you try to reinstall this? Ref. to this error from your installation:

-- Performing Test BOOST_REGEX_UNICODE_RUNS - Failed 

Jostein 

-- 

--- 
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: Building on FreeBSD 10.0

2014-06-24 Thread Jostein Berntsen
On 24.06.14,14:30, Chris Leyon wrote:
 I'm having difficulties compiling the latest Ledger code on FreeBSD
 10.0 (well, PC-BSD actually) with clang and Boost 1.55.0.  I followed
 some suggested commands, step 2 from Thierry on 2014-05-04 in message
 a48ef73e-b08c-4e28-bfb9-69d1e1711...@googlegroups.com. I include the
 output below.  If anyone has any suggestions for fixing this bug or
 compiling on FreeBSD I would be very happy to hear them.  Until then,
 my ledgering is out of commission for a while.
 
 Thanks for any help,
 Chris
 
 
 --888--
 
 cleyon@rosso:ledger-2014-06-24$ rm -rf ledger/
 
 cleyon@rosso:ledger-2014-06-24$ git clone git://github.com/ledger/ledger.git
 Cloning into 'ledger'...
 remote: Reusing existing pack: 32431, done.
 remote: Total 32431 (delta 0), reused 0 (delta 0)
 Receiving objects: 100% (32431/32431), 14.13 MiB | 5.33 MiB/s, done.
 Resolving deltas: 100% (24322/24322), done.
 Checking connectivity... done.
 
 cleyon@rosso:ledger-2014-06-24$ cd ledger/
 
 cleyon@rosso:ledger$ git submodule update --init
 Submodule 'lib/utfcpp' (http://github.com/ledger/utfcpp.git)
 
 ...

The most recent version of ledger do work with boost versions from 1.49 and
up. 

You can try this:

Delete the ledger directory and clone it again. Go into the CMakeLists.txt
file and change this line:

add_definitions(-std=c++11) 

to:

add_definitions(-std=c++11 -U__STRICT_ANSI__) 

Then run:

./acprep --python update 

and see if that works.

Jostein


-- 

--- 
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: How to record and keep track of stock share ?

2014-06-22 Thread Jostein Berntsen
On 20.06.14,08:50, Martin Michlmayr wrote:
 * Jostein Berntsen jber...@broadpark.no [2014-06-20 04:26]:
   ; Selling 2 ShareB at 2014/04/01 
   2014-04-01 Selling 2 ShareB 
 Assets:Investments:Stocks:ShareB -2 ShareB @ 100€ 
 Assets:SoldStocks:SoldB2 ShareB @ 120€ 
Income:Investment Gains 
  
  Martin: Does this seem right for you?
 
 I'm not sure what Assets:SoldStocks:SoldB is for.  If you're selling
 two stocks for cash, you get cash; but in your example, you still have
 those 2 stocks as an asset:
 
 ledger -f qq bal Assets:SoldStocks:SoldB
 2 ShareB  Assets:SoldStocks:SoldB
 
 What you want is this:
 
 ; Initial openings at 2014/01/01
 2014-01-01 Opening Balance
   Assets:Bank:Check Account  5000,00 €
   Equity:Opening Balance
 
 ; Details of shares at 2014/01/01
 ;P 2014-01-01 00:00:00   ShareA 20€
 ;P 2014-01-01 00:00:00   ShareB 100€
 2014-01-01 Details for shares
   Equity:Opening Balance:Initial Investments
   Assets:Investments:Stocks:ShareA15 ShareA @ 20€
   Assets:Investments:Stocks:ShareB5 ShareB @ 100€
 
 ; Selling 2 ShareB at 2014/04/01
 2014-04-01 Selling 2 ShareB
   Assets:Investments:Stocks:ShareB -2 ShareB {100€} @ 120€
   Assets:Cash   240€
   Income:Investment Gains   -40€
 
 ; Selling 2 ShareB at 2014/04/01
 2014-04-02 Selling 4 ShareA
   Assets:Investments:Stocks:ShareA -4 ShareA {20€} @ 30€
   Assets:Cash   120€
   Income:Investment Gains   -40€
 

Thanks, I see that error. But to me this seems more correct after some testing:

; Initial openings at 2014/01/012014-01-01 Opening Balance
  Assets:Bank:Check Account  5000,00 €
  Equity:Opening Balance


; Details of shares at 2014/01/01
;P 2014-01-01 00:00:00   ShareA 20 €
;P 2014-01-01 00:00:00   ShareB 100 €
2014-01-01 Details for shares
  Equity:Opening Balance:Initial Investments
  Assets:Investments:Stocks:ShareA15 ShareA @ 20 €
  Assets:Investments:Stocks:ShareB5 ShareB @ 100 €

; Selling 2 ShareB at 2014/04/01
2014-04-01 Selling 2 ShareB
Assets:Investments:Stocks:ShareB   -2 ShareB @ 100 €
Assets:Cash  240 €
 Income:Investment Gains

; Details of shares at 2014/04/01
P 2014-04-01 00:00:00   ShareA 30 €
P 2014-04-01 00:00:00   ShareB 120 €

Selling 2 ShareA at 2014/05/02
2014-04-02 Selling 4 ShareA
  Assets:Investments:Stocks:ShareA -4 ShareA @ 20 €
  Assets:Cash   120 € 
 Income:Investment Gains  


; Details of shares at 2014/05/01
P 2014-04-01 00:00:00   ShareA 70 €
P 2014-04-01 00:00:00   ShareB 120 €


Jostein






-- 

--- 
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: ledger basics and habits

2014-06-22 Thread Jostein Berntsen
On 22.06.14,08:28, Simon Michael wrote:
 Thanks!
 
 The http://matthewturland.com/2014/03/29/ledger-basics-and-habits post is
 the best short-medium intro I've seen yet.
 
 Now featuring on https://twitter.com/LedgerTips .
 

Thanks. The Ledger manual is great, but I think these simpler intros is very
useful for many as well.

Jostein


-- 

--- 
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: installation headaches

2014-06-22 Thread Jostein Berntsen
In the more recent ledger versions the libboost requirement has been 
downgraded. Check if you can find a more recent Debian package, or install 
ledger from github. 

-- 

--- 
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: How to record and keep track of stock share ?

2014-06-20 Thread Jostein Berntsen


On Thursday, June 19, 2014 12:30:37 AM UTC+2, Jostein Berntsen wrote:

 On 11.06.14,22:10, Christophe Schockaert wrote: 
  Hi all, 
  

  

  
  So, what's the status for this question ? 
  
   2) The left-over for Share B shows 260€, which does not render the 
 fact that 
  I still have 3 plain stocks, which would at least value 300€ (from 
 their 
  initial value), or 360€ for the current value. 
  
  In the documentation example, everything was sold at one time, so we are 
 not in 
  the same situation. 
  
   3) I would like to have a view of the left-over value of the stocks, at 
 time 
  t. In case A, the total still show 800€ which is the initial 
 value, 
  and in case B, I see 560€, which reflects the 800€-240€, but not 
 the 
  sum of the 10 ShareA and the 3 remaining ShareB. 
  
  I understand that it shows what it has to show, but I would like to know 
 how to 
  set things up, so that I can see what I described there. 
  
  I also tried to play with lines like: 
  P 2014-01-01 00:00:00   ShareB 100€ 
  P 2014-04-01 00:00:00   ShareB 120€ 
  
  In that case, I can toggle the display of share or values with the 
 option -V, 
  which gets close to what I want. 
  
  However, I run into other issues, mainly that it only uses the last 
 value, even 
  for the initial value, and if I mix the notation in plain shares (-2 
 ShareB) 
  and the notation with attributed values (-2 ShareB {100€} @ 120€), they 
 don't 
  get along very well. 
  
  So, I prefered to narrow things down and start with my first two 
 examples. 
  
  Thank you for having the patience to read that all way through. 
  
  Do you have any clues or advices so I can get a clear view of stocks in 
 my 
  files, in accountancy terms, and with ledger in particular ? 
  
  Any help will be appreciated, 
  Thanks in advance, 
  
  Christophe S. 

 Can you try this way to do it? 

 dat file: 

 ; Initial openings at 2014/01/012014-01-01 Opening Balance 
   Assets:Bank:Check Account  5000,00 € 
   Equity:Opening Balance 


 ; Details of shares at 2014/01/01 
 ;P 2014-01-01 00:00:00   ShareA 20€ 
 ;P 2014-01-01 00:00:00   ShareB 100€ 
 2014-01-01 Details for shares 
   Equity:Opening Balance:Initial Investments 
   Assets:Investments:Stocks:ShareA15 ShareA @ 20€ 
   Assets:Investments:Stocks:ShareB5 ShareB @ 100€ 

 ; Selling 2 ShareB at 2014/04/01 
 2014-04-01 Selling 2 ShareB 
   Assets:Investments:Stocks:ShareB -2 ShareB @ 100€ 
   Assets:SoldStocks:SoldB2 ShareB @ 120€ 
  Income:Investment Gains 

 ; Selling 2 ShareB at 2014/04/01 
 2014-04-02 Selling 4 ShareA 
   Assets:Investments:Stocks:ShareA -4 ShareA @ 20€ 
   Assets:SoldStocks:SoldA4 ShareA @ 30€ 
  Income:Investment Gains 

 Output: 

 jostein:~/Documents/Finans/ledger/testing$ ledger -B bal -f testshares.dat 
5880,00 €  Assets 
5000,00 €Bank:Check Account 
 520,00 €Investments:Stocks 
 220,00 €  ShareA 
 300,00 €  ShareB 
 360,00 €SoldStocks 
 120,00 €  SoldA 
 240,00 €  SoldB 
   -5800,00 €  Equity:Opening Balance 
-800,00 €Initial Investments 
 -80,00 €  Income:Investment Gains 
  
0 

 jostein:~/Documents/Finans/ledger/testing$ ledger -V bal -f testshares.dat 
6050,00 €  Assets 
5000,00 €Bank:Check Account 
 690,00 €Investments:Stocks 
 330,00 €  ShareA 
 360,00 €  ShareB 
 360,00 €SoldStocks 
 120,00 €  SoldA 
 240,00 €  SoldB 
   -5800,00 €  Equity:Opening Balance 
-800,00 €Initial Investments 
 -80,00 €  Income:Investment Gains 
  
 170,00 € 




Martin: Does this seem right for you?

Jostein 

-- 

--- 
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: Experimental feature: SELECT-ish style queries

2014-06-18 Thread Jostein Berntsen


On Tuesday, March 13, 2012 4:41:06 PM UTC+1, John Wiegley wrote:

 Many thanks to Alexandre Rademaker for suggesting the following idea.

 Ledger now has an experimental (i.e., not to be published until 3.1, and 
 won't
 hold up release) feature: SELECT-style queries.  The syntax is very simple,
 you state what columns you want, what table you want them from, and what
 your query is.  For example:

   ledger select 'date, account, amount from posts where account =~ 
 /Expenses/'

 Behind the scenes, what this does is (a) rewrite what you've asked for as a
 format string, and (b) setup all the related options (like --limit) to 
 satisfy
 your query.  What's extra nifty about all this is:

   - It honors all the special options, like --amount-width, colorizing,
 --bold-if, etc.

   - It knows how to properly format and colorize accounts vs. amounts, etc.

   - It auto-widens/narrows account/payee names to make the report fit 
 within
 the requested --columns

   - The column names are actually value expressions; you can query on
 unrounded(amount), and select will still know it's an amount column

   - The width of unrecognized columns is governed by --meta-width

   - from posts is the default, you don't have to specify it

 Some gotchas already (and there will be many with a feature like this):

   - Error handling is currently terrible.  You can't ask for 'payee' in an
 accounts report, and you don't want to try. :)

   - The 'account' column in account reports doesn't show up hierarchically 
 yet

   - Doesn't yet blank out repeated dates and payee names if they all occur
 within the same transaction

 To show you an example of the time this can save you, let's say I wanted 
 this
 weird register report:

 ledger --meta-width=14 -f test/input/sample.dat \
select 'date, aux_date or date, payee, tag(Sample),' \
'amount, amount * 2' from posts

 Here's the formatting string this builds:

 %(ansify_if(ansify_if(justify(format_date(date), int(date_width)),green if 
 color and date  today),bold if should_bold)) 
 %(ansify_if(ansify_if(justify(format_date((aux_date | date)), 
 int(date_width)),green if color and date  today),bold if should_bold)) 
 %(ansify_if(ansify_if(justify(truncated(payee, int(payee_width)), 
 int(payee_width)),bold if color and !cleared and actual),bold if 
 should_bold)) %(ansify_if(justify(truncated(tag(Sample), int(meta_width 
 or 10)), int(meta_width) or 10),bold if should_bold)) 
 %(ansify_if(justify(scrub(display_amount), 
 int(amount_width),int(date_width) + 1 + int(date_width) + 1 + 
 int(payee_width) + 1 + (int(meta_width) or 10) + 1 + int(amount_width), 
 true, color), bold if should_bold)) 
 %(ansify_if(justify(scrub((display_amount * {2})), 
 int(amount_width),int(date_width) + 1 + int(date_width) + 1 + 
 int(payee_width) + 1 + (int(meta_width) or 10) + 1 + int(amount_width) + 1 
 + int(amount_width), true, color), bold if should_bold))\n

 And here's the output:

 04-May-01 04-May-01 Checking balance $1,000.00   
  $2,000.00
 04-May-01 04-May-01 Checking balance$-1,000.00   
 $-2,000.00
 04-May-03 04-May-01 Investment balance 50 AAPL 100 
 AAPL
 04-May-03 04-May-01 Investment balance  $-1,500.00   
 $-3,000.00
 04-May-14 04-May-14 Páy dày500.00€ 
 1000.00€
 04-May-14 04-May-14 Páy dày   -500.00€   
  -1000.00€
 04-May-14 04-May-14 Another dày in w.. $500.00   
  $1,000.00
 04-May-14 04-May-14 Another dày in w..$-500.00   
 $-1,000.00
 04-May-14 04-May-14 Another dày in w..   $1,000.00   
  $2,000.00
 04-May-14 04-May-14 Another dày in w..  $-1,000.00   
 $-2,000.00
 04-May-27 04-May-27 Book Store  $20.00   
 $40.00
 04-May-27 04-May-27 Book Store  $40.00   
 $80.00
 04-May-27 04-May-27 Book Store  $30.00   
 $60.00
 04-May-27 04-May-27 Book Store $-90.00 
 $-180.00
 04-May-27 04-May-27 Book Store  $-2.00   
 $-4.00
 04-May-27 04-May-27 Credit card comp.. Another Value$20.00   
 $40.00
 04-May-27 04-May-27 Credit card comp.. Value   $-20.00 
  $-40.00

 John


This looks like a very useful feature. Are there more examples on how this 
can be used? Anyone using this now?

Jostein
 

-- 

--- 
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: A Slow-Tech Approach to Tracking Spending

2014-06-18 Thread Jostein Berntsen


On Tuesday, May 13, 2014 2:41:45 AM UTC+2, Martin Blais wrote:

 FYI.
 Interesting article re. tracking your money:

 http://mobile.nytimes.com/2014/05/12/your-money/household-budgeting/a-slow-tech-approach-to-tracking-spending.html


 With all the great tools to track spending, I’ve really struggled with 
 this issue. By concluding that automation may actually cost me more, I feel 
 like a Luddite. But like the process of financial planning, I think the 
 budgeting process is simply more effective when I take the time to manually 
 enter every transaction myself. It’s not really about the numbers, but 
 about the intent behind the numbers.

 Keep in mind that with a bit of practice, it will take an hour a week at 
 most to do. 



I got his book The Behaviour Gap because of this link. Interesting read. 
Thanks!

 

-- 

--- 
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: How to record and keep track of stock share ?

2014-06-18 Thread Jostein Berntsen
On 11.06.14,22:10, Christophe Schockaert wrote:
 Hi all,
 



 
 So, what's the status for this question ?
 
  2) The left-over for Share B shows 260€, which does not render the fact 
 that
 I still have 3 plain stocks, which would at least value 300€ (from their
 initial value), or 360€ for the current value.
 
 In the documentation example, everything was sold at one time, so we are not 
 in
 the same situation.
 
  3) I would like to have a view of the left-over value of the stocks, at time
 t. In case A, the total still show 800€ which is the initial value,
 and in case B, I see 560€, which reflects the 800€-240€, but not the
 sum of the 10 ShareA and the 3 remaining ShareB.
 
 I understand that it shows what it has to show, but I would like to know how 
 to
 set things up, so that I can see what I described there.
 
 I also tried to play with lines like:
 P 2014-01-01 00:00:00   ShareB 100€
 P 2014-04-01 00:00:00   ShareB 120€
 
 In that case, I can toggle the display of share or values with the option 
 -V,
 which gets close to what I want.
 
 However, I run into other issues, mainly that it only uses the last value, 
 even
 for the initial value, and if I mix the notation in plain shares (-2 ShareB)
 and the notation with attributed values (-2 ShareB {100€} @ 120€), they don't
 get along very well.
 
 So, I prefered to narrow things down and start with my first two examples.
 
 Thank you for having the patience to read that all way through.
 
 Do you have any clues or advices so I can get a clear view of stocks in my
 files, in accountancy terms, and with ledger in particular ?
 
 Any help will be appreciated,
 Thanks in advance,
 
 Christophe S.

Can you try this way to do it? 

dat file:

; Initial openings at 2014/01/012014-01-01 Opening Balance
  Assets:Bank:Check Account  5000,00 €
  Equity:Opening Balance


; Details of shares at 2014/01/01
;P 2014-01-01 00:00:00   ShareA 20€
;P 2014-01-01 00:00:00   ShareB 100€
2014-01-01 Details for shares
  Equity:Opening Balance:Initial Investments
  Assets:Investments:Stocks:ShareA15 ShareA @ 20€
  Assets:Investments:Stocks:ShareB5 ShareB @ 100€

; Selling 2 ShareB at 2014/04/01
2014-04-01 Selling 2 ShareB
  Assets:Investments:Stocks:ShareB -2 ShareB @ 100€
  Assets:SoldStocks:SoldB2 ShareB @ 120€
 Income:Investment Gains

; Selling 2 ShareB at 2014/04/01
2014-04-02 Selling 4 ShareA
  Assets:Investments:Stocks:ShareA -4 ShareA @ 20€
  Assets:SoldStocks:SoldA4 ShareA @ 30€
 Income:Investment Gains

Output:

jostein:~/Documents/Finans/ledger/testing$ ledger -B bal -f testshares.dat
   5880,00 €  Assets
   5000,00 €Bank:Check Account
520,00 €Investments:Stocks
220,00 €  ShareA
300,00 €  ShareB
360,00 €SoldStocks
120,00 €  SoldA
240,00 €  SoldB
  -5800,00 €  Equity:Opening Balance
   -800,00 €Initial Investments
-80,00 €  Income:Investment Gains

   0

jostein:~/Documents/Finans/ledger/testing$ ledger -V bal -f testshares.dat
   6050,00 €  Assets
   5000,00 €Bank:Check Account
690,00 €Investments:Stocks
330,00 €  ShareA
360,00 €  ShareB
360,00 €SoldStocks
120,00 €  SoldA
240,00 €  SoldB
  -5800,00 €  Equity:Opening Balance
   -800,00 €Initial Investments
-80,00 €  Income:Investment Gains

170,00 €


Jostein

-- 

--- 
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: How to record and keep track of stock share ?

2014-06-17 Thread Jostein Berntsen


On Saturday, June 14, 2014 7:50:32 PM UTC+2, Martin Blais wrote:

 On Fri, Jun 13, 2014 at 9:57 AM, Martin Blais bl...@furius.ca 
 javascript: wrote:

 On Fri, Jun 13, 2014 at 9:01 AM, Rick F ri...@farnbach.com javascript:
  wrote:

 The method used in the cookbook, is not correct.


 That's not exactly true: it's correct if your definition of capital gain 
 does not take into account commissions. I used the definition that excludes 
 capital gains in order to keep things simple (the level of discussion I 
 chose in that doc is that congruent with trying to explain P/L clearly, 
 intro level). Whether you should be able to exclude commissions or not from 
 your gains is a matter tax law, and it depends on your own situation.

 Thanks for bringing up the topic, though, I admit I did forget to explain 
 it. I'll add a separate section about commissions. I'm well aware of this.

 At the moment, I simply subtract the commissions from the gains for 
 reporting. The gains and commissions get counted in separate accounts 
 (which is mostly fine, except for the prorating detail you bring up below). 
 You can subtract the total commissions from total gain for a good 
 approximation of gains-without-commissions. Most of my trading accounts 
 already provide a suitable 1099 so I use my own accounting on these 
 accounts for tax planning and cross-checking against their calculations, 
 and I use the 1099 forms for tax reporting.
  


 The cookbook uses the example of buying 10 shares of IBM at $160 and then 
 selling those shares at $170.  Without commissions, that would amount to a 
 realized gain of $100, $1700 (the sales price) - $1600 (the cost basis). 
  With commissions, however, the reportable gain is really $1700 (the sales 
 price) - $9.95 (commission on the sale) - $1600 (basis) - $9.95 
 (commission on purchase) = $80.10.  The method in the cookbook only 
 accounts for the sale commission when figuring the capital gain.


 Actually, that's incorrect, the method I described does exclude the 
 commission from the gain on BOTH sides and will thus calculate a gain of 
 100$ (no commissions at all).
  

 So what's the right way to do this, accounting for commission on 
 purchase.  Note that if only part of the purchased shares are sold the 
 commission is prorated, so the actual basis is $1609.95 or $160.995 per 
 share.


 That's a great question.

 Again, how it should be done is a matter of tax law, it's a choice, but 
 this is indeed a sensible one in many cases. Simply subtracting the sum of 
 the commissions - you could easily track them per account, e.g. using 
 Expenses:US:ETrade:Commissions instead of Expenses:Financial:Commissions - 
 from the capital gains provides a good approximation of the gains as you 
 describe it, but as you point out, not a perfectly accurate one, especially 
 if you hold positions across reporting periods (taxation years). It is 
 appropriate to note that folding in the purchase commission on the cost 
 basis is but one method to automatically pro-rate that commission into the 
 gain - we could track it separately, per-lot - but it is one that is 
 elegant and leads to an unambiguous implementation. I would like to be able 
 to support it.

 I don't have a good solution for doing this at the moment, but I want to 
 think of one. 
 In particular, we should design a method that leads to easy entry by a 
 user, with a correspondingly nice syntax.

 I'll be thinking about this; any ideas welcome.



 Some more thinking about this: one possible method would be to allow the user 
 to
 indicate that a particular leg of the transaction is meant to be folded into 
 the
 cost of another leg's, something I would implement like the following.

 First let's make up an example of a transaction the way they're currently 
 done,
 with the full capital gain, that is, one that unfairly (to you) includes
 commissions:

 2014-06-13 * Transactions with Commissions
   Assets:US:Invest:Cash-5009.95 USD  ;  5009.95 
 USD
   Expenses:US:Invest:Commissions   9.95 USD  ; 9.95 
 USD
   Assets:US:Invest:GOOG   10.00 GOOG {500.00 USD};  5000.00 
 USD

 2014-06-20 * Transactions with Commissions
   Assets:US:Invest:GOOG  -10.00 GOOG {500.00 USD}; -5000.00 
 USD
   Expenses:US:Invest:Commissions   9.95 USD  ; 9.95 
 USD
   Assets:US:Invest:Cash 5090.05 USD  ;  5090.05 
 USD
   Income:US:Invest:PnL  -100.00 USD  ;  -100.00 
 USD

 This is what we need to fix, we want the gain to become 100 USD - 2 x 9.95 
 USD.

 So now let's introduce a flag into the cost syntax (there's already a flag
 available on each posting):

 2014-06-13 * Transactions with Commissions
   Assets:US:Invest:Cash  -5009.95 USD  ;  5009.95 
 USD
   + Expenses:US:Invest:Commissions   9.95 USD  ; 0.00 
 USD (+)
   

Re: Automatically Credit an Account

2014-06-04 Thread Jostein Berntsen


On Wednesday, June 4, 2014 7:32:22 AM UTC+2, Martin Blais wrote:

 On Mon, Jun 2, 2014 at 8:55 PM, Martin Blais bl...@furius.ca 
 javascript: wrote:

 Why don't you build a tool for printing out the result of these 
 rule-based modifications? Do you think that would be useful? Is it 
 possible? I see a lot of questions like: Why doesn't my rule such and such 
 work? I see unexpected results in the register. If Ledger had a command to 
 expand everything, and print the expanded results, all of these questions 
 would be easily answered by inspecting what it's doing, no? Is that easy to 
 implement? 

 Just an idea. I'm building something exactly like that for Beancount, to 
 help in debugging plugins, which are essentially functions that transform a 
 list of entries in arbitrary ways, into a new, modified list of entries. 
 One should be able to diff the files and round-trip between data-structure 
 to text and back.


 Actually, I just completed support for round-trips tonight (I had been 
 writing comparison code lately in order to make it easier to write tests by 
 writing a list of expected transactions in the input syntax itself, so it 
 was a-propos). This means that Beancount can now read a complete ledger 
 file, spit it back out in text, and re-reading that output generates the 
 same data structures in memory. Writing that re-read structure out again to 
 a second file also shows no file diff against the first output to text, 
 it's identical. I tested this on my gigantic personal ledger of 8 years, 
 and it passes clean.

 I'll add a new report type called print shortly, which will just spit 
 out the data structure it read in memory back to text, after running all 
 the transformations (e.g. automatically setting the amounts on postings, 
 processing the tag directives, adding price entries for postings at a 
 price, and whatever else the plugins do). This should be a nice debugging 
 tool in the future, as it reflects what it does, e.g., what was 
 automatically generated by the syntax shortcuts.


This sounds like a great feature. Can you give an example on how it works?

Jostein 

-- 

--- 
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: Automatically Credit an Account

2014-06-03 Thread Jostein Berntsen


On Tuesday, June 3, 2014 12:42:50 AM UTC+2, b0ef wrote:

 Jostein Berntsen jbe...@broadpark.no javascript: writes: 

  This seems to work for me: 
  
  = /Assets:1500/ 
   
 Assets:Total  1 
   Income:3010  -1 
  2014-06-02 foo   
  
 Assets:1500:foo:101011337 
  Assets:Total 
  2014-06-03 foo   
  
 Assets:1500:foo:201015100 
  Assets:Total 

 That's because you're doing something totally different. 

 If you look at my example, I only have one line in each transaction. 

 I don't want to write, ie Assets:Total 15 brazillion times. 



Then you can do something like this:

bucket 
Income:3010 




2014-06-02 
foo 

 

Assets:1500:foo:101011337

2014-06-03 
foo 

 

Assets:1500:foo:201015100
 
 ledger -f ~/Documents/Finans/testing/test.dat bal
6437  Assets:1500:foo
133710101
510020101
   -6437  Income:3010

   0

Jostein

-- 

--- 
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: Convert CSV Bank Statement to ledger

2014-06-02 Thread Jostein Berntsen


On Friday, May 30, 2014 9:55:00 AM UTC+2, Jostein Berntsen wrote:

 On 29.05.14,23:18, Esben Stien wrote: 
  
  I have the following bank statement from my bank: 
  
  03.11.2013;Foo;04.11.2013;1.638,00; 
  03.11.2013;Bar;04.11.2013;;492,93 
  
  The fields are: 
  
  Date;Description;Interest Date;Out of Account;In to Account 
  
  , so the ins and outs are separated, the date format is fubar, the 
  separator is semicolon and the amount format is just as fubar. 
  
  I could script it into something more sane, but I wonder if 
  
  https://github.com/bhutley/bank-csv-to-ledger 
  
  ..or another import package can work directly with this format? 
  

 I like to use reckon: 

 https://github.com/cantino/reckon 

 How to use: 


 http://blog.andrewcantino.com/blog/2010/11/06/command-line-accounting-with-ledger-and-reckon/
  


 Jostein 



The most updated link:

http://blog.andrewcantino.com/blog/2013/02/16/command-line-accounting-with-ledger-and-reckon/

Jostein
 

-- 

--- 
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: building on cygwin

2014-06-02 Thread Jostein Berntsen


On Tuesday, May 27, 2014 5:23:26 PM UTC+2, Daniel Martins wrote:

 I'm sorry for digging up this matter.
 I've managed to build ledger on cygwin just now. Here are the steps I've 
 taken, just in case anybody is interested:


- On reports.h
   - Comment lines #791 to #808
   - Comment line #810
- On quotes.cc
   - On line #65, replace #ifndef WIN32 with #if 0
- On times.cc
   - Comment lines #36 and #38
- On strptime.cc
   - Comment lines #16 and #189
   - Replace every single occurrence of strnicmp by strncasecmp
   - Add #include strings.h

 Hope this helps! ;)


 On Saturday, 11 August 2012 21:03:34 UTC+1, Anton Vodonosov wrote:

 I've just cloned the gitub ledger repo.

 Running ./acprep udpate on cygwin results in:

 $ ./acprep update
 acprep: INFO: Invoking primary phase: update
 acprep: INFO: Executing phase: update
 acprep: INFO: Executing phase: pull
 Traceback (most recent call last):
   File /usr/lib/python2.6/logging/__init__.py, line 776, in emit
 msg = self.format(record)
   File /usr/lib/python2.6/logging/__init__.py, line 654, in format
 return fmt.format(record)
   File /usr/lib/python2.6/logging/__init__.py, line 436, in format
 record.message = record.getMessage()
   File /usr/lib/python2.6/logging/__init__.py, line 306, in getMessage
 msg = msg % self.args
 TypeError: not all arguments converted during string formatting


 I would appreciate advice how to finish the build 


This looks interesting, did look into some of these files previously, but 
did not try all this out. I had a hard time getting ledger installed in 
cygwin, but found out this worked for me:

Update CMakeLists.txt with this:

add_definitions(-std=c++11 -U__STRICT_ANSI__)

Then you can run ./acprep --python update and it gets installed. It does 
not link up the ledger.exe files in /usr/bin correctly with the 
libledger-3.dll thought so I had to do that manually. 

 Jostein

-- 

--- 
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: 'equity' cannot accept virtual and non-virtual postings to the same account

2014-06-02 Thread Jostein Berntsen


On Saturday, May 17, 2014 9:10:04 PM UTC+2, Jostein Berntsen wrote:

 On 16.05.14,22:06, John Wiegley wrote: 
   Jostein Berntsen jber...@broadpark.no writes: 
  
   Is there a reason for this? 
  
  This sounds rather odd, and may be a bug. 
  
  John 
  
   Example data: 
  
   2014/03/05 * Opening Balance 
   Assets:Project:Budget   100,00 NOK 
  
   Equity:Opening Balance 
  
   =  /TeamDev/ 
(Assets:Project:Budget)   (1000,00 NOK * amount) 
  
   Example command and output: 
  
   ledger reg -s budget 
   While handling posting from 
   /home/jostein/Documents/Finans/ledger/project.dat, line 16: 
   (Assets:Project:Budget)   (1000,00 NOK * amount) 
   Error: 'equity' cannot accept virtual and non-virtual postings to the 
 same 
   account 
  

 For some reason these commands gives the right output: 

 ledger bal budget 
 ledger reg budget 

 But these give the error above: 

 ledger reg -s budget 
 ledger reg -M budget 

 My intention is to add hours like in the entry below to the Budget account 
 and calculated into a total cost in NOK. How is the best way to do this? 

 2014/04/17 Resource 1 - Week 16, 2014 Book 
 ; Week16: 2014 
 ; Resource1: John James 
 ; TeamDev: Workshop and plannning 
 Allocation:Resources:TeamDev -15 H   
  Assets:Project:Budget 


 Jostein 



I solved this by entering this code for the automated transactions instead:

=   /TeamDev/
Assets:Allocation:Hours   (1000,00 NOK * amount)
Assets:Project:Budget   (-1000,00 NOK * amount)

=   /TeamTest/
Assets:Allocation:Hours   (800,00 NOK * amount)
Assets:Project:Budget   (-800,00 NOK * amount)

and:

2014/04/18 Resource 1 - Week 16, 2014
; Week16: 2014
; Resource1: John James
Expenses:Resources:TeamDev 15 H; Hours
 Assets:Allocation:Hours


2014/04/18 Resource 2 - Week 16, 2014
; Week16: 2014
; Resource2: Jim Ding
Expenses:Resources:TeamDev 30 H; Hours
 Assets:Allocation:Hours


Jostein 


-- 

--- 
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: Automatically Credit an Account

2014-06-01 Thread Jostein Berntsen
On 01.06.14,23:11, Esben Stien wrote:
 I'm trying to do an automated transaction on this:
 
 2014-06-01 foo
 ;[[id:e235bd4a-ec6f-4975-ab26-7da247b3bb77][1337453 foo]]
 Assets:1500:foo:1337453 1337
 
 The actual transaction without automation would be: 
 
 2014-06-01 foo
 ;[[id:e235bd4a-ec6f-4975-ab26-7da247b3bb77][1337453 foo]]
 Assets:1500:foo:1337453 1337
 Income:3010
 
 So, this amount is supposed to be credited from the Income:3010 account, so
 I've tried many possible variations of this:
 
 = Assets:1500
 Income:3010
 
 ..with $account 1 and the Income:3010 -1, but none of them seem to work
 
 Any pointers as to how I can do this?
 

Have you tried something like this?


= /Assets:1500/
 Income:Transaction(1 * amount)
 Income:3010  (-1 * amount)


Jostein


-- 

--- 
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: Convert CSV Bank Statement to ledger

2014-05-30 Thread Jostein Berntsen
On 29.05.14,23:18, Esben Stien wrote:
 
 I have the following bank statement from my bank:
 
 03.11.2013;Foo;04.11.2013;1.638,00;
 03.11.2013;Bar;04.11.2013;;492,93
 
 The fields are:
 
 Date;Description;Interest Date;Out of Account;In to Account
 
 , so the ins and outs are separated, the date format is fubar, the
 separator is semicolon and the amount format is just as fubar.
 
 I could script it into something more sane, but I wonder if 
 
 https://github.com/bhutley/bank-csv-to-ledger
 
 ..or another import package can work directly with this format?
 

I like to use reckon:

https://github.com/cantino/reckon

How to use:

http://blog.andrewcantino.com/blog/2010/11/06/command-line-accounting-with-ledger-and-reckon/


Jostein

-- 

--- 
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: Convert CSV Bank Statement to ledger

2014-05-30 Thread Jostein Berntsen
On 30.05.14,09:19, Edwin van Leeuwen wrote:
 On Fri, 30 May 2014 09:54:39 +0200, Jostein Berntsen jber...@broadpark.no 
 wrote:
  On 29.05.14,23:18, Esben Stien wrote:
   
   I have the following bank statement from my bank:
   
   03.11.2013;Foo;04.11.2013;1.638,00;
   03.11.2013;Bar;04.11.2013;;492,93
   
   The fields are:
   
   Date;Description;Interest Date;Out of Account;In to Account
   
   , so the ins and outs are separated, the date format is fubar, the
   separator is semicolon and the amount format is just as fubar.
   
   I could script it into something more sane, but I wonder if 
   
   https://github.com/bhutley/bank-csv-to-ledger
   
   ..or another import package can work directly with this format?
   
  
  I like to use reckon:
  
  https://github.com/cantino/reckon
  
  How to use:
  
  http://blog.andrewcantino.com/blog/2010/11/06/command-line-accounting-with-ledger-and-reckon/
  
 
 Reckon should parse your csv file correctly. If not please file a bug so
 we can improve Reckon :)
 
 Cheers, Edwin

Thanks, Edwin. :) Here is an example on a reckon command I use for my bank
csv fle:

eckon -f drang2.csv -v --ignore-columns 2 --csv-separator ';' --currency NOK
--suffixed  --comma-separates-cents -l jbfinans.dat -o jbfinans.dat

Jostein


-- 

--- 
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: Convert CSV Bank Statement to ledger

2014-05-30 Thread Jostein Berntsen
On 30.05.14,15:51, Jostein Berntsen wrote:
 On 30.05.14,09:19, Edwin van Leeuwen wrote:
  On Fri, 30 May 2014 09:54:39 +0200, Jostein Berntsen jber...@broadpark.no 
  wrote:
   On 29.05.14,23:18, Esben Stien wrote:

I have the following bank statement from my bank:

03.11.2013;Foo;04.11.2013;1.638,00;
03.11.2013;Bar;04.11.2013;;492,93

The fields are:

Date;Description;Interest Date;Out of Account;In to Account

, so the ins and outs are separated, the date format is fubar, the
separator is semicolon and the amount format is just as fubar.

I could script it into something more sane, but I wonder if 

https://github.com/bhutley/bank-csv-to-ledger

..or another import package can work directly with this format?

   
   I like to use reckon:
   
   https://github.com/cantino/reckon
   
   How to use:
   
   http://blog.andrewcantino.com/blog/2010/11/06/command-line-accounting-with-ledger-and-reckon/
   
  
  Reckon should parse your csv file correctly. If not please file a bug so
  we can improve Reckon :)
  
  Cheers, Edwin
 
 Thanks, Edwin. :) Here is an example on a reckon command I use for my bank
 csv fle:
 
 eckon -f drang2.csv -v --ignore-columns 2 --csv-separator ';' --currency NOK
 --suffixed  --comma-separates-cents -l jbfinans.dat -o jbfinans.dat
 

Sorry, it should be this command for my bank csv file:

reckon -f drang2.csv -v --ignore-columns 2 --csv-separator ';' --currency NOK
--suffixed  --comma-separates-cents -l jbfinans.dat -o jbfinans.dat

Jostein

-- 

--- 
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: Beancount Cheat Sheet

2014-05-26 Thread Jostein Berntsen


On Wednesday, May 21, 2014 4:46:11 PM UTC+2, Simon Michael (sm) wrote:

 On 5/12/14 3:09 PM, Martin Blais wrote: 
  I created a cheat sheet for Beancount syntax: 
  http://furius.ca/beancount/doc/cheatsheet/beancount-cheatsheet.pdf 

 +1, we should have one of these for each ledger-like. 



+1. These sheets are very useful. 
 

-- 

--- 
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: 'equity' cannot accept virtual and non-virtual postings to the same account

2014-05-17 Thread Jostein Berntsen
On 16.05.14,22:06, John Wiegley wrote:
  Jostein Berntsen jber...@broadpark.no writes:
 
  Is there a reason for this? 
 
 This sounds rather odd, and may be a bug.
 
 John
 
  Example data:
 
  2014/03/05 * Opening Balance
  Assets:Project:Budget   100,00 NOK
 
  Equity:Opening Balance
 
  =  /TeamDev/
   (Assets:Project:Budget)   (1000,00 NOK * amount)
 
  Example command and output:
 
  ledger reg -s budget
  While handling posting from
  /home/jostein/Documents/Finans/ledger/project.dat, line 16:
  (Assets:Project:Budget)   (1000,00 NOK * amount)
  Error: 'equity' cannot accept virtual and non-virtual postings to the same
  account
 

For some reason these commands gives the right output:

ledger bal budget
ledger reg budget

But these give the error above:

ledger reg -s budget
ledger reg -M budget

My intention is to add hours like in the entry below to the Budget account
and calculated into a total cost in NOK. How is the best way to do this?

2014/04/17 Resource 1 - Week 16, 2014 Book
; Week16: 2014
; Resource1: John James 
; TeamDev: Workshop and plannning
Allocation:Resources:TeamDev -15 H  
 Assets:Project:Budget


Jostein


-- 

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


'equity' cannot accept virtual and non-virtual postings to the same account

2014-05-15 Thread Jostein Berntsen
Is there a reason for this? 

Example data:

2014/03/05 * Opening Balance
Assets:Project:Budget   100,00 NOK

Equity:Opening Balance

=  /TeamDev/
 (Assets:Project:Budget)   (1000,00 NOK * amount)

Example command and output:

ledger reg -s budget
While handling posting from
/home/jostein/Documents/Finans/ledger/project.dat, line 16:
  (Assets:Project:Budget)   (1000,00 NOK * amount)
Error: 'equity' cannot accept virtual and non-virtual postings to the same
account




Jostein

-- 

--- 
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: Riscontro List

2014-05-10 Thread Jostein Berntsen
On 10.05.14,07:41, Esben Stien wrote:
 John Wiegley jo...@newartisans.com writes:
 
  I think you'd need:
 
2014-04-21 PAY foo.33341
; Link: [[id:0b073899-81b7-4e41-b137-f62c839d316f][foo.33341]]
Liabilities:2400:foo381
Assets:1920 
 
  Now you can refer to %(tag('Link')) in a format string.
 
 I don't understand. If I do several of these registrations when I
 receive the invoice:
 
 2014-04-21 REG foo.33341
 ;[[id:0b073899-81b7-4e41-b137-f62c839d316f][foo.33341]]
 Expenses:4110   381
 Liabilities:2400:foo
 
 2014-04-21 REG foo.33342
 ;[[id:7fab2e8e-97d1-0d2b-459d-ae6de1130215][foo.33342]]
 Expenses:4110   481
 Liabilities:2400:foo
 
 2014-04-21 REG foo.33343
 ;[[id:7d5d7b6b-13d5-1e23-11fc-a27dfc11fd20][foo.33343]]
 Expenses:4110   581
 Liabilities:2400:foo
 
 There must be some way to get a list of invoices that are not paid, f.ex
 in this case, the following invoices are not paid:
 
 foo.33341
 foo.33342
 foo.33343
 

I guess you can mark the invoice as pending and get the list of unpaid
invoices with --pending?


2014-04-21 ! REG foo.33342
;[[id:7fab2e8e-97d1-0d2b-459d-ae6de1130215][foo.33342]]
Expenses:4110   481
 Liabilities:2400:foo
 
 2014-04-21 ! REG foo.33343
 ;[[id:7d5d7b6b-13d5-1e23-11fc-a27dfc11fd20][foo.33343]]
 Expenses:4110   581
 Liabilities:2400:foo

Jostein


-- 

--- 
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: ISO 4217 commodities

2014-05-07 Thread Jostein Berntsen
On 23.04.14,12:26, Alexis wrote:
 If anyone thinks it's worthwhile I'll gladly add it to the ledger
 repo under contrib/ and throw in a little shell script, which
 downloads the latest version of the XML and runs the XSL transformation.
 

This sounds great! Is this available to test? Is this a static XML file, or
are the currencies updated regularly?

Jostein

-- 

--- 
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: Building on Ubuntu 12.04

2014-05-07 Thread Jostein Berntsen
On 07.05.14,11:36, thierry wrote:
 
 
   - switched to clang
 
  Did that work?
 
 
  No, I can't remember the error, other build problems.
 
 
 It did not worked for me too, with error message:
   error: C++0x was disabled in PCH file but is currently enabled
 
 See point 3) of my 
 message https://groups.google.com/d/msg/ledger-cli/Mm9M6ffZTRU/Oed4a4GkMqAJ
 
 

Have you checked the latest commit, ref. to the recent post from Johann K?

https://groups.google.com/forum/#!topic/ledger-cli/Mm9M6ffZTRU

Jostein


-- 

--- 
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: Unable to build

2014-05-06 Thread Jostein Berntsen
On 04.05.14,10:20, Jostein Berntsen wrote:
 On 02.05.14,15:40, thierry wrote:
  On vanilla Ubuntu 14.04, I managed to compile, with some trick:
  
  a) Install dependencies, the following were the minimum for me: 
  build-essential cmake doxygen libboost-system1.55-dev libboost1.55-dev 
  python-dev gettext git libboost-date-time1.55-dev 
  libboost-filesystem1.55-dev libboost-iostreams1.55-dev 
  libboost-python1.55-dev libboost-regex1.55-dev libboost-test1.55-dev 
  libedit-dev libgmp3-dev libmpfr-dev texinfo
  
  b) Clone repository : 
  git clone git://github.com/ledger/ledger.git
  
  c) Change directory to ledger, then :
  ./acprep update
  -- this fails as described in first post from James
  
  d) Launch compilation via:
  cmake . -DUSE_DOXYGEN=1 -DUSE_PYTHON=1
  make
  
  e) Check if everything looks ok:
  make check
  
  I have tried a+b+d : it fails.
  Only a+b and then (d+c or c+d) works.
  
  I believe there is something missing in acprep script.
  
  
 
 Thanks, Thierry. This seems to work for me as well in Slackware 14.1:
 
 First:
 
 Install the slackbuild ledger package (v.2.6.3)
 Upgrade from boost 1.54.0 to boost 1.55.0.
 
 Then:
 
 Clone the ledger repo
 cmake . -DUSE_DOXYGEN=1 -DUSE_PYTHON=1
 ./acprep update
 
 
 Will also check in Cygwin next week.
 

I tried the same in Cygwin and then running these commands:

cmake -G Unix Makefiles
cmake . -DUSE_DOXYGEN -DUSE_PYTHON
make clean
make

Then it first errors out early at the setenv function in report.h. Removing this
code makes it error out at popen and pclose in quote.cc at 53%. Any ideas?

Jostein


-- 

--- 
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: Unable to build

2014-05-04 Thread Jostein Berntsen
On 02.05.14,15:40, thierry wrote:
 On vanilla Ubuntu 14.04, I managed to compile, with some trick:
 
 a) Install dependencies, the following were the minimum for me: 
 build-essential cmake doxygen libboost-system1.55-dev libboost1.55-dev 
 python-dev gettext git libboost-date-time1.55-dev 
 libboost-filesystem1.55-dev libboost-iostreams1.55-dev 
 libboost-python1.55-dev libboost-regex1.55-dev libboost-test1.55-dev 
 libedit-dev libgmp3-dev libmpfr-dev texinfo
 
 b) Clone repository : 
 git clone git://github.com/ledger/ledger.git
 
 c) Change directory to ledger, then :
 ./acprep update
 -- this fails as described in first post from James
 
 d) Launch compilation via:
 cmake . -DUSE_DOXYGEN=1 -DUSE_PYTHON=1
 make
 
 e) Check if everything looks ok:
 make check
 
 I have tried a+b+d : it fails.
 Only a+b and then (d+c or c+d) works.
 
 I believe there is something missing in acprep script.
 
 

Thanks, Thierry. This seems to work for me as well in Slackware 14.1:

First:

Install the slackbuild ledger package (v.2.6.3)
Upgrade from boost 1.54.0 to boost 1.55.0.

Then:

Clone the ledger repo
cmake . -DUSE_DOXYGEN=1 -DUSE_PYTHON=1
./acprep update


Will also check in Cygwin next week.


Jostein



-- 

--- 
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: Unable to build

2014-04-28 Thread Jostein Berntsen


On Monday, April 21, 2014 2:05:08 PM UTC+2, James Clemence wrote:

 On Ubuntu 14.04 x86_64, the build is failing. I've got the following 
 dependencies installed:

 libboost1.55-dev libboost-regex1.55-dev libboost-date-time1.55-dev 
 libboost-filesystem1.55-dev build-essential cmake texinfo python-dev 
 zlib1g-dev libbz2-dev libgmp3-dev bjam gettext cvs libmpfr-dev

 However, build fails with the following issue:

 [  3%] Building CXX object src/CMakeFiles/libledger.dir/stats.cc.o
 /home/jvc26/ledger/src/stats.cc:32:21: warning: 
 /home/jvc26/ledger/system.hh.gch: not used because `__GNUC_GNU_INLINE__' 
 not defined [-Winvalid-pch]
  #include system.hh
  ^
 In file included from /home/jvc26/ledger/src/exprbase.h:57:0,
  from /home/jvc26/ledger/src/draft.h:45,
  from /home/jvc26/ledger/src/stats.cc:34:
 /home/jvc26/ledger/src/utils.h:488:12: error: ‘std::unique_ptr’ has not 
 been declared
  using std::unique_ptr;
 ^
 In file included from /home/jvc26/ledger/src/report.h:52:0,
  from /home/jvc26/ledger/src/stats.cc:38:
 /home/jvc26/ledger/src/session.h:62:3: error: ‘unique_ptr’ does not name a 
 type
unique_ptrjournal_t journal;
^
 /home/jvc26/ledger/src/stats.cc: In function ‘ledger::value_t 
 ledger::report_statistics(ledger::call_scope_t)’:
 /home/jvc26/ledger/src/stats.cc:49:31: error: ‘class ledger::session_t’ 
 has no member named ‘journal’
  statistics(report.session.journal-master-family_details(true));
^
 make[2]: *** [src/CMakeFiles/libledger.dir/stats.cc.o] Error 1
 make[1]: *** [src/CMakeFiles/libledger.dir/all] Error 2
 make: *** [all] Error 2
 acprep: ERROR: Execution failed: make

 Any pointers? Thanks!


The same error messages occur for me when trying to install ledger in 
cygwin.

Jostein
 

-- 

--- 
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: Building on Ubuntu 13.04

2014-04-28 Thread Jostein Berntsen
On 26.04.14,11:57, Martin Blais wrote:
 Thanks Jostein, I already have all the dependencies, hitting other problems.
 I got mbudde's PPA, that works, but there's no Python module, only the main
 binary.
 I'm due for an upgrade to 14.04 anyhow, I'll wait until I do that and
 retry, I just have too little time to get this workign right now.
 I'd like to eventually use the Ledger parser from Python to convert into
 Beancount data structure so you can all try/use the web interface I built.
 
 

This seems also to be a problem in cygwin:

https://groups.google.com/forum/#!topic/ledger-cli/Mm9M6ffZTRU

Jostein



-- 

--- 
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: Building on Ubuntu 13.04

2014-04-28 Thread Jostein Berntsen
On 28.04.14,11:49, Martin Blais wrote:
 I'm hitting this very same error message.
 Quick attempts to fix add #include memory did not succeed.
 (Moved on, had other cats to whip.)
 
 
 
 
 On Mon, Apr 28, 2014 at 10:25 AM, Jostein Berntsen 
 jber...@broadpark.nowrote:
 
  On 26.04.14,11:57, Martin Blais wrote:
   Thanks Jostein, I already have all the dependencies, hitting other
  problems.
   I got mbudde's PPA, that works, but there's no Python module, only the
  main
   binary.
   I'm due for an upgrade to 14.04 anyhow, I'll wait until I do that and
   retry, I just have too little time to get this workign right now.
   I'd like to eventually use the Ledger parser from Python to convert into
   Beancount data structure so you can all try/use the web interface I
  built.
  
  
 
  This seems also to be a problem in cygwin:
 
  https://groups.google.com/forum/#!topic/ledger-cli/Mm9M6ffZTRU
 
  Jostein
 
 

It seems like it errors out because of something with gcc. Maybe it would be
possible to tweak something in acprep to make this work?

Jostein


-- 

--- 
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: Project accounting

2014-04-27 Thread Jostein Berntsen
On 25.04.14,05:59, Jostein Berntsen wrote:
 I guess ledger also can be used for project accounting for weekly reports 
 and other status reports. Total cost of hours pr.resource would usually be 
 main cost driver in such a budget. 
 

A better working example here:

N NOK
h hours

2014/03/05 * Opening Balance
Assets:Project:Budget   100,00 NOK
Assets:Project:Risk 146000,00 NOK
Assets:Project:Contingency  12,00 NOK
Assets:Project:Hardware 80,00 NOK
Assets:Project:Software 20,00 NOK
Liabilities:Cost:Other  0,00 NOK
Equity:Opening Balances

=   /TeamDev/ 
(Assets:Project:Budget)   (1000,00 NOK * amount)

=   /TeamTest/ 
(Assets:Project:Budget)   (800,00 NOK * amount)

~ Monthly
 Expenses:Rent   5000,00 NOK
 Expenses:External   2,00 NOK
 Expenses:Materials   1000,00 NOK
 Assets:Project:Budget


2014/04/18 Resource 1 - Week 16, 2014
; Week16: 2014
; Resource1: John James 
Allocation:Resources:TeamDev -15 hours; Hours
 Assets:Project:Budget


2014/04/18 Resource 2 - Week 16, 2014
; Week16: 2014
; Resource2: Jim Ding 
Allocation:Resources:TeamDev -30 hours; Hours
 Assets:Project:Budget

2014/04/25 Resource 1 - Week 17, 2014
; Week17: 2014
; Resource1: John James 
Allocation:Resources:TeamDev -50 hours; Hours
 Assets:Project:Budget

2014/04/25 Resource 2 - Week 17, 2014
; Week17: 2014
; Resource2: Jim Ding 
; Comment: Check these hours? - ACT
Allocation:Resources:TeamDev -20 hours; Hours
 Assets:Project:Budget

2014/04/25 Resource 2 - Week 17, 2014
; Week17: 2014
; Resource3: Sharon Lee 
Allocation:Resources:TeamTest -25 hours; Hours
 Assets:Project:Budget



Jostein

-- 

--- 
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: Building on Ubuntu 13.04

2014-04-26 Thread Jostein Berntsen
On 25.04.14,22:52, Martin Blais wrote:
 Sorry I meant, 13.04, not the LTS.
 
 
 
 On Fri, Apr 25, 2014 at 10:47 PM, Martin Blais bl...@furius.ca wrote:
 
  Hi,
  I'm trying to build Ledger from source on a vanilla Ubuntu 12.04 in order
  to write a script to convert Ledger files to other formats.
  I just burnt 3 hours fiddling and fiddling to get this working, I think
  I've hit all the issues so far:
  - the utf8.h missing file,
  - older version of cmake barfing,
  - custom install of recent boost not being recognized (had to edit a file
  to force it)
  - failed build using g++-4.7 (cannot recognize unique_ptr somehow)
  - switched to clang
  and a few more.
 
  Does anyone have straightforward instructions on how to build on Ubuntu
  12.04?
  It is an awfully common platform, after all, it's the LTS.
  (I've done a lot of this, I know if I keep banging on it I will win, but
  this would save me lots of time.)
  Thanks,

Will this help?

https://groups.google.com/forum/#!topic/ledger-cli/WeCQ9SEjYAA

Jostein


-- 

--- 
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: Disable Piping to Less

2014-04-25 Thread Jostein Berntsen
On 22.04.14,04:52, Esben Stien wrote:
 Martin Michlmayr t...@cyrius.com writes:
 
  I'm not sure if there's a better solution, but this will work:
  --pager /bin/cat
 
 Perfectamente;) Thanks.
 

For me this works best:

--pager more

I would like to use vim as a pager though. Anyone made ledger work with 
vimpager or
some similar solution?

Jostein

-- 

--- 
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: Project accounting

2014-04-25 Thread Jostein Berntsen
On 25.04.14,10:34, djp wrote:
 On Friday, 25 April 2014 08:59:10 UTC-4, Jostein Berntsen wrote:
 
  I guess ledger also can be used for project accounting for weekly reports 
  and other status reports. 
 
  Has anyone tried this? 
 
  
 Jostein, that looks brilliant!


Thanks! :)

Jostein


-- 

--- 
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: How do I import ledger?

2014-04-06 Thread Jostein Berntsen
On 06.04.14,14:09, Ethan wrote:
 Hey, what's the current status of Python support? It seems as though there
 have been a few pull requests to change/update things related to Python,
 and it seems like the most up-to-date way to import ledger is to ln -s
 libledger.so ledger.so, but when I do this, I get:
 
  import ledger
 Traceback (most recent call last):
   File stdin, line 1, in module
 ImportError: dynamic module does not define init function (initledger)
 
 Indeed, it seems like the py* files didn't get built. (I don't see them in
 src/CMakeFiles.)
 
 I built using ./acprep --python update after first doing ./acprep
 --python clean. Am I doing something stupid/wrong?
 

There might be some hints in this previous thread:

https://groups.google.com/forum/#!topic/ledger-cli/FjcppC_xShk

This looks cool: ledgertools

https://github.com/frasertweedale/ledgertools$

Jostein

-- 

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


Cygwin installation problem

2014-04-03 Thread Jostein Berntsen
I have tried to install ledger in cygwin, but it stalls when generating the 
system.hh.gch file. I first do this:

e210618@PC-31296 /cygdrive/c/MyDocs/Downloads/ledger3/ledger
$ cmake -G Unix Makefiles
-- Boost version: 1.53.0
-- Found the following Boost libraries:
--   date_time
--   filesystem
--   system
--   iostreams
--   regex
--   unit_test_framework
-- Configuring done
-- Generating done
-- Build files have been written to: 
/cygdrive/c/MyDocs/Downloads/ledger3/ledger

When running -/acprep update I get this error:

/usr/include/boost/functional/hash/hash.hpp:439:5: error: 'ulong_long_type' 
is not a member of 'boost'
/usr/include/boost/functional/hash/hash.hpp:439:5: error: template argument 
1 is invalid
 BOOST_HASH_SPECIALIZE(boost::ulong_long_type)
 ^
src/CMakeFiles/libledger.dir/build.make:56: recipe for target 
'system.hh.gch' failed
make[2]: *** [system.hh.gch] Error 1
CMakeFiles/Makefile2:115: recipe for target 
'src/CMakeFiles/libledger.dir/all' failed
make[1]: *** [src/CMakeFiles/libledger.dir/all] Error 2
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2
acprep: ERROR: Execution failed: make


Anyone knows what to do here?

Jostein


-- 

--- 
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: Tags and formulas

2014-04-02 Thread Jostein Berntsen
On 30.03.14,23:12, Pascal Fleury wrote:
 Hello,
 
 I am trying to get a summary of what my health insurance needs to reimburse
 me. So I started by tracking the bills I pay with tags:
 
 2014/02/19 * Associated Dentists
 ; insurance: dental
 ; patient: pascal
 ; treatment: 2014/02/03
 Expenses:Insurances:Health   68.75 CHF
 Assets:Account:Bank
 
 2014/03/31 * Hospital
 ; insurance: accident
 ; patient: pascal
 ; treatment: 2014/03/29
 Expenses:Insurances:Health   68.75 CHF
 Assets:Account:Bank
 
 The insurance have different ways to reimburse and different coverages
 depending on what is in your contract. Say for accidents, they cover 50% of
 all costs, and for dental 75% and for the remaining part, there is a
 liability of 300 CHF. (that's actually simplified but enough for this
 case...).
 when they reimburse me, I just track it as an income.
 
 I tried this:
 
 ; rounds to the nearest 5 cents limit.
 define swiss_rounding(amount) = (roundto(amount * 20, 0) / 20)
 
 = /Insurances:Health/ and tag insurance = 'accident'
   (Virtual:Summary:Health)(swiss_rounding(amount * 0.50))
 
 = /Insurances:Health/ and tag insurance = 'dental'
   (Virtual:Summary:Health)(swiss_rounding(amount * 0.75))
   ; missing computation of the remaining amount this year @ max 300 CHF
 
 = /Income:Health and tag insurance
   (Virtual:Summary:Health)1.0
 
 Unfortunately I don't seem to be able to use tag values to apply the
 formulas separately depending on that tag value (all transactions tagged
 with 'insurance' get both rules applied), nor did I find a way to do a
 transaction that depends on the current amount in a particular account for
 a given period (typically the calendar year).
 
 Is there a way to do that ? Did I miss some obvious documentation ?
 

Could you use Expenses:Insurances1:Health and Expenses:Insurances:Health
instead and calculate this in a different way? That would also make it
easier to limit it to specific periods?

Jostein


-- 

--- 
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: How do I put spaces on the command line for an account name?

2014-03-30 Thread Jostein Berntsen
On 30.03.14,12:50, Alan Schmitt wrote:
 Hello,
 
 I have an account named Bucket:Expenses:Tel Portable. I'm trying to
 get a register of all the transactions involving this account, but
 I don't know how to write the command line invocation to this end. If
 I do
 
 ledger reg '^Bucket:Expenses:Tel Portable'
 
 then I get transactions matching 'Bucket:Expenses:Tel' or 'Portable'.
 I tried adding some '\' before the space, but then I'm getting errors of
 the form Incomplete escape sequence found..
 
 How can I require spaces in an account name on the command line?
 

Have you tried ledger reg Bucket:Exp$enses:Tel Portable instead? 

Jostein

-- 

--- 
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: Is there an official ledger 3.0 release?

2014-03-26 Thread Jostein Berntsen
On 09.03.14,09:34, Craig Earls wrote:
 Does anyone know who maintains the home-brew entry for ledger?
 
 On Sun, Mar 9, 2014 at 2:50 AM, Jostein Berntsen jber...@broadpark.no wrote:
  On 08.03.14,17:45, Craig Earls wrote:
  Somehow it seems like this should be more momentous...
 
  On Fri, Mar 7, 2014 at 8:34 PM, John Wiegley jo...@newartisans.com wrote:
   The current 'master' is now v3.0. :)
  
 
  Maybe push the new version to freecode.com as well? Will give it more 
  notice.
 
  Jostein

Seems like the freecode site is still at the old version. Should this be
updated as well to get 3.0 more published?

Jostein

-- 

--- 
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: Can't build ledger on debian 8

2014-03-13 Thread Jostein Berntsen
On 12.03.14,04:21, Max Linke wrote:
 Hi 
 
 I'm trying to build ledger on debian jessie. I always get an error that 
 `uintmax_t` is ambiguous.  
 
 ```
 640X4 finanzen/ledger ‹master› » ./acprep opt make --python 
 --prefix=$HOME/.local
 acprep: INFO: Invoking primary phase: make
 acprep: INFO: Executing phase: make
 acprep: INFO: Executing phase: config
 acprep: INFO: Executing phase: submodule
 acprep: INFO: Executing phase: configure
 acprep: INFO: System type is = Linux
 acprep: INFO: Setting up build flavor = opt
 -- The C compiler identification is GNU 4.8.2
 -- The CXX compiler identification is GNU 4.8.2
 -- Check for working C compiler: /usr/bin/cc
 -- Check for working C compiler: /usr/bin/cc -- works
 -- Detecting C compiler ABI info
 -- Detecting C compiler ABI info - done
 -- Check for working CXX compiler: /usr/bin/g++
 -- Check for working CXX compiler: /usr/bin/g++ -- works
 -- Detecting CXX compiler ABI info
 -- Detecting CXX compiler ABI info - done
 -- Found PythonInterp: /usr/bin/python (found version 2.7.6) 
 -- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython2.7.so (found 
 version 2.7.6) 
 -- Boost version: 1.54.0
 -- Found the following Boost libraries:
 --   date_time
 --   filesystem
 --   system

Have you tried './acprep dependencies' and 'cmake -G Unix Makefiles' to
check if you miss some dependencies?

Jostein


-- 

--- 
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: Is there an official ledger 3.0 release?

2014-03-09 Thread Jostein Berntsen
On 08.03.14,17:45, Craig Earls wrote:
 Somehow it seems like this should be more momentous...
 
 On Fri, Mar 7, 2014 at 8:34 PM, John Wiegley jo...@newartisans.com wrote:
  The current 'master' is now v3.0. :)
 

Maybe push the new version to freecode.com as well? Will give it more notice. 

Jostein

-- 

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


Colors in Ledger output

2014-03-09 Thread Jostein Berntsen
When I run the register and balance commands the output in my black terminal
is a bit too dark. Where can I adjust these?

Jostein

-- 

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


Taq queries

2014-03-09 Thread Jostein Berntsen
Tags are very useful. There are some things about the queries I don't
understand. I would like to ask for all withdrawals that has the tag
Cordoba, but when I do:

ledger reg Uttak tag Cordoba 

I get no output. 

If I run 

ledger reg Uttak and tag Cordoba

I get way too much output. Is there another syntax that works here? 

dat entry example:

2014/02/24  130630091
Expenses:Reise:Uttak2557,63 NOK
Assets:Bank:Spbkonto-2557,63 NOK
; Cordoba: Uttak - Reise vinteferien



Jostein


-- 

--- 
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: Taq queries

2014-03-09 Thread Jostein Berntsen
Thanks. Now I get this error:

jostein:~/Documents/Finans/ledger$ ledger reg Uttak --limit tag=~/Cordoba/--
While parsing value expression:
  (tag=~/Cordoba/--)((account =~ /Uttak/))
   ^
Error: ) operator not followed by argument

Jostein


On 09.03.14,14:55, Craig Earls wrote:
 Use --limit tag=~/Cordoba/--
 Craig
 
 On Sun, Mar 9, 2014 at 2:30 PM, Jostein Berntsen jber...@broadpark.no
 wrote:
 
  Tags are very useful. There are some things about the queries I don't
  understand. I would like to ask for all withdrawals that has the tag
  Cordoba, but when I do:
  ledger reg Uttak tag Cordoba 
  I get no output. 
  If I run 
  ledger reg Uttak and tag Cordoba
  I get way too much output. Is there another syntax that works here? 
  dat entry example:
  2014/02/24  130630091
  Expenses:Reise:Uttak2557,63 NOK
  Assets:Bank:Spbkonto-2557,63 NOK
  ; Cordoba: Uttak - Reise vinteferien
  Jostein
  -- 
  --- 
  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.

-- 

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


  1   2   >