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

Материал из WiKi - UserSide
Нет описания правки
Нет описания правки
 
(не показано 6 промежуточных версий этого же участника)
Строка 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 ERP "UserSide"
  $usersideApiKey      - [[UserSide API Key|API-key of ERP "UserSide"]]
  $usersideApiKey      - [[UserSide API Key_EN|API-key of ERP "UserSide"]]
  $billingId          - The billing number in ERP "UserSide" ''("Setup - Billings")'''
  $billingId          - The billing number in ERP "UserSide" ''("Settings - 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)''
Строка 64: Строка 64:
  $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      - customer name to access the billing database
  $billingDBPassword  - password for access to the billing database
  $billingDBPassword  - password for access to the billing database
  $billingDBName      - 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)
  $confDateConnectSrc - from where to get the date of user's connection to the network (1 - users.registration, 2 - dv/internet_log.start).
$confAddressListCityIds                - list of localities IDs (address_types.id) ''(may be separated by comma)''
  $confUserImportExpr - optional condition for importing users
  $confDateConnectSrc                     - from where to get the date of customer's connection to the network (1 - users.registration, 2 - dv/internet_log.start).
  $confAddFieldPhone - users_pi. - name of the field in the users_pi table with the phone number (default: phone)
  $confUserImportExpr                     - optional condition for importing customers
  $confAddFieldCellPhone - users_pi. - name of the field in the users_pi table with mobile phone number
  $confAddFieldPhone                     - users_pi. - name of the field in the users_pi table with the phone number (default: phone)
  $confAddFieldEntrance - users_pi. - name of the field in the users_pi table with the entrance number
  $confAddFieldCellPhone                 - users_pi. - name of the field in the users_pi table with mobile phone number
  $confAddFieldFloor - users_pi. - field name in users_pi table with floor number
  $confAddFieldEntrance                   - users_pi. - name of the field in the users_pi table with the entrance number
  $confIsSavePasswordToComment - flag - save user's password to notes
  $confAddFieldFloor                     - users_pi. - field name in users_pi table with floor number
  $confIsCidIp - flag - dv/internet_log.CID field contains subscriber's IP address
  $confIsSavePasswordToComment           - flag - save customer's password to notes
  $confIsIsIpAdrOnlyFromDhcpHosts - flag - import IP address only from dhcphosts_hosts
  $confIsCidIp                           - flag - dv/internet_log.CID field contains subscriber's IP address
  $confIsIpAdrSkipFromDhcpHosts - flag - do not import IP addresses from dhcphosts_hosts
  $confIsIpAdrOnlyFromDhcpHosts          - flag - import IP address only from dhcphosts_hosts
  $confUserStateSrc - source for subscriber status in billing (if empty - dm.disable (or u.disable))
  $confIsIpAdrSkipFromDhcpHosts           - flag - do not import IP addresses from dhcphosts_hosts
  $confWorkState2 - convert "Not activated" state to [0|1|2] (0 - Stop, 1 - Pause, 2 - Active) (default: 0)
  $confUserStateSrc                       - source for subscriber status in billing (if empty - dm.disable (or u.disable))
  $confWorkState5 - convert "Deposit too small" state to [0|1|2] (0 - Stop, 1 - Pause, 2 - Active) (default: 1)
  $confWorkState2                         - convert "Not activated" state to [0|1|2] (0 - Stop, 1 - Pause, 2 - Active) (default: 0)
  $confIsHideDvLogData - flag - do not import data from dv/internet_log table
  $confWorkState5                         - convert "Deposit too small" state to [0|1|2] (0 - Stop, 1 - Pause, 2 - Active) (default: 1)
  $confIsHideIpAdrFromDvCalls - flag - do not import IP address from the table dv/internet_calls
  $confIsHideDvLogData                   - flag - do not import data from dv/internet_log table
  $confIsHideCidFromDvMain - flag - do not import CID from "dv/internet_main" table
  $confIsHideIpAdrFromDvCalls             - flag - do not import IP address from the table dv/internet_calls
  $confUserAccountSrc - source of user's personal account [uid|bill_id] (default: uid)
  $confIsHideCidFromDvMain               - flag - do not import CID from "dv/internet_main" table
  $confIsImportTags - flag - import user tags (tags)
  $confUserAccountSrc                     - source of customer's personal account [uid|bill_id] (default: uid)
  $confAddressSrc - source of information about user address [builds|users_pi] (default: builds)
  $confIsImportTags                       - flag - import customer tags (tags)
  $confIsImportMsg - flag whether to import users' messages.
  $confAddressSrc                         - source of information about customer address [builds|users_pi] (default: builds)
  $confPasswordSecretKey - "Secret Key" for decrypting users' passwords (/usr/abills/libexec/config.pl - $conf{secretkey})
  $confIsImportMsg                       - flag whether to import customers' messages.
  $confIsImportPasswordToUsPassword - flag - whether to import user's password into UserSide's user password
  $confPasswordSecretKey                 - "Secret Key" for decrypting customers' passwords (/usr/abills/libexec/config.pl - $conf{secretkey})
  $confIsImportOnlyUsedAddress - flag - import only used addresses
  $confIsImportPasswordToUsPassword       - flag - whether to import customer's password into UserSide's customer password
  $confIsPrimaryDvModule - flag - use only DV module information
  $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)''
  $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 "users"
  $confTaxNumberField                     - name of the field with tax number from the table "customers"
  $confImportCustomerPassport - import user's passport into user's additional fields ''(specify additional field ID)''
  $confImportCustomerPassport             - import customer's passport into customer's additional fields ''(specify additional field ID)''
  $confPassportField - name of the field with passport from the table "users"
  $confPassportField                     - name of the field with passport from the table "customers"
  $confImportCustomerNasIp - import user's NAS IP address into user's additional fields ''(specify additional field ID)''
  $confImportCustomerNasIp               - import customer's NAS IP address into customer's additional fields ''(specify additional field ID)''
  $confImportCustomerNasPort - import user's NAS port into user's additional fields ''(specify additional field ID)''
  $confImportCustomerNasPort             - import customer's NAS port into customer's additional fields ''(specify additional field ID)''
  $confImportCustomerNasName - import user's NAS name into user's additional fields ''(specify additional field ID)''
  $confImportCustomerNasName             - import customer's NAS name into customer's additional fields ''(specify additional field ID)''
  $confImportCustomerNasVlan - import user's NAS Vlan into user's additional fields ''(specify additional field ID)''
  $confImportCustomerNasVlan             - import customer's NAS Vlan into customer's additional fields ''(specify additional field ID)''
  $confImportCustomerGroup - import user's group into user'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)''
  $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)''
  $confContactTypeIdCellPhone             - Type Id of user_contacts table for importing mobile phone number ''(default: 2)''


== Running in a Docker environment ==
== Running in a Docker environment ==

Текущая версия от 08:00, 1 апреля 2024

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