Article ID: 118491, created on Nov 7, 2013, last review on Apr 14, 2015

  • Applies to:
  • Business Automation 5.5
  • Business Automation 5.4

Question

How period is calculated when MONTHDIFF_ALG_ACTUALDAYS algorithm is used?

Answer

  1. A parameter MonthDiff is calculated - how many months between a month of the start date and a month of the end date

    MonthDiff = [month number of end date] - [month number of start date]

    for example, upgrade order was placed on June, 20 (start date), subscription next billing date is Aug, 15 (end date), then

    MonthDiff = 8 - 6 = 2

  2. A parameter restDays is calculated - how many days left from the start date till the end of month

    restDays = [number of days in month of start date] - [exact day of start date] + 1

    based on the dates from an example in the step 1:

    restDays = 30 - 20 + 1 = 11

  3. A parameter fractMonthStart is calculated - a part of month from the start date till the end of month

    fractMonthStart = restDays/[number of days in month of start date]

    based on the dates from an example in the step 1:

    fractMonthStart = 11/30 ~ 0.3667

  4. A parameter fractMonthEnd is calculated - a part of month from the beginning of a month for the end date till the end date

    fractMonthEnd = ([exact date of end date] - 1)/[number of days in month of end date]

    for the end date Aug, 15

    fractMonthEnd = (15 - 1)/31 = 14/31 ~ 0,4516

  5. A parameter diffInMonths is calculated - a period between the start and the end dates

    diffInMonths = MonthDiff + fractMonthStart + fractMonthEnd - 1

    diffInMonths = 2 + 0.3667 + 0,4516 - 1 = 1,8183 ~ 1,82 , so as a result the client will be billed for 1,82 month.

Additional information

The MONTHDIFF_ALG_ACTUALDAYS algorithm is just one of the algorithms a provider can choose to calculate the number of days to be used for proration. To learn about other algorithms and how to switch between them please refer to https://kb.odin.com/en/116095.

Search Words

total price switch plan

MONTHDIFF_ALG_ACTUALDAYS

algorithm

pba total price switch plan

198398b282069eaf2d94a6af87dcb3ff caea8340e2d186a540518d08602aa065 801221f8cd76fba7300d1e6817c8e08b 92711db0799e8aefe8e51f12dace0496 e12cea1d47a3125d335d68e6d4e15e07 210d017ddc3a076d22f0f865b1cf0730

Email subscription for changes to this article
Save as PDF