Possible bug with fixed lot pricing

2024-04-04 Thread Pranshu Goyal
Let's consider this posting for a company's stock grant:

*2024/04/01 * Acme*

*  Assets   
7 ACM @ $10*

*  Tax 
3 ACM @ = $10*

*  Income   
 -$100*

 

*P 2024/04/04 ACM $15*


Here, the intention is to fix the price of stock used to pay tax, so 
balance reports in future report the same tax amount in dollar values even 
after stock price changes.

Hence the command after price changes to $15:

*ledger bal Tax -V*

gives:

*$30 Tax *


Which follows the expectation. Now lets look at balance report for Assets 
asked after the price changed on 4th April 2024:

*ledger bal Assets -V*

this produces 

*$70 Assets*


This in my opinion is unexpected behavior.  I used fixed lot price syntax 
to fix the price for Tax but not for Assets, but it also fixed the price 
for assets. I'm not sure if I'm doing something wrong here or if it is a 
bug.

Pranshu Goyal

-- 

--- 
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/6b011b67-290e-49f9-93ae-e1868984374an%40googlegroups.com.


Re: is this a bug?

2022-08-31 Thread John Wiegley
> "LF" == Lipp F  writes:

LF> Thanks John. I am wondering if you can be more specific. I have tried to
LF> add -G to "ledger reg" and it throws an error - "Error: Cannot add a
LF> sequence to an integer"

LF> I am looking to get a list with account values, it could be either balance
LF> or gain, for a period of time. Is there any way to do that?

Hmm... without knowing more about the data, I can't quite tell. But if you
build with debugging support enabled, and run with `--debug expr.calc`, it
should become clearer which two values it's trying to add that are not
compatible.

But other than the "revaluation" entries introduced by -G, Ledger does not
report entries for days where nothing happened. Maybe see if -E will give you
the empty entries you need for days with no change?

John

-- 

--- 
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/m27d2owdga.fsf%40newartisans.com.


Re: is this a bug?

2022-08-30 Thread Lipp F.
Thanks John. I am wondering if you can be more specific. I have tried to
add -G to "ledger reg" and it throws an error - "Error: Cannot add a
sequence to an integer"

I am looking to get a list with account values, it could be either balance
or gain, for a period of time. Is there any way to do that?

On Tue, Aug 30, 2022 at 2:37 PM John Wiegley  wrote:

> > "lf" == lipp f  writes:
>
> lf> Those are investment / trading accounts and, although there are no
> always
> lf> transactions for the last day, the value of the accounts always change
> due
> lf> to daily changes for prices of securities held. There are daily
> entries in
> lf> the pricedb for all securities.
>
> In that case you may want to add -G for the gain/loss report, since that
> generates "daily positions adjustments" beyond the last entry in the
> ledger.
>
> John
>

-- 

--- 
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/CAG-zHX7%3D7JPVfOcxkQ4swYa8k4aE4Pz%2B6hEAoYVfrRPrN5ajNg%40mail.gmail.com.


Re: is this a bug?

2022-08-30 Thread John Wiegley
> "lf" == lipp f  writes:

lf> Those are investment / trading accounts and, although there are no always
lf> transactions for the last day, the value of the accounts always change due
lf> to daily changes for prices of securities held. There are daily entries in
lf> the pricedb for all securities.

In that case you may want to add -G for the gain/loss report, since that
generates "daily positions adjustments" beyond the last entry in the ledger.

John

-- 

--- 
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/m2zgfl60ij.fsf%40newartisans.com.


Re: is this a bug?

2022-08-30 Thread lipp f
Those are investment / trading accounts and, although there are no always 
transactions for the last day, the value of the accounts  always change due 
to daily changes for prices of securities held. There are daily entries in 
the pricedb for all securities.



On Tuesday, August 30, 2022 at 11:42:32 AM UTC-4 jwie...@gmail.com wrote:

> >>>>> "lf" == lipp f  writes:
>
> lf> "ledger reg" command is missing records at the end. I am running these 
> on
> lf> Aug 31. For acc1 the last row is 2022-08-21 (2 weeks missing) and for 
> acc2
> lf> the last row is 2022-07-03 (9 weeks missing). Is this a bug? Any
> lf> workaround?
>
> And you have transactions related to account acc1 in your file beyond
> 2022-08-21?
>
> John
>

-- 

--- 
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/f7560da9-bcc8-4cf1-99f0-bcdfa74d3512n%40googlegroups.com.


Re: is this a bug?

2022-08-30 Thread John Wiegley
>>>>> "lf" == lipp f  writes:

lf> "ledger reg" command is missing records at the end. I am running these on
lf> Aug 31. For acc1 the last row is 2022-08-21 (2 weeks missing) and for acc2
lf> the last row is 2022-07-03 (9 weeks missing). Is this a bug? Any
lf> workaround?

And you have transactions related to account acc1 in your file beyond
2022-08-21?

John

-- 

--- 
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/m2v8q9eo0u.fsf%40newartisans.com.


is this a bug?

2022-08-30 Thread lipp f
"ledger  reg" command is missing records at the end. I am running these on 
Aug 31. For acc1 the last  row is 2022-08-21 (2 weeks missing) and for  
acc2 the last  row is  2022-07-03   (9 weeks missing). Is this a bug? Any 
workaround?

$ ledger -J -X USD -V -M --collapse reg acc1

2020-03-01 3.2250856547
2020-03-08 12.7704218218652774763
2020-03-15 26.18540631567
2020-03-22 36.3850603442
..
2022-08-07 34043.6595879335223997432
2022-08-14 33566.2372724361028684014
2022-08-21 29085.177419898814
2022-08-21 29143.673327103207785134

$ ledger -J -X USD -V -M --collapse reg acc2

2020-09-06 -67.5034127105
2020-09-13 -88.70350586078
2020-09-20 -57.70738591814
2020-09-27 -44.918500714
...
2022-06-26 5658.840091886942
2022-06-26 5676.8992906700606888
2022-07-03 6501.099703264095
2022-07-03 6587.0297032640949555

-- 

--- 
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/738d13f0-7cb6-4f9e-aa7c-0ba5fd49f0a2n%40googlegroups.com.


Re: Possible bug in --market interaction with --end

2022-01-13 Thread Martin Michlmayr
* Richard M Kreuter  [2022-01-13 08:48]:
> Is the following behavior a bug?

No.

> That is, the --end date appears to act as an upper exclusive bound
> for the purpose of summing postings, but seemingly not as an
> exclusive bound for price db lookup involved in calculating market
> value.

--end stops evaluating transactions, but things are still evaluated as
of the _current_ date, including pricedb entries after the end of
--end.

What you want is --now (maybe in combination with --end) which
specifies when to value things.

(Note that --end is exclusive whereas --now is inclusive, i.e. --end
stops one day before --end; --now is on the date of --now)

I use this command for value my investments at the end of the year:

-p "until 2021-01-01" --now 2020-12-31 bal --price-db pricedb/funds.pricedb -V

-- 
Martin Michlmayr
https://www.cyrius.com/

-- 

--- 
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/YeC3oXDMZqTUUa9K%40jirafa.cyrius.com.


Possible bug in --market interaction with --end

2022-01-13 Thread Richard M Kreuter
Hello,

Is the following behavior a bug?

Given the leger file at /tmp/foo.ledger containing exactly

--
2022-01-01 * Buy FOO
Assets:Brokerage  10 FOO @ $1.00
Assets:Cash  $-10.00

P 2022-01-02 23:59:00 FOO  $2.00

2022-01-03 * Buy more FOO
Assets:Brokerage 2.5 FOO @ $4.00
Income:Cash  $-10.00
--

and these environment settings

--
$ export LEDGER_FILE=/tmp/foo.ledger
$ export LEDGER_PAGER=cat
--

I find that a balance report with an --end option produces these
outputs, varying only whether the --market option is used:

--
$ ledger --end 2022-01-03 bal --balance-format '%A\t%t\n' /Brokerage/
Assets:Brokerage  10.0 FOO
$ ledger --market --end 2022-01-03 bal --balance-format '%A\t%t\n' /Brokerage/
Assets:Brokerage$40.00
--

The first invocation ignores the 2.5 FOO from the posting on 2022-01-03,
but the second seems to use the price in that posting. That is, the
--end date appears to act as an upper exclusive bound for the purpose of
summing postings, but seemingly not as an exclusive bound for price db
lookup involved in calculating market value.

[If this somehow isn't a bug, it looks like one workaround is to use (@)
and (@@) instead of @ or @@ in postings. That's good enough for my
needs, I think.]

In case it matters, I'm using this version of Ledger:

--
$ ledger --version
Ledger 3.2.1-20200518, the command-line accounting tool

Copyright (c) 2003-2019, John Wiegley.  All rights reserved.

This program is made available under the terms of the BSD Public License.
See LICENSE file included with the distribution for details and disclaimer.
--

Thanks,
Richard

-- 

--- 
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/10025.1642081728%40vps0.progn.net.


bug or a feature?

2021-11-03 Thread lipp f
$ ledger reg Assets -X CAD -V --yearly --collapse
2018-01-01 - 2018-12-31  
 -15,746.09672 CAD  -15,746.09672 CAD
2019-01-01 - 2019-12-31
   51,163.03850 CAD   35,416.94178 CAD
 
   3,454.84427 CAD   38,871.78605 CAD
2020-01-01 - 2020-12-31
   64,631.73227 CAD  103,503.51832 CAD
 
  80,301.36273 CAD  183,804.88105 CAD
2021-01-01 - 2021-12-31
  140,670.01551 CAD  324,474.89656 CAD
 
  70,622.01012 CAD  395,096.90668 CAD

$ ledger reg Assets -X CAD -V --yearly --collapse -p 2021
2021-01-01 - 2021-12-31  
  70,622.01012 CAD   70,622.01012 CAD

So, when a period expression is specified, automatically --no-revalued flag 
gets applied. How to include the "" lines with a period 
expression? 

Also, I have noticed that sometimes months are missing in reg -M .
TIA.

-- 

--- 
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/d6704114-1552-4302-812f-22dd0e85e456n%40googlegroups.com.


Re: Possible bug with payee aliases or am I missing something?

2021-09-11 Thread Martin Michlmayr
* Felipe Mica  [2021-09-11 17:25]:
> line 15: Unknown payee 'BBB'
> line 23: Unknown payee 'DDD'
> line 31: Unknown payee 'FFF'
> 
> Why aren't the aliases working in this case?

They are working.  Run "ledger reg" and you'll see that it's working
as expected.

The "Unknown payee" warnings are wrong.  It's fixed already but we
have to make a new release.

https://github.com/ledger/ledger/commit/5560b0c40f3986704df25095fcc485bcc1de9e5b

-- 
Martin Michlmayr
https://www.cyrius.com/

-- 

--- 
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/YT1OK7IRIEaMnqut%40jirafa.cyrius.com.


Possible bug with payee aliases or am I missing something?

2021-09-11 Thread Felipe Mica
In the example bellow, if I use the options
--strict --check-payees
it results in the following warnings:

line 15: Unknown payee 'BBB'
line 23: Unknown payee 'DDD'
line 31: Unknown payee 'FFF'

Why aren't the aliases working in this case?

payee AAA
alias BBB

payee CCC
alias DDD

payee EEE
alias FFF


2021-09-06 AAA
Assets:Checking
Expenses:Food:Groceries1 USD

2021-09-06 BBB
Assets:Checking
Expenses:Food:Groceries1 USD

2021-09-06 CCC
Assets:Checking
Expenses:Food:Groceries1 USD

2021-09-06 DDD
Assets:Checking
Expenses:Food:Groceries1 USD

2021-09-06 EEE
Assets:Checking
Expenses:Food:Groceries1 USD

2021-09-06 FFF
Assets:Checking
Expenses:Food:Groceries1 USD

-- 

--- 
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/843ae06d-b10e-47b4-ab61-9b73a940b14en%40googlegroups.com.


Cannot use expressions inside braces. Possible bug or am I missing something?

2021-09-11 Thread Felipe Mica
2021-09-06 Test
Assets:Checking
Expenses:Food:Groceries 1 BTC @ (R$ 280,000.00 * 2)

Expressions using @ works. But inside {  } does not. Why?

2021-09-06 Test
Assets:Checking
Expenses:Food:Groceries 1 BTC {(R$ 280,000.00 * 2)}

While parsing file "draft.ledger", line 3:
While parsing posting:
  Expenses:Food:Groceries 1 BTC {(R$ 280,000.00 * 2)}
  ^^^
Error: No quantity specified for amount


-- 

--- 
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/509c4be1-ebec-4f92-b9d0-68422c4c9e70n%40googlegroups.com.


Re: Possible bug: Re: How does --unrealized work?

2019-03-29 Thread Dániel Fancsali
Hello,

I think, the question of where ledger gets it is answered by this:

$ ledger reg -f list.ldg --revalued -X '$' -w

18-Dec-31 Opening Balances   Assets:Stocks
$1000$1000

 Equity:Opening Balances
$-10000

19-Feb-01 Commodities revalued   
  $80  $80

19-Feb-02 Broker Assets:Stocks
$-540$-460

 Assets:Checking
  $540  $80

19-Feb-10 Commodities revalued   
  $-50  $30

19-Feb-10 Broker Assets:Stocks
  $490 $520

 Assets:Checking
$-490  $30

19-Mar-01 Commodities revalued   
  $70 $100


It seems to me it is the gains are the sum of the positive, while the
losses the negative revaluations.

What I couldn't wrap my head around is this:

MAC-0073934:Private f7745312$ ledger reg -f list.ldg --lot-prices -w

18-Dec-31 Opening Balances   Assets:Stocks
2 AAPL {$500}2 AAPL {$500}

 Equity:Opening Balances
$-1000   $-1000


  2 AAPL {$500}

19-Feb-02 Broker Assets:Stocks
-1 AAPL {$540}   $-1000


  2 AAPL {$500}


-1 AAPL {$540}

 Assets:Checking
  $540$-460


  2 AAPL {$500}


-1 AAPL {$540}

19-Feb-10 Broker Assets:Stocks
1 AAPL {$490}$-460


  1 AAPL {$490}


  2 AAPL {$500}


-1 AAPL {$540}

 Assets:Checking
$-490$-950


  1 AAPL {$490}


  2 AAPL {$500}


-1 AAPL {$540}
Does that mean, ledger is unable to decide which one I really sold? Or am I
missing the point of the whole lot-pricing system?

Regards,
Dan

On Fri, 29 Mar 2019 at 06:28, Martin Michlmayr  wrote:

> * Richard Lawrence  [2019-03-22 13:10]:
> > I never got a reply, so since it's possible there's a bug here, I
> > thought I would bump this message.  Does anyone have any insights about
> > my Example 3?
>
> I think we need John to comment on this.  It certainly looks incorrect
> to me.
> --
> Martin Michlmayr
> https://www.cyrius.com/
>
> --
>
> ---
> 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: Possible bug: Re: How does --unrealized work?

