Rounding in the price db.

Geert Janssens geert.gnucash at kobaltwit.be
Fri Sep 4 05:17:52 EDT 2015


On Tuesday 01 September 2015 15:13:48 John Ralls wrote:
> > Geert,
> > 
> > Thanks for testing. I agree that the check_foo() semantics are
> > clumsy. I did it that way to avoid negating the return value in the
> > if conditional, but in retrospect that would be clearer, so I’ll
> > flip it.
> > 
> > Roger that the checks aren’t reliably bidirectional. I’ll dig into
> > that. I hadn’t yet changed anything with regards to which direction
> > prices are recorded, at least not on purpose, so I’ll have to track
> > that down too.
> > 
> > I coded up the price-rounding algorithm on the flight back today and
> > played with it a little. I think it may need some adjustment.
> I’ve pushed more changes to single-price which I think address Geert’s
> comments and some tweaks to maximize significant digit preservation
> while keeping denominators <= 10E6 in most cases. Please test some
> more!
> 
> Regards,
> John Ralls

John,

I pulled your branch again yesterday and ran some tests on it this morning.

Here is what I did today:

- removed all prices from the price db.
- created an invoice in EUR
- added one entry to this invoice to an account denominated in USD
- post the invoice => as expected this brings up the transfer dialog to get an exchange rate.
- as I removed all prices beforehand, there was no suggested price (obviously), so I hit fetch 
quotes
=> When fetch quotes finished, I still didn't have an exchange rate entered in the dialog.
- so to continue I entered one myself
- close transfer dialog and chech the price db via the price editor
=> There are two quotes in there now:
Security EUR, Currency USD, type user:xfer-dialog
Security USD, Currency EUR, type Finance::Quote (last)

The latter seems to have been fetched successfully by the transfer dialog but was never 
proposed. The former is the price I had to manually enter to continue.

The exact same thing happens if I now use process payment and for test pay this (Euro 
denominated) invoice in HKD.
Transfer dialog won't propose an exchange rate even after hitting the fetch quotes button. 
Setting one manually will allow me to continue and afterwards there will be two new quotes 
in the price editor
Security EUR, Currency HKD, type user:xfer-dialog
Security HKD, Currency EUR, type Finance::Quote (last)

Looks like the transfer dialog is not yet fully aware of bidirectional quotes.

Regards,

Geert


More information about the gnucash-devel mailing list