Rounding in the price db.

John Ralls jralls at ceridwen.us
Wed Sep 9 21:20:46 EDT 2015


> On Sep 5, 2015, at 8:44 AM, John Ralls <jralls at ceridwen.us> wrote:
> 
>> 
>> On Sep 4, 2015, at 2:17 AM, Geert Janssens <geert.gnucash at kobaltwit.be> wrote:
>> 
>> 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.
> 
> Not just the Transfer Dialog. Price-quotes.scm doesn’t read the output from gnc-fq-helper quite the way I thought it did. This weekend’s pretty busy but I should be able to fix it Monday along with finishing the source prioritization.

So I’ve got that fixed along with some other issues and the preference of some sources and it’s pushed to my github branch. It’s doing too much rounding somewhere so that our Sao Tomé Dobra test gets rounded to uselessness in one direction, but I think the rest is working. Please test while I wrestle some more with the rounding.

Regards,
John Ralls




More information about the gnucash-devel mailing list