Connection to Billing

Connection to Billing



If modules Billing and Envia are active at the same time there are some interactions that can cause problems on invoice production. To avoid this we have to set start and end dates of items to correct values (which can be extracted from EnviaOrders).

So Nino and Patrick made some decisions:

  1. Add a bundled_with_voip flag to products of type internet. We get two subgroups of internet products which then will be used for standalone (=without VoIP) or mixed calculation.

  2. Start and end dates of items will be automatically updated from provvoipenvia:update_envia_orders cron command.

  3. ItemObserver and provvoipenvia:update_envia_orders will also set the originally used data fields (e.g. voip_id in contract table or activation_date in phonenumbermanagement) to actual values. So module Envia can use this entries in each case (billing active or not) and there is no need of double implementation.

  4. The main problem (and cause for complexity) is that update_envia_orders have to update start and end dates of up to three items per cycle. To avoid n:m tables between items and enviaorders there is only one future item per type allowed – the updater command than can work of the current and the (one) future item without checking relations

  5. To catch special cases (there are e.g. up to six numbers per SIP line) we also add a flag to Item (valid_from_fixed). Set this flag if a start date is as not allowed to be changed (e.g. the first phonenumber of an Voip item is activated).

1.1. Overview of possible Scenarios

Bundled only for inet items

Only 1 future tariff possible (foreach type)

Inet tariff can only be changed while pending enviaorder when bundled state changes

 

actual State

wished future state

items

actions

notes

actual State

wished future state

items

actions

notes

New Contract

 

 

 

  • change ItemObserver: inet items start date = today (not tomorrow!)

No Voip - No Inet

Voip + Inet separate

3 (unbundled Inet from today, bundled Inet+Voip in future)

increment end date of unbundled and start date of bundled tariffs until actual start date (comes from enviaorder)

  • adapt updateEnviaOrdersCommand (1)

 

Voip + bundled Inet

2 (bundled Inet+Voip in future)

increment start date of bundled tariffs until actual start date (comes from enviaorder)

 

 

 

 

 

 

Existing Contract

 

 

 

 

Inet

Voip + bundled Inet

add voip + bundled inet in future

increment end date of unbundled and start date of bundled tariffs until actual start date (comes from enviaorder)

 

bundled Inet + Voip

Inet

add unbundled Inet

increment end dates of bundled Inet & Voip and start date of unbundled Inet until actual start date (comes from enviaorder)

when porting comes from e.g. telekom - dates have to be set manually (no incrementation of dates needed)

 

bundled Inet + Voip + new/remove Phonenr

?

increment end date of old Voip and start date of new Voip until actual start date (comes from enviaorder)

The first SIP-line includes 6 numbers – so up six numbers are paid with one base fee. For every six more numbers man has to add a line – and therefore there is a price raise (and a new Voip-Item)

 

 

 

 

 

1.2. Flow Diagram to update Item from EnviaOrder