Billing coding problem

From: Sandra Becker <sbecker6925_at_gmail.com>
Date: Fri, 19 Aug 2011 09:07:33 -0600
Message-ID: <CAJzM94B0WuTHoUpT2LDEGb-ne1oJYWR3mJND+2VGFSbDP++SRg_at_mail.gmail.com>



Oracle - EE 10.2

I have been asked to code an Apex application to replace our current poorly performing, inaccurate and woefully inadequate billing procedures, most of which is manual. Very sad state of affairs for a software company, but there you have it. The problem stems from the way we bill certain customers for archiving their data. Billing is a tiered structure:

First 10g - flat fee
11-20g    - rate 1
21-50g    - rate 2

Over 50g - rate 3

To further complicate, each rate level bills only for the gig that fall in that level. Two examples:

     customer has 15g; they would be billed flat fee + (5g * rate1).

     customer has 200g; they would be billed flat fee + (10 * rate1) + (30 * rate2) + (150 * rate3)

My math skills not being what they should be, I'm having difficulty coming up with the code to accurately calculate the billing amount. Any help will be greatly appreciated.

-- 
Sandy
Transzap, Inc.

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Aug 19 2011 - 10:07:33 CDT

Original text of this message