Re: Unexpected balance verification

2023-02-23 Thread John Wiegley
> "'WvL" == 'Dave Webb' via Ledger  writes:

'WvL> I found a transaction in my ledger for which I think balance
'WvL> verification should fail but ledger accepts it. I am using 3.3.0.
'WvL> Here is a simplified example of what I found

'WvL> 2016-08-19 OpeningBalances
'WvL>   Assets:Cash  £ 3
'WvL>   Equity:OpeningBalances

'WvL> 2016-09-25 X
'WvL>   Expenses:Other  £ 2
'WvL>   Assets:Cash  = £ 1

'WvL> 2016-09-26 X
'WvL>   Expenses:Other  £ 1
'WvL>   Assets:Cash   = £ 1       ; I would expect this to fail

Just to note, a balance assertion that has no associated amount will always
just adjust the balance to match.

Now, I edited this file to get rid of a lot of really strange whitespace, and
I changed the currency to $, just to rule out all strangeness. After I did
that, I got the output I expected to see:

  Vulcan ~/dl $ ledger -f foo.dat reg
  While parsing file "/Users/johnw/Downloads/foo.dat", line 11:
  While balancing transaction from "/Users/johnw/Downloads/foo.dat", lines 9-11:
  > 2022/09/26 X
  > Expenses:Other$1
  > Assets:Cash= $1
  Unbalanced remainder is:
$1
  Amount to balance against:
$1
  Error: Transaction does not balance

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


Re: Unexpected balance verification

2023-02-20 Thread 'Dave Webb' via Ledger
...so maybe no longer compatible environment (probably in the small print 
when I was installing homebrew stuff!)

On Monday, February 20, 2023 at 7:11:01 PM UTC Dave Webb wrote:

> Okay thankyou for your patience, just for the record, on a MacOS 12 
> machine I get the problem e.g., 
> 2016-08-19 OpeningBalances
>   Assets:Cash  £ 3
>   Equity:OpeningBalances
>
> 2016-09-25 X
>   Expenses:Other  £ 2
>   Assets:Cash
>
> 2016-09-26 X
>   Expenses:Other  £ 1
>   Assets:Cash   = £ 1  ; On a MacOS 12 machine, ledger is accepting 
> anything
>   ; between -0.5 and 1 here!
>
> But on an up to date machine the transaction is rejected.
> On Sunday, February 19, 2023 at 2:22:58 AM UTC Martin Michlmayr wrote:
>
>> * 'Dave Webb' via Ledger  [2023-02-18 11:53]: 
>> > 2016-09-25 X 
>> > Expenses:Other £ 2 
>> > Assets:Cash = £ 1 
>> > 
>> > 2016-09-26 X 
>> > Expenses:Other £ 1 
>> > Assets:Cash = £ 1 ; I would expect this to fail 
>>
>> If I change the last transaction to: 
>>
>> 2016-09-26 X 
>> Expenses:Other £ 1 
>> Assets:Cash = £ 1 ; I would expect this to fail 
>> x 
>>
>> then I get: 
>> with 3.2.1: 
>> Error: Only one posting with null amount allowed per transaction 
>> with 3.3.0: 
>> 2016-09-25 X Assets:Cash £ -2 
>> x £ -1 
>>
>> so it seems the "Assets:Cash" posting is treated as not having an 
>> amount. 
>>
>> BTW, if I rename "Assets:Cash" to another account it works fine. 
>>
>> So the problem is 2 balance assignments to the same account after 
>> each other. 
>>
>> There are some open bug reports but I'm not sure this is covered 
>> already. 
>> -- 
>> 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/7a1e0cc1-33b0-4bfe-a454-2b0ad2eb59cbn%40googlegroups.com.


Re: Unexpected balance verification

2023-02-20 Thread 'Dave Webb' via Ledger
Okay thankyou for your patience, just for the record, on a MacOS 12 machine 
I get the problem e.g., 
2016-08-19 OpeningBalances
  Assets:Cash  £ 3
  Equity:OpeningBalances

2016-09-25 X
  Expenses:Other  £ 2
  Assets:Cash

2016-09-26 X
  Expenses:Other  £ 1
  Assets:Cash   = £ 1  ; On a MacOS 12 machine, ledger is accepting anything
  ; between -0.5 and 1 here!

But on an up to date machine the transaction is rejected.
On Sunday, February 19, 2023 at 2:22:58 AM UTC Martin Michlmayr wrote:

> * 'Dave Webb' via Ledger  [2023-02-18 11:53]:
> > 2016-09-25 X
> > Expenses:Other £ 2
> > Assets:Cash = £ 1
> > 
> > 2016-09-26 X
> > Expenses:Other £ 1
> > Assets:Cash = £ 1 ; I would expect this to fail
>
> If I change the last transaction to:
>
> 2016-09-26 X
> Expenses:Other £ 1
> Assets:Cash = £ 1 ; I would expect this to fail
> x
>
> then I get:
> with 3.2.1:
> Error: Only one posting with null amount allowed per transaction
> with 3.3.0:
> 2016-09-25 X Assets:Cash £ -2
> x £ -1
>
> so it seems the "Assets:Cash" posting is treated as not having an
> amount.
>
> BTW, if I rename "Assets:Cash" to another account it works fine.
>
> So the problem is 2 balance assignments to the same account after
> each other.
>
> There are some open bug reports but I'm not sure this is covered
> already.
> -- 
> 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/9cf24343-7cd6-453e-9d69-ebcccd8525a5n%40googlegroups.com.


Re: Unexpected balance verification

2023-02-18 Thread Martin Michlmayr
* 'Dave Webb' via Ledger  [2023-02-18 11:53]:
> 2016-09-25 X
>   Expenses:Other  £ 2
>   Assets:Cash  = £ 1
> 
> 2016-09-26 X
>   Expenses:Other  £ 1
>   Assets:Cash   = £ 1   ; I would expect this to fail

If I change the last transaction to:

2016-09-26 X
  Expenses:Other  £ 1
  Assets:Cash   = £ 1   ; I would expect this to fail
  x

then I get:
 with 3.2.1:
   Error: Only one posting with null amount allowed per transaction
 with 3.3.0:
   2016-09-25 X  Assets:Cash   £ -2
 x £ -1

so it seems the "Assets:Cash" posting is treated as not having an
amount.

BTW, if I rename "Assets:Cash" to another account it works fine.

So the problem is 2 balance assignments to the same account after
each other.

There are some open bug reports but I'm not sure this is covered
already.
-- 
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/Y/GH%2BSGWkbh5rLpM%40jirafa.cyrius.com.


Unexpected balance verification

2023-02-18 Thread 'Dave Webb' via Ledger
Hi,
I found a transaction in my ledger for which I think balance verification 
should fail but ledger accepts it. I am using 3.3.0. Here is a simplified 
example of what I found

2016-08-19 OpeningBalances
  Assets:Cash  £ 3
  Equity:OpeningBalances

2016-09-25 X
  Expenses:Other  £ 2
  Assets:Cash  = £ 1

2016-09-26 X
  Expenses:Other  £ 1
  Assets:Cash   = £ 1   ; I would expect this to fail

I discovered this while playing 
with https://docs.rs/ledger-utils/latest/ledger_utils/

Not causing me a problem but thought it was worth mentioning
Regards Dave

-- 

--- 
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/840be53a-f9e8-429e-bb99-dbcee4f066ddn%40googlegroups.com.