Usm billing EN: различия между версиями
Нет описания правки |
Нет описания правки |
||
Строка 96: | Строка 96: | ||
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. | 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 | $confIsSkipUpdateAgreementDate - flag - skip updates of contract date | ||
$confIsDisableCreateAddress - flag - do not create new address objects when importing data | $confIsDisableCreateAddress - flag - do not create new address objects when importing data | ||
$confIsSkipDeleteEmptyIp - flag - do not delete unused IP addresses of users | $confIsSkipDeleteEmptyIp - flag - do not delete unused IP addresses of users | ||
$confSkipDeleteIp - array with the range of IP addresses ignored for deletion | $confSkipDeleteIp - array with the range of IP addresses ignored for deletion | ||
$confIsImportLessPhone - flag - import empty phone values ''(delete already filled ones in userside)'' | $confIsImportLessPhone - flag - import empty phone values ''(delete already filled ones in userside)'' | ||
$confIsImportLessAddress - flag - import empty user address ''(delete already filled 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)'' | $confIsUpdateEmptyLevel - flag - import empty user floor ''(delete in userside already filled in)'' | ||
$confIsUpdateEmptyEntrance - flag - import empty entryway of user ''(delete in userside already filled)'' | $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 | $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 | $confIsSkipUpdateDateActivity - flag - do not update the date of user's activity in the billing system | ||
$confIsSkipUnusedAddress - flag - do not import unused addresses | $confIsSkipUnusedAddress - flag - do not import unused addresses | ||
$isWithoutLog - flag - do not create log files | $isWithoutLog - flag - do not create log files | ||
$confAlwaysSetCustomerGroupId - set group ID for all imported users | $confAlwaysSetCustomerGroupId - set group ID for all imported users | ||
$confIsUseStreetFullName - flag - use full name of imported street ''(with suffix/prefix)'' | $confIsUseStreetFullName - flag - use full name of imported street ''(with suffix/prefix)'' | ||
$confIsImportMessage - flag - import user messages from billing ''(where possible)'' | $confIsImportMessage - flag - import user messages from billing ''(where possible)'' | ||
== Using the module in Docker == | == Using the module in Docker == |
Версия от 17:01, 28 сентября 2023
This function is one of the possibilities |
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)
Using the module in Docker
The Docker-bundle since version 3.16.6 includes a service that includes usm_billing.
The service is configured using environment variables directly in compose.yaml. The names of the environment variables are identical to the names of the configuration variables given in the previous section.
For more advanced configuration, an additional configuration file containing only special variables whose values cannot be set via environment variables can be attached. To do this, in compose.yaml for the usm_billing service, add or uncomment the line in volumes:
- ${ERP_BASE_DIR}/config/usm_billing_config.php:/module/usm_billing_config.php
And change (create) the file in config/usm_billing_config.php in the bandle subdirectory to specify special variables.The first line of this file must necessarily be the line <?php
.
To enable periodic launch of the module, you need to uncomment the corresponding line in /etc/cron.d/userside.
You can also run the module outside of the docker bundle. To do this, you must also specify the URL of your USERSIDE in the USERSIDE_API_URL
environment variable.