Hi,
It looks like I have found a issue in mutl file journal setup when using lots.
PFA the zip attached for reference.
These are three years sample journal files and there corresponding close/open flies. I am generating the close/open files using the scripts. The scripts should be run in order.
'1_create_open_close_2021.sh
2_create_open_close_2022.sh
3_create_open_close_2023.sh
As intended, I get the holdings as zero when i run individual ledger files.
hledger -f ledger_2021.journal holdings --lots
hledger -f ledger_2022.journal holdings --lots
hledger -f ledger_2023.journal holdings --lots
Alls good till here.
But when I try to use all.journal, it gives following error. (Probable reason is that the visibility of RELIANCE shares changes when used individually in 2023 close script and resultant close file of 2023 ledger. . But when using all.journal, those assumptions of genreated 001 lot doesn't hold). I tried to simply the example journal as much as I can. These errors are not there if I put all the entries in a single file, probably because of visiblity of transactinos to hledger engine..
Note: The particular case is from a real world split of RELIANCE into RELIANCE and JIOFIN with dates moved 3 months back to fit in yearly journal for ease in debugging purpose)
$ hledger -f all.journal holdings
hledger: Error: /tmp/money/close_2023.journal:1:
1 | 2023-12-31 closing balances ; clopen:2023_close
| assets:cash:sbi_saving -1,00,000.00 ₹ = 0.00 ₹
| assets:cash:zerodha 1,36,317.75 ₹ = 0.00 ₹
| assets:investments:stocks:{2021-09-20, "0001", 2,170.4364 ₹} -5 RELIANCE {2021-09-20, "0001", 2,170.4364 ₹}
| assets:investments:stocks:{2021-09-20, 106.5636 ₹} -5 JIOFIN {2021-09-20, 106.5636 ₹}
| assets:investments:stocks:{2021-11-28, "0001", 2,170.4364 ₹} -10 RELIANCE {2021-11-28, "0001", 2,170.4364 ₹}
| assets:investments:stocks:{2021-11-28, 106.5636 ₹} -10 JIOFIN {2021-11-28, 106.5636 ₹}
| assets:investments:stocks:{2022-11-07, 2,300.00 ₹} -15 RELIANCE {2022-11-07, 2,300.00 ₹}
| assets:investments:stocks:{2022-12-15, 2,250.00 ₹} -30 RELIANCE {2022-12-15, 2,250.00 ₹}
| equity:opening/closing balances
Postings were read as: unclassified, unclassified, transfer-from, transfer-from, transfer-from, transfer-from, transfer-from, transfer-from, unclassified.
no lots matching {2021-09-20, "0001", 2,170.4364 ₹} for commodity RELIANCE in account assets:investments:stocks on 2023-12-31
Available lots in this account:
{2021-09-20, "0004", 2,170.4364 ₹} 5
{2021-11-28, "0004", 2,170.4364 ₹} 10
{2022-11-07, "0001", 2,300.00 ₹} 15
{2022-12-15, "0001", 2,250.00 ₹} 30
Total: 60 RELIANCE