bugfix

Re-categorizing accounts

I’ve been toying around with this idea a bit, not sure if it would meet the needs of the majority of the folks having problems with mis-categorized accounts:

With some custom Javascript I could easily visually ‘move’ an account let’s say from ‘Cash’ to ‘Investments’ and re-calculate the Accounts total on-the-fly . The caveat is that this change would only affect the Overview page, the Trends page would still be wrong without a server-side fix from Mint. Also obviously the mobile apps would continue being wrong as well.

If this partial solution is something that you think is worth pursuing please vote/reply to this post. If there’s enough interest I could add it to the next version of my Chrome extension

Advertisements

Order Accounts by Balance

Edit 4/8:  The steps below are now obsolete. I have created a Chrome  Extension that does the account sorting automatically and adds a lot more functionality to Mint. See this post for more details. Original post follows:

After Mint.com broke the account sorting functionality for the second time in less than a year I decided to take matters into my own hands.  I wrote a small Javascript snippet that reorders accounts by balance on the fly. The neat thing is that everything is done client-side (I’m simply reordering the page markup), so your account information is safe. I developed/tested this using Chrome but it also works in Firefox. If you like this post consider making a donation .

Steps

  1. On your computer login to Mint.com as you usually do.
  2. Once you are logged in your URL should be something like https://wwws.mint.com/overview.event.
  3. Press F12, this should bring up the Javascript Console.
  4. Copy and paste the following text snippet  and hit enter:
javascript:(YUI().use("*",function(e){e.all("li.moduleAccount").each(function(e,t,n){var r=[];e.all("li.accounts-data-li").each(function(e){r.push(e.cloneNode(true))});r.sort(function(e,t){var n=e.one("span.balance").get("text");var r=t.one("span.balance").get("text");var i=Number(n.replace(/[^-0-9\.]+/g,""));var s=Number(r.replace(/[^-0-9\.]+/g,""));var o=i-s;return o});e.all("li.accounts-data-li").each(function(e){var t=r.pop().get("innerHTML");e.set("innerHTML",t)})})}))

The account balances should be reordered now. You can close the console again by pressing F12.

For reference below are two screenshots for Chrome/Firefox showing you where you need to paste this code. (Click on the thumbnails to see a larger image)

chrome

firefox

Other option is to create a shortcut on your bookmarks bar. Give it any title and on the URL address just paste the code there. Then you would click on your bookmarklet when you want to fix the account balance order. Edit:  If you don’t like having the Bookmarks bar visible here’s a good explanation about how to create a bookmarklet in Chrome for quick access. If you are a Firefox user you could setup a smart bookmark or creating a hotkey shortcut.

I’m also looking into possibly converting this script into a Chrome Extension / GreaseMonkey user script so that changes are applied automatically every time you visit the website.

Feel free to post a comment if you have any questions or suggestions. Below is an unminified/readable version of the code.

YUI().use('*', function (Y) {
    Y.all('li.moduleAccount').each(
     function (node, idx, lst) {
         var arr = [];
         //For each Account Section iterate through all the different accounts. 
         node.all("li.accounts-data-li").each(function (n) { arr.push(n.cloneNode(true)) });
         arr.sort(function (a, b) {
             //locate the HTML element that holds the balance for an account
             var currencyA = a.one("span.balance").get('text');
             var currencyB = b.one("span.balance").get('text');
             //Convert the balance to number that javascript can understand
             var keyA = Number(currencyA.replace(/[^-0-9\.]+/g, ""));
             var keyB = Number(currencyB.replace(/[^-0-9\.]+/g, ""));
             var result = keyA - keyB;
             return result;

         });
         //Replace markup with sorted accounts
         node.all("li.accounts-data-li").each(function (n) {
             var ordered = arr.pop().get('innerHTML');
             n.set("innerHTML", ordered);
         });
     }
   );
});

I provide this code under a BSD License.  Now buy me a beer 😉  Buy me a beer if you like this :)