billmax documentation   BillMax Billing Solutions
  877.245.5629
  sales@billmax.com
 

Name

createcust — Create an Account, User or Service

Synopsis

/usr/local/billmax/bin/createcust [[-a number] | [-u number]] [-c] [-n] [-h]

DESCRIPTION

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 number. This creates Users and Services under the specified Account. However, createcust recognizes a special environment variable ACCOUNT_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 user option.

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.

OPTIONS

-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

The User to which Services are added.

-c

Do not create the database records. Only check the data supplied.

-n

Do not bill for Services created. Useful for data imports.

RETURN VALUE

0 for success.

If successful, the account.number, user.number and service.number are printed on stdout separated by spaces.

NOTES

NONE

SEE ALSO

enter_account.cgi, enter_user.cgi, enter_service.cgi, account table, user table, service table


Document Revision A for BillMax 2.2.0   -   Copyright © 1997-2006 The iSpark Group, Inc.

All rights reserved. No part of this documentation may be reproduced or transmitted in any fashion without written permission by The iSpark Group, Inc. This documentation is for the sole use of licensees of the BillMax billing software created by The iSpark Group, Inc. Making the documentation available to a non-licensee of BillMax without written permission of The iSpark Group, Inc. is a violation of the use of this documentation.

While precautions have been taken in the preparation of this documentation, The iSpark Group, Inc. assumes neither liability nor responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.

All terms mentioned that are known to be trademarks have been appropriately capitalized. Use of the a trademark does not affect the validity of any trademark or service mark.

Links to third-party Web sites are provided for convenience. The iSpark Group, Inc. is not responsible for any content contained in the third-party Web sites.

Comments about this documentation may be sent to doc@billmax.com