Proration in EngageIP
Summary
This article describes how prorating works in EngageIP when billing packages and services. Prorating charges occur when a package or service is being billed for a partial billing period.
Prorate: "To divide, distribute, or assess proportionately."
Prorating occurs only for services that are NOT 'Once' frequency services. (example Month, Year frequency services will be allowed to prorate)
Proration Formula
EngageIP follows a simple formula to this calculation, but that is only to get the final result. It is important to note that all calculations of periods are done in Months.
In order to know the price per day the full period must be calculated, from which the number of days can be extracted. The full period is calculated based the package’s bill date, base time unit and frequency, as well as the start and end date of the proration period. The system figures out the next bill date of the package and uses this as the end of the full period. Next it looks at the start date of the prorate period and sets the start bill date as if it was available within the same month and year. Using these two dates, the start bill date and the next bill date, it figures out the number of full periods between both and compares it to the package’s base time unit and frequency. This gives the full number of periods the prorate period is within. If there is a monthly frequency greater than 1, then a calculation is performed to figure out how many periods are being occupied and converts them down into months. Once the number of full periods in months in determined, the previous bill date can be calculated based on the next bill date.
Prorate Example
Below are some criteria that will be used in showing a prorated calculation. This example is very close to how billing works when a user package is added with the bill now setting enabled.
User Bill Day:Â 1st of the Month
Base Time Unit Amount:Â 30
Package Frequency: 1
Package Base Time Unit:Â Month
Start Date:Â 12/22/2014
End Date:Â 1/1/2015
The prorated period will be from the Start Date up until the Next Bill Day for the user, which is the 1st of the month.
Â
In order to calculate the full period some additional pieces of information must be found. First, the next bill date must be calculated. This is done by using the User Bill Day and finding the next one after the end of the prorate period.
Then, the Previous Bill Date has to be calculated. In order to do this, the beginning of the prorate period is examined and the bill date previous to that is subtracted from the Next Bill Date. This difference is then applied, along with monthly frequency to calculate the Previous Bill Date. In this example, the bill date previous to the prorate Start Date is the bill day prior to December 22, 2014, which is December 1, 2014.
Â
Now that the NextBillDay and the PreviousBillDay have been calculated, the number of months in the full period are just the difference in the number of months between the two dates.
With this value we can calculate out the amount that would have been charged if the package was being billed for the full period.
The last few calculations involve the number of days in each period. Â The number of days is obtained by letting the system DateTime library do the heavy lifting.
First the system calculates the actual period days as below:
Second, the system compares the number of full days in the period to the number of days in the current month (the month in which you are physically billing the customer - todays month), and it will use the greater of the day amounts. If we are billing in December for a February prorate, the system would use 31 days of December as the number of days in a full period rather than 28 days from the actual prorate period as example.
Finally, the prorated amount can be calculated.
So the final, prorated amount rounded off is \$9.68
Annual Package Proration
Prorating in EngageIP is designed with monthly cycles in mind, the logic determines if the proration period spans more than one cycle and then calculates the daily unit price using all the whole cycles involved.
For example:Â if monthly proration is being calculated with a proration period of mid-September to the end of October, the average price per day is calculated by two month's amount divided by the number of days in September and October. The proration amount is then calculated by the number of days in the prorated period multiplied by the average price per day (a multi-cycle average is used to avoid any bias in one cycle, i.e. the number of days in a given month).
For an annual package the cycles may span 1-2 years, but the proration logic is the same:
Determine the average price:Â avg price per day = (package annual price * number of cycles) / total number of days in the cycles
Calculate the prorated amount: avg price per day * number of prorated days
Annual Proration Example that Includes a Leap Year:
Annual Package price: \$100.00
Base Unit: Year
Days in the year: 366 (includes a leap day)
Average price per day: price over two cycles (2 x 100 = 200) divided by the number of days in the full years (366 + 365 = 731): 200 / 731 =Â 0.273597811217510 or about \$0.27 per day.
The prorated amount is then simply the number of prorated days multiplied by the average price per day:
Proration Example: Total number of prorated days (Sept 15th to Oct 31st = 46 days) multiplied by the average price per day (0.273597811217510) = 12.5854993160054 rounded to a proration charge of \$12.59
Full Period Proration Example: Full period days (366) * average price (0.273597811217510) =Â 100.136798905608, rounded: \$100.14 (the extra $0.14 is the result of multiple cycles of differing length (366 vs. 365) being used to calculate the average price per day)