Usm utm5 EN
This function is one of the possibilities |
usm_utm5 - module to organise import of data from UTM5 billing system into ERP UserSide
This module is a replacement for the deprecated us_utm5 module - See: Switching from us utm5 to usm utm5
Module Language: PHP
Current version: See: Modules
Module Status: Paid
For more information and a list of imported data, see the page: UTM5
Information on installing the module
Make sure that the php_mysqli library is present on the system where the module will be running
The usm_utm5.zip archive contains the files
usm_utm5.php usm_utm5.conf.php-example
1. On any server (no difference - billing server, userside or third machine) allocate a separate (arbitrary) 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. Rename the sample configuration file usm_utm5.conf.php-example to usm_utm5.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_utm5.php
It should work without error and return the data:
usm_utm5 ==================================== 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 reconcile 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_utm5.php
Configuration parameters
The module is configured in the usm_utm5.conf.php file
You can also use the default parameters from the usm_billing module
$usersideUrl - URL to the 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 $billingDBUser - customer name for access to the billing database $billingDBPassword - password for access to the billing database $billingDBName - billing database name $billingCodePage - billing database encoding $billingDbProvider - DBMS type [mysql|postgresql] (default: mysql)
$confServiceData - use service mappings instead of tariff mappings (0 - service mappings, 1 - tariff mappings, 2 - both) $confIsHideShablonsFromTariffList - flag - do not include templates in tariff imports $confServiceDataServiceTypeRestrict - import tariffs (and customers) with such service_data.service_type $confRentId - ID of the field with customer fee for the tariff (services_data.service_type in billing) $confDontImportTariffWithComment - do NOT import tariffs with this comment $confMultiplicationTariffFees - multiplication factor for subscription fees in tariffs (1.20 - 20% VAT, etc.) $confIsUseDateConnect - use customers.connect_date field to get the date of connection to the network (0 - users.create_date, 1 - users.connect_date). $confIsCustomerConnectFix - flag - add information about customers' connection to switches to additional data $confIsImportBankInformation - flag - import customer's bank details into the "Additional data" field $confDontImportCustomerFromGroupId - flag - do not import customers from this group (groups.id) $confImportCustomerOnlyFromGroupId - import customers ONLY from this group (groups.id) $confImportCustomerExpr - condition for importing customers. It allows importing only a part of customers from billing (executed before WHERE) $confImportCustomerExpr2 - condition for importing customers. Allows importing only a part of customers from the billing (executed after WHERE) $confTrafficRxClass - class of incoming traffic $confTrafficTxClass - class of outgoing traffic (several comma separated) $confUseIpMethod - operation variant (it is recommended not to change it) $confIsUseDhcpData - load DHCP data from the dhs_sessions_log table (0 - do not load, 2 - dhs_sessons_log) $confDhcpServiceLinkId - service link ID from "dhs_sessions_log.Acct_Status_Type" (default: 3) $confIsHostByteOrder - flag - host byte order in dhs_sessions_log.Framed_IP_Address (Relevant for UTM5 versions >=5.3 update 3. Don't switch it on if you don't know what it's about) $confIsActiveAllDhcp - flag - use current date for active dhs_sessions_log entries $confIsDhcpLeasesLogUse - load DHCP data from dhcp_leases_log table (0 - do not load, 1 - load). $confIsBlockType1IsPause - flag - consider block_info.block_type #1 as PAUSE $confIsBlockType2IsStop - flag - consider block_info.block_type #2 as STOP $confIsUseIdToAgreement - use customer ID as contract number $confIsSavePasswordToComment - flag - save customer's password from billing in the "additional data" field $confIsImportPaidHistory - flag - import data on customer payments (payment_transactions) $confVersionFramedIp - import type dhs_sessions_log.Framed_IP_Address [0|1] $confIsImportHistoryTariff - flag - import history of tariff changes by customer $confCustomerAccountSrc - source of customer account number [accounts.external_id|accounts.id|users.basic_account] $confImportCustomerUnlimited - import "accounts.unlimited" field into UserSide (need to specify additional field id)' additional data $confImportCustomerPassport - import passport data into additional data UserSide (need to specify additional field id) $confIsDontUpdateDateConnect - flag - do not import customer's date of connection $confIsImportAdditionalServices - flag - import additional services $confIsImportSwitchCommutation - flag - import customer's switching to equipment (routers_info table of billing) $confIsImportSwitchTableCommutation - flag - import customer switching to equipment (billing switches table) $confImportPaidLimit - limit on the number of imports at one time of customer payments (default: 5000) $confIsImportLessPhone - flag - whether to import empty phone numbers of customers (this allows to erase in UserSide the numbers that are no longer in billing) $confIsSaveVpnPasswordToComment - flag - save vpn password in customer's comments $confAddressSrc - source of customer's address (0 - users.house_id, 1 - users.actual_address) $confExprIpImport - condition for importing IP addresses $lastPaidIdPlus - initial counter for importing payments $confIsSkipCustomerBuilding - flag - do not import building number for customers $confImportPaidDisableMethod - list of ignored payment methods in import $confIsSkipDhsSessionsLogTraffic - flag - ignore traffic data from dhs_sessions_log table $confIsImportServiceWithAddressAsAliasCustomer - flag - import service with address as child record of customer $confIsIgnoreHouseBlock - flag - ignore house block $confAdditionalFieldWithAgreementNumber - optional billing field with contract number $confAdditionalFieldWithAgreementDate - additional billing field with contract date $confImportCustomerAllowedCid - import "User Allowed Cid" into additional data of UserSide (need to specify id of additional field) $confImportCustomerPassword - import subscriber's password into additional data of UserSide (need to specify additional field id) $confAccountPattern - template when importing customer account number (e.g.: 02000000) $confImportGateway - import customer's gateway into UserSide additional data (need to specify id of additional field) $confImportMask - import customer's mask into UserSide (need to specify additional field id) $confIsRegionAddressSystem - flag - import regions/regions from billing address system (only when $confAddressSrc = 0) $confIsImportServiceLinksAsChild - flag - import service links as child records of customers(only for UTM+) $confIsImportWorkPhoneToPhone - flag - import work phone as "normal" phone $confImportCustomerUnlimited - import unlimited fact into UserSide (need to specify id of additional field) $confImportCustomerVlanId - import VlanID into additional data UserSide (need to specify additional field id) $confImportCustomerTaxNumber - import tax number into additional data UserSide (need to specify additional field id)' $confAddressRemoveStr1 - string #1 to replace in the text address $confAddressRemoveStr2 - string #2 to replace in text address $confAddressRemoveStr3 - string #3 to replace in text address // If it is necessary to import an internal IP address for a customer when importing an external IP address - fill in the following parameters $confIpGrayNet - which IP address subnet to consider as external - e.g.: "172.16.0.0" or "0" - do not process it $confIpWhiteNet - which IP address subnet to add - e.g. "10.0.0.0.0" or "0" - do not add it // You can configure additional marks on the customer depending on the value of the additional field in billing $markMerge[6]['id'] = 1; - [utm5.uaddparams_desc.paramid]['id'] = userside.id $markMerge[6]['value'] = 'test_string'; - [utm5.uaddparams_desc.paramid]['value'] = Compare String // 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 customer card $additionalCustomerDataMerge[1] = 1; - [utm5.uaddparams_desc.paramid] = userside.id $additionalCustomerDataMerge[2] = 2; - [utm5.uaddparams_desc.paramid] = userside.id