Created attachment 373249 [details] bug-invest.QIF QIF files fail import when 1. includes an investment account 2. that account has a transaction with qif type "NCash" 3. category of that transaction is an account "L[accountname]" ===Setup Windows 10 GnuCash 3.5 Quicken 2016 ===Repo 1. Start gnucash 2. Create a new file 3. Cancel the new file wizard/template 4. File/import bug-invest.QIF 5. Choose m-d-y as the date format 6. Notice that there is no account "Trigger bug" on the step to "Match QIF accounts". That account *should* be listed. 7. Continue through the importer not making any changes...except for... 7. Choose to use trading accounts, choose to use split action field for number 8. Start the import ===Result Import fails with a critical error "A bug was detected while converting the QIF data". ===Expected A successful import. You can successfully import using bug-invest-workaround.QIF. This uses the bug workaround listed below. ===Workaround One can manually edit the QIF file and change the categories on these problematic transactions to a temporary Expense category (e.g. named "Bug Workaround") L[accountname] ...changed to... LBug Workaround After the import, you can use the gnucash UI to move the transactions to the correct accounts. ===Notes These QIF "NCash" transactions are created by Quicken 2016 in investment accounts (e.g. Traditional IRA). ...quicken register for that investment account ...click in blank register line ...click Edit button on the right ...from the "Enter transaction" pulldown scroll to the bottom and choose Withdraw ...complete the dialog box and in the Category choose another account When these are exported by Quicken, it creates the NCash transactions in QIF. This seems to be related to an earlier step in the importer. Why? Because the importer UI never shows the account of this problematic transfer on the step that normally shows all involved accounts. I suspect this leads to the importer not having a reference to this account, and when it reaches the transaction and needs to assign the "far" account of the transfer, it doesn't have the needed reference. Trace file: In C:\Program Files (x86)\gnucash\share\gnucash/scm/qif-import/qif-to-gnc.scm: 400: 19* (if (not (qif-xtn:mark xtn)) (let* (#) (xaccTransBeginEdit gnc-xtn) ...)) 402: 20 (let* ((gnc-xtn #)) (xaccTransBeginEdit gnc-xtn) ...) 411: 21* [qif-import:qif-xtn-to-gnc-xtn # # # ...] 450: 22 (let (# # # # ...) (cond # #) (if qif-payee #) ...) 520: 23* (if (not qif-security) (begin # # # ...) (let* # # # ...)) 614: 24 (let* (# # # # ...) (if # #) (if xtn-amt # #) ...) ... 786: 25 (begin # # # ...) 791: 26* [xaccSplitSetAccount #<swig-pointer Split * ebd15a0> #f] C:\Program Files (x86)\gnucash\share\gnucash/scm/qif-import/qif-to-gnc.scm:791:17: In procedure xaccSplitSetAccount in expression (xaccSplitSetAccount gnc-far-split far-acct): C:\Program Files (x86)\gnucash\share\gnucash/scm/qif-import/qif-to-gnc.scm:791:17: Wrong type argument in position 2: #f Log file: Contains log entries up to and including the QIF transaction before the problematic transaction. This allowed me to identify the transaction causing the problem.
Created attachment 373250 [details] bug-invest-workaround.QIF