Hello,

Recently I found a very strange output when I mixed --gain, --exchange, and 
filters:

~~~
] register Second --gain --exchange XXX
19-Apr-01 Commodities revalued                                    <Revalued>    
                                                                         -75.81 
XXX                                 0
19-May-01 Commodities revalued                                    <Revalued>    
                                                                         -64.14 
XXX                                 0
19-Jun-01 Commodities revalued                                    <Revalued>    
                                                                         -54.97 
XXX                                 0
19-Jun-23 Commodities revalued                                    <Revalued>    
                                                                           0.20 
XXX                                 0
19-Jul-01 Commodities revalued                                    <Revalued>    
                                                                         -54.54 
XXX                         -6.70 XXX
19-Aug-01 Commodities revalued                                    <Revalued>    
                                                                         -47.51 
XXX                        -12.53 XXX
19-Sep-01 Commodities revalued                                    <Revalued>    
                                                                         -47.81 
XXX                        -23.57 XXX
19-Oct-01 Commodities revalued                                    <Revalued>    
                                                                         -42.49 
XXX                        -33.37 XXX
~~~

Two unexpected things:

1. The last column contains zeros while the column with posting values
   has some values.
2. The first column contains some values for April 2019, but without
   --exchange XXX the first record is for 19-Jun-23.

So far I think that the last column with running totals has right
numbers, and I don't understand the posting values.

Is it a bug or don't I understand something fundamental? I tried to
read the expressions for -G [1], but my ledger-fu isn't good enough to
understand them :)

Here's the journal data to reproduce:

~~~
P 2019/03/01 00:00:00 XXX YYY 1.1001
P 2019/04/01 00:00:00 XXX YYY 1.2002
P 2019/05/01 00:00:00 XXX YYY 1.3003
P 2019/06/01 00:00:00 XXX YYY 1.4004
P 2019/07/01 00:00:00 XXX YYY 1.5005
P 2019/08/01 00:00:00 XXX YYY 1.6006
P 2019/09/01 00:00:00 XXX YYY 1.7007
P 2019/10/01 00:00:00 XXX YYY 1.8008

2019/03/01 * Opening Balances
    Assets:First                        10000.00 XXX
    Assets:Second                        1000.00 YYY
    Equity:Opening Balances

2019/06/23 * Recharge
    Assets:Second                         140.00 YYY @@ 100.00 XXX
    Assets:First                         -100.00 XXX

2019/08/03 * Recharge
    Assets:Second                         160.06 YYY @@ 100.00 XXX
    Assets:First                         -100.00 XXX
~~~

[1]: 
https://github.com/ledger/ledger/blob/0db50b5e31c85437ece1f70d52f8c3420ce35979/src/report.h#L687-L709

Oleg

-- 

--- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ledger-cli/20200716111415.xnznsr43qthhugq2%40macbook-dmage.local.

Reply via email to