2019-03-29 Thread Martin Michlmayr
* Richard Lawrence  [2019-03-22 13:10]:
> I never got a reply, so since it's possible there's a bug here, I
> thought I would bump this message.  Does anyone have any insights about
> my Example 3?

I think we need John to comment on this.  It certainly looks incorrect
to me.
-- 
Martin Michlmayr
https://www.cyrius.com/

-- 

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


Possible bug: Re: How does --unrealized work?

2019-03-22 Thread Richard Lawrence
Hi all,

I never got a reply, so since it's possible there's a bug here, I
thought I would bump this message.  Does anyone have any insights about
my Example 3?

Best,
Richard

Richard Lawrence  writes:

> Hi everyone,
>
> In trying to answer Chary's question, I have realized I do not have a
> very good grip on how to think about "unrealized" gains and losses, and
> how ledger calculates them.  So I wrote a few test cases to help explain
> it to myself.  (Can you tell I'm procrastinating a little bit? ;) I am
> not sure, but I *may* have discovered a bug: see Example 3.  Can someone
> explain this to me?
>
> Example 1: you hold a certain quantity of stock throughout the
> entire period, during which its value fluctuates.  Say you hold 2
> shares of AAPL.  At the beginning of the period, each is worth $500.
> At the end, each is worth $525.
>
> 2018/12/31 Opening Balances
> Assets:Stocks  2 AAPL @ $500
> Equity:Opening Balances
>
> P 2019/01/01 AAPL $500
> P 2019/02/01 AAPL $515
> P 2019/03/01 AAPL $525
>
> The unrealized gain is then:
>   (2 AAPL * $525) - (2 AAPL * $500) = $1050 - $1000 = $50
> i.e.,
>   (end quantity * end price) - (beginning quantity * beginning price) 
>
> That is exactly what ledger reports, with --unrealized:
>
> ledger -f test.journal bal Assets:Stocks -X '$' --unrealized
>
>$1050  Assets:Stocks
> $-50  Equity:Unrealized Gains
> 
>$1000
>
> ==
> Example 2: you hold a certain quantity of stock throughout the
> entire period, but you also acquire more at some point in the
> middle.  Say you hold 2 AAPL at the beginning of the period, each
> worth $500. At some later point, when AAPL is up to $510, you buy
> one more share.  At the end of the period, all three shares are
> worth $525.  
>
> 2018/12/31 Opening Balances
> Assets:Stocks  2 AAPL @ $500
> Assets:Checking $1000.00
> Equity:Opening Balances
>
> P 2019/01/01 AAPL $500
>
> P 2019/02/01 AAPL $510
>
> 2019/02/02 Broker
> Assets:Stocks  1 AAPL @ $510.00
> Assets:Checking
> 
> P 2019/03/01 AAPL $525
>
> I would then expect the unrealized gain to be:
>   (3 AAPL * $525) - (2 AAPL * $500 + 1 AAPL * $510) = $65
>
> Again, this is just what ledger says:
>
> ledger -f test.journal bal Assets:Stocks -X '$' --unrealized 
> $1575.00  Assets:Stocks
>  $-65.00  Equity:Unrealized Gains
> 
> $1510.00
>
> ==
> Now for the problematic example:
>
> Example 3: you sell some stock at one point when the price
> rises, and reacquire it when the price drops.  Say you start holding
> 2 shares of AAPL, each worth $500.  Then, when the price is up to
> $540, you sell one share, resulting in a realized gain of $40.
> Later, the price drops to $490 and you buy another share.  At the
> end of the period, the price is $525, and you also have $50 in the bank.
>
> 2018/12/31 Opening Balances
> Assets:Stocks  2 AAPL @ $500
> Equity:Opening Balances
>
> P 2019/02/01 AAPL $540
>
> 2019/02/02 Broker
> Assets:Stocks -1 AAPL @ $540.00
> Assets:Checking
>
> P 2019/02/10 AAPL $490
>
> 2019/02/10 Broker
> Assets:Stocks  1 AAPL @ $490
> Assets:Checking
>   
> P 2019/03/01 AAPL $525
>
> Now, what is the unrealized gain here?  First of all, it's not clear how
> this should be calculated.  I thought of two reasonable ways to
> calculate it, which give different results. From one perspective, this
> example is the same as Example 1: you started and ended the period with
> 2 shares of AAPL, worth $500 each at the beginning and $525 at the end,
> for an unrealized gain of $50.  But following the logic of Example 2,
> counting unrealized gains only from the first time the share is
> acquired, we'd get:
>   $525 - $500 = $25 unrealized gain for Share #1 (held the whole period)
>   $525 - $490 = $35 unrealized gain for Share #3 (bought on 2019/02/10)
> leading to a total of $60 of unrealized gain.   
>
> Ledger actually does it differently.  It says we have $150 in
> unrealized gains, and $50 in unrealized losses:
>
> ledger -f test.journal bal Assets:Stocks -X '$' --unrealized 
> $1050.00  Assets:Stocks
> $-100.00  Equity
> $-150.00Unrealized Gains
>   

Re: Bug with --flat and --depth?

2018-06-26 Thread Scott Carpenter
Ah, that looks like it. Thank you.

On Tuesday, June 26, 2018 at 9:03:45 AM UTC-5, Martin Michlmayr wrote:
>
> * Scott Carpenter > [2018-06-26 06:13]: 
> > With this data: 
>
> I think this is the same as 
> https://github.com/ledger/ledger/issues/1020 
>
> -- 
> Martin Michlmayr 
> https://www.cyrius.com/ 
>

-- 

--- 
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: Bug with --flat and --depth?

2018-06-26 Thread Scott Carpenter
I started looking at csv exports which is maybe something I should be using 
anyway, but I see there the same issue with --depth, e.g.:

$ ledger csv -f temp.ldg --depth 2
"2018/06/26","","store","abc: def","$","100","",""

However! Going back to my other post with data like this:

2018/06/26 store
abc $50
abc: def$100
lmnop: qrs: tuv

That comes out much better when not using --depth:

"2018/06/26","","store","abc","$","50","",""
"2018/06/26","","store","abc: def","$","100","",""
"2018/06/26","","store","lmnop: qrs: tuv","$","-150","",""

So I can look at doing my own depth management.


On Tuesday, June 26, 2018 at 8:13:56 AM UTC-5, Scott Carpenter wrote:
>
> With this data:
>
> 2018/06/26 store
> abc: def$100
> lmnop: qrs: tuv
>
> bal --depth 2 results in:
>
> $100  abc: def
>$-100  lmnop: qrs
> 
>0
>
> But bal --depth 2 --flat gives:
>
> $100  abc: def
>
>

-- 

--- 
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: Bug with --flat and --depth?

2018-06-26 Thread Martin Michlmayr
* Scott Carpenter  [2018-06-26 06:13]:
> With this data:

I think this is the same as
https://github.com/ledger/ledger/issues/1020

-- 
Martin Michlmayr
https://www.cyrius.com/

-- 

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


Bug with --flat and --depth?

2018-06-26 Thread Scott Carpenter
With this data:

2018/06/26 store
abc: def$100
lmnop: qrs: tuv

bal --depth 2 results in:

$100  abc: def
   $-100  lmnop: qrs

   0

But bal --depth 2 --flat gives:

$100  abc: def

-- 

--- 
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 this a bug? Unknown account warning with --strict when using $account

2017-12-21 Thread John Wiegley
>>>>> "RJ" == Radoslaw Jurga <radoslaw.ju...@gmail.com> writes:

RJ> I get a warning that I think shouldn't be there when I use the --strict
RJ> option.

This is definitely a bug!

John

-- 

--- 
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 this a bug? Unknown account warning with --strict when using $account

2017-12-01 Thread John Wiegley
>>>>> "RJ" == Radoslaw Jurga <radoslaw.ju...@gmail.com> writes:

JR> I get a warning that I think shouldn't be there when I use the --strict
RJ> option.

>> Warning: "Budget.dat", line 16: Unknown account 'Budget:$account'

Yes, you're right, this is a bug.

The Bugzilla is still down, but I'd like to migrate the issues to GitHub. Let
me spend some time over the next week and see how difficult that will really be.

John

-- 

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


Is this a bug? Unknown account warning with --strict when using $account

2017-12-01 Thread Radoslaw Jurga
I get a warning that I think shouldn't be there when I use the --strict 
option.

> Warning: "Budget.dat", line 16: Unknown account 'Budget:$account'

Here are the relevant lines in Budget.dat:

> = /^Expenses:(?=Groceries|Rent|Utilities)/
> (Budget:$account)-1.0

When the referenced $account is parsed during execution, Budget:$account 
always yields accounts that are already known. So in my opinion there 
should be no warning and I would consider this a bug.

A workaround is to add the following at the top of the Budget.dat file:

> account Budget:$account

Please let me know if you know better ways to deal with this situation. 
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.


Bug fix for total in value expressions; Added print directive (was Re: Debugging assertion failures ...)

2017-10-22 Thread John Lee
I debugged this and it seems this is indeed a bug (which crops up when
total is used in a value expression that's evaluated before all
transactions have been parsed): when I change account_t::add_post in
account.cc to null out xdata_->family_details.total, things seem to
behave more or less how I expected.

I think there's no way to print the value of a value expression, so I
added a directive for that.  I named it 'debug', but probably it should
be called 'print'?

I'll post my patches when bugzilla is back (but they need cleaning up,
adding docs etc).

On Thu, 19 Oct 2017, at 23:43, John Lee wrote:
> An example that currently has me puzzled: the first assert below passes,
> and the second fails.  I'm interested both in learning why in this
> particular case, and more important, learning how to use ledger to debug
> problems like this in general.
> 
> 2017-10-01 * Opening Balance
> Assets:CurrentAccount   $1000
> Equity:OpeningBalance
> 
> 2017-10-02 * Savings
> Assets:CurrentAccount:Savings   $100
> Assets:CurrentAccount
> 
> assert account("Assets:CurrentAccount").total == $1000
> 
> 2017-10-03 * Savings
> Assets:CurrentAccount:Savings   $100
> Assets:CurrentAccount
> 
> assert account("Assets:CurrentAccount").total == $1000
> 
> 
> This surprises me because if I comment that last assert out and run
> ledger b '^Assets:CurrentAccount$' I get $800, and ledger b
> '^Assets:CurrentAccount:Savings$' prints $200 -- which adds to $1000,
> and indeed ledger b '^Assets:CurrentAccount' prints $1000.  Bug??  How
> can I see what ledger *thinks* the total is when it evaluates the
> assert?
> 
> 
> On Thu, 19 Oct 2017, at 23:13, John Lee wrote:
> > Sometimes the assert expressions I'm adding to my ledger file fail and I
> > don't immediately know why.  If I have something like this:
> > 
> > assert account("Assets:CurrentAccount").total == $123.45
> > 
> > and I'm wrong about the total, then I'll just be told that I'm wrong,
> > and not what the correct value is.  What's the easiest way to get ledger
> > to compute and print the correct value?
> > 
> > Maybe there's a way to print out account values at a given point in a
> > ledger file?  In particular, maybe there's a way to print the values of
> > value expressions as the ledger file is evaluated by a command like
> > balance?
> > 
> > I realize it's good to be able to see what the answer is before one
> > writes it down, but sometimes it just saves time to have the computer
> > work it out so you can see quickly what you did wrong.

-- 

--- 
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: Bug with automated transactions and balance assertions?

2017-02-25 Thread 'Yuval Hager' via Ledger

On 02/24/2017 11:32 PM, John Wiegley wrote:

This is run whenever a transaction is parsed.  It's current.journal->add_xact
that does the processing of automated transactions before adding it to the
journal.


I am not familiar with the code, but I tried debugging it anyways, as I use 
automated transactions myself quite a bit.


It seems that indeed the automated transaction is processed correctly and 
pushed to the account on the second post.


However, on the third xact, the assertion kicks in. Before the balance 
assertion is thrown, in instance_t::parse_post, the value of the account is 
calculated (line 1650):


  value_t account_total
(post->account->amount().strip_annotations(keep_details_t()));

This calculates the value of the account by adding all the transactions. I 
believe at this point, then automated transaction is not being considered.


I conclude that by seeing that in amount(), add_to_value() is called only once, 
(just the explicit transaction, and not for the automated one probably). Here's 
an excerpt from my gdb session:


Breakpoint 3, ledger::(anonymous namespace)::instance_t::parse_post 
(this=0x7fffacb0, line=0x7db19c "Budget", len=17, account=0x7d0620,
xact=0x7e62b0, defer_expr=false) at 
/home/yuval/software/ledger/src/textual.cc:1650

1650(post->account->amount().strip_annotations(keep_details_t()));
(gdb) c
Continuing.

Breakpoint 4, ledger::post_t::add_to_value (this=0x7e40c0, value=..., expr=...) 
at /home/yuval/software/ledger/src/post.cc:628

