Add company name to billing history

May 1st, 2008

Problem: When viewing the billing history table in Smartway — the administrative area of webjobs — it is difficult to tell what company paid for the job b/c it only includes the user ID.

Solution: — Add the company name to the billing table.
1. In smartway/modules/billing_history.php, around line 78, add this line into the array:

‘company_name’ => ‘company_name’,

2.Around line 236, add:

$company_name = $input[’company_name’];

3.Around line 312, add the following line into the array:

‘company_name’ => $company_name,

4. Around line 541, after this line:

$constraints[] = “bh.user_id = ‘” . $user_id . ‘\”;

add:

$constraints[] = “u.id = ‘” . $user_id . ‘\”;

5. For the entire SELECT statement and array around line 604, change it to this:

‘SELECT bh.user_id, u.company_name, bh.id, bh.timestamp, bh.name, bh.quantity, bh.price, bh.type, bh.pending, bh.comment ‘ .
‘FROM `jb_billing_history` AS bh, `jb_users` AS u ‘ .
‘WHERE bh.user_id=u.id ‘ .
“AND $constraints $order_clause”,
array(’user_id’, ‘invoice’, ‘company_name’,'id’, ‘timestamp’, ‘name’, ‘quantity’, ‘price’, ‘type’, ‘pending’, ‘comment’, ‘controls’));

6. Change the SQL query around line 706 to:

$sql->query(’SELECT bh.user_id, u.company_name, u.login, bh.timestamp, bh.name, bh.type, bh.quantity, bh.duration, bh.price, bh.comment, bh.pending ‘ .
‘FROM `jb_billing_history` AS bh LEFT JOIN `jb_users` AS u ON(bh.user_id = u.id) ‘ .
“WHERE bh.id = $id LIMIT 1″);

7. Change the language file so that the Company label appears in the table. Open smartway/conf/lang/eng/text.billing_history.php and add

‘company_name’ => ‘Company:’,

on the line below this comment

// Smartway translations for modules billing_history.php

You’re done! If all went as planned, company name should show up in the table after the invoice number.

Collecting Rainwater

April 28th, 2008

My banana plants, although showing new growth everyday, have brown spots on their leaves. Apparently they don’t like the chlorine that is in our city water. They like rainwater best, but we’ve been short on rain here in South Texas… until yesterday. The skies opened up and it poured.

About 15 minutes after the rain started, I told the kids “Quick, put the watering can under the gutter!” I figured I could save the rainwater for the next time I needed to water the banana plants. I hoped the 15 minute delay allowed the grime, squirrel and bird poop to wash out of the gutters, giving a cleaner water.

Well, the kids love the rain, so they happily obliged. When the watering can filled up in mere minutes, they were having fun, so they went on a search for every bucket and empty container they could find. An hour later, when the rain finally stopped, I had 5 dutch-oven style kettles, 3 large plastic totes, 3 buckets, 1 watering can, and 2 kitchen pitchers full of fresh rain water. A bit more than I was needing for the bananas, but considering that less than 1% of our water on Earth is used for drinking, I’ll put it to use.

I can’t store it for too long. I’m worried about mosquitos in these open containers of standing water. I put the lids on the plastic totes and left them where they are. They are too heavy for me to move. The water in these totes should water our garden for a few weeks, with much left over to wash our cars. The open containers — kettles, soup pots, buckets — were pulled into the garage to offer some protection from bugs.

How to use all of this water? So far, I mopped the floor with it, washed the windows, and cleaned the bathtub and shower. Then I used this dirty cleaning water to flush the toilets. Flushing the toilet is normally just a waste of good drinking water.

I heard that rainwater makes your skin soft, so I filtered out a large bowl of rainwater with two sieves filled with cheesecloth. Worried about nasty things I couldn’t see in the water, I then boiled it. I let it cool to room temperature then used it to wash my face. I didn’t notice softer skin, but I didn’t wake up with insects crawling around my face under my skin either. Note — to be on the safe side, we will NOT be using this rainwater to drink or for washing dishes.

All in all, I feel pretty good about it. The kids had a blast and were occupied for an hour or more, I’m saving money on my water bills this week, and I didn’t let a natural resource go to waste. And my banana plants should reap the benefits next week when they dry out again. Maybe they’ll even reward me by giving me some nice bananas to eat.

A bigger, better step for us is to install a REAL rainwater barrel collection system — one with hoses for feeding our washing machine, watering our garden, flushing the toilet, etc. I believe the money spent on this type of system would be quickly given back in city water savings.

What uses have you found for rainwater?

Doing GTD to 2 minute music

April 24th, 2008

One of David Allen’s key components of the GTD process is his 2 minute Rule, which basically states that if you pick up an item from your inbox, and you can do it’s next action in 2 minutes or under, do it right away.

Do it even if it’s not a real high priority because then it will be done and gone and not cluttering up your head.

This is a great rule, and very important to the success of doing GTD. My problem is that I’ve somehow started to stretch out this rule to 15 minutes. I think, “well, I can’t do it in 2 minutes, but I can do it in 15 minutes, so I might as well do it and get it done with.” The problem arises when I have too many of these “short” tasks, and they eat up my entire morning. Then I didn’t do the really important Next Actions and I feel horribly guilty and unproductive.

To remind me of how long 2 minutes really is, I googled “GTD 2 minutes” and ran across Christopher Schmitt’s blog article Two Minute Playlists for Getting Things Done. He plays songs that are under 2 minutes each while he’s working on his short actions to get rid of the need for a 2 minute timer.

There are quite a few songs that are under 2 minutes. I checked my current ITunes inventory of MP3s, sorted by time, and found the following gems:

  • Owen Wilson (from the Starsky and Hutch soundtrack) - Don’t Give Up on Us - 1:09
  • Beethoven - Symphony No. 9 (scherzo) - 1:16
  • Stone Temple Pilots - No Memory - 1:20
  • Green Day - Coming Clean - 1:35
  • Simon & Garfunkel - Feelin’ Groovy- 1:50
  • Nirvana - Molly’s Lips -1:53
  • Red Hot Chili Peppers - Right On Time - 1:55
  • Pixies - Tame - 1:56
  • Blind Melon - Skinned - 1:58
  • Third Eye Blind - Anything - 2:01 (close enough!)

Tomorrow I’m going to make a playlist and get motivated to the music to get through my short actions sooner.

Looking forward to hearing suggestions of more 2 minute or under songs!