importQIFIntoAccount question

rapscallion's Avatar

rapscallion

28 May, 2019 02:43 PM

I am attempting to load transactions parsed from a PDF file into Moneydance. I am using the importQIFIntoAccount Java API call which seems to work just fine when Common.QIF_MODE_TRANSFER is used, but no transactions appear when using Common.QIF_MODE_DOWNLOAD is set. I am not sure why, any ideas...? That is the only parameter I am changing on the API call, the file content I am using is not changing.

I am tracing this using Eclipse and can see that the file is being read correctly (line by line), however it seems that no txns are being setup in the txn set when Common.QIF_MODE_DOWNLOAD is used. An example of the rows in the QIF file being imported are:

!Type:Bank
D2019-05-20
T-1246.19
NB8E21SQA00JA004V
C
PJoe Bloggs
L
MSaldo beheer xxxxx318
^
D2019-05-20
T-86.56
NB8E20AG2JK000023
C
PAlbert Heijn
L
MABC 20-05-2019 16:52
^

Showing page 2 out of 2. View the first page

  1. 31 Posted by Stuart Beesley ... on 07 Feb, 2021 11:40 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    Ah yes, Python doesn't have this issue as it's not compiled, and just runs... Glad you have found it... (but yes, I do link the latest jar file into my IDE for code checking anyway)....

  2. 32 Posted by tgilbert666 on 07 Mar, 2021 02:48 AM

    tgilbert666's Avatar

    Hi Stuart,
    Thanks for your work here. I've had a chance to give it a glance, but I think I'm still constrained by the importer. My QIF files have categories, and so far as I can see, the importer still insists that I may have categories imported OR confirmation blue dots, but not both.
    I really don't understand the logic behind that, but it appears insurmountable, or I've overlooked some option somewhere?
    Ultimately, I would like to be able to import my QIFs downloaded from my banks with the categories they already contain, and then run through the confirmation process to merge any already entered transactions without having all the categories reset to the default or to the "MD-knows-better-by-inferring-from-recent-value" during the confirmation. In other words, to use confirmation in my use-case, MD thinks it best to remove the correctly provided categories during the import and replace them with the default category, and then offer a somewhat randomly intelligent guess during the import. Groan.
    Does anyone know of a method to import QIF categories AND set the confirm flag?

    I only download QIF files monthly, but I -mostly- enter sync transactions as I go, so there's a need to manually process and assess duplicates SUBJECTIVELY at month end. It can't be sensibly handled by Macro as suggested elsewhere by Kevin N. because the macro can't decide whether it's a dupe, entered to the wrong account, legitimate, or mis-dated, mis-categorised etc. Maybe there's some AI scope there, but I think we're not there yet and the whole confirmation process would be ideal if MD would allow me to use it purposefully by not killing my categories during the import! :-)
    Cheers,
    Tony

  3. 33 Posted by Stuart Beesley ... on 07 Mar, 2021 02:45 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    .

  4. 34 Posted by Stuart Beesley ... on 07 Mar, 2021 02:47 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    First part of response:

    IMHO when you set the (bank) 'DOWNLOADED' flag then you get the full online txn functionally and match features; when you don't, you don't.. It's hardcoded deeeeep in the API.. I do not see how you can change this:

    E.g. right at the very end before the record save....:

    If Bank DOWNLOADED
          OnlineTxn olTxn = new OnlineTxn()
          ....
          set all the ol.xxx parameter keys
          ....
          setAccountWasUpdated(account, olTxn);
    
    ELSE (if not bank downloaded)
    
          txn.setParameter("qif.orig-txn", qifTxn.getOriginalLines());
          eliminateDuplicatesAndAddTxn(txn, possibleDuplicate, txnSet);
    
    return theTransaction
    

    You could post-process the txns and programmatically add the necessary keys, but I think this would be problematic and not a very future proofed solution......

    Onto your related question.....

  5. 35 Posted by Stuart Beesley ... on 07 Mar, 2021 03:10 PM

    Stuart Beesley (Mr Toolbox)'s Avatar

    So, perhaps some good news... I think I just did what you wanted.... If I understand you correctly, you want to be able to specify the category in the QIF file and import it such that the category is retained AND you get the online matching (blue dots) facility...

    So, I used the field L in my qif

    I set the L field to be exactly the same name/case as my existing Moneydance category.
    - e.g.

    LSTUART-CAT
    

    I used my demo_calling_import_functions.py script (v4).

    I set:
    i_want_popups = True
    default_import_type = ImportDataSourceType.DOWNLOADED
    fileToImport="my file.qif"

    Then I ran it. Selected DOWNLOADED.. Interestingly, MD wanted to override this and on the next normal import popup screen, the Downloaded field was NOT set. So I ticked it, and then ran the import.. Hey presto - a blue dot AND my category was set..

    I suspect the pre-scan is overriding it.. If you play around with this (i.e. set it again after the pre-scan) you may get the headless mode to work the same....

  6. System closed this discussion on 06 Jun, 2021 03:20 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac