2.6.9 exchange rate structure change and reports

John Ralls jralls at ceridwen.us
Wed Oct 21 22:29:49 EDT 2015


> On Oct 20, 2015, at 3:17 PM, Wm... <tcnw81 at tarrcity.demon.co.uk> wrote:
> 
> Fri, 16 Oct 2015 07:20:45 <380C9B08-7C86-49C3-879E-4115216C7575 at ceridwen.us>
> John Ralls <jralls at ceridwen.us> wrote...
> 
>> 
>>> On Oct 15, 2015, at 4:04 PM, Wm... <tcnw81 at tarrcity.demon.co.uk> 
>> wrote:
>>> 
>>> 
>>> I'm not sure if I'm missing something but should reports, e.g. 
>> balance sheets, know about the fact that exchange rates that were
>>> 
>>> fraction buys 1
>>> 
>>> are now
>>> 
>>> 1 buys many?
>>> 
>> My reports seem to be stuck at the exchange rate last collected using 
> the 2.6.8 structure.
>> 
>> Hopefully I'm doing something wrong otherwise all reports involving 
> currencies that inverted are going to be increasingly out of date over time.
>> 
>> An example of not-insignificant currencies inverting is GBP / USD
> 
> Yes, and I had thought that they already checked in both directions. I’ll take a look.
> 
> 
> 
> The wrong exchange rate is being used on the main accounts display too if one of the "Name (Currency)" columns is displayed.
> 
> I've tried having a look in the code but it is taking me too long to find.
> 
> If there are no pre 2.6.9 prices in a book it gets the right one.
> 
> Not sure if this is a re-opening of an old bug but I have added a new one with example books anyway and hope I got it right
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=756889
> 

Yeah, it only looks at the “reverse” quotes if there are no “forward” quotes, and even that’s in only a few places. I don’t know why I didn’t recognize that that was the wrong way when I first looked at it. A possible work-around if you’re not interested in historical prices is to use the “Remove Old” button on the price editor. That won’t fix everything, but it will fix the places where it looks for “reverse” quotes and where the direction doesn’t switch much.
 
I’ve got a better design in progress, where both directions are queried and the results sorted chronologically. It’s in the pricedb code so there will be no issue of having to call the query in each direction as is the case now, but calling code will need to check the direction of each returned price and use it accordingly.

This is becoming a much bigger change than I initially thought it would be. Perhaps it would be better to revert the pricedb back to the 2.6.7 state and apply it to master for the next major version. Any votes one way or the other?

Regards,
John Ralls




More information about the gnucash-user mailing list