Invert the F::Q price if there's already one in the other direction.

We don't want to create prices in both directions on the same day.
This commit is contained in:
John Ralls 2015-09-01 14:56:19 -07:00
parent 890cfe2186
commit 157c7e30a5

View File

@ -411,6 +411,12 @@
(set! saved-price (gnc-pricedb-lookup-day pricedb
commodity currency
gnc-time))
(if (null? saved-price)
(begin
(set! saved-price (gnc-pricedb-lookup-day pricedb currency
commodity gnc-time))
(if (not (null? saved-price))
(set! price (gnc-numeric-invert(price))))))
(if (not (null? saved-price))
(begin
(gnc-price-begin-edit saved-price)