Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bean-report produces invalid hledger postings for lots with both a price and a cost #2

Closed
blais opened this issue Apr 16, 2020 · 2 comments
Labels
bug Something isn't working hledger Bugs related to hledger support
Milestone

Comments

@blais
Copy link
Member

blais commented Apr 16, 2020

Original report by Marin Bernard (Bitbucket: marinbernard, GitHub: marinbernard).


For instance, invoking bean-report hledger with the following journal file:

2020-01-01 open Assets:Bank
2020-01-01 open Expenses:Grocery
2020-01-01 commodity SALAD
2020-01-01 commodity USD

option "operating_currency" "USD"

2020-01-01 * "Grocery"  "Salad"
    Expenses:Grocery                5 SALAD  {1.00 USD} @   1.00 USD
    Assets:Bank

2020-01-01 * "Grocery"  "Salad"
    Expenses:Grocery                5 SALAD  {1.00 USD} @@  5.00 USD
    Assets:Bank

2020-01-01 * "Grocery"  "Salad"
    Expenses:Grocery                5 SALAD {{5.00 USD}} @  1.00 USD
    Assets:Bank

2020-01-01 * "Grocery"  "Salad"
    Expenses:Grocery                5 SALAD {{5.00 USD}} @@ 5.00 USD
    Assets:Bank

Returns:

;; Open: 2020-01-01 close Assets:Bank

;; Open: 2020-01-01 close Expenses:Grocery

commodity SALAD

commodity USD

2020-01-01 * Grocery | Salad
  Expenses:Grocery                                                 5 SALAD @ 1.00 USD       @ 1.00 USD
  Assets:Bank                                                             -5.00 USD

2020-01-01 * Grocery | Salad
  Expenses:Grocery                                                 5 SALAD @ 1.00 USD       @ 1.00 USD
  Assets:Bank                                                             -5.00 USD

2020-01-01 * Grocery | Salad
  Expenses:Grocery                                                 5 SALAD @ 1.00 USD       @ 1.00 USD
  Assets:Bank                                                             -5.00 USD

2020-01-01 * Grocery | Salad
  Expenses:Grocery                                                 5 SALAD @ 1.00 USD       @ 1.00 USD
  Assets:Bank                                                             -5.00 USD

Expected output:

;; Open: 2020-01-01 close Assets:Bank

;; Open: 2020-01-01 close Expenses:Grocery

commodity SALAD

commodity USD

2020-01-01 * Grocery | Salad
  Expenses:Grocery                                    5 SALAD @ 1.00 USD
  Assets:Bank                                                  -5.00 USD

2020-01-01 * Grocery | Salad
  Expenses:Grocery                                    5 SALAD @ 1.00 USD
  Assets:Bank                                                  -5.00 USD

2020-01-01 * Grocery | Salad
  Expenses:Grocery                                    5 SALAD @ 1.00 USD
  Assets:Bank                                                  -5.00 USD

2020-01-01 * Grocery | Salad
  Expenses:Grocery                                    5 SALAD @ 1.00 USD
  Assets:Bank                                                  -5.00 USD

Even if specifying equal costs and prices does not make sense, this is still legal beancount syntax, and should result in valid hledger data.

@tbm
Copy link
Collaborator

tbm commented Jul 17, 2020

Can you move this ticket to https://github.com/beancount/beancount2ledger

There should be a link "Transfer issue" in the lower right corner (there's an arrow to the right).

@blais blais transferred this issue from beancount/beancount Jul 17, 2020
@tbm
Copy link
Collaborator

tbm commented Jul 23, 2020

@MarinBernard I split out the ledger conversion from beancount into a standalone tool called beancount2ledger. Please give this a go.

@tbm tbm closed this as completed in b99e01f Jul 23, 2020
@tbm tbm added this to the 1.1 milestone Jul 24, 2020
@tbm tbm added bug Something isn't working hledger Bugs related to hledger support labels Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working hledger Bugs related to hledger support
Projects
None yet
Development

No branches or pull requests

2 participants