628   if (xdata_ && xdata_->has_flags(POST_EXT_COMPOUND)) {
(gdb)
Continuing.

Breakpoint 2, ledger::(anonymous namespace)::instance_t::parse_post 
(this=0x7fffacb0, line=0x7db19c "Budget", len=17, account=0x7d0620,
xact=0x7e62b0, defer_expr=false) at 
/home/yuval/software/ledger/src/textual.cc:1690

1690  amount_t tot = amt - diff;
(gdb) p account_total.as_amount().to_double()
$53 = 100

I could not fully drill down the values to print them in gdb, but I would 
expect to see two calls to add_to_value(), and that the account_total would be 
90 at this point. My guess is that the automated transaction is missing a flag.



Here's a debug run:

$ ./ledger --debug post -f /tmp/ledger.dat
0ms  [INFO]  Ledger starting
1ms  [INFO]  Parsing file "/home/yuval/.ledgerrc"
Ledger 3.1.2-20160801, the command-line accounting tool

Copyright (c) 2003-2016, John Wiegley.  All rights reserved.

This program is made available under the terms of the BSD Public License.
See LICENSE file included with the distribution for details and disclaimer.
1ms  [INFO]  Parsing file "/tmp/ledger.dat"
3ms  [DEBUG] line 14: account balance = $90
3ms  [DEBUG] line 14: post amount = $90
3ms  [DEBUG] line 14: diff = $0
3ms  [DEBUG] line 15: account balance = $10
3ms  [DEBUG] line 15: post amount = $10
3ms  [DEBUG] line 15: diff = $0
4ms  [DEBUG] line 16: account balance = $100
4ms  [DEBUG] line 16: post amount = $90
4ms  [DEBUG] line 16: diff = $-10
While parsing file "/tmp/ledger.dat", line 16:
While parsing posting:
  Budget   $0 = $90
^^^
Error: Balance assertion off by $-10 (expected to see $100)
4ms  [INFO]  Ledger ended


I used v3.1-567-g3a00e1cd, and the same file the OP gave in the top of the 
thread. Here it is again:


= /Expense/
(Budget)  -1

01/01 Paid
Assets  $100
Income
(Budget)  $100

01/02 Lunch
Expense  $10
Assets

01/03 Assertions
Assets   $0 = $90
Expense  $0 = $10
Budget   $0 = $90

--

--- 
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: Bug with automated transactions and balance assertions?

2017-02-25 Thread Michael Cooper
In the test file I included in my first message the automated transaction
definition occurs first thing in the file. My real files are a little more
complex, consisting of multiple files all included together, but the rules
are included before the transactions in that case as well.

On Fri, Feb 24, 2017 at 11:32 PM John Wiegley  wrote:

> > "MC" == Michael Cooper  writes:
>
> MC> for transaction in transactions_from(some_file):
> MC> transaction.check_assertions()
> MC> book.apply_automated(transaction)
> MC> book.add(transaction)
>
> Yes, this is how it should be.  In the parser we find:
>
> void instance_t::xact_directive(char * line, std::streamsize len)
> {
>   if (xact_t * xact = parse_xact(line, len, top_account())) {
> unique_ptr manager(xact);
>
> if (context.journal->add_xact(xact)) {
>   manager.release();// it's owned by the journal now
>   context.count++;
> }
>   } else {
> throw parse_error(_("Failed to parse transaction"));
>   }
> }
>
> This is run whenever a transaction is parsed.  It's
> current.journal->add_xact
> that does the processing of automated transactions before adding it to the
> journal.
>
> Just to check: Do your automated transaction occur earlier in the Ledger
> file
> than the transactions in question?
>
> --
> John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
> http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2
>
> --
>
> ---
> 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: Bug with automated transactions and balance assertions?

2017-02-24 Thread John Wiegley
> "MC" == Michael Cooper  writes:

MC> for transaction in transactions_from(some_file):
MC> transaction.check_assertions()
MC> book.apply_automated(transaction)
MC> book.add(transaction)

Yes, this is how it should be.  In the parser we find:

void instance_t::xact_directive(char * line, std::streamsize len)
{
  if (xact_t * xact = parse_xact(line, len, top_account())) {
unique_ptr manager(xact);

if (context.journal->add_xact(xact)) {
  manager.release();// it's owned by the journal now
  context.count++;
}
  } else {
throw parse_error(_("Failed to parse transaction"));
  }
}

This is run whenever a transaction is parsed.  It's current.journal->add_xact
that does the processing of automated transactions before adding it to the
journal.

Just to check: Do your automated transaction occur earlier in the Ledger file
than the transactions in question?

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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: Bug with automated transactions and balance assertions?

2017-02-20 Thread Michael Cooper
I'm not sure I can whether the automated transaction's posting get inserted
before or after the posting that triggered them, as I don't expect to be
able to make assertions inside a transaction that is affected by an
automated transaction. I think what I care about is that transactions
affected by automated transactions don't ever exist in a partially-complete
state.

To be clear, the error that I'm trying  to point out is not that the
automated transaction didn't apply "in-time" to the 3rd transaction, the
one on 01/03, but that it didn't apply correctly to the *second*
transaction, the one on 01/02. Right now it seems that the automated
transaction is only processed after all transactions have been processed,
instead of "in-line". To explain in code, I think the current process is
something like (in Python):

```
for transaction in transactions_from(some_file):
transaction.check_assertions()
book.add(transaction)

for transaction in book:
book.apply_automated(transaction)
```

What I think it *should* be is more like

```
for transaction in transactions_from(some_file):
transaction.check_assertions()
book.apply_automated(transaction)
book.add(transaction)
```

Disclaimer: I haven't read any of the ledger source code, and I don't know
C++. This is just based on a guess of how I might write a ledger-like-tool.

On Sun, Feb 19, 2017 at 9:48 AM John Wiegley <jo...@newartisans.com> wrote:

> >>>>> "MC" == Michael Cooper <myth...@gmail.com> writes:
>
> MC> It seems that the automated transaction has not taken affect when the
> MC> balance assertion is evaluated. I consider this a bug.
>
> Looking at the code, it seems we handle balance assertions right away,
> before
> automated transactions are processed.
>
> The problem with reversing the order is this: The ordering of the postings
> in
> the transaction is significant. If all the automated transactions's
> postings
> just get added to the end (which is what happens), it won't change the
> behavior to what you're expecting.
>
> It seems like what you want to happen is that the automated transaction's
> posting get inserted immediately *before* the posting the triggered them.
> This
> is the only way they could effect the balance assertions, but it seems a
> bit
> of a strange place to insert them...
>
> --
> John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
> http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2
>

-- 

--- 
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: maybe a bug

2017-02-02 Thread o1bigtenor
On Thu, Feb 2, 2017 at 1:37 PM, Craig Earls  wrote:

> You didn't give ledger a command (bal, reg, etc) so it put you into
> interactive mode.
>
>
Thank you! Added 'balance' after ledger and everything is good.

Sorry to the distirbance! I did tell me that there were errors in the same
format as
per normal so I didn't realize that I hadn't included the command.

Over and out

Dee

>
> On Thu, Feb 2, 2017 at 12:06 o1bigtenor  wrote:
>
>> Greetings
>>
>> Working on my books and I'm getting this:
>>
>> user@hostname:~$ ledger -f /location/of/my/file
>> Ledger 3.1.0-20141005, the command-line accounting tool
>>
>> Copyright (c) 2003-2014, John Wiegley. All rights reserved.
>>
>> This program is made available under the terms of the BSD Public License.
>> See LICENSE file included with the distribution for details and
>> disclaimer.
>> ]
>>
>>
>> haven't yet had the opportunity of seeing this joy before.
>>
>> What does it mean?
>>
>> TIA
>>
>> Dee
>>
>> --
>>
>> ---
>> 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.
>>
> --
> Craig, Corona De Tucson, AZ
> [image: missile_flyout]
> enderw88.wordpress.com
>
> --
>
> ---
> 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: How can I report a bug?

2017-01-12 Thread Martin Michlmayr
* Mario Sangiorgio <mariosangior...@gmail.com> [2017-01-12 06:58]:
> I was trying to use ledger with the --explicit and --pedantic command line 
> options but I came across a bug.
> If I don't have any account defined it doesn't raise any error. I tried to 
> add a single account definition and I got the errors I was expecting.

This is a known issue:
http://bugs.ledger-cli.org/show_bug.cgi?id=771

-- 
Martin Michlmayr
http://www.cyrius.com/

-- 

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


How can I report a bug?

2017-01-12 Thread Mario Sangiorgio
Hello,

I was trying to use ledger with the --explicit and --pedantic command line 
options but I came across a bug.
If I don't have any account defined it doesn't raise any error. I tried to 
add a single account definition and I got the errors I was expecting.

The github page has issues disabled so I am wondering what's the 
recommended way to report issues.

Thanks,
Mario

-- 

--- 
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: Bad problem with {=....} (bug?)

2016-11-13 Thread thierry
Ooops

```
$ ledger --args-only --no-pager --file=/tmp/test.ledger bal
  $ -8938.26
23.99975 LTC  Assets
  $ -8938.26Bank
23.99975 LTCMycelium
 $ 88.49
0.00025 LTC {=$ 399.99}  Expenses
 $ 88.49
0.5 LTC {=$ 399.99}Trading costs
0.00020 LTC {=$ 399.99}Transfer fees
 0.00025 LTC
-0.00025 LTC {=$ 399.99}  Revenue:Exchange

  $ -8849.77
24.0 LTC
```


On Sunday, November 13, 2016 at 11:45:18 PM UTC+1, thierry wrote:
>
> This is how I would have done it:
>
> ```
> P 2016-01-14 01:27:52 LTC $ 432.05
>
> P 2016-01-17 17:19:08 LTC $ 372.92
>
> 2016/01/17=2016/01/20 * purchase on trading platform
> Assets:Trading  24 LTC @@ $ 8849.77
> Expenses:Trading costs $ 88.49
> Assets:Bank $ -8938.26
>
> 2016-01-30 * transfer of LTC purchase
> Assets:Trading -24 LTC
> Assets:Mycelium 24 LTC
>
> P 2016-07-26 18:00:00 LTC $ 399.99
>
> 2016-07-26 * transfer to trading platform
> Assets:Mycelium -8 LTC
> Assets:Trading 7.99975 LTC
> Expenses:Transfer fees  0.0002 LTC {=$ 399.99}
> Expenses:Trading costs 0.5 LTC {=$ 399.99}
> Revenue:Exchange 8 LTC
> Revenue:Exchange  -7.99975 LTC
> Revenue:Exchange   -0.0002 LTC {=$ 399.99}
> Revenue:Exchange  -0.5 LTC {=$ 399.99}
>
> 2016-07-28 * transfer from trading platform
> Assets:Trading-7.99975 LTC
> Assets:Mycelium7.99975 LTC
>
> P 2016-08-03 21:35:02 LTC $ 539.48
> ```
>
> ```
> $ ledger --args-only --file=/tmp/test.ledger bal
>   $ -8938.26
> 23.99975 LTC  Assets
>   $ -8938.26Bank
> 23.99975 LTCMycelium
>  $ 88.49
> 0.00025 LTC {=$ 368.7405}  Expenses
>  $ 88.49
> 0.5 LTC {=$ 368.7405}Trading costs
> 0.00020 LTC {=$ 368.7405}Transfer fees
>  0.00025 LTC
> -0.00025 LTC {=$ 368.7405}  Revenue:Exchange
> 
>   $ -8849.77
> 24.0 LTC
> ```
>
> Thierry
>
> On Sunday, November 13, 2016 at 8:50:06 PM UTC+1, Manuel Amador (Rudd-O) 
> wrote:
>>
>> Using ledger 3.1.1-1.fc24 I am seeing the following issue whenever I use 
>> the @= stanza to fix the price of an expenditure in an expense account 
>> (so that it won't fluctuate wildly with the exchange rate).  Instead of 
>> the fraction of the lot getting the fixed price, *the entire lot* gets 
>> that fixed price. 
>>
>> This looks like a bug to me.  But, if it isn't, I would certainly 
>> appreciate people helping me figure out how I fix the price of an 
>> expenditure without fixing it for the rest of the lot. 
>>
>> --- 
>>
>> P 2016-01-14 01:27:52 BTC $ 432.05 
>>
>> P 2016-01-17 17:19:08 BTC $ 372.92 
>>
>> 2016/01/17=2016/01/20 * purchase on trading platform 
>> Assets:Trading  24 LTC @ $ 368.7405 
>> Expenses:Trading costs $ 88.49 
>> Assets:Bank $ -8938.26 
>>
>> 2016-01-30 * transfer of LTC purchase 
>> Assets:Trading   -24 LTC {$ 368.7405} 
>> [2016/01/17] @ $ 368.7405 
>> Assets:Mycelium24 LTC {$ 368.7405} 
>> [2016/01/17] @ $ 368.7405 
>>
>> 2016-07-26 * transfer to trading platform 
>> Assets:Mycelium  -8 LTC {$ 368.7405} [2016/01/17] @ $ 
>> 368.7405 
>> Assets:Trading 7.99975 LTC {$ 368.7405} [2016/01/17] 
>> @ $ 368.7405 
>> Expenses:Transfer fees  0.0002 LTC {$ 368.7405} 
>> [2016/01/17] @= $ 368.7405 
>> Expenses:Trading costs  0.5 LTC {$ 368.7405} 
>> [2016/01/17] @= $ 368.7405 
>>
>> 2016-07-28 * transfer from trading platform 
>> Assets:Trading   -7.99975 LTC {$ 368.7405} 
>> [2016/01/17] @ $ 368.7405 
>> Assets:Mycelium   7.99975 LTC {$ 368.7405} 
>> [2016/01/17] @ $ 368.7405 
>>
>> P 2016-08-03 21:35:02 BTC $ 539.48 
>>
>> ;Expected ledger bal -f test 
>> ;  $ -8938.26 
>> ;23.99975 LTC  Assets 
>> ;  $ -8938.26Bank 
>> ;23.99975 LTCMycelium 
>> ; 

Re: Bad problem with {=....} (bug?)

2016-11-13 Thread thierry
This is how I would have done it:

```
P 2016-01-14 01:27:52 LTC $ 432.05

P 2016-01-17 17:19:08 LTC $ 372.92

2016/01/17=2016/01/20 * purchase on trading platform
Assets:Trading  24 LTC @@ $ 8849.77
Expenses:Trading costs $ 88.49
Assets:Bank $ -8938.26

2016-01-30 * transfer of LTC purchase
Assets:Trading -24 LTC
Assets:Mycelium 24 LTC

P 2016-07-26 18:00:00 LTC $ 399.99

2016-07-26 * transfer to trading platform
Assets:Mycelium -8 LTC
Assets:Trading 7.99975 LTC
Expenses:Transfer fees  0.0002 LTC {=$ 399.99}
Expenses:Trading costs 0.5 LTC {=$ 399.99}
Revenue:Exchange 8 LTC
Revenue:Exchange  -7.99975 LTC
Revenue:Exchange   -0.0002 LTC {=$ 399.99}
Revenue:Exchange  -0.5 LTC {=$ 399.99}

2016-07-28 * transfer from trading platform
Assets:Trading-7.99975 LTC
Assets:Mycelium7.99975 LTC

P 2016-08-03 21:35:02 LTC $ 539.48
```

```
$ ledger --args-only --file=/tmp/test.ledger bal
  $ -8938.26
23.99975 LTC  Assets
  $ -8938.26Bank
23.99975 LTCMycelium
 $ 88.49
0.00025 LTC {=$ 368.7405}  Expenses
 $ 88.49
0.5 LTC {=$ 368.7405}Trading costs
0.00020 LTC {=$ 368.7405}Transfer fees
 0.00025 LTC
-0.00025 LTC {=$ 368.7405}  Revenue:Exchange

  $ -8849.77
24.0 LTC
```

Thierry

On Sunday, November 13, 2016 at 8:50:06 PM UTC+1, Manuel Amador (Rudd-O) 
wrote:
>
> Using ledger 3.1.1-1.fc24 I am seeing the following issue whenever I use 
> the @= stanza to fix the price of an expenditure in an expense account 
> (so that it won't fluctuate wildly with the exchange rate).  Instead of 
> the fraction of the lot getting the fixed price, *the entire lot* gets 
> that fixed price. 
>
> This looks like a bug to me.  But, if it isn't, I would certainly 
> appreciate people helping me figure out how I fix the price of an 
> expenditure without fixing it for the rest of the lot. 
>
> --- 
>
> P 2016-01-14 01:27:52 BTC $ 432.05 
>
> P 2016-01-17 17:19:08 BTC $ 372.92 
>
> 2016/01/17=2016/01/20 * purchase on trading platform 
> Assets:Trading  24 LTC @ $ 368.7405 
> Expenses:Trading costs $ 88.49 
> Assets:Bank $ -8938.26 
>
> 2016-01-30 * transfer of LTC purchase 
> Assets:Trading   -24 LTC {$ 368.7405} 
> [2016/01/17] @ $ 368.7405 
> Assets:Mycelium24 LTC {$ 368.7405} 
> [2016/01/17] @ $ 368.7405 
>
> 2016-07-26 * transfer to trading platform 
> Assets:Mycelium  -8 LTC {$ 368.7405} [2016/01/17] @ $ 368.7405 
> Assets:Trading 7.99975 LTC {$ 368.7405} [2016/01/17] 
> @ $ 368.7405 
> Expenses:Transfer fees  0.0002 LTC {$ 368.7405} 
> [2016/01/17] @= $ 368.7405 
> Expenses:Trading costs  0.5 LTC {$ 368.7405} 
> [2016/01/17] @= $ 368.7405 
>
> 2016-07-28 * transfer from trading platform 
> Assets:Trading   -7.99975 LTC {$ 368.7405} 
> [2016/01/17] @ $ 368.7405 
> Assets:Mycelium   7.99975 LTC {$ 368.7405} 
> [2016/01/17] @ $ 368.7405 
>
> P 2016-08-03 21:35:02 BTC $ 539.48 
>
> ;Expected ledger bal -f test 
> ;  $ -8938.26 
> ;23.99975 LTC  Assets 
> ;  $ -8938.26Bank 
> ;23.99975 LTCMycelium 
> ; $ 88.49 
> ; 0.00025 LTC  Expenses 
> ; $ 88.49 
> ;0.5 LTC{=$ 368.7405}Trading costs 
> ;0.00020 LTC{=$ 368.7405}Transfer fees 
> ; 
> ;  $ -8849.77 
> ;24.0 LTC 
> ; 
> ;Got ledger bal -f test 
> ;  $ -8938.26 
> ;23.99975 LTC {=$ 368.7405}  Assets 
> ;  $ -8938.26Bank 
> ;23.99975 LTC {=$ 368.7405}Mycelium 
> ; $ 88.49 
> ;0.00025 LTC {=$ 368.7405}  Expenses 
> ; $ 88.49 
> ;0.5 LTC {=$ 368.7405}Trading costs 
> ;0.00020 LTC {=$ 368.7405}Transfer fees 
> ; 
> ;  $ -8849.77 
> ;24.0 LTC {=$ 368.7405} 
>
> -- 
> Rudd-O 
> http://rudd-o.com/ 
>
>

-- 

--- 
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: Budgeting bug (account hierarchies and matching)

2016-10-02 Thread James Blachly
Thanks to both of you for your input, and to Lifepillar for introducing me to 
the “budget” command. I had previously not used it because I had ledger aliased 
to 'ledger -E -V’ ; interestingly running the budget subcommand with those 
options in combination (but neither singly) will crash the program.

> On Oct 2, 2016, at 3:33 PM, Lifepillar  wrote:
> 
> On 2016-10-02 17:35:07 +, John Wiegley said:
> 
>>> "L" == Lifepillar   writes:
>> L> Re (1), I believe that it is a good idea not to have nested accounts in 
>> the
>> L> budget, the way you have. In other words, I think that reports would make
>> L> more sense if you used:
>> Although, there's a useful meaning here.  Say my budget were:
>>~ Monthly
>> Expenses:Food   $50.00
>> Expenses:Food:Dining$20.00
>> Assets
>> This says that I want to spend no more than $50 on food in a given month; and
>> that further, of that $50, I'd like no more than $20 to be spent on dining.
> 
> Sure, but that does not seem well supported by Ledger, e.g., `ledger budget` 
> outputs:
> 
>  0   $70.00   $70.00 0  
> Expenses:Food
>  0   $20.00   $20.00 0Dining
>      -
>  0   $70.00   $70.00 0
> Actual BudgetedRemaining  Used
> 
> Ditto for --budget. At least, you should do this instead:
> 
>>~ Monthly
>> Expenses:Food:Dining$20.00
>> Expenses:Food   $30.00
>> Assets
> 
> Say you spend $40 on food and $10 on dining out, then you'll get:
> 
> $50.00   $50.000  100%  
> Expenses:Food
> $10.00   $20.00   $10.00   50%Dining
>      -
> $50.00   $50.000  100%
> Actual BudgetedRemaining  Used
> 
> 
> which is a fine report. The problem is that the budget seems inconsistent with
> the report. IMHO, avoiding subaccounts is a good compromise, e.g.,
> 
> ~ Monthly
> Expenses:Food:Other $30.00
> Expenses:Food:Dining$20.00
> Assets
> 
> 2016/10/02 * Other
> Expenses:Food:Other   $40.00
> Expenses:Food:Dining  $10.00
> Assets
> 
> ledger budget exp
> 
> $50.00   $50.000  100%  
> Expenses:Food
> $10.00   $20.00   $10.00   50%Dining
> $40.00   $30.00  $-10.00  133%Other
>      -
> $50.00   $50.000  100%
> Actual BudgetedRemaining  Used
> 
> I still see that I am within budget overall. Besides, the report looks in 
> accordance
> with the way the budget is defined. It does give the impression that I've 
> overspent
> in a category, though.
> 
> In this example, one may prefer the former method, but in a more complex 
> budget
> it may get confusing, I believe.
> 
> Life
> 
> 
> -- 
> 
> --- 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/UdwJnM6MSL8/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.


Re: Budgeting bug (account hierarchies and matching)

2016-10-02 Thread Lifepillar

On 2016-10-02 17:35:07 +, John Wiegley said:



"L" == Lifepillar   writes:


L> Re (1), I believe that it is a good idea not to have nested accounts in the
L> budget, the way you have. In other words, I think that reports would make
L> more sense if you used:

Although, there's a useful meaning here.  Say my budget were:

~ Monthly
 Expenses:Food   $50.00
 Expenses:Food:Dining$20.00
 Assets

This says that I want to spend no more than $50 on food in a given month; and
that further, of that $50, I'd like no more than $20 to be spent on dining.


Sure, but that does not seem well supported by Ledger, e.g., `ledger 
budget` outputs:


  0   $70.00   $70.00 0  
Expenses:Food

  0   $20.00   $20.00 0Dining
      -
  0   $70.00   $70.00 0
 Actual BudgetedRemaining  Used

Ditto for --budget. At least, you should do this instead:


~ Monthly
 Expenses:Food:Dining$20.00
 Expenses:Food   $30.00
 Assets


Say you spend $40 on food and $10 on dining out, then you'll get:

 $50.00   $50.000  100%  
Expenses:Food

 $10.00   $20.00   $10.00   50%Dining
      -
 $50.00   $50.000  100%
 Actual BudgetedRemaining  Used


which is a fine report. The problem is that the budget seems inconsistent with
the report. IMHO, avoiding subaccounts is a good compromise, e.g.,

~ Monthly
Expenses:Food:Other $30.00
Expenses:Food:Dining$20.00
Assets

2016/10/02 * Other
 Expenses:Food:Other   $40.00
 Expenses:Food:Dining  $10.00
 Assets

ledger budget exp

 $50.00   $50.000  100%  
Expenses:Food

 $10.00   $20.00   $10.00   50%Dining
 $40.00   $30.00  $-10.00  133%Other
      -
 $50.00   $50.000  100%
 Actual BudgetedRemaining  Used

I still see that I am within budget overall. Besides, the report looks 
in accordance
with the way the budget is defined. It does give the impression that 
I've overspent

in a category, though.

In this example, one may prefer the former method, but in a more complex budget
it may get confusing, I believe.

Life


--

--- 
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: Budgeting bug (account hierarchies and matching)

2016-10-02 Thread James Blachly
Dear John et al,

The workaround (re-ordering the periodic transactions as described in #415) 
fixes the assignment issue for both the minimal example I posted as well as my 
production data.

Do others use the ~ Periodic + —budget mode, or am I in a very small minority?

Kind regards
James


> On Oct 2, 2016, at 1:52 AM, John Wiegley <jo...@newartisans.com> wrote:
> 
>>>>>> "JB" == James Blachly <james.blac...@gmail.com> writes:
> 
> JB> If anyone can weigh in on whether this behavior is likely to change (bug
> JB> reported by John in 2010...), I can decide how best to structure all my
> JB> accounts (as I am a new user, I am still trying to find the best system of
> JB> accounts / hierarchies). At a minimum, it would be nice if this key fact
> JB> is mentioned in documentation (section 9.1).
> 
> JB> Lastly, if this has gotten no attention because literally no one actually
> JB> uses the periodic transactions + --budget, and instead uses something else
> JB> like virtual accounts, or automatic postings to envelope-type accounts,
> JB> please let me know!
> 
> I haven't heard anyone else complain about it yet, although it's certainly a
> bug.  Does the workaround described in #415 work for you?
> 
> -- 
> John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
> http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2
> 
> -- 
> 
> --- 
> 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/UdwJnM6MSL8/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.


Re: Budgeting bug (account hierarchies and matching)

2016-10-01 Thread John Wiegley
>>>>> "JB" == James Blachly <james.blac...@gmail.com> writes:

JB> If anyone can weigh in on whether this behavior is likely to change (bug
JB> reported by John in 2010...), I can decide how best to structure all my
JB> accounts (as I am a new user, I am still trying to find the best system of
JB> accounts / hierarchies). At a minimum, it would be nice if this key fact
JB> is mentioned in documentation (section 9.1).

JB> Lastly, if this has gotten no attention because literally no one actually
JB> uses the periodic transactions + --budget, and instead uses something else
JB> like virtual accounts, or automatic postings to envelope-type accounts,
JB> please let me know!

I haven't heard anyone else complain about it yet, although it's certainly a
bug.  Does the workaround described in #415 work for you?

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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: Budgeting bug (account hierarchies and matching)

2016-10-01 Thread James Blachly
Well, I apologize that I may have posted too soon.

After more digging, I found Bug 415: 
http://bugs.ledger-cli.org/show_bug.cgi?id=415

This appears to be the same thing.

If anyone can weigh in on whether this behavior is likely to change (bug 
reported by John in 2010...), I can decide how best to structure all my 
accounts (as I am a new user, I am still trying to find the best system of 
accounts / hierarchies). At a minimum, it would be nice if this key fact is 
mentioned in documentation (section 9.1).

Lastly, if this has gotten no attention because literally no one actually 
uses the periodic transactions + --budget, and instead uses something else 
like virtual accounts, or automatic postings to envelope-type accounts, 
please let me know!

Thanks again.

-- 

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


Budgeting bug (account hierarchies and matching)

2016-10-01 Thread James Blachly
Hello,

I am a brand new user with less than a month of transactions entered so 
far, but I am sold on plain text accounting. Wish I had discovered this 
years ago!

Anyway, while setting up budgets, I ran into the following problem, which 
is best summarized as *"IFF balancing against a budget, expenses are 
counted against the highest-in-hierarchy matching account, rather than the 
most specific account." *Here is a minimal reproducible example:

~ Monthly
 Expenses:Auto $100.00
 Expenses:Auto:Gas $50.00
 Assets


2016/10/01 * Gulf
 Expenses:Auto:Gas $40.00
 Assets


Now, when I run a register it looks correct:

$ ledger -E -f example_budgetbug.txt reg exp
16-Oct-01 Gulf  Expenses:Auto:Gas   
  $40.00   $40.00



*However, if I run this in --budget balance mode it does not:*

$ ledger -E -f example_budgetbug.txt --budget reg exp
16-Oct-01 Budget transactionExpenses:Auto   
$-100.00 $-100.00
16-Oct-01 Budget transactionExpenses:Auto:Gas   
 $-50.00 $-150.00
16-Oct-01 Gulf  Expenses:Auto   
  $40.00 $-110.00



*Note that it matched the transaction to Expenses:Auto instead of 
Expenses:Auto:Gas as in the previous example.*
This is of course problematic because now I cannot track a subcategory (in 
this case, gas) separately from miscellaneous category expenses.
To be more concrete, if I wanted to track how I am doing on gas expenses, I 
cannot:

$ ledger -E -f example_budgetbug.txt reg expenses:auto:gas
16-Oct-01 Gulf  Expenses:Auto:Gas   
  $40.00   $40.00
$ ledger -E -f example_budgetbug.txt --budget reg expenses:auto:gas
16-Oct-01 Budget transactionExpenses:Auto:Gas   
 $-50.00  $-50.00



Finally, eliminating the broad category does eliminate the wrong behavior 
as you would predict:
(in the following example I changed the broad category to 
Expenses:Auto:Repair)

$ cat example_budgetbug.txt

~ Monthly
 Expenses:Auto:Repair $100.00
 Expenses:Auto:Gas $50.00
 Assets


2016/10/01 * Gulf
 Expenses:Auto:Gas $40.00
 Assets


$ ledger -E -f example_budgetbug.txt reg expenses:auto:gas
16-Oct-01 Gulf  Expenses:Auto:Gas   
  $40.00   $40.00
$ ledger -E -f example_budgetbug.txt --budget reg expenses:auto:gas
16-Oct-01 Budget transactionExpenses:Auto:Gas   
 $-50.00  $-50.00
16-Oct-01 Gulf  Expenses:Auto:Gas   
  $40.00  $-10.00





I am running Ledger 3.1.1-20160111 from Homebrew, and I apologize if this 
represents a bug that was already fixed. I looked in the bug tracker but 
did not see it. Thank you all in advance for your help.

James 

-- 

--- 
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: Possible bug in budgeting?

2016-03-10 Thread John Wiegley
> Andrew Lyon  writes:

> I was planning on setting some budgets per-month, so "in " seemed to
> make sense. Is there a reason it doesn't work like this? After your
> suggestion I also tried "monthly from mar to april" but that has the same
> effect as "in mar" (only includes the first transaction). Either way I can
> work around this now.

"month from mar to april" is the same as "month in mar", since the ending of
the period is exclusive.

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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: Possible bug in budgeting?

2016-03-10 Thread Andrew Lyon
Yes, thank you, that works!

I was planning on setting some budgets per-month, so "in " seemed to 
make sense. Is there a reason it doesn't work like this? After your 
suggestion I also tried "monthly from mar to april" but that has the same 
effect as "in mar" (only includes the first transaction). Either way I can 
work around this now.

Thanks.

On Thursday, March 10, 2016 at 1:31:33 PM UTC-8, Lifepillar wrote:
>
> On 2016-03-10 17:40:05 +, Andrew Lyon said: 
>
> > Ryan, I'm having a similar issue. Were you able to resolve it? 
> > 
> > Here's my log: 
> > 
> > ~ monthly in mar 
> > expenses:finance:investment  $400 
> > expenses:household:groceries $550 
> > expenses:household:hardware  $25 
> > assets 
>
> Wouldn't 
>
>  ~ monthly since mar 
>
> be ok for you? 
>
> Life 
>
>
>

-- 

--- 
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: Possible bug in budgeting?

2016-03-10 Thread Lifepillar

On 2016-03-10 17:40:05 +, Andrew Lyon said:


Ryan, I'm having a similar issue. Were you able to resolve it?

Here's my log:

~ monthly in mar
    expenses:finance:investment              $400
    expenses:household:groceries             $550
    expenses:household:hardware              $25
    assets


Wouldn't

~ monthly since mar

be ok for you?

Life


--

--- 
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: Possible bug in budgeting?

2016-03-10 Thread Andrew Lyon
Ryan, I'm having a similar issue. Were you able to resolve it?

Here's my log:

~ monthly in mar
expenses:finance:investment  $400
expenses:household:groceries $550
expenses:household:hardware  $25
assets

2016/03/02 retirement
expenses:finance:investment  $400.00
liabilities:andrew

2016/03/09 groceries plus
expenses:household:groceries  $58.47
liabilities:jcc

2016/03/10 hank's
expenses:household:hardware   $14.37
liabilities:jcc


$ ledger -f test/log.txt budget
   0 $-975.00  $975.00 0  assets
 $400.00  $975.00 $-575.00   41%  expenses
 $400.00  $400.000  100%finance:investment
   0  $575.00 $-575.00 0household
   0  $550.00 $-550.00 0  groceries
   0   $25.00  $-25.00 0  hardware
   -
 $400.000  $400.00 0

It's showing everything under "household" as 0 even though there is are 
grocery and hardware transactions. If I remove the "2016/03/02 retirement" 
transaction, then the groceries transaction is counted but not hardware. It 
seems like only the first transaction that matches the budget is being 
counted and all others are thrown out. Running a reg or bal command counts 
those transactions just fine, so there are obviously no syntax issues.

The same issues occur if using --budget on the reg command. Maybe a deeper 
bug in the budgeting system? Anyone else experiencing this?

Andrew


On Saturday, February 20, 2016 at 2:14:51 PM UTC-8, Ryan Nowakowski wrote:
>
> With this ledger file: 
>
> ~ Monthly 2016/1/1 
> Expenses:Salary $4000 
> Assets:Checking 
>
> ~ Monthly 2016/2/1 
> Expenses:Salary $5000 
> Assets:Checking 
>
> 2016/1/1 Salary 
> Expenses:Salary $4000 
> Assets:Checking 
>
> 2016/2/1 Salary 
> Expenses:Salary $4000 
> Assets:Checking 
>
> ...when I run this: ledger register ^Expenses --monthly 
>
> ...I get this: 
> 16-Jan-01 - 16-Jan-31   Expenses:Salary   $4000   
>  $4000 
> 16-Feb-01 - 16-Feb-29   Expenses:Salary   $4000   
>  $8000 
>
> Which looks correct.  When I add --budget like this: ledger register 
> ^Expenses --monthly --budget 
>
> ...I get this: 
>
> 16-Feb-01 - 16-Feb-29   Expenses:Salary  $-1000   
> $-1000 
>
> I would expect to get this instead: 
>
> 16-Jan-01 - 16-Jan-31   Expenses:Salary       $4000   
>  0 
> 16-Feb-01 - 16-Feb-29   Expenses:Salary  $-1000   
> $-1000 
>
> Could this be a bug?  This is using release/3.1.1 compiled from git 
>
> - Ryan 
>

-- 

--- 
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: [Bug?] Automatic transaction on null-amount posting with multiple commodities

2016-03-01 Thread John Wiegley
>>>>> Paggas  <pag...@yahoo.gr> writes:

> I really think this is a bug, since ledger would generate 2 filled postings
> for the null-posting, so the automatic transaction should also run on both.
> For now I'm circumventing this bug by writing in the amount of the posting
> by hand in the file.

Indeed, this sounds like a bug. Could you please report it to
http://bugs.ledger-cli.org? It sounds like something I simply forgot to allow
for.

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

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


[Bug?] Automatic transaction on null-amount posting with multiple commodities

2016-03-01 Thread Paggas
Hello ledger mailing list!

I've just noticed a possible bug in ledger.  The idea is that, when there 
is a null-amount posting which balances multiple commodities in the 
transaction, any automatic transactions that get activated on that posting 
will only run for one of the commodities.

The issue came up in Bitcoin trading, where one commodity is EUR (euros) 
and the other is XBT (bitcoins).  I'll write an example ledger file.



= /^Income:Capital/
Budget:Income:Capital  -1
Budget:Total  1

1/1  Sell
Assets:EUR  3,728.76 kr (400 EUR)
Assets:XBT  -1 XBT
Income:Capital



A register report on the above file will show that the automatic 
transaction will run on the EUR posting of Income:Capital, but not on the 
XBT posting.



$ ledger -f test.ledger reg
16-Jan-01 Sell  Assets:EUR  400 EUR 
 400 EUR
Assets:XBT   -1 XBT 
 400 EUR
  
-1 XBT
Income:Capital -400 EUR   
-1 XBT
Income:Capital1 XBT 
   0
Budget:Income:Capital   400 EUR 
 400 EUR
Budget:Total   -400 EUR 
   0



I really think this is a bug, since ledger would generate 2 filled postings 
for the null-posting, so the automatic transaction should also run on both. 
 For now I'm circumventing this bug by writing in the amount of the posting 
by hand in the file.

Any comments welcome :)

//Paggas

-- 

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


Possible bug in budgeting?

2016-02-20 Thread Ryan Nowakowski
With this ledger file:

~ Monthly 2016/1/1 
Expenses:Salary $4000
Assets:Checking

~ Monthly 2016/2/1
Expenses:Salary $5000
Assets:Checking

2016/1/1 Salary
Expenses:Salary $4000
Assets:Checking

2016/2/1 Salary
Expenses:Salary $4000
Assets:Checking

...when I run this: ledger register ^Expenses --monthly

...I get this:
16-Jan-01 - 16-Jan-31   Expenses:Salary   $4000$4000
16-Feb-01 - 16-Feb-29   Expenses:Salary   $4000$8000

Which looks correct.  When I add --budget like this: ledger register ^Expenses 
--monthly --budget

...I get this:

16-Feb-01 - 16-Feb-29   Expenses:Salary  $-1000   $-1000

I would expect to get this instead:

16-Jan-01 - 16-Jan-31   Expenses:Salary   $40000
16-Feb-01 - 16-Feb-29   Expenses:Salary  $-1000   $-1000

Could this be a bug?  This is using release/3.1.1 compiled from git

- Ryan

-- 

--- 
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: Bug - forecast "forgets" about monthly transactions?

2016-01-21 Thread John Wiegley
> G S Osler  writes:

> ~ every 14 days from 2016/01/04

> The first forecast transaction unless I am mistaken should be 1st Feb., not
> 27th Jan.

Yes, that is odd...

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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: Bug - forecast "forgets" about monthly transactions?

2016-01-21 Thread G S Osler

Ledger v3.1.0, also getting forecasting issues:

~ every 14 days from 2016/01/04
Assets:Current2500.00
Income:Salary

2016/01/11 * Opening balance
Assets:Current15000.00
Equity:Opening Balances

with the command:

ledger -f ./foo.dat --forecast 'd<[2017]' register '^Assets'

Gives the following forecast:

16-Jan-11 Opening balance   Assets:Current15000
15000
16-Jan-27 Forecast transaction  Assets:Current 2500
17500
16-Feb-10 Forecast transaction  Assets:Current 2500
2
16-Feb-24 Forecast transaction  Assets:Current 2500
22500

The first forecast transaction unless I am mistaken should be 1st Feb., not 
27th Jan.

This is abstracted out from the main ledger file, things worked fine until 
the new 3.X release.

-- 

--- 
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: Bug - forecast "forgets" about monthly transactions?

2016-01-21 Thread G S Osler

It gets odder, if I change the recurrence rule from 'every 2 weeks' to 
'biweekly':

~ biweekly from 2016/01/04
Assets:Current2500.00
Income:Salary

Unless I am mistaken the output should not be any different yet the result 
is:

16-Jan-11 Opening balance   Assets:Current15000
15000
16-Jan-24 Forecast transaction  Assets:Current 2500
17500
16-Feb-07 Forecast transaction  Assets:Current 2500
2
16-Feb-21 Forecast transaction  Assets:Current 2500
22500

-- 

--- 
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: Bug - forecast "forgets" about monthly transactions?

2016-01-10 Thread John Wiegley
>>>>> Kuba Orlik <groovy...@gmail.com> writes:

> Is there an issue/bug tracker that we can report this bug to?

http://bugs.ledger-cli.org

> Also, do you know of:
> * any way to mitigate this subtle bug?
> * an alternative to the `--forecast` option? It could be an additional piece
> of software.

Personally, no, I do not right now.

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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: Bug - forecast "forgets" about monthly transactions?

2016-01-10 Thread Kuba Orlik
Is there an issue/bug tracker that we can report this bug to?

Also, do you know of:
* any way to mitigate this subtle bug?
* an alternative to the `--forecast` option? It could be an additional
piece of software.

-- 

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


Bug - forecast "forgets" about monthly transactions?

2016-01-09 Thread Kuba Orlik


Ledger version: 3.1.1-20150915 (compiled from source, commit c9427aa, 
tagged `release-3.1.1)

Consider the following data file:

~ Monthly
Expenses:Food  100
Assets:Checking

~ Monthly
Income  -80
Assets:Checking

2016/01/01 Initial state
Assets:Checking  150
Equity

2016/01/15 Grocery
Expenses:Food  20
Assets:Checking

Running the following command: ledger r assets --forecast "T>={0}"

Gives the following result:

16-Jan-01 Initial stateAssets:Checking 150  150
16-Jan-15 Grocery  Assets:Checking -20  130
16-Feb-01 Forecast transaction Assets:Checking-100   30
16-Feb-01 Forecast transaction Assets:Checking  80  110
16-Mar-01 Forecast transaction Assets:Checking-100   10
16-Mar-01 Forecast transaction Assets:Checking  80   90
16-Apr-01 Forecast transaction Assets:Checking  80   70
16-May-01 Forecast transaction Assets:Checking  80  150
16-Jun-01 Forecast transaction Assets:Checking  80  230
16-Jul-01 Forecast transaction Assets:Checking  80  310
16-Aug-01 Forecast transaction Assets:Checking  80  390
16-Sep-01 Forecast transaction Assets:Checking  80  470
16-Oct-01 Forecast transaction Assets:Checking  80  550
16-Nov-01 Forecast transaction Assets:Checking  80  630
16-Dec-01 Forecast transaction Assets:Checking  80  710
17-Jan-01 Forecast transaction Assets:Checking  80  790
17-Feb-01 Forecast transaction Assets:Checking  80  870
17-Mar-01 Forecast transaction Assets:Checking  80  950
17-Apr-01 Forecast transaction Assets:Checking  80 1030
17-May-01 Forecast transaction Assets:Checking  80 1110
17-Jun-01 Forecast transaction Assets:Checking  80 1190
17-Jul-01 Forecast transaction Assets:Checking  80 1270
:
(the list goes on)

It seems that after two months, it “forgets” to subtract 100… why is that 
so? Is it a problem with the program itself, or with its configuration?
​

-- 

--- 
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: Bug - forecast "forgets" about monthly transactions?

2016-01-09 Thread John Wiegley
>>>>> Kuba Orlik <groovy...@gmail.com> writes:

> Running the following command: ledger r assets --forecast "T>={0}"

> It seems that after two months, it “forgets” to subtract 100… why is that
> so? Is it a problem with the program itself, or with its configuration?

The forecasting should continue as long as the total is greater than 0. This
sounds like a subtle bug.

The forecasting logic is mostly a hack anyway, and should be ripped out of
core Ledger and moved into a Python module.

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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 surprising result (bug?) with --end quiry option

2015-12-15 Thread John Wiegley
> Martin Michlmayr  writes:

> (There are 3 definitions for --end!)

The source code shows that --end is *exclusive*, such that:

-b 2014 -e 2015

Means: All transactions in 2014, none from 2015.

One can always use value expressions with --limit to craft whatever time
equation they wish. The options above equate to:

-l 'date >= [2014] && date < [2015]'

-- 
John Wiegley  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com  60E1 46C4 BD1A 7AC1 4BA2

-- 

--- 
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 surprising result (bug?) with --end quiry option

2015-12-15 Thread Martin Michlmayr
* charles  [2015-12-07 17:04]:
> ledger -f test.ldg print --begin 2015-12-07 --end 2015-12-08

This is correct.

> That description makes me think --end 2015-12-07 would find a transaction 
> dated 2015-12-07.
> Or am I misunderstanding??

The man page is misldeading.

The manual is clearer on this:

Limit the processing to transactions before @var{DATE}.

Specify the end @var{DATE} for a transaction to be considered in the
report.  All transactions on or after this date are ignored.

Constrain the report so that transactions on or after @var{DATE} are
not considered.

(There are 3 definitions for --end!)

I'll update the man page.

-- 
Martin Michlmayr
http://www.cyrius.com/

-- 

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


a surprising result (bug?) with --end quiry option

2015-12-07 Thread charles
Hello all,

I performed this little test with ledger and was surprised by the result. 
Is it a bug, or intended?

I created a test file containing the following transaction:

2015-12-07 (exp) holiday chocolate for clients
  ; holiday gift for promotion
  Expenses:PromotionUSD 75.73 
  Assets:Checking

I was surprised when following ledger command produced no output:

ledger -f test.ldg print --begin 2015-12-01 --end 2015-12-07

[zilch]

Yes this command with the end date bumped out one day does find the 
transaction:

ledger -f test.ldg print --begin 2015-12-07 --end 2015-12-08

2015-12-07 (exp) holiday chocolate for clients
; holiday gift for promotion
Expenses:Promotion USD 75.73
; debit account
Assets:Checking
; credit account


Man ledger contains this description of --end:

  --end DATE (-e)
  Specify the end DATE for a transaction to be considered in the
  report.

That description makes me think --end 2015-12-07 would find a transaction 
dated 2015-12-07.
Or am I misunderstanding??

-- Charles

-- 

--- 
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: initial blank line bug

2014-12-24 Thread Craig Earls
I feel better but it isn't great news.  This is a ledger bug.  Putting
unicode spaces on empty lines confuses ledger.  I will put it in bug zilla.


On Mon, Dec 22, 2014 at 9:33 AM, Craig Earls ender...@gmail.com wrote:

 Thanks. I will look into this.


 On Monday, December 22, 2014, Robert Carlsen 
 princessandsuper...@gmail.com wrote:

 Any of the unicode space characters on this page -
 http://www.cs.tut.fi/~jkorpela/chars/spaces.html - seem to trigger the
 issue.  I've only tried putting them on lines outside of transactions FWIW.

 On Saturday, November 8, 2014 10:29:20 PM UTC-6, Craig Earls wrote:

 Can you tell me what characters?  If ledger wasn't choking on them,
 neither should ledger mode

 On Saturday, November 8, 2014, Robert Carlsen princessa...@gmail.com
 wrote:

 Someone had been inserting strange, invisible unicode characters into
 my journal.  Sorry for the noise - and long, lost reply.

 On Friday, August 8, 2014 9:51:52 PM UTC-5, Craig Earls wrote:

 I can't reproduce this behavior.  What library versions are you using?

 On Wed, Aug 6, 2014 at 11:56 AM, Robert Carlsen
 princessa...@gmail.com wrote:
  When the first line of my ledger file is blank, I get this error:
 
  While parsing file /home/robert/git/money/rwc-finances.ledger,
 line 1:
  Error: Directive '' requires an argument
 
  Removing the initial blank line fixes the issue.
 
  OS: x86_64 arch linux
  Ledger version 3.0.2-20140507
 
  --
 
  ---
  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+...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

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



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

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



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com




-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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: initial blank line bug

2014-12-22 Thread Robert Carlsen
Any of the unicode space characters on this page - 
http://www.cs.tut.fi/~jkorpela/chars/spaces.html - seem to trigger the 
issue.  I've only tried putting them on lines outside of transactions FWIW.

On Saturday, November 8, 2014 10:29:20 PM UTC-6, Craig Earls wrote:

 Can you tell me what characters?  If ledger wasn't choking on them, 
 neither should ledger mode

 On Saturday, November 8, 2014, Robert Carlsen princessa...@gmail.com 
 javascript: wrote:

 Someone had been inserting strange, invisible unicode characters into my 
 journal.  Sorry for the noise - and long, lost reply.

 On Friday, August 8, 2014 9:51:52 PM UTC-5, Craig Earls wrote:

 I can't reproduce this behavior.  What library versions are you using? 

 On Wed, Aug 6, 2014 at 11:56 AM, Robert Carlsen 
 princessa...@gmail.com wrote: 
  When the first line of my ledger file is blank, I get this error: 
  
  While parsing file /home/robert/git/money/rwc-finances.ledger, line 
 1: 
  Error: Directive '' requires an argument 
  
  Removing the initial blank line fixes the issue. 
  
  OS: x86_64 arch linux 
  Ledger version 3.0.2-20140507 
  
  -- 
  
  --- 
  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+...@googlegroups.com. 
  For more options, visit https://groups.google.com/d/optout. 



 -- 
 Craig, Corona De Tucson, AZ 
 enderw88.wordpress.com 

  -- 

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



 -- 
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com


-- 

--- 
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: initial blank line bug

2014-12-22 Thread Craig Earls
Thanks. I will look into this.

On Monday, December 22, 2014, Robert Carlsen princessandsuper...@gmail.com
wrote:

 Any of the unicode space characters on this page -
 http://www.cs.tut.fi/~jkorpela/chars/spaces.html - seem to trigger the
 issue.  I've only tried putting them on lines outside of transactions FWIW.

 On Saturday, November 8, 2014 10:29:20 PM UTC-6, Craig Earls wrote:

 Can you tell me what characters?  If ledger wasn't choking on them,
 neither should ledger mode

 On Saturday, November 8, 2014, Robert Carlsen princessa...@gmail.com
 wrote:

 Someone had been inserting strange, invisible unicode characters into my
 journal.  Sorry for the noise - and long, lost reply.

 On Friday, August 8, 2014 9:51:52 PM UTC-5, Craig Earls wrote:

 I can't reproduce this behavior.  What library versions are you using?

 On Wed, Aug 6, 2014 at 11:56 AM, Robert Carlsen
 princessa...@gmail.com wrote:
  When the first line of my ledger file is blank, I get this error:
 
  While parsing file /home/robert/git/money/rwc-finances.ledger,
 line 1:
  Error: Directive '' requires an argument
 
  Removing the initial blank line fixes the issue.
 
  OS: x86_64 arch linux
  Ledger version 3.0.2-20140507
 
  --
 
  ---
  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+...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

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



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

 ---
 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
 javascript:_e(%7B%7D,'cvml','ledger-cli%2bunsubscr...@googlegroups.com');
 .
 For more options, visit https://groups.google.com/d/optout.



-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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-mode - Bug and patch ledger-copy-transaction-at-point

2014-12-21 Thread guivho
The attached patch fixes the described problems for the current git version.

On Wednesday, December 17, 2014 3:23:36 PM UTC+1, guivho wrote:

 Hi Craig,

 I am using the latest elpa version ledger-mode-20141216.41

 ledger-copy-transaction-at-point has some issues for me:
 1) it does not insert a blank line after the new xact, although 
 ledger-navigate-find-xact-extents requires it
 2) it modifies the date of the xact that follows the freshly copied xact 
 rather than the date of tne new xact

 The attached patch fixes both problems.

 Kind regards,

 Guido


-- 

--- 
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.
*** ledger-xact.el.orig	Sun Dec 21 09:07:52 2014
--- ledger-xact.el	Sun Dec 21 09:09:06 2014
*** MOMENT is an encoded date
*** 128,135 
Ask for a new DATE and copy the transaction under point to that date.  Leave point on the first amount.
(interactive  (list
   (ledger-read-date Copy to date: )))
!   (let* ((here (point))
!  (extents (ledger-navigate-find-xact-extents (point)))
   (transaction (buffer-substring-no-properties (car extents) (cadr extents)))
   encoded-date)
  (if (string-match ledger-iso-date-regexp date)
--- 128,134 
Ask for a new DATE and copy the transaction under point to that date.  Leave point on the first amount.
(interactive  (list
   (ledger-read-date Copy to date: )))
!   (let* ((extents (ledger-navigate-find-xact-extents (point)))
   (transaction (buffer-substring-no-properties (car extents) (cadr extents)))
   encoded-date)
  (if (string-match ledger-iso-date-regexp date)
*** MOMENT is an encoded date
*** 138,150 
 (string-to-number (match-string 3 date))
 (string-to-number (match-string 2 date)
  (ledger-xact-find-slot encoded-date)
! (insert transaction \n)
! (ledger-navigate-beginning-of-xact)
! (re-search-forward ledger-iso-date-regexp)
! (replace-match date)
! (ledger-next-amount)
! (if (re-search-forward [-0-9])
! (goto-char (match-beginning 0)
  
  (defun ledger-delete-current-transaction (pos)
Delete the transaction surrounging POS.
--- 137,151 
 (string-to-number (match-string 3 date))
 (string-to-number (match-string 2 date)
  (ledger-xact-find-slot encoded-date)
! (let ((here (point)))
!   (insert transaction \n\n)
!   (goto-char here)
!   (ledger-navigate-beginning-of-xact)
!   (re-search-forward ledger-iso-date-regexp)
!   (replace-match date)
!   (ledger-next-amount)
!   (if (re-search-forward [-0-9])
!   (goto-char (match-beginning 0))
  
  (defun ledger-delete-current-transaction (pos)
Delete the transaction surrounging POS.


Bug ledger-copy-transaction-at-point

2014-12-17 Thread guivho
Hi Craig,

I am using the latest elpa version ledger-mode-20141216.41

ledger-copy-transaction-at-point has some issues for me:
1) it does not insert a blank line after the new xact, although 
ledger-navigate-find-xact-extents requires it
2) it modifies the date of the xact that follows the freshly copied xact 
rather than the date of tne new xact

The attached patch fixes both problems.

Kind regards,

Guido

-- 

--- 
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.
*** .~/ledger-xact.el.~1~	2014-12-17 14:58:37.0 +0100
--- ledger-xact.el	2014-12-17 15:05:20.0 +0100
*** MOMENT is an encoded date
*** 128,135 
Ask for a new DATE and copy the transaction under point to that date.  Leave point on the first amount.
(interactive  (list
   (ledger-read-date Copy to date: )))
!   (let* ((here (point))
!  (extents (ledger-navigate-find-xact-extents (point)))
   (transaction (buffer-substring-no-properties (car extents) (cadr extents)))
   encoded-date)
  (if (string-match ledger-iso-date-regexp date)
--- 128,134 
Ask for a new DATE and copy the transaction under point to that date.  Leave point on the first amount.
(interactive  (list
   (ledger-read-date Copy to date: )))
!   (let* ((extents (ledger-navigate-find-xact-extents (point)))
   (transaction (buffer-substring-no-properties (car extents) (cadr extents)))
   encoded-date)
  (if (string-match ledger-iso-date-regexp date)
*** MOMENT is an encoded date
*** 138,150 
 (string-to-number (match-string 3 date))
 (string-to-number (match-string 2 date)
  (ledger-xact-find-slot encoded-date)
! (insert transaction \n)
! (ledger-navigate-beginning-of-xact)
! (re-search-forward ledger-iso-date-regexp)
! (replace-match date)
! (ledger-next-amount)
! (if (re-search-forward [-0-9])
! (goto-char (match-beginning 0)
  
  (defun ledger-delete-current-transaction (pos)
Delete the transaction surrounging POS.
--- 137,151 
 (string-to-number (match-string 3 date))
 (string-to-number (match-string 2 date)
  (ledger-xact-find-slot encoded-date)
! (let ((here (point)))
!   (insert transaction \n\n)
!   (goto-char here)
!   (ledger-navigate-beginning-of-xact)
!   (re-search-forward ledger-iso-date-regexp)
!   (replace-match date)
!   (ledger-next-amount)
!   (if (re-search-forward [-0-9])
!   (goto-char (match-beginning 0))
  
  (defun ledger-delete-current-transaction (pos)
Delete the transaction surrounging POS.


Re: [BUG] Crash when using --trace option

2014-12-04 Thread Alexis
Hello John Wiegley on Thu, Dec 04, 2014 at 02:44:26AM CET, you wrote:
 I think it's --debug='*memory*' maybe?

Ah yes --debug memory in combination with --verify gives me
those TRACE_[CD]TOR messages, now I just need to make sense of it...

Alexis

-- 

--- 
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: [BUG] Crash when using --trace option

2014-12-03 Thread Alexis

 I'm not sure what's causing the segmentation fault, but there are no trace
 messages above level 9,

The documentation lists 11, see doc/ledger3.texi:9276
  --trace INT
Enable tracing. The INT specifies the level of trace desired:

  LOG_OFF 0
  LOG_CRIT  1
  LOG_FATAL 2
  LOG_ASSERT  3
  LOG_ERROR 4
  LOG_VERIFY  5
  LOG_WARN  6
  LOG_INFO  7
  LOG_EXCEPT  8
  LOG_DEBUG 9
  LOG_TRACE 10
  LOG_ALL 11

 so I'm not sure what type of information you'd be looking for.

I wanted to understand how parsing of timelog entries is done
and more specifically how the checkin of a post is initialized,
and whether it is converted to a value_t at some point.

 The whole tracing mechanism was pretty much subsumed by the advanced --debug
 class mechanism which got added later.  That one is regular expression based,
 so that I can target exactly which debug messages I'm interested in seeing.

I see, does the --trace option still serve any purpose that isn't handled by
the --debug option?

So which --debug option would I need to specify in order to see those
TRACE_CTOR and TRACE_DTOR messages?


Alexis

-- 

--- 
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: [BUG] Crash when using --trace option

2014-12-02 Thread John Wiegley
 Alexis  surryh...@gmail.com writes:

 Note that using smaller values than 10 work, even though it
 seems to have no effect on the trace level as suggested by the manpage.

 % for trace in {1..9}; do ./ledger -f test/input/sample.dat test--trace
 ${trace} 2/tmp/ledger_trace_${trace}.txt /dev/null; done

 Any helpful hints what needs to be changed?

I'm not sure what's causing the segmentation fault, but there are no trace
messages above level 9, so I'm not sure what type of information you'd be
looking for.

The whole tracing mechanism was pretty much subsumed by the advanced --debug
class mechanism which got added later.  That one is regular expression based,
so that I can target exactly which debug messages I'm interested in seeing.

John

-- 

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


[BUG] Crash when using --trace option

2014-12-01 Thread Alexis
Hi all,
I've build a debug version of ledger HEAD (4ee5329) and it crashes
when I try to use it with a value greater than 9 for its --trace option.

Steps to reproduce:
  * Run ledger with the --trace option, e.g.:
  % ./ledger -f test/input/sample.dat reg --trace 10

Expected result:
  Ledger shows detailed debugging log messages

Actual result:
  Ledger crashes with the following error message:
  libc++abi.dylib: terminating with uncaught exception of type
  std::logic_error: Argument to --trace must be an integer

Note that using smaller values than 10 work, even though it
seems to have no effect on the trace level as suggested by the manpage.

% for trace in {1..9}; do ./ledger -f test/input/sample.dat test--trace 
${trace} 2/tmp/ledger_trace_${trace}.txt /dev/null; done

Any helpful hints what needs to be changed?


Cheers,
Alexis

-- 

--- 
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: initial blank line bug

2014-11-08 Thread Robert Carlsen
Someone had been inserting strange, invisible unicode characters into my 
journal.  Sorry for the noise - and long, lost reply.

On Friday, August 8, 2014 9:51:52 PM UTC-5, Craig Earls wrote:

 I can't reproduce this behavior.  What library versions are you using? 

 On Wed, Aug 6, 2014 at 11:56 AM, Robert Carlsen 
 princessa...@gmail.com javascript: wrote: 
  When the first line of my ledger file is blank, I get this error: 
  
  While parsing file /home/robert/git/money/rwc-finances.ledger, line 1: 
  Error: Directive '' requires an argument 
  
  Removing the initial blank line fixes the issue. 
  
  OS: x86_64 arch linux 
  Ledger version 3.0.2-20140507 
  
  -- 
  
  --- 
  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+...@googlegroups.com javascript:. 
  For more options, visit https://groups.google.com/d/optout. 



 -- 
 Craig, Corona De Tucson, AZ 
 enderw88.wordpress.com 


-- 

--- 
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: initial blank line bug

2014-11-08 Thread Craig Earls
Can you tell me what characters?  If ledger wasn't choking on them, neither
should ledger mode

On Saturday, November 8, 2014, Robert Carlsen princessandsuper...@gmail.com
wrote:

 Someone had been inserting strange, invisible unicode characters into my
 journal.  Sorry for the noise - and long, lost reply.

 On Friday, August 8, 2014 9:51:52 PM UTC-5, Craig Earls wrote:

 I can't reproduce this behavior.  What library versions are you using?

 On Wed, Aug 6, 2014 at 11:56 AM, Robert Carlsen
 princessa...@gmail.com wrote:
  When the first line of my ledger file is blank, I get this error:
 
  While parsing file /home/robert/git/money/rwc-finances.ledger, line
 1:
  Error: Directive '' requires an argument
 
  Removing the initial blank line fixes the issue.
 
  OS: x86_64 arch linux
  Ledger version 3.0.2-20140507
 
  --
 
  ---
  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+...@googlegroups.com.
  For more options, visit https://groups.google.com/d/optout.



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

 ---
 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
 javascript:_e(%7B%7D,'cvml','ledger-cli%2bunsubscr...@googlegroups.com');
 .
 For more options, visit https://groups.google.com/d/optout.



-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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: Potential bug with period expressions

2014-09-01 Thread John Wiegley
 Andrew Schwartzmeyer and...@schwartzmeyer.com writes:

 Error: Unexpected date period token ‘until'

This is certainly a bug.  You can see how Ledger parses any period expression
using the period subcommand:

ledger period from jun to sep

Strangely, if you say from jun 2010 to sep, it works just fine, so it sounds
like it's just a deficiency of the current parser.

Can you please enter this as a high priority bug at bugs.ledger-cli.org?  I'm
at ICFP right now and am a bit distracted.

Thanks!
  John

-- 

--- 
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: Potential bug with period expressions

2014-09-01 Thread Andrew Schwartzmeyer

On Sep 1, 2014, at 5:07 AM, John Wiegley jo...@newartisans.com wrote:

 Andrew Schwartzmeyer and...@schwartzmeyer.com writes:
 
 Error: Unexpected date period token ‘until'
 
 This is certainly a bug.  You can see how Ledger parses any period expression
 using the period subcommand:
 
ledger period from jun to sep
 
 Strangely, if you say from jun 2010 to sep, it works just fine, so it sounds
 like it's just a deficiency of the current parser.

Quite strange indeed, but good enough workaround for me right now, thanks!
 
 Can you please enter this as a high priority bug at bugs.ledger-cli.org?

And done!

 I’m at ICFP right now and am a bit distracted.

I am definitely incredibly jealous. You’ll have to let me know how it is :D
 
 Thanks!
  John
 
 -- 
 
 --- 
 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.



signature.asc
Description: Message signed with OpenPGP using GPGMail


Potential bug with period expressions

2014-08-31 Thread Andrew Schwartzmeyer
Let me preface this with the fact that I may be using period expressions 
completely wrong and this isn’t a bug at all.

I’ve read through section 8.4 of the 3.0 docs on Period Expressions 
(http://www.ledger-cli.org/3.0/doc/ledger3.html#Period-Expressions). My long 
goal is to display my budgeted transactions monthly for this month, last month, 
and next month (July, August, September). I would think that a ledger command 
like this:

ledger --period from jul to sep” reg

Would at least display my register “from jul” [BEGIN] “to sep” [END], which may 
both be specified. The range is also sensible, so I feel like this should be 
accepted by the grammar. However, this expression causes ledger to return:

Error: Unexpected date period token ‘until'

This is true for ledger vesions Ledger 3.0.2-20140507 (home brew stable 
install) and 3.0.3-20140608 (home brew —from-HEAD install, so the master branch 
I’m assuming).

Am I totally missing something or is this a bug in the parser?


signature.asc
Description: Message signed with OpenPGP using GPGMail


Re: Bug in budget report?

2014-08-24 Thread Dave Wells
Was this patch rejected? I still get the error when putting in the test 
input above. Using Ledger 3.0.2-20140507 on OS X 10.9.4, installed via 
Homebrew.

Dave


On Thursday, November 3, 2011 8:35:27 PM UTC-7, Craig Earls wrote:

 John,
If you have the source for 3.0 and can't wait for a fix through the
 normal channel, open up report.h and at line 437 replace the budget
 format string with:

  %(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))
   %(justify(-scrub(get_at(total_expr, 1)), 12, 
 12 + 1 + 12, true, color))
   %(justify(scrub(get_at(total_expr, 1) + 
   get_at(total_expr, 0)), 12, 
 12 + 1 + 12 + 1 + 12, true, color))
   %(ansify_if(
 justify((get_at(total_expr, 1) ? 
  (100% * quantity(scrub(get_at(total_expr, 0 / 
   -quantity(scrub(get_at(total_expr, 1))) : 0), 
 5, -1, true, false),
 magenta if (color and get_at(total_expr, 1) and 
 (abs(quantity(scrub(get_at(total_expr, 0))) / 
  quantity(scrub(get_at(total_expr, 1 = 
 1
%(!options.flat ? depth_spacer : \\)
  %-(ansify_if(partial_account(options.flat), blue if color))\n
  %/%$1 %$2 %$3 %$4\n%/
  %(prepend_width ? \ \ * prepend_width : \\)
     -\n

 then rebuild the program (lengthy since many components are dependent
 on this header)

 I have entered a bug report and a pull request to incorporate the fix.


 On Thu, Nov 3, 2011 at 19:07, John Rakestraw li...@johnrakestraw.com 
 javascript: wrote:
 
  Thanks!
 

 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com



-- 

--- 
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: Bug in budget report?

2014-08-24 Thread Craig Earls
I will check this evening.  I couldn't merge pull requests back then and
may not have sent that patch correctly.

On Sunday, August 24, 2014, Dave Wells shawki...@gmail.com wrote:

 Was this patch rejected? I still get the error when putting in the test
 input above. Using Ledger 3.0.2-20140507 on OS X 10.9.4, installed via
 Homebrew.

 Dave


 On Thursday, November 3, 2011 8:35:27 PM UTC-7, Craig Earls wrote:

 John,
If you have the source for 3.0 and can't wait for a fix through the
 normal channel, open up report.h and at line 437 replace the budget
 format string with:

  %(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))
   %(justify(-scrub(get_at(total_expr, 1)), 12, 
 12 + 1 + 12, true, color))
   %(justify(scrub(get_at(total_expr, 1) + 
   get_at(total_expr, 0)), 12, 
 12 + 1 + 12 + 1 + 12, true, color))
   %(ansify_if(
 justify((get_at(total_expr, 1) ? 
  (100% * quantity(scrub(get_at(total_expr, 0 / 
   -quantity(scrub(get_at(total_expr, 1))) : 0), 
 5, -1, true, false),
 magenta if (color and get_at(total_expr, 1) and 
 (abs(quantity(scrub(get_at(total_expr, 0))) / 
  quantity(scrub(get_at(total_expr, 1 =
 1
%(!options.flat ? depth_spacer : \\)
  %-(ansify_if(partial_account(options.flat), blue if color))\n
  %/%$1 %$2 %$3 %$4\n%/
  %(prepend_width ? \ \ * prepend_width : \\)
     -\n

 then rebuild the program (lengthy since many components are dependent
 on this header)

 I have entered a bug report and a pull request to incorporate the fix.


 On Thu, Nov 3, 2011 at 19:07, John Rakestraw li...@johnrakestraw.com
 wrote:
 
  Thanks!
 

 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

 ---
 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
 javascript:_e(%7B%7D,'cvml','ledger-cli%2bunsubscr...@googlegroups.com');
 .
 For more options, visit https://groups.google.com/d/optout.



-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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: Bug in budget report?

2014-08-24 Thread Craig Earls
Wow, longest bug fix ever!  This patch never got merged back in 2011.  I
put it in tonight.


On Sun, Aug 24, 2014 at 2:37 PM, Craig Earls ender...@gmail.com wrote:

 I will check this evening.  I couldn't merge pull requests back then and
 may not have sent that patch correctly.


 On Sunday, August 24, 2014, Dave Wells shawki...@gmail.com wrote:

 Was this patch rejected? I still get the error when putting in the test
 input above. Using Ledger 3.0.2-20140507 on OS X 10.9.4, installed via
 Homebrew.

 Dave


 On Thursday, November 3, 2011 8:35:27 PM UTC-7, Craig Earls wrote:

 John,
If you have the source for 3.0 and can't wait for a fix through the
 normal channel, open up report.h and at line 437 replace the budget
 format string with:

  %(justify(scrub(get_at(total_expr, 0)), 12, -1, true, color))
   %(justify(-scrub(get_at(total_expr, 1)), 12, 
 12 + 1 + 12, true, color))
   %(justify(scrub(get_at(total_expr, 1) + 
   get_at(total_expr, 0)), 12, 
 12 + 1 + 12 + 1 + 12, true, color))
   %(ansify_if(
 justify((get_at(total_expr, 1) ? 
  (100% * quantity(scrub(get_at(total_expr, 0 /
 
   -quantity(scrub(get_at(total_expr, 1))) : 0), 
 5, -1, true, false),
 magenta if (color and get_at(total_expr, 1) and 
 (abs(quantity(scrub(get_at(total_expr, 0))) / 
  quantity(scrub(get_at(total_expr, 1
 = 1
%(!options.flat ? depth_spacer : \\)
  %-(ansify_if(partial_account(options.flat), blue if color))\n
  %/%$1 %$2 %$3 %$4\n%/
  %(prepend_width ? \ \ * prepend_width : \\)
     -\n

 then rebuild the program (lengthy since many components are dependent
 on this header)

 I have entered a bug report and a pull request to incorporate the fix.


 On Thu, Nov 3, 2011 at 19:07, John Rakestraw li...@johnrakestraw.com
 wrote:
 
  Thanks!
 

 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com

  --

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



 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com




-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

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


initial blank line bug

2014-08-08 Thread Robert Carlsen
When the first line of my ledger file is blank, I get this error:

While parsing file /home/robert/git/money/rwc-finances.ledger, line 1:
Error: Directive '' requires an argument

Removing the initial blank line fixes the issue.

OS: x86_64 arch linux
Ledger version 3.0.2-20140507

-- 

--- 
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: initial blank line bug

2014-08-08 Thread Craig Earls
I can't reproduce this behavior.  What library versions are you using?

On Wed, Aug 6, 2014 at 11:56 AM, Robert Carlsen
princessandsuper...@gmail.com wrote:
 When the first line of my ledger file is blank, I get this error:

 While parsing file /home/robert/git/money/rwc-finances.ledger, line 1:
 Error: Directive '' requires an argument

 Removing the initial blank line fixes the issue.

 OS: x86_64 arch linux
 Ledger version 3.0.2-20140507

 --

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



-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

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


Bug 768 - OS X installer is incomplete

2014-05-13 Thread Martin Michlmayr
Can someone running OS X please comment on Bug 768 - OS X installer is
incomplete:

http://bugs.ledger-cli.org/show_bug.cgi?id=768

-- 
Martin Michlmayr
http://www.cyrius.com/

-- 

--- 
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: Bug 768 - OS X installer is incomplete

2014-05-13 Thread Zack Williams
I think this is a documentation problem.  I assume they installed the
.dmg installer from the downloads page.

The places that ledger installs binaries are fine, although
/opt/ledger/bin or /usr/local/bin would also be suitable, but neither
of those is in the default PATH under OS X.

It's possible to add informative pages to the OS X installer process
that would tell the user they need to update their PATH variable in
order to use ledger.

I'm not sure how John is generating the installer package, but there
are a variety of ways to do it. I build OS X packages all the time for
$DAYJOB, so I could take this on.

- Zack

-- 

--- 
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: Bug 768 - OS X installer is incomplete

2014-05-13 Thread John Wiegley
 Zack Williams zdw...@gmail.com writes:

 I'm not sure how John is generating the installer package, but there are a
 variety of ways to do it. I build OS X packages all the time for $DAYJOB, so
 I could take this on.

Consider it yours, Zack! :)  Thank you so much.

John

-- 

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


budget bug

2014-01-18 Thread msft1055
~ Yearly from 2014/01/01 to 2014/12/31
Expenses:Health  $2400 
Expenses:Food:Restaurant  $1200
Expenses:Food:Groceries  $5400
Assets

1/7 bartell
Expenses:Food:Groceries  ($3.69 * 4)
amexCC

1/17 
Expenses:Food:Restaurant  $15 
amexCC

1/18 
Expenses:Health:SelfPay:Medication  $40.95
amexCC 




Note that the health account amount is wrong  

Report: budgetSpending
Command: ledger -f expb.ledger --budget --yearly register ^expenses
==

':0:'14-Jan-01 - 14-Dec-31   Expense:Food:Groceries$-5385.24   
 $-5385.24
':0:'Expens:Food:Restaurant$-1200.00   
 $-6585.24
':0:'Expenses:Health   $-2400.00   
 $-8985.24


now if I remove the 2 transactions dated 1/7 and 1/17
the report is correct 

bug filed  as  http://bugs.ledger-cli.org/show_bug.cgi?id=1008 

-- 

--- 
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/groups/opt_out.


Re: Bug: Decimal point parsing fails with many points after decimal

2013-11-27 Thread Craig Earls
Ledger's default is period decimal.  Failure to parse comma decimal without
--decimal-comma is not a bug.  Although I believe it should fail better.
 You can define decimal comma in your initialization file so that you don;t
have to type it from the command line.


On Tue, Nov 26, 2013 at 5:51 PM, mor...@tarn-vedra.de wrote:

 It seems like ledger (latest HEAD and before) makes the wrong judgements
 about decimal comma or decimal point when parsing values like
 '0,098BTC' (it's parsed as '98,0082BTC' unless --decimal-comma is
 active). A small test case is available under
 http://p.tarn-vedra.de/ledger-decimal-bug.html

 egh in the IRC channel pointed me to this line, which is responsible for
 parsing:
 https://github.com/ledger/ledger/blob/bba851b8304ef1bb432bb0dc41b1e5c57bc9cc61/src/amount.cc#L1118

 Please note that I'm posting via the Google Groups interface - please
 excude broken formatting or similar.

 Cheers,
 Moritz Ulrich

 --

 ---
 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/groups/opt_out.




-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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/groups/opt_out.


Re: Bug: Decimal point parsing fails with many points after decimal

2013-11-27 Thread Erik Hetzner
At Wed, 27 Nov 2013 06:44:02 -0700,
Craig Earls wrote:
 
 Ledger's default is period decimal.  Failure to parse comma decimal without
 --decimal-comma is not a bug.  Although I believe it should fail better.
  You can define decimal comma in your initialization file so that you don;t
 have to type it from the command line.

Hi Craig,

ledger does do detection to try to figure out what format the amount
is in. It is this detection that seems to be failing when the number
of digits following the comma is evenly divisible by 3. You can see
this by comparing how

  Assets:Bitcoin:Local  0,98BTC

and:

  Assets:Bitcoin:Local  0,980BTC
^ extra 0

are parsed.

(Personally, I find code like this fragile and tend to just prefer the
user tell me, via LC_NUMERIC or some such how numerals are formatted.
After all, how are we to distinguish `1,012BTC`?) But the code to try
to figure this out is there.

-Erik
-- 
Sent from my free software system http://fsf.org/.

-- 

--- 
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/groups/opt_out.


Re: Bug: Decimal point parsing fails with many points after decimal

2013-11-27 Thread Craig Earls
Maybe we should take it out to match my documentation!

--
Craig

On Wed, Nov 27, 2013 at 10:00 AM, Erik Hetzner ehetz...@gmail.com wrote:

 At Wed, 27 Nov 2013 06:44:02 -0700,
 Craig Earls wrote:
 
 Ledger's default is period decimal.  Failure to parse comma decimal without
 --decimal-comma is not a bug.  Although I believe it should fail better.
  You can define decimal comma in your initialization file so that you don;t
 have to type it from the command line.
 Hi Craig,
 ledger does do detection to try to figure out what format the amount
 is in. It is this detection that seems to be failing when the number
 of digits following the comma is evenly divisible by 3. You can see
 this by comparing how
   Assets:Bitcoin:Local  0,98BTC
 and:
   Assets:Bitcoin:Local  0,980BTC
 ^ extra 0
 are parsed.
 (Personally, I find code like this fragile and tend to just prefer the
 user tell me, via LC_NUMERIC or some such how numerals are formatted.
 After all, how are we to distinguish `1,012BTC`?) But the code to try
 to figure this out is there.
 -Erik
 -- 
 Sent from my free software system http://fsf.org/.

-- 

--- 
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/groups/opt_out.


Bug: Decimal point parsing fails with many points after decimal

2013-11-26 Thread moritz
It seems like ledger (latest HEAD and before) makes the wrong judgements 
about decimal comma or decimal point when parsing values like 
'0,098BTC' (it's parsed as '98,0082BTC' unless --decimal-comma is 
active). A small test case is available under 
http://p.tarn-vedra.de/ledger-decimal-bug.html

egh in the IRC channel pointed me to this line, which is responsible for 
parsing: 
https://github.com/ledger/ledger/blob/bba851b8304ef1bb432bb0dc41b1e5c57bc9cc61/src/amount.cc#L1118

Please note that I'm posting via the Google Groups interface - please 
excude broken formatting or similar.

Cheers,
Moritz Ulrich

-- 

--- 
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/groups/opt_out.


[BUG] Segmentation fault with -p and an empty selection

2013-06-02 Thread Rémi Vanicat
Hello,

In last ledger from git, I've a segmentation fault when using -p
something and there is no selected transaction as in:

  ledger reg \^Liabbillitti  -p 'monthly'
or
  ledger reg \^Liabbillitti  -p 'daily'


-- 
Rémi Vanicat

-- 

--- 
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/groups/opt_out.




Re: [BUG] Segmentation fault with -p and an empty selection

2013-06-02 Thread thierry
same here

On Sunday, June 2, 2013 3:02:45 PM UTC+2, Remi Vanicat wrote:

 Hello, 

 In last ledger from git, I've a segmentation fault when using -p 
 something and there is no selected transaction as in: 

   ledger reg \^Liabbillitti  -p 'monthly' 
 or 
   ledger reg \^Liabbillitti  -p 'daily' 


 -- 
 Rémi Vanicat 



-- 

--- 
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/groups/opt_out.




Date output bug???

2013-05-10 Thread David Keegan

Craig,

FWIW

.ledgerrc:
--date-format %Y-%m-%d

gives me reg output like

...
2002-05-11 Brooks ...
...

with ledger version checked out 2013-04-14.

Regards,
David.
-- 
[David Keegan d...@eircom.net 353 1 2988743]
[56 Roebuck Downs Dublin 14 IRELAND]

Craig Earls writes:
  I must be doing something wrong but I just realized that the register
  reports doesn't seem to be honoring my --date-format command.
  
  I have --date-format %Y-%m-%d in .ledgerrc.  But register still puts
  out %Y/%m/%d
  
  Is this me?
  
  --
  Craig, Corona De Tucson, AZ
  enderw88.wordpress.com
  
  -- 
  
  --- 
  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/groups/opt_out.
  
  
  

-- 

--- 
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/groups/opt_out.




Re: Date output bug???

2013-05-10 Thread Craig Earls
Thanks.  It must something buried in my setup somewhere.

On Fri, May 10, 2013 at 11:57 AM, David Keegan d...@eircom.net wrote:

 Craig,

 FWIW

 .ledgerrc:
 --date-format %Y-%m-%d

 gives me reg output like

 ...
 2002-05-11 Brooks ...
 ...

 with ledger version checked out 2013-04-14.

 Regards,
 David.
 --
 [David Keegan d...@eircom.net 353 1 2988743]
 [56 Roebuck Downs Dublin 14 IRELAND]

 Craig Earls writes:
   I must be doing something wrong but I just realized that the register
   reports doesn't seem to be honoring my --date-format command.
  
   I have --date-format %Y-%m-%d in .ledgerrc.  But register still puts
   out %Y/%m/%d
  
   Is this me?
  
   --
   Craig, Corona De Tucson, AZ
   enderw88.wordpress.com
  
   --
  
   ---
   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/groups/opt_out.
  
  
  

 --

 ---
 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/groups/opt_out.





-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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/groups/opt_out.




Re: Date output bug???

2013-05-10 Thread Craig Earls
I found my problem.  I had a custom register format that called out
date, but did not pass it through format_date()


On Fri, May 10, 2013 at 11:58 AM, Craig Earls ender...@gmail.com wrote:
 Thanks.  It must something buried in my setup somewhere.

 On Fri, May 10, 2013 at 11:57 AM, David Keegan d...@eircom.net wrote:

 Craig,

 FWIW

 .ledgerrc:
 --date-format %Y-%m-%d

 gives me reg output like

 ...
 2002-05-11 Brooks ...
 ...

 with ledger version checked out 2013-04-14.

 Regards,
 David.
 --
 [David Keegan d...@eircom.net 353 1 2988743]
 [56 Roebuck Downs Dublin 14 IRELAND]

 Craig Earls writes:
   I must be doing something wrong but I just realized that the register
   reports doesn't seem to be honoring my --date-format command.
  
   I have --date-format %Y-%m-%d in .ledgerrc.  But register still puts
   out %Y/%m/%d
  
   Is this me?
  
   --
   Craig, Corona De Tucson, AZ
   enderw88.wordpress.com
  
   --
  
   ---
   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/groups/opt_out.
  
  
  

 --

 ---
 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/groups/opt_out.





 --
 Craig, Corona De Tucson, AZ
 enderw88.wordpress.com



-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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/groups/opt_out.




Reproducible bug on the next branch

2013-04-29 Thread Samuel Tardieu
The following file does not work with ledger on the next branch, while it
works fine with master.

Of course, this is not a real file, it is a reduced example coming from a
multi-k lines ledger.

% cat x.dat
2011-12-26 X
A:B  30.00€
A:C:D
% ledger -f x.dat --sort date bal
While comparing if 0 is less than 2011/12/26:
Error: Cannot compare an integer to a date

  Sam

-- 

--- 
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/groups/opt_out.




Re: Reproducible bug on the next branch

2013-04-29 Thread Craig Earls
What is your date format set to in .ledgerrc?

On Mon, Apr 29, 2013 at 1:41 PM, Samuel Tardieu s...@rfc1149.net wrote:
 The following file does not work with ledger on the next branch, while it
 works fine with master.

 Of course, this is not a real file, it is a reduced example coming from a
 multi-k lines ledger.

 % cat x.dat
 2011-12-26 X
 A:B  30.00€
 A:C:D
 % ledger -f x.dat --sort date bal
 While comparing if 0 is less than 2011/12/26:
 Error: Cannot compare an integer to a date

   Sam

 --

 ---
 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/groups/opt_out.





-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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/groups/opt_out.




Re: Reproducible bug on the next branch

2013-04-29 Thread Samuel Tardieu
2013/4/29 Craig Earls ender...@gmail.com

 What is your date format set to in .ledgerrc?


I have removed the .ledgerrc for the purpose of this test.

Using the date format I usually use, it gives the same thing:

% ledger -f x.dat --sort date bal --date-format %Y-%m-%d
While comparing if 0 is less than 2011/12/26:
Error: Cannot compare an integer to a date

-- 

--- 
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/groups/opt_out.




Re: Reproducible bug on the next branch

2013-04-29 Thread Craig Earls
Thanks.  Does it happen if there are two xacts in the file?

On Mon, Apr 29, 2013 at 1:46 PM, Samuel Tardieu s...@rfc1149.net wrote:



 2013/4/29 Craig Earls ender...@gmail.com

 What is your date format set to in .ledgerrc?


 I have removed the .ledgerrc for the purpose of this test.

 Using the date format I usually use, it gives the same thing:

 % ledger -f x.dat --sort date bal --date-format %Y-%m-%d

 While comparing if 0 is less than 2011/12/26:
 Error: Cannot compare an integer to a date

 --

 ---
 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/groups/opt_out.





-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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/groups/opt_out.




Re: Reproducible bug on the next branch

2013-04-29 Thread Samuel Tardieu
2013/4/29 Craig Earls ender...@gmail.com

 Thanks.  Does it happen if there are two xacts in the file?


You mean more than one? Sure, it comes from a multi-file transactions.

-- 

--- 
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/groups/opt_out.




Re: Reproducible bug on the next branch

2013-04-29 Thread Samuel Tardieu
2013/4/29 Craig Earls ender...@gmail.com

 I haven't used master in a long time.  What version is it showing?  I
 think it might still be a 2.6



Nope. It gives me: (build from 20 minutes ago)

% ledger --version
Ledger 3.0.0-20120518, the command-line accounting tool

Copyright (c) 2003-2012, John Wiegley.  All rights reserved.

This program is made available under the terms of the BSD Public License.
See LICENSE file included with the distribution for details and disclaimer.

-- 

--- 
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/groups/opt_out.




Re: Minor bug: variable names with underscores

2013-03-21 Thread Harshad RJ
Pre script: Just saw John's reply while typing the below mail and most
likely this mail is of no use. I am still sending it in case it helps by
any chance.

I had a quick peek at token.cc. It looks like parse_ident() would be the
function responsible for tokenising variable names. It's core logic checks
for

std::isalnum(c) || c == '_'

It looks like it should accept (in regex):
[_a-zA-Z0-9]+

So, the problem is probably at a higher level.

-- 
*Harshad RJ* http://lavadip.com

-- 

--- 
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/groups/opt_out.




Re: Minor bug: variable names with underscores

2013-03-21 Thread John Wiegley
 Harshad RJ harshad...@gmail.com writes:

 Ah, I am not familiar with commodities in ledger. So what are the variable
 names that are legal? Is there a safe way to include numbers in the names
 somehow? Numbers are required to represent invoice numbers, bill numbers,
 etc.

Alphabetic+'_' is all that I think variable names can use.  As for commodity
names, you can enclose the commodity name in double quotes.

At present variable names aren't used for much.  Can you show me an example of
where you'd want to use a bill number in a variable name?  Perhaps there's
another way (such as with metadata) to make such a usage easier for you.

John

-- 

--- 
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/groups/opt_out.




Re: Minor bug: variable names with underscores

2013-03-21 Thread Harshad RJ
On Thu, Mar 21, 2013 at 6:00 PM, John Wiegley jo...@newartisans.com wrote:

 At present variable names aren't used for much.  Can you show me an
 example of
 where you'd want to use a bill number in a variable name?  Perhaps there's
 another way (such as with metadata) to make such a usage easier for you.


Example: I raise an invoice say in April 2012, and received a payment in
May 2012 with TDS (Tax deducted at source). This is how I thought I could
record it:

define TDS_RATE = 0.1

define INVOICE_1 = 1

2012/4/1
   ; Raising an invoice here
   Debtor:XYZ   INVOICE_1
   Income

2012/5/1
   ; Receiving a payment here
   BankAccout  INVOICE_1 * TDS
   Assets:TDS  INVOICE_1 * (1 - TDS)
   Debtor:XYZ

If there is a better way to do it, please let me know.

thanks,
-- 
*Harshad RJ* http://lavadip.com

-- 

--- 
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/groups/opt_out.




Re: Minor bug: variable names with underscores

2013-03-21 Thread Craig Earls
RJ,
  I think I see what you are trying to do, but it will not scale the
way you are doing it.  When you have a few thousand invoices ledger
will slow to a crawl.  What about something like this:

2012/4/1   XYZ
   ; Raising and invoice
   Debtor:XYZ  1 Rs  ; Invoice: 1
   Income

2012/5/1  XYZ
; Receiving a payment here
   BankAccount  (1 Rs * TDS)  ; Invoice: 1
   Assets:TDS(1 Rs * (1 - TDS))  ; Invoice: 1
   Debtor:XYZ

You must be very careful to commoditize every number you use.  Even if
you only work in a single currency, uncommoditized numbers do not work
as you think they should in ledger.

The comments in the data above are actually meta data, the colon after
Invoice means the the value of Invoice is 1 for that posting.  You
can search on that metadata.  There is decent information in the
ledger3 manual about using metadata.  It is much faster than using
value expression all over the place.

On Thu, Mar 21, 2013 at 5:41 AM, Harshad RJ harshad...@gmail.com wrote:

 On Thu, Mar 21, 2013 at 6:00 PM, John Wiegley jo...@newartisans.com wrote:

 At present variable names aren't used for much.  Can you show me an
 example of
 where you'd want to use a bill number in a variable name?  Perhaps there's
 another way (such as with metadata) to make such a usage easier for you.


 Example: I raise an invoice say in April 2012, and received a payment in May
 2012 with TDS (Tax deducted at source). This is how I thought I could record
 it:

 define TDS_RATE = 0.1

 define INVOICE_1 = 1

 2012/4/1
; Raising an invoice here
Debtor:XYZ   INVOICE_1
Income

 2012/5/1
; Receiving a payment here
BankAccout  INVOICE_1 * TDS
Assets:TDS  INVOICE_1 * (1 - TDS)
Debtor:XYZ

 If there is a better way to do it, please let me know.

 thanks,
 --
 Harshad RJ

 --

 ---
 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/groups/opt_out.





-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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/groups/opt_out.




Re: Minor bug: variable names with underscores

2013-03-21 Thread Craig Earls
I will have to defer to John for a deeper explanation of why you must
specify a commodity, but you must.  You can specify a default
commodity with the commodity directive.  It is documented on page 27
of the ledger docs.

BTW, this all refers to ledger 3, if you are using ledger 2.6.3 all
bets are off.

On Thu, Mar 21, 2013 at 8:25 AM, Harshad RJ harshad...@gmail.com wrote:
 Thanks Craig. My intention was to only avoid repeating the number 10,000. In
 some cases (not in this specific example) I sometimes need to play with a
 value to make predictions. It is easier to do such trials by changing a
 value at a single place. I think this flexibility is one of the major
 advantages of ledger over an opaque accounting software.

 I didn't know that there was a catch with uncommonditized numbers. Can you
 please point it out to me. Is it not true that uncommoditized numbers can be
 assumed to have a default commodity of say NULL?


 thanks,
 --
 Harshad RJ

 --

 ---
 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/groups/opt_out.





-- 
Craig, Corona De Tucson, AZ
enderw88.wordpress.com

-- 

--- 
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/groups/opt_out.




Re: Minor bug: variable names with underscores

2013-03-21 Thread John Wiegley
 Harshad RJ harshad...@gmail.com writes:

 Ok, so if I define a default commodity and then use undecorated numbers, is
 this problem solved?

No, the default commodity has nothing to do with what Ledger's internals call
simply integers.

 If so, would it be possible to modify ledger to use a pre-defined commodity
 as default?

No, because then I don't think you'd be able to use simple scalars in the ways
that you can now.

 Can an empty string be the name of the commodity?

You mean like  10?  I'm pretty sure that's allowed and makes sense.  Whether
that should be the default meaning of 10 is something else again...

Thanks for bringing up these great questions!

John

-- 

--- 
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/groups/opt_out.




  1   2   >