billmax documentation   BillMax Billing Solutions
  877.245.5629
  sales@billmax.com
 

Advanced CI topics

Working with the CI Templates

Working with CI templates is similar to working with the Staff Interface templates. The are composed of JavaScript and HTML with "##" tags interspersed. A "##" tag represents a substitution marker. bmui.cgi will substitute values for the "##" tags as the template a processed. A "##" tag spans from the "##" to the the terminating "#". An example is "##DSERVICE_number#" for which bmui.cgi will substitute the number of a Service. The following tags are supported:

  • ##F - Value is HTML-escaped before replace "##" tag.

  • ##D - Value is output as is with no escaping.

  • ##J - A backslash is inserted before all single quotes and backslashes. The entire string is surrounded by single quotes. Primarily used to insert a value into JavaScript.

  • ##E - If an error in data occurs for a field, the error message (either stock error message or from tabledefaults table) is displayed red and bold.

For "##" tag F, if the name of the tag is followed by "_list", then an HTML dropdown list is displayed using the List referenced in the "##" as the source for the dropdown list. As an example, ##Fpaytype_list# will cause the entries from the paytypes list to be displayed.

[Note] Note

Note that the name of the list without the trailing "s" is used in the tag name.

For "##" tag F, if the name of the tag is followed by "select?", then an HTML dropdown list is displayed using the POP entries from the selected POP if the name of the tag was included in the hidden variable "POP_FIELDS". As an example, ##FPHONENUMBERselect# will cause the PHONENUMBER entries from the POP data for a specific POP to be displayed if PHONENUMBER was also part of the "POP_FIELDS" form variable.

A "##" tag may be qualified by (EDATE) specifying that field should be treated as a date and the date be split into year, month and day fields and the BillMax calendar icon be displayed. As an example, ##F(EDATE)enddate#.

Managing Virtual Companies

By default, registration of a new customer associates the customer with the smallest number BillMax Virtual Company. Associating a new Account with a specific Virtual Company may be accomplished by add the following to the CI templates:

				
<input type="hidden" name="virtualcompany" value="num"/>
				
				

where num is the number of the Virtual Company to which the Account will be associated.

In addition, the Service Definition offerings for an existing customer may be filtered to those available to every Virtual Company and those specified by form variable "virtualcompany".

CI templates to which the hidden form variable "virtualcompany" may be added are"

  • htmlfilephone.tmp

  • htmlfileregform.tmp

  • htmlfilenewuser.tmp

  • htmlfilenewsrvc.tmp

Customizing the Registration Response

As previously mentioned, upon successful registration, bmuid will process a template and pass the results to bmui.cgi. The processed template is called a "Registration Response". The data in the template should be customized to be suitable for the registration software, e.g. an HTML response for a browser, a special file format for a CD signup, etc. Lines beginning with the "#" character are ignored by bmuid and are not passed as part of the registration response.

As the template is processed, data may be inserted into the "Registration Response" by means replacing data for tags embedded in the template. The following tags are supported:

  • ##name## - i.e. ##newsserver##. A non-null value for "name" must be available. If not available, it is considered an error.

  • @@name@@ - i.e. @@newsserver@@. A value (null or otherwise) for "name" is optional. If the value is not present, then record of the template containing @@name@@ is discarded and will not be part of the "Registration Response".

Values that are used to substitute for tags may come from a variety of sources. These are:

  • The POP data that has been defined for the POP to which the new Service has been associated.

  • The data that has been collected from the customer.

Replacing the CI Tree Pane

  • Set cgimenu in the ciparms list to cgimenu_html.

  • Copy /usr/local/billmax/cgi-bin/cgimenu_html to the web server cgi directory as specified by the value of ciparms cgipath. This should be the same location into which bmui.cgi was copied during initial installation. Make sure that cgimenu_html is executable.

  • In the web server directory specified by the value of ciparms cgihtml, make a backup copy of menu.htm, title.htm and index.tmp, i.e. cp menu.htm menu.htm-dist.

  • In the web server directory specified by the value of ciparms cgihtml, copy the following:

    1. menu.htm-html to menu.htm

    2. title.htm-html to title.htm

    3. index.htm-html to index.htm

Note that there exists the file /usr/local/billmax/cgi-bin/cgimenu. This generates the default tree pane and may be used similarly to /usr/local/billmax/cgi-bin/cgimenu_html to customize the tree pane. When doing this, there is no need to copy the ".htm" files.

Determining a Customer's Sales Tax Region During Registration

When registering a new customer, it may be necessary to correctly identify the customer's sales tax region for tax purposes. This may be done by customizing the program /usr/local/billmax/local/tax_hook. The data supplied by the customer is in the execution environment of /usr/local/billmax/local/tax_hook. This data may be used to determine the identifier of the BillMax sales tax region. The successful output of the program is an integer written to stdout that is the number of the sales tax region for the customer.

Example 5.1. Determining a Customer's Sales Tax Region When Using the Customer Interface for Self-Registration

Assume that there are two sales tax regions defined in BillMax, Region 1 and Region 2, identified in BillMax by 1 and 2 respectively. All customers for postal code 82341 are associated with Region 1. All customers for postal code 81231 are associated with Region 2. Any other postal codes submitted by a customer will result in a error. The following code is sufficient for this scenario:

if( $ENV{ACCOUNT_zipcode} eq '82341' ) {
	printf( "1\n" );
	exit(0);
}
if( $ENV{ACCOUNT_zipcode} eq '81231' ) {
	printf( "2\n" );
	exit(0);
}
exit(1);
						



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