Periodic write-offs¶
Periodic write-offs - a process of writing-off funds from a balance, which occurs automatically with specified period.
These write-offs reflect performed services.
Typical examples of periodic write-offs: subscription fee, fee for equipment leasing, fee for DID number usage, etc.
Periodic write-offs could be configured for Companies and Users, further named Write-off subjects.
Theory of operation is the same for both Write-off subjects.
For each Write-off subject there can be configured several types of write-offs at the same time.
period - duration of period and mean of its measurement. For example, 30 days, 1 month, 7 days, etc
amount - amount of funds in a currency that are written-off each period
service - description of service, for which funds are written-off
Write-off occurs for a time period during which Write-off subject has been activated.
Write-off subject is treated as activated if:
- activation date is set, which has been elapsed (activation date is not in future)
- deactivation date isn't set of hasn't been elapsed yet (deactivation date is not in past)
To understand the meaning of parameter partial need to step further into theory of operation of periodic write-offs.
Write-off is performed by write_off application, which is launched periodically.
You can setup custom period for launch in Tasks.
Therefore, if:
- Write-off subject has been activated at September, 10, 19:30
- write-off period is 1 month
- period of write_off application invocation - each hour at 00 minutes
then write-off will occur at October, 10, 20:00.
In case if Write-off subject has been deactivated September, 20, he will be written-off 33% of the sum of periodic write-off, because services are not performed to deactivated Write-off subjects.
Therefore, if:
- Write-off subject has been activated at September, 10 19:30
- write-off period is 1 month
- write_off application launch period - each day at 19:00
then first write-off in amount of 1/30 of whole sum will occur September, 11, 19:00, second write-off in amount 1/30 of whole sum - September, 12, 19:00 and so on.
Write-offs will be performed each day such way, that in 1 month the sum of all write-offs will be equal to configured amount for 1 month.
Therefore, scheme with partial = yes is more suitable to cut-off balance of Write-off subject to 0.
However it's more resource-intensive due to frequent invocation of write_off.
In scheme with partial = no a case, when Write-off subject will get negative balance at the period end, is likely to happen.
Therefore on practice we recommend to choose a reasonable compromise.
The result of work of periodic write-offs you can see at page Write-offs on each from Write-off subjects.
Write-offs, which are made automatically, doesn't differ in any way from write-offs, which are made manually.