[GNC] "Enter value" (exchange rate?) for multi-currency scheduled transaction

Jim DeLaHunt list+gnucash at jdlh.com
Thu Aug 6 21:37:17 EDT 2020


Hello, folks:

A new multi-currency scheduled transaction in my Gnucash book just 
occurred for the first time. It was confusing. I would like help 
understanding what was going on, and pointers to where the relevant 
documentation and/or source code are. I suspect this may turn into a bug 
report, or more detail on a wiki page, or both.

I just set up a multi-currency subscription: buy a service in US dollars 
(USD), pay with a Canadian dollars (CAD) credit card. This has the 
complication that each month the CAD amount charged will vary with the 
USD-CAD exchange rate. The USD amounts are fixed.

I entered a transaction in GnuCash to record the first payment. This 
transaction divided the amount among three Expense accounts: two USD, 
and one CAD. For a few payments, I duplicated the previous month's 
transaction in the credit card ledger. Before this month's payment, I 
turned last month's transaction into a scheduled transaction. The 
template transaction has six splits: one split to the CAD credit card 
Liability account, two splits to USD Expense accounts, one split to a 
CAD Expense account, and splits to Trading:CURRENCY:CAD and to 
Trading:CURRENCY:USD.

Today, I started GnuCash, and the scheduled transaction ran for the 
first time. In the Since Last Run dialogue, there was an entry for this 
transaction, with a line saying something like:

    CAD -> USD   [(Give value)]

where "[(Give value)]" is a text entry box. (The line might have been 
"USD -> CAD", and the wording might have been different; I didn't 
capture a screenshot.) I tried typing in various numbers into the text 
entry box, and clicking OK for the Since Last Run dialogue. The numbers 
appeared to be discarded each time. I tried typing in the transaction 
value in USD, in CAD, an exchange rate of CAD per 1.00 USD. None of 
these were accepted.

At one point, I typed in 1.00 to the text box, and I also reached past 
the Since Last Run dialogue to open up Tools… Price Database…, and press 
the Get Quotes button, so that Gnucash would have an exchange rate for 
USD per 1 CAD. The Since Last Run dialogue disappeared, and the 
transaction appeared in my ledgers as expected. I selected the CAD 
Expense split and the CAD Liability credit card charge split, and used 
Actions… Edit Exchange Rate to check the exchange rate. They were 1 CAD 
= 1.00 USD.

This was enough to let me edit the transaction. I set the CAD Liability 
credit card charge split to the correct CAD value, set the other CAD 
Expense split to the correct value, and set the Exchange Rates to the 
correct value. I'm comfortable with the per-month adjustments I had to 
make to the new transaction.

What I would like to understand is: Why didn't the Scheduled Transaction 
service simply duplicate the template transaction as a new transaction, 
with the template transaction's existing per-split exchange rates?  What 
value was the Since Last Run dialogue asking me to enter: exchange rate? 
Split amount? Why didn't the dialogue accept the values I was entering?  
Why did it finally work? Did the Get Prices action supply the needed 
value, or did the number I typed provide the value? What is the correct 
way to enter a multi-currency scheduled transaction so that it gets 
created smoothly each time?

Where in the code will I find the functionality that asked for this 
value and created this transaction? I'm happy to read the code to learn 
more. A few searches for keywords like "scheduled transaction", "give 
value", "enter value", etc. returned search hits, but nothing that was 
clearly the applicable code.  I don't see this topic mentioned in the 
Doxygen overviews 
<https://code.gnucash.org/docs/MAINT/index.html#doxylist>.

I didn't see multi-currency issues mentioned in the Scheduled 
Transaction sections of the Concept Guide 
<https://lists.gnucash.org/docs/C/gnucash-guide/chapter_txns.html>, the 
Manual <https://lists.gnucash.org/docs/C/gnucash-help/ch04s06.html>, or 
the Wiki <https://wiki.gnucash.org/wiki/Scheduled_Transactions>. I 
looked for Scheduled Transaction discussions involving multiple 
currencies in the GnuCash-user list archives 
<https://wiki.gnucash.org/wiki/Scheduled_Transactions>. There must be 
some threads there, but I didn't find them.

I am running GnuCash 3.10 on macOS 10.13.6 High Sierra. My book's 
default currency is CAD. I am using currency trading accounts. I expect 
to upgrade to GnuCash 4.1 soon. I didn't take detailed notes and screen 
shots of the problem this time, but the transaction will recur next 
month, and I can make the notes then. I intend to post an update to this 
thread then.

Any suggestions of where to look in the meantime?

Thank you in advance,
      —Jim DeLaHunt, software engineer, Vancouver, Canada



More information about the gnucash-user mailing list