System information
Then this top resellers can login on the web interface and create their own billing and add sub resellers and/or child endusers. Reseller can create a “base
tariff” and other tariffs assigned to individual users. Multiple packets are allowed and packets can be assigned to other users or resellers directly from web
(in the same way like on the “Users and Devices” form -> “Billing” tab -> Billing packet setting. Resellers usually will create their own price lists by
cloning an existing list or their base tariff list. Individual reseller prices are stored in tb_billsources with their “resellerid”. If reseller has not tariffs, than the
billing will be done after usual enduserprices. If reseller has no credit, the billing will be done after the provider prices (usually generating profit loss for the
reseller)
set parent for top reseller accounts to an owner account
CDR records:
When the reseller option is enabled, the main cdr record will store the top reseller user id in tb_cdrs.resellerid and the “othercost” field will contain the
payment from the reseller (loaded from public reseller price).
Individual reseller cdr records are stored in a separate table called tb_cdrresellers (when a reseller will login to the web interface, all reports are loaded from
this table and not from the main cdr table –tb_cdrs)
In the first cdr:
-the caller enduser name
-reseller field set to top reseller
-pricing after parent reseller
You can see the reseller account statistics by using the “Advanced Statistics” form by checking the “OC” and the “PR”/”PFR” fields or if you login with
their own credentials on the web (or with parent user credentials)
Billing
There are two options for reseller billing controlled by the “defearlypay” global config option:
The possible values for defearlypay are the followings:
0=configurable (default). Early billing if the “stage” field in tb_users is set to 9. Otherwise late billing (default is 8 for the “stage” field which
means late billing)
1=always late billing
2=always early billing
1. Late billing
The credit for the reseller and enduser will be deducted after each call.
(Resellers can assign any amount of credit for the users, but the calls from the users will be rejected when the credit for the reseller reach to 0)
2. Early billing










