h1. Billing re-calculation *Billing re-calculation* - feature which allows to perform billing re-calculation fir the calls which have been already stored in database. In VoIP business there is a common situation, when it appears, that manager has supplied wrong prices for destination codes. Or partner has sent new prices to you but you forgot to import them into the system. However during calls pass-through billing works in real-time mode and calls have been already billed. In this case _Billing re-calculation_ is handy. _Billing re-calculation_ works on the calls which are stored in database. During operation system calculates new price for each call according to current configuration of: * peers * prices for destination codes and their activation times * [[Timetable]] * [[Consumption profiles]] Re-calculation is performed this way: 1. System traverses all CDRs for the period of interest. 2. For each CDR billing re-calculation is done (a *Billing* tab inside [[Call detail report]]) according to prices and [[Consumption profiles]]. 3. For the specified period system finds all changes of peer/companies and all found peers/companies, which have participated in calls are marked as needed for re-calculation. For example, if you perform re-calculation for peer-terminator, which has company changed for the given period, then cascade re-calculation will occur both for peer-terminator and company's peers. 4. Billing caches are updated according to re-calculated CDRs. Billing cache is described in section [[Billing]]. There is a possibility to perform just i.4. This might be needed after incorrectly performed update or to fix system error. For this you should set option *synchronize billing cache only*. Billing cache synchronization occurs much faster than full billing re-calculation. Full billing re-calculation can e quite long, especially if long period is taken. To prevent from long blockages, it's not allowed to perform billing re-calculation for the present day. When having such a limitation, system is able to perform billing re-calculation completely without blockages (because no other process may alter data at the same time for the past period). The only exception is the case when some other web-interface user has launched billing re-calculation at the same time on the same part of data. Therefore you need to protect from this case using [[Role-based access]], to limit access to the same data or to function of billing re-calculation. You can schedule billing re-calculation to some later time using [[Redo billing timetable]]. [[Пересчет биллинга|Русский перевод]]