![]() |
BillMax Billing Solutions 877.245.5629 sales@billmax.com |
/usr/local/billmax/bin/createcust [[-a number] | [-u number]] [-c] [-n] [-h]
Creates associated Account, User and Service database records in the BillMax database using environment variables for input data. Unlike enter_account.cgi, enter_user.cgi and enter_service.cgi, which create a single record in the account table, user table and service table respectively, createcust may create records in all three tables during a single execution.
createcust gathers the data to be used from the environment. For account table data, use environment variables of the form "ACCOUNT_*" where "*" is a lowercase field name in the account table. Similarly, use "USER_*" for user table data and "SERVICE_*" for service table data.
Specifying a non-zero value for ACCOUNT_number is the same as using the -a . This creates Users and Services under the specified Account. However, createcust recognizes a special environment variable numberACCOUNT_NUMBER_SUPPLIED. If this variable exists and is equal to YES then createcust will use the value for ACCOUNT_number and attempt to create a new Account, User and Service using the "ACCOUNT_*" variables instead of adding a User and Service to an existing Account. This is useful when importing data from another system where and the desire is to use account numbers from the other system.
Specifying a non-zero value for USER_number is the same as using the -u option.
user
Account specific information. The following are required ACCOUNT_* environment variables:
ACCOUNT_cfname
ACCOUNT_clname
ACCOUNT_addr1
ACCOUNT_city
ACCOUNT_statename
ACCOUNT_zip
ACCOUNT_taxregion
ACCOUNT_reseller if ACCOUNT_taxable is supplied and is 0.
ACCOUNT_ccexp_month, ACCOUNT_ccexp_year, ACCOUNT_ccnum if ACCOUNT_cctype is supplied and is not NULL.
The following defaults are used if not supplied:
ACCOUNT_email and USER_email are generated using SERVICE_d01 and Virtual Company defdomain to which the Account is added.
Virtual Company n settings are used if ACCOUNT_customerof is not set where n represents the lowest number Virtual Company in the config table.
"*_startdate" and "*_entdate" for all tables are set to the current date. "*_startdate" may be set through the environment variables. However, all other date environment variables are ignored and the current date and time are used.
ACCOUNT_paytype is 2 (credit card).
ACCOUNT_bmui access is 1 (allow access through Customer Interface)
ACCOUNT_terms uses the terms specified by Virtual Company based on the Account Payment Method
All other account fields are set to zeroes, nulls, etc. depending on the field type.
User specific information. There are no required "USER_*" fields. "USER_*" fields will default to comparable "ACCOUNT_*" field values.
Service specific information. The following are required "SERVICE_*" environment variables:
SERVICE_servdef
SERVICE_d01
SERVICE_pop
Other "SERVICE_*" fields will default to related Service Definition values.
After creation of the Account, User and Service records, the Service is billed. After billing, if the Service is in Wait_For_Payment State and the Account balance is zero or negative, the Service state is changed to Open State
You must have at least Accounting Write Permissions to execute this program.
-a number
The Account to which Users and Services are added. If the environment variable ACCOUNT_NUMBER_SUPPLIED exists and is set to YES, then a new Account is created.
-u number-cDo not create the database records. Only check the data supplied.
-nDo not bill for Services created. Useful for data imports.
0 for success.
If successful, the account.number, user.number and service.number are printed on stdout separated by spaces.