jump to navigation

NOTE: The spam filter is being unusually aggressive. If you comment does not immediately appear, it has simply been placed in moderation and I will approve it as quickly as possible. Thank you for your patience.

"Murphy was an optimist!"

What is programming? November 24, 2006 12:30 pm

Posted by Doug McCaughan in : ColdFusion, Daily Life, Programming, Technology
, trackback

In essense, a client presents a challenge and I solve the problem.

Today’s challenge: a custom ordering system (shopping cart) written in ColdFusion is producing the wrong totals.
The system design: tax is built into the price of the items stored in the database except for certain non-taxable items. A flag indicates if an item has tax built into the price or not. At the bottom of the invoice, the amount of tax charged is shown.
The problem: The system allows for the administrator to apply a discount. Tax cannot be discounted but the total tax shown on the invoice is calculated off the discounted price.

How do you solve this kind of problem? I use my tools available to me. I could just jump into the code and start changing it but I can do a better job and document my efforts by using MS Excel and MS Word to help solve the problem.

  1. I pull up the sample invoice that the client used to show the incorrect figures.
  2. I reproduce the invoice in Excel.
  3. I open the database (in this case with MS Access) and find the products listed on the invoice so that I can be certain which items are taxed and which are not.
  4. I manipulate the spreadsheet to assure that I am using the correct math formulas to get the correct result.
  5. Find the code within the system that calculates the tax and change it to use the new formula for presentation.

Update: I think perhaps the end of this post was lost…

Comments after advertisement

Comments»

1. The Bosphorus - November 24, 2006

I like seeing how you work through a problem. I also like how you have this posted under daily life. That seems appropriate in more ways than one.


trackback