Usm abills EN: различия между версиями

Материал из WiKi - UserSide
Нет описания правки
Нет описания правки
Строка 56: Строка 56:
You can also use the default parameters from the [[usm_billing_EN#Configuration Parameters|usm_billing]] module
You can also use the default parameters from the [[usm_billing_EN#Configuration Parameters|usm_billing]] module


  $usersideUrl                 - URL to the UserSide ERP
  $usersideUrl         - URL to the UserSide ERP
  $usersideApiKey         - [[UserSide API Key|API-key of ERP "UserSide"]]
  $usersideApiKey     - [[UserSide API Key|API-key of ERP "UserSide"]]
  $billingId                       - The billing number in ERP "UserSide" ''("Setup - Billings")'''
  $billingId           - The billing number in ERP "UserSide" ''("Setup - Billings")'''
  $logPath                       - Path for logging
  $logPath             - Path for logging
  $isSilence                     - "Silence Mode" flag ''(hide the output of information messages from the module to the console)''
  $isSilence           - "Silence Mode" flag ''(hide the output of information messages from the module to the console)''
   
   
  $billingDBHost     - address of the billing server
  $billingDBHost       - address of the billing server
  $billingDBPort     - port of mysql connection to the billing database
  $billingDBPort       - port of mysql connection to the billing database
  $billingDBUser     - user name to access the billing database
  $billingDBUser       - user name to access the billing database
  $billingDBPassword     - password for access to the billing database
  $billingDBPassword   - password for access to the billing database
  $billingDBBName      - billing database name
  $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)
  $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)

Версия от 14:02, 28 сентября 2023

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 the UserSide ERP
$usersideApiKey      - API-key of ERP "UserSide"
$billingId           - The billing number in ERP "UserSide" ("Setup - 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       - user 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)
$confDateConnectSrc - from where to get the date of user's connection to the network (1 - users.registration, 2 - dv/internet_log.start).
$confUserImportExpr - optional condition for importing users
$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 user's password to notes
$confIsCidIp - flag - dv/internet_log.CID field contains subscriber's IP address
$confIsIsIpAdrOnlyFromDhcpHosts - 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 user's personal account [uid|bill_id] (default: uid)
$confIsImportTags - flag - import user tags (tags)
$confAddressSrc - source of information about user address [builds|users_pi] (default: builds)
$confIsImportMsg - flag whether to import users' messages.
$confPasswordSecretKey - "Secret Key" for decrypting users' passwords (/usr/abills/libexec/config.pl - $conf{secretkey})
$confIsImportPasswordToUsPassword - flag - whether to import user's password into UserSide's user password
$confIsImportOnlyUsedAddress - flag - import only used addresses
$confIsPrimaryDvModule - flag - use only DV module information

$confImportCustomerTaxNumber - import user's tax number into user's additional fields (specify additional field ID)
$confTaxNumberField - name of the field with tax number from the table "users"
$confImportCustomerPassport - import user's passport into user's additional fields (specify additional field ID)
$confPassportField - name of the field with passport from the table "users"
$confImportCustomerNasIp - import user's NAS IP address into user's additional fields (specify additional field ID)
$confImportCustomerNasPort - import user's NAS port into user's additional fields (specify additional field ID)
$confImportCustomerNasName - import user's NAS name into user's additional fields (specify additional field ID)
$confImportCustomerNasVlan - import user's NAS Vlan into user's additional fields (specify additional field ID)
$confImportCustomerGroup - import user's group into user'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