[GNC] Import CSV Multi-currency

David Cousens davidcousens at bigpond.com
Sun Nov 25 17:04:45 EST 2018


Hi Geert,On Sun, 2018-11-25 at 15:47 +0100, Geert Janssens wrote:
> Op zaterdag 24 november 2018 23:47:33 CET schreef David Cousens:
> > The single line format data cannot be imported correctly at all at the
> > moment as Geert indicated in his reply. The single line exported data has a
> > separate column for the base account for the transaction and a separate
> > column for the transfer account but in the importer as it is coded at the
> > moment there is no facility to associate a transfer account to this column.
> > 
> 
> This is inaccurate. You definitely can associate a transfer account to the 
> column in single line import mode. There is "Account" and "Transfer Account" 
> for a reason. And it works well in a single currency environment. It breaks 
> down in a multi currency one.
Agreed that it works generally but ther are some specific limitations someone importing transactions
will need to be aware of. I have started testing the importer as systematically
as I can for a multicurrency import, specifically a multicurrency transaction AUD to USD for
a withdrawal/credit to an AUD savings account of $100 AUD deposited/debited to a USD
savings account with an exchange rate entered as 10/11 in the currency dialog. I have created 
single line exports in the GnuCash Export Format for the transaction from both the AUD Savings account
and the USD Savings account.
 
The exported transaction in SL mode from the AUD account contains no information that it involves another
currency other than that the Full Category Path points to the USD account.

If I select the import format as GnuCash Export Settings, set the date format and most of the columns to the values
suggested by the headers, I cannot set the Full Category Path column in the exported data to Transfer Account as it does
not appear in the drop down list. I would have expected that GnuCash on import would have been able to set the Transfer
Account with the export settings.

If however I use No Settings, set the date format and assign the columns as their headings suggest, the Transfer Account
does come up and I can set the import data Full Category Path as Transfer Account however the price data is 1.00 and
when imported it shows the transaction value as $100, which is reasonable as there is no currency conversion information
in the exported record, however the import is not triggering the currency conversion dialog.

I am still experimenting with importing the export from the USD account. There is more hope of getting restoration of
the internal record of the transaction here as it does contain the conversion price information. Doing it systematically
and exploring the effects of various import setting and recording them is fairly time consuming however so it may take
me some time to complete and report it.

I hope to identify any problems/limitations and perhaps provide some guidelines for importing multicurrency transactions
to use. I'll try and play a dumb user with no knowledge of the internals who does the totally unexpected.

> 
> Obviously with one "Account" column and one "Transfer Account" column there 
> can only be a maximum of two accounts per line. As such a 'single line' import 
> can only work for transactions involving only two accounts.
> 
> And that's why a multi-line mode was added: in this mode each line represents 
> one split of a transaction. As one split can only belong to one transaction, 
> the "Transfer Account" no longer makes sense in the multi-line mode. That's 
> why it only appears in single-line mode.
> 
> > Geert also indicated that the main developer effort is currently directed to
> > other areas. I have had a little bit of experience with some parts of the
> > importer code although not that associated with currency/commodities to
> > data so far. I will try have a look at the code area to see if I can
> > isolate at least the above problem with the multiline import which is in
> > the
> > import-matcher I have previously looked at and fix that. I may learn enogh
> > to start looking at the single line import problems, but that will certainly
> > take longer.
> 
> That would be really cool. Don't hesitate to ask for clarifications of the 
> code if needed.
Will do. Thanks. It is difficult to penetrate the GnuCash code from scratch. I am beginning
to understand the importer better than other areas. I have looked at the register code
a bit as well and everytime I think I have grasped something it slips out of reach again.
> 
> Geert
> 
> 

David



More information about the gnucash-user mailing list