Account names

Jan 31, 2012 at 7:07 PM

This works great for getting all the transactions, but does not include the account name - am I right?

Coordinator
Feb 4, 2012 at 6:49 PM

That's correct, it does not include the account name.

Apr 20, 2012 at 4:19 PM

I added Account to the BasicTransaction class and it seems to work fine. Is there a reason you didn't include it?

Coordinator
Apr 20, 2012 at 6:47 PM

The QIF file format has no field to link a transaction to an account. This API was meant only to represent the QIF file format.

Apr 20, 2012 at 8:56 PM

Well, it does, kind of. It's not a field per se, but it is part of the QIF definition. The account is specified in the header line (http://en.wikipedia.org/wiki/Quicken_Interchange_Format#Header_Line). I'm not a very good OOP programmer, but my workaround in your source was to:

  1. Modify the BasicTransaction class to add the Account string
  2. Modifed the import method to read and save the account when it shows up in the QIF, then pass it along to the individual import methods. I'm sure there's a better way to do this . . .
  3. Save the account

I think that's all I did.

I'm not interested in getting into the transactions of my investment accounts, just the cash-related ones, so I haven't bothered with those types. I'm simply trying to build a simple way for me to quickly export all my Quicken data to SQL so I can build custom reports I can then share outside of Quicken on my personal website, and therefore on my phone, yay! I'll still need to manually push out the QIF export. unfortunately.

Modify BasicTransaction.cs

Added a string Account:

public string Account
{
 get;
 set;
}

Modify QifDom.cs

I created a new string variable in the ImportFile method, which I then fill in the AccountList transactionType:

// Save this account name to use with transactions
currentAccount = AccountListLogic.Import(accountListItems)[0].Name;

I then pass this variable to the import methods of BankLogic, AssetLogic, CashLogic, CreditCardLogic, and LiabilityLogic. For instance:

// Import all transaction types
result.BankTransactions.AddRange(BankLogic.Import(bankItems, currentAccount));

Modify AssetLogic.cs (and the others):

Each of the <type>Logic.cs classes I mentioned above obviously get modified to accept the Account string and then assign it to the property:

internal static List<BasicTransaction> Import(string transactionItems, string accountName)
....
bt.Account = accountName;
result.Add(bt);
Apr 20, 2012 at 8:58 PM

Oh, and by the way, the last thing I have to do is pull the splits from the SortedLists. I see you've worked around Memos being optional by using the Amount count, but I still am running into splits that have Amount and Category, but no items in the Memo list, and can't figure out why. Any ideas? I'm trying to pull the splits into a detail table, and of course need the Memos to align with the number of items that Amounts and Categories have.