[GNC] GC Importing GC Export Format - too many credits

David Cousens davidcousens at bigpond.com
Tue Oct 8 18:27:08 EDT 2019


I think you have found the bug in the import and export of stock
transactions. I recently exportedsome dummy stock transactions and the
information in the exported CSV records appears to be correct. I am working
my way through the CSV import process and documenting it as I go with
examples for the guide
and I hadn't made it to doing the stock transactions as yet. 

I have jumped ahead and reimported  stock purchase and stock sale
transactions with no errors at all.I created a dummy dividend reinvestment
transaction for a stock and exported it in the GnuCash Export Format and
then reimported it. On reimporting it created a miscellaneous transaction to
the imbalance account for 3.45.   The price on export was 14+17238/34483 but
when reimported the price is recorded as 13+17238/34483 accounting for this
difference. This appears to be some problem with importing prices expressed
as a whole number + a fractional part.

The transaction recorded before export in the stock account register  was
                                                                          
Shares       Price                      Debit      Credit
Asset:Investments:Brokerage:Stock:Acme              6.8966      
14+17238/34483   100
Income:Dividend                                                                                                              
100

After reimporting after deleting the transaction exported it reappears as

                                                                          
Shares       Price                      Debit      Credit
Asset:Investments:Brokerage:Stock:Acme              6.8966      
13+17238/34483   96.55
Imbalance                                                                                                          
3.45
Income:Dividend                                                                                                              
100
                                                                                            
1

and there is a spurious line with a 1 in the price column - no account and
no values in the debit and credit columns.

If I edit the 96.55 to 100 and then tab to the next line and ask for the
price to be recalculated when the dialogue to rebalance the transaction
comes up then the price is restored to its original value and a second
imbalance line with a credit of 3.45 is created to balance the debit which
still exists although ithe Imbalance account does not appear in the account
column for that line (it is assigned to the Imbalance account when the edit
is closed). If I then close the edit on the transaction by clicking on
another transaction or at the bottom of the register it closes and when
reopened the Imbalance entries have disappeared as expected. 

Deleting the Imbalance entries in the editor can be tricky as you can't 
select the two matching entries simultaneously and delete them together and
the minute you delete one GnuCash recalulates the other because the
transaction is imbalanced. This is a quirk of the transaction edit operation
as it does not currently check if there is an existing split to an Imbalance
account which could be cancelled out (or its balance changed) by the newly
created balancing split. 

I didn't have a dummy mutual fund setup in the dummy books I am currently
using to develop the documentation but the stock import should be the same
and is likely experiencing  the same problem. If you open the CSV file in a
text editor and find the line you can check if the price recorded on export
is the same after being reimported to see if the problem is the same. If it
is you could report it as a bug at bugs.gnucash .org

David Cousens



-----
David Cousens
--
Sent from: http://gnucash.1415818.n4.nabble.com/GnuCash-User-f1415819.html


More information about the gnucash-user mailing list