Usm billing EN

Материал из WiKi - UserSide

en | ru

This function is one of the possibilities
to update the activity date of an object

usm_billing - module for organising import of data from billing systems into ERP UserSide using the so-called Universal API

Language of the module: PHP

Current version: see page: Modules

Supported standard billings: uBilling v.0.7.2+, MikBill v.2.8.16+, Carbon Billing v.5.15.06+, ABillS v.0.77.50+, Platex v.7+

Module Status: Free

List of data to be imported *

* - may vary depending on what kind of data the billing system gives you

Tariff Plans

  • name
  • subscription fee
  • daily or monthly subscription fee
  • incoming speed
  • outgoing speed
  • amount of included traffic

Users

  • account
  • FULL NAME
  • contract number and date
  • personal account number
  • current tariff plan
  • next tariff plan
  • date of last internet activity
  • volume of traffic consumed by the user during the current month
  • user's address ( locality, street, house number, house building, flat)
  • IP/MAC-addresses
  • work status in billing
  • user notes
  • balance
  • credit
  • user discount
  • 2 phone number
  • individual/legal entity
  • date of connection to the network
  • e-mail address
  • additional user fields/data (customisable)

Information on installing the module

The usm_billing.zip archive contains the files

usm_billing.php
usm_billing.conf.php-example

1. Allocate a separate (random) directory for the module and place these files in it

2. Allocate a separate directory for the module logs. Give write permissions to this directory.

3. The example configuration file usm_billing.conf.php-example should be renamed to usm_billing.conf.php and make the required changes (the list of parameters is given below) in it

4. Run the module manually several times (*) with the command

php usm_billing.php

It should work without error and return the data:

usm_billing
====================================
 Start module at 2015-11-22 17:32:03
Finish module at 2015-11-22 17:32:14
====================================

* - At the first run - many objects will be pre-created only. The more objects the module imports - the longer it will take. The second and subsequent runs will verify the changed data and only these will be updated. The second run will also take a long time, because after the first run the newly created objects do not contain any data. But the third and subsequent runs will run much faster.

5. Visually verify the completeness of the imported data in the ERP "UserSide"

6. When it is clear that the module works stably - add it to the system cron for periodic operation (specify the necessary paths)

*/10 * * * * php usm_billing.php

Configuration parameters

$billingName - Billing type [standart|carbon5]
$usersideUrl - URL to ERP "UserSide"
$usersideApiKey - API-key of ERP "UserSide"
$billingUrl - URL to the billing API
$billingId - Billing number in ERP "UserSide" ("Settings - Billings")
$logPath - Path for logging
$isSilence - "Silence Mode" flag (hide the output of information messages from the module to the console)
// It is possible to configure import of additional fields from billing to additional fields of ERP "UserSide" user (if necessary)
// The $additionalDataMerge array (for userside 3.13 and earlier) or $additionalCustomerDataMerge array (for userside 3.14 and later) is filled in. You can add your own fields. If the field code value is null - import is not performed
// Import is performed into already created additional fields. I.e. beforehand - this additional field must be created in UserSide for the user's card.
$additionalCustomerDataMerge - Configuring import of additional data/fields

These parameters can be used in all modules of interaction with standard billing (usm_utm5, usm_abills, etc.), as they are based on the current module.

$confIsSkipUpdateAgreementDate - flag - skip updates of contract date
$confIsDisableCreateAddress - flag - do not create new address objects when importing data
$confIsSkipDeleteEmptyIp - flag - do not delete unused IP addresses of users
$confSkipDeleteIp - array with the range of IP addresses ignored for deletion
$confIsImportLessPhone - flag - import empty phone values (delete already filled ones in userside)
$confIsImportLessAddress - flag - import empty user address (delete already filled in userside)
$confIsUpdateEmptyLevel - flag - import empty user floor (delete in userside already filled in)
$confIsUpdateEmptyEntrance - flag - import empty entryway of user (delete in userside already filled)
$confIsImportPasswordToUsPassword - flag - import user's password from billing into password for login to UserSide personal cabinet
$confIsSkipUpdateDateActivity - flag - do not update the date of user's activity in the billing system
$confIsSkipUnusedAddress - flag - do not import unused addresses
$isWithoutLog - flag - do not create log files
$confAlwaysSetCustomerGroupId - set group ID for all imported users 
$confIsUseStreetFullName - flag - use full name of imported street (with suffix/prefix)
$confIsImportMessage - flag - import user messages from billing (where possible)