Usm abills EN

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

en | ru

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

usm_abills - module to organise the import of data from the ABillS billing system into ERP UserSide

This module is a replacement for the deprecated us_abills module - See: Migrating from us abills to usm abills

Module Language: PHP

Current version: See: Modules

Module Status: Paid

For more information and a list of imported data, see the page: ABillS

Information on installing the module

Make sure that the php_mysqli library is present on the system where the module will run

The usm_abills.zip archive contains the files

usm_abills.php
usm_abills.conf.php-example

1. On any server (no difference - billing server, userside or third machine) allocate a separate ( random) directory for the module and place these files in it

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

3. Rename the example configuration file usm_abills.conf.php-example to usm_abills.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_abills.php

It should work without error and return the data:

usm_abills
====================================
 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 further 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 further 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_abills.php

Configuration parameters

The module is configured in the usm_abills.conf.php file

You can also use the default parameters from the usm_billing module

$usersideUrl         - URL to ERP "UserSide"
$usersideApiKey      - API-key of ERP "UserSide"
$billingId           - The 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)

$billingDBHost       - address of the billing server
$billingDBPort       - port of mysql connection to the billing database
$billingDBUser       - customer name to access the billing database
$billingDBPassword   - password for access to the billing database
$billingDBName       - billing database name

$confAdrDistrictMode                    - (1 - add district name to street name (only when $zadress = 1), 2 - then transfer district name to city name, 3 - use city name from districts.city)
$confAddressListCityIds                 - list of localities IDs (address_types.id) (may be separated by comma)
$confDateConnectSrc                     - from where to get the date of customer's connection to the network (1 - users.registration, 2 - dv/internet_log.start).
$confUserImportExpr                     - optional condition for importing customers
$confAddFieldPhone                      - users_pi. - name of the field in the users_pi table with the phone number (default: phone)
$confAddFieldCellPhone                  - users_pi. - name of the field in the users_pi table with mobile phone number
$confAddFieldEntrance                   - users_pi. - name of the field in the users_pi table with the entrance number
$confAddFieldFloor                      - users_pi. - field name in users_pi table with floor number
$confIsSavePasswordToComment            - flag - save customer's password to notes
$confIsCidIp                            - flag - dv/internet_log.CID field contains subscriber's IP address
$confIsIpAdrOnlyFromDhcpHosts           - flag - import IP address only from dhcphosts_hosts
$confIsIpAdrSkipFromDhcpHosts           - flag - do not import IP addresses from dhcphosts_hosts
$confUserStateSrc                       - source for subscriber status in billing (if empty - dm.disable (or u.disable))
$confWorkState2                         - convert "Not activated" state to [0|1|2] (0 - Stop, 1 - Pause, 2 - Active) (default: 0)
$confWorkState5                         - convert "Deposit too small" state to [0|1|2] (0 - Stop, 1 - Pause, 2 - Active) (default: 1)
$confIsHideDvLogData                    - flag - do not import data from dv/internet_log table
$confIsHideIpAdrFromDvCalls             - flag - do not import IP address from the table dv/internet_calls
$confIsHideCidFromDvMain                - flag - do not import CID from "dv/internet_main" table
$confUserAccountSrc                     - source of customer's personal account [uid|bill_id] (default: uid)
$confIsImportTags                       - flag - import customer tags (tags)
$confAddressSrc                         - source of information about customer address [builds|users_pi] (default: builds)
$confIsImportMsg                        - flag whether to import customers' messages.
$confPasswordSecretKey                  - "Secret Key" for decrypting customers' passwords (/usr/abills/libexec/config.pl - $conf{secretkey})
$confIsImportPasswordToUsPassword       - flag - whether to import customer's password into UserSide's customer password
$confIsImportOnlyUsedAddress            - flag - import only used addresses
$confIsPrimaryDvModule                  - flag - use only DV module information

$confImportCustomerTaxNumber            - import customer's tax number into customer's additional fields (specify additional field ID)
$confTaxNumberField                     - name of the field with tax number from the table "customers"
$confImportCustomerPassport             - import customer's passport into customer's additional fields (specify additional field ID)
$confPassportField                      - name of the field with passport from the table "customers"
$confImportCustomerNasIp                - import customer's NAS IP address into customer's additional fields (specify additional field ID)
$confImportCustomerNasPort              - import customer's NAS port into customer's additional fields (specify additional field ID)
$confImportCustomerNasName              - import customer's NAS name into customer's additional fields (specify additional field ID)
$confImportCustomerNasVlan              - import customer's NAS Vlan into customer's additional fields (specify additional field ID)
$confImportCustomerGroup                - import customer's group into customer's additional fields (specify additional field ID)
$confContactTypeIdPhone                 - Type Id of user_contacts table for importing phone number (default: 1)
$confContactTypeIdCellPhone             - Type Id of user_contacts table for importing mobile phone number (default: 2)

Running in a Docker environment

If you use USERSIDE in a Docker environment, you will probably be interested in running usm external modules in separate Docker containers.

We provide a docker environment to run the usm_abills module (the environment does not contain the module files - you need to download them from your personal account yourself).

You can download the docker-environment at: https://github.com/userside/usm_abills-docker-env/releases