Bug 1216 - Transaction does not balance
Summary: Transaction does not balance
Status: UNCONFIRMED
Alias: None
Product: Ledger
Classification: Unclassified
Component: misc (show other bugs)
Version: 3.1.1
Hardware: PC Linux
: P5 major
Assignee: John Wiegley
URL:
Depends on:
Blocks:
 
Reported: 2017-07-14 19:40 UTC by Aleksej
Modified: 2017-07-15 09:39 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Aleksej 2017-07-14 19:40:22 UTC
Debian stretch, ledger 3.1.2~pre1+g3a00e1c


========
; Just for clarity, does not affect the output.
account liabilities
	assert commodity == "r"

account expenses:low
	assert commodity == "Low"

account expenses:medium
	assert commodity == "Medium"

account expenses:high
	assert commodity == "High"

2017-01-02 
    expenses:medium    1 Medium = 1 Medium
    liabilities  (- 1 * 100 r) = -100 r


2017-01-02 
    [expenses:high]  = 0 High

2017-01-02                                                  
    [expenses:low] = 0 Low


2017-01-03 
    expenses:high	2 High = 2 High
    expenses:medium	3 Medium = 4 Medium
    expenses:low	4 Low = 4 Low
    liabilities	(-(2 * 1000 r + 3 * 100 r + 4 * 10 r)) = -2440 r
========


========
$ ledger -f test
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.
While parsing file "/home/ik/ledger/test", line 29:
While balancing transaction from "/home/ik/ledger/test", lines 25-29:
> 2017-01-03 
>     expenses:high	2 High = 2 High
>     expenses:medium	3 Medium = 4 Medium
>     expenses:low	4 Low = 4 Low
>     liabilities	(-(2 * 1000 r + 3 * 100 r + 4 * 10 r)) = -2440 r
Unbalanced remainder is:
              2 High
               4 Low
            3 Medium
             -2340 r
Amount to balance against:
              2 High
               4 Low
            3 Medium
Error: Transaction does not balance
========
Comment 1 Aleksej 2017-07-14 19:44:43 UTC
This does not differ:

ledger --price-db prices.db -f test


$ cat prices.db 
P 2017-01-01 Low 10 r
P 2017-01-01 Medium 100 r
P 2017-01-01 High 1000 r