Skip to content

--infer-costs does not understand postings with blank amounts #1954

Open
@ag-eitilt

Description

@ag-eitilt

I'm using a variant of the equity-postings method of recording currency conversions/securities trading, where I leave the equity account unfilled to catch both commodities; using the example in the manual, my transaction would be:

2021-01-01
    assets:cash        -100 EUR
    assets:cash         120 USD
    equity:conversion

This works well for most reports, but does not introduce a basis when using the -B flag. (I'm using the {$0.00} syntax for lots, in the hopes that's eventually made functional, but that's a separate issue.) So far no surprises since that's exactly what the docs describe, but when I try adding the --infer-cost flag as used in the manual hledger throws an error complaining that "Conversion postings must occur in adjacent pairs". I agree that being explicit with your conversion account is a good thing, but I feel like the case where there's a posting with a blank amount and multiple commodities which don't balance without it is very nearly as explicit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WISHSome kind of improvement request or proposal.journalThe journal file format, and its features.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions