Total price in importers

29 views
Skip to first unread message

Daniele Nicolodi

unread,
Dec 18, 2018, 3:30:38 AM12/18/18
to bean...@googlegroups.com
Hello,

I'm trying to write an importer for some account statements that report
operations in different currencies. For example transferring USD to EUR.
Those statements report the amount paid for the transaction (in USD),
the total fees (in USD), the amount converted (that could be obtained
from the previous two amounts), the amount transferred (in EUR), and the
exchange rate, oddly in EUR per 1 USD, rather than the other way around.

To enter this transaction I would like to enter something like:

2018-12-11 * "TRANSFER" "Foo"
Expenses:Unknown 20.00 EUR @@ 22.74 USD
Expenses:Fees:Transfer 1.32 USD
Assets:Checking -24.06 USD

but I haven't found a way to specify the total cost with the @@ syntax
in the ingest framework.

As an alternative solution I can simply convert the total price into
unit price, but this introduces rounding errors, and I would like to
avoid to think about those.

Am I missing something or what I would like to do is not possible?

Thank you.

Best,
Dan

Martin Blais

unread,
Dec 18, 2018, 10:10:05 PM12/18/18
to Beancount
On Tue, Dec 18, 2018 at 3:30 AM Daniele Nicolodi <dan...@grinta.net> wrote:
Hello,

I'm trying to write an importer for some account statements that report
operations in different currencies. For example transferring USD to EUR.
Those statements report the amount paid for the transaction (in USD),
the total fees (in USD), the amount converted (that could be obtained
from the previous two amounts), the amount transferred (in EUR), and the
exchange rate, oddly in EUR per 1 USD, rather than the other way around.

To enter this transaction I would like to enter something like:

2018-12-11 * "TRANSFER" "Foo"
     Expenses:Unknown             20.00 EUR @@ 22.74 USD
     Expenses:Fees:Transfer        1.32 USD
     Assets:Checking             -24.06 USD

but I haven't found a way to specify the total cost with the @@ syntax
in the ingest framework.

The schema does not provide a representation of the total price.
Only the per-unit price.
The convenience is provided at the level of the grammar, but converted to per-unit price:
 


As an alternative solution I can simply convert the total price into
unit price, but this introduces rounding errors, and I would like to
avoid to think about those. 

Tolerance is a normal part of the process of balancing a transaction.
If you sum up the amounts, the balance rule ensures that the residual amount is below some tolerance number.
The tolerance is inferred as per the numbers provided on the transaction (for each currency).
Read more about it here:

 

Am I missing something or what I would like to do is not possible?

Not possible.
This would introduce too many complications in the schema, it has been considered and discussed numerous times.


 

Thank you.

Best,
Dan

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To post to this group, send email to bean...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/2aeb8251-183c-0e6a-37db-815402c4ad73%40grinta.net.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages