Hourly billing

From ISPWiki
Jump to: navigation, search

This feature allows to consider only actual service time and charge clients only for those resources that they consumed. The feature is available for tariff plans with "Daily charges" activated.

Tariff configuration

To enable hourly billing, navigate to "Tariff plans" and select the "Allow clients to resume/suspend services /остановку" check box. Therefore, your clients will be able to resume and suspend services associated with this tariff, themselves. The billing panel won't calculate downtime. After you select this check box, tariff plan and its add-ons will have additional check box "Charge client after suspension" (it is selected by default). This means that a client won't be refunded for a suspended service. Clear the check box if your clients shouldn't pay for service (add-ons) downtime.

Charge.png

Attention: the "Charge client after suspension" check box in a tariff plan configuration form, and in its add-ons are not associated with each other.

Charges

Calculations are made in the same ways as for daily charges. At the beginning of the day, full daily amount will be charged from client's account. At the beginning of the next day, the system will make a refund for service downtime.

The amount that will be charged from the client is calculated as follows:

(Service price + Resource price)/Hours in a day*Hours when service was suspended + Resource price including charges during downtime

First, we need to calculate the cost of a service and its add-ons per hour multiplied by the number of hours when the service was active.

E.g.: a service costs 10 USD; if the service was activated only on 12 pm, 5 USD will be refunded to client's account.

Cron billdaily makes recalculation and refund. The cron job starts once a day, and changes a suspension date for services with hourly charges. Recalculation and refund are made for services, which suspension dates equal the current date. Once the job is completed, the suspension date changes to the next date. If you want to make recalculation again, you need modify suspension dates in the database and start billdaily via the console. We don't recommend doing so, because it can influence expenses for services, which are not set to daily charges! To refund a client, you need to edit expenses that were created one day before for that service and its add-ons.

Example

Let's suppose we sell virtual machines, and we don't charge our clients when a VPS gets suspended (the check box "Charge client after suspension" is not selected).

Service cost is 10 USD per day.

We created two add-ons for this service - disk space for 5 USD, and public IP address for 10 USD. When the service gets suspended, the client continues using disk space, that's why the "Charge client after suspension" check box is selected for this add-on, and cleared for public IP address, meaning that we will make a refund for downtime.

The total price for our VPS: Service(10)+HD(5)+IP(10)=25 USD.

Yesterday we activated the service only on 12 pm.

That's why the client will be refunded with a half price of the service (10:24*12=5), and a half price of the "IP address" add-on (10:24*12=5). Thus, for the previous day the client will need to pay Service (5)+HD(5)+IP(5)=15 USD.