'freeside_1_2_3_pci_mods'.
+++ /dev/null
-domreg@domain.tld
+++ /dev/null
-192.168.1.1 ns1.domain.tld
-192.168.1.2 ns2.domain.tld
-192.168.1.3 ns3.domain.tld
+++ /dev/null
-[ URL ftp://rs.internic.net/templates/domain-template.txt ] [ 03/98 ]
-
-******* Please DO NOT REMOVE Version Number or Sections A-Q ********
-
-Domain Version Number: 4.0
-
-******* Email completed agreement to hostmaster@internic.net *******
-
- NETWORK SOLUTIONS, INC.
-
- DOMAIN NAME REGISTRATION AGREEMENT
-
-
-A. Introduction. This domain name registration agreement
-("Registration Agreement") is submitted to NETWORK SOLUTIONS, INC.
-("NSI") for the purpose of applying for and registering a domain name
-on the Internet. If this Registration Agreement is accepted by NSI,
-and a domain name is registered in NSI's domain name database and
-assigned to the Registrant, Registrant ("Registrant") agrees to be
-bound by the terms of this Registration Agreement and the terms of
-NSI's Domain Name Dispute Policy ("Dispute Policy") which is
-incorporated herein by reference and made a part of this Registration
-Agreement. This Registration Agreement shall be accepted at the
-offices of NSI.
-
-B. Fees and Payments.
-
-1) Registration or renewal (re-registration) date through March 31, 1998:
-Registrant agrees to pay a registration fee of One Hundred United States
-Dollars (US$100) as consideration for the registration of each new domain
-name or Fifty United States Dollars (US$50) to renew (re-register) an
-existing registration.
-2) Registration or renewal date on and after April 1, 1998: Registrant
-agrees to pay a registration fee of Seventy United States Dollars (US$70)
-as consideration for the registration of each new domain name or the
-applicable renewal (re-registration) fee (currently Thirty-Five United
-States Dollars (US$35)) at the time of renewal (re-registration).
-3) Period of Service: The non-refundable fee covers a period of two (2)
-years for each new registration, and one (1) year for each renewal,
-and includes any permitted modification(s) to the domain name record
-during the covered period.
-4) Payment: Payment is due to Network Solutions within thirty (30)
-days from the date of the invoice.
-
-C. Dispute Policy. Registrant agrees, as a condition to
-submitting this Registration Agreement, and if the Registration
-Agreement is accepted by NSI, that the Registrant shall be bound by
-NSI's current Dispute Policy. The current version of the Dispute
-Policy may be found at the InterNIC Registration Services web site:
-"http://www.netsol.com/rs/dispute-policy.html".
-
-D. Dispute Policy Changes or Modifications. Registrant agrees
-that NSI, in its sole discretion, may change or modify the Dispute
-Policy, incorporated by reference herein, at any time. Registrant
-agrees that Registrant's maintaining the registration of a domain name
-after changes or modifications to the Dispute Policy become effective
-constitutes Registrant's continued acceptance of these changes or
-modifications. Registrant agrees that if Registrant considers any such
-changes or modifications to be unacceptable, Registrant may request
-that the domain name be deleted from the domain name database.
-
-E. Disputes. Registrant agrees that, if the registration of its
-domain name is challenged by any third party, the Registrant will be
-subject to the provisions specified in the Dispute Policy.
-
-F. Agents. Registrant agrees that if this Registration Agreement
-is completed by an agent for the Registrant, such as an ISP or
-Administrative Contact/Agent, the Registrant is nonetheless bound as a
-principal by all terms and conditions herein, including the Dispute
-Policy.
-
-G. Limitation of Liability. Registrant agrees that NSI shall have
-no liability to the Registrant for any loss Registrant may incur in
-connection with NSI's processing of this Registration Agreement, in
-connection with NSI's processing of any authorized modification to the
-domain name's record during the covered period, as a result of the
-Registrant's ISP's failure to pay either the initial registration fee
-or renewal fee, or as a result of the application of the provisions of
-the Dispute Policy. Registrant agrees that in no event shall the
-maximum liability of NSI under this Agreement for any matter exceed
-Five Hundred United States Dollars (US$500).
-
-H. Indemnity. Registrant agrees, in the event the Registration
-Agreement is accepted by NSI and a subsequent dispute arises with any
-third party, to indemnify and hold NSI harmless pursuant to the terms
-and conditions contained in the Dispute Policy.
-
-I. Breach. Registrant agrees that failure to abide by any
-provision of this Registration Agreement or the Dispute Policy may be
-considered by NSI to be a material breach and that NSI may provide a
-written notice, describing the breach, to the Registrant. If, within
-thirty (30) days of the date of mailing such notice, the Registrant
-fails to provide evidence, which is reasonably satisfactory to NSI,
-that it has not breached its obligations, then NSI may delete
-Registrant's registration of the domain name. Any such breach by a
-Registrant shall not be deemed to be excused simply because NSI did
-not act earlier in response to that, or any other, breach by the
-Registrant.
-
-J. No Guaranty. Registrant agrees that, by registration of a
-domain name, such registration does not confer immunity from objection
-to either the registration or use of the domain name.
-
-K. Warranty. Registrant warrants by submitting this Registration
-Agreement that, to the best of Registrant's knowledge and belief, the
-information submitted herein is true and correct, and that any future
-changes to this information will be provided to NSI in a timely manner
-according to the domain name modification procedures in place at that
-time. Breach of this warranty will constitute a material breach.
-
-L. Revocation. Registrant agrees that NSI may delete a
-Registrant's domain name if this Registration Agreement, or subsequent
-modification(s) thereto, contains false or misleading information, or
-conceals or omits any information NSI would likely consider material
-to its decision to approve this Registration Agreement.
-
-M. Right of Refusal. NSI, in its sole discretion, reserves the
-right to refuse to approve the Registration Agreement for any
-Registrant. Registrant agrees that the submission of this Registration
-Agreement does not obligate NSI to accept this Registration Agreement.
-Registrant agrees that NSI shall not be liable for loss or damages
-that may result from NSI's refusal to accept this Registration
-Agreement.
-
-N. Severability. Registrant agrees that the terms of this
-Registration Agreement are severable. If any term or provision is
-declared invalid, it shall not affect the remaining terms or
-provisions which shall continue to be binding.
-
-O. Entirety. Registrant agrees that this Registration Agreement
-and the Dispute Policy is the complete and exclusive agreement between
-Registrant and NSI regarding the registration of Registrant's domain
-name. This Registration Agreement and the Dispute Policy supersede all
-prior agreements and understandings, whether established by custom,
-practice, policy, or precedent.
-
-P. Governing Law. Registrant agrees that this Registration
-Agreement shall be governed in all respects by and construed in
-accordance with the laws of the Commonwealth of Virginia, United
-States of America. By submitting this Registration Agreement,
-Registrant consents to the exclusive jurisdiction and venue of the
-United States District Court for the Eastern District of Virginia,
-Alexandria Division. If there is no jurisdiction in the United States
-District Court for the Eastern District of Virginia, Alexandria
-Division, then jurisdiction shall be in the Circuit Court of Fairfax
-County, Fairfax, Virginia.
-
-Q. This is Domain Name Registration Agreement Version
-Number 4.0. This Registration Agreement is only for registrations
-under top-level domains: COM, ORG, NET, and EDU. By completing
-and submitting this Registration Agreement for consideration and
-acceptance by NSI, the Registrant agrees that he/she has read and
-agrees to be bound by A through P above.
-
-
-Authorization
-0a. (N)ew (M)odify (D)elete....:###action###
-0b. Auth Scheme................:
-0c. Auth Info..................:
-
-1. Comments...................:###purpose###
-
-2. Complete Domain Name.......:###domain###
-
-Organization Using Domain Name
-
-3a. Organization Name..........:###company###
-###LOOP###
-3b. Street Address.............:###address###
-###ENDLOOP###
-3c. City.......................:###city###
-3d. State......................:###state###
-3e. Postal Code................:###zip###
-3f. Country....................:###country###
-
-Administrative Contact
-4a. NIC Handle (if known)......:
-4b. (I)ndividual (R)ole........:I
-4c. Name (Last, First).........:###last###, ###first###
-4d. Organization Name..........:###company###
-###LOOP###
-4e. Street Address.............:###address###
-###ENDLOOP###
-4f. City.......................:###city###
-4g. State......................:###state###
-4h. Postal Code................:###zip###
-4i. Country....................:###country###
-4j. Phone Number...............:###daytime###
-4k. Fax Number.................:###fax###
-4l. E-Mailbox..................:###email###
-
-Technical Contact
-5a. NIC Handle (if known)......:###tech_contact###
-5b. (I)ndividual (R)ole........:
-5c. Name (Last, First).........:
-5d. Organization Name..........:
-5e. Street Address.............:
-5f. City.......................:
-5g. State......................:
-5h. Postal Code................:
-5i. Country....................:
-5j. Phone Number...............:
-5k. Fax Number.................:
-5l. E-Mailbox..................:
-
-Billing Contact
-6a. NIC Handle (if known)......:
-6b. (I)ndividual (R)ole........:
-6c. Name (Last, First).........:
-6d. Organization Name..........:
-6e. Street Address.............:
-6f. City.......................:
-6g. State......................:
-6h. Postal Code................:
-6i. Country....................:
-6j. Phone Number...............:
-6k. Fax Number.................:
-6l. E-Mailbox..................:
-
-Prime Name Server
-7a. Primary Server Hostname....:###primary###
-7b. Primary Server Netaddress..:###primary_ip###
-
-Secondary Name Server(s)
-###LOOP###
-8a. Secondary Server Hostname..:###secondary###
-8b. Secondary Server Netaddress:###secondary_ip###
-###ENDLOOP###
-
-END OF AGREEMENT
-
+++ /dev/null
-hostmaster@internic.net
+++ /dev/null
-#!/usr/bin/perl -w
-
-# Template for importing legacy customer data
-#
-# $Id: TEMPLATE_cust_main.import,v 1.3 1999-03-26 13:15:56 ivan Exp $
-#
-# ivan@sisd.com 98-aug-17 - 20
-#
-# $Log: TEMPLATE_cust_main.import,v $
-# Revision 1.3 1999-03-26 13:15:56 ivan
-# s/create/new/, use all necessary FS::table_names to avoid warnings
-#
-# Revision 1.2 1998/12/16 05:29:45 ivan
-# adminsuidsetup now need user
-#
-
-use strict;
-use Date::Parse;
-use FS::UID qw(adminsuidsetup datasrc);
-use FS::Record qw(fields qsearch qsearchs);
-use FS::cust_main;
-use FS::cust_pkg;
-use FS::cust_svc;
-use FS::svc_acct;
-use FS::pkg_svc;
-
-my $user = shift or die &usage;
-adminsuidsetup $user;
-
-# use these for the imported cust_main records (unless you have these in legacy
-# data)
-my($agentnum)=4;
-my($refnum)=5;
-
-# map from legacy billing data to pkgpart, maps imported field
-# LegacyBillingData to pkgpart. your names and pkgparts will be different
-my(%pkgpart)=(
- 'Employee' => 10,
- 'Business' => 11,
- 'Individual' => 12,
- 'Basic PPP' => 13,
- 'Slave' => 14,
- 'Co-Located Server' => 15,
- 'Virtual Web' => 16,
- 'Perk Mail' => 17,
- 'Credit Hold' => 18,
-);
-
-my($file)="legacy_file";
-
-open(CLIENT,$file)
- or die "Can't open $file: $!";
-
-# put a tab-separated header atop the file, or define @fields
-# (use these names or change them below)
-#
-# for cust_main
-# custnum - unique
-# last - (name)
-# first - (name)
-# company
-# address1
-# address2
-# city
-# state
-# zip
-# country
-# daytime - (phone)
-# night - (phone)
-# fax
-# payby - CARD, BILL or COMP
-# payinfo - Credit card #, P.O. # or COMP authorization
-# paydate - Expiration
-# tax - 'Y' for tax exempt
-# for cust_pkg
-# LegacyBillingData - maps via %pkgpart above to a pkgpart
-# for svc_acct
-# username
-
-my($header);
-$header=<CLIENT>;
-chop $header;
-my(@fields)=map { /^\s*(.*[^\s]+)\s*$/; $1 } split(/\t/,$header);
-#print join("\n",@fields);
-
-my($error);
-my($link,$line)=(0,0);
-while (<CLIENT>) {
- chop;
- next if /^[\s\t]*$/; #skip any blank lines
-
- #define %svc hash for this record
- my(@record)=split(/\t/);
- my(%svc);
- foreach (@fields) {
- $svc{$_}=shift @record;
- }
-
- # might need to massage some data like this
- $svc{'payby'} =~ s/^Credit Card$/CARD/io;
- $svc{'payby'} =~ s/^Check$/BILL/io;
- $svc{'payby'} =~ s/^Cash$/BILL/io;
- $svc{'payby'} =~ s/^$/BILL/o;
- $svc{'First'} =~ s/&/and/go;
- $svc{'Zip'} =~ s/\s+$//go;
-
- my($cust_main) = new FS::cust_main ( {
- 'custnum' => $svc{'custnum'},
- 'agentnum' => $agentnum,
- 'last' => $svc{'last'},
- 'first' => $svc{'first'},
- 'company' => $svc{'company'},
- 'address1' => $svc{'address1'},
- 'address2' => $svc{'address2'},
- 'city' => $svc{'city'},
- 'state' => $svc{'state'},
- 'zip' => $svc{'zip'},
- 'country' => $svc{'country'},
- 'daytime' => $svc{'daytime'},
- 'night' => $svc{'night'},
- 'fax' => $svc{'fax'},
- 'payby' => $svc{'payby'},
- 'payinfo' => $svc{'payinfo'},
- 'paydate' => $svc{'paydate'},
- 'payname' => $svc{'payname'},
- 'tax' => $svc{'tax'},
- 'refnum' => $refnum,
- } );
-
- $error=$cust_main->insert;
-
- if ( $error ) {
- warn $cust_main->_dump;
- warn map "$_: ". $svc{$_}. "|\n", keys %svc;
- die $error;
- }
-
- my($cust_pkg)=new FS::cust_pkg ( {
- 'custnum' => $svc{'custnum'},
- 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}},
- 'setup' => '',
- 'bill' => '',
- 'susp' => '',
- 'expire' => '',
- 'cancel' => '',
- } );
-
- $error=$cust_pkg->insert;
- if ( $error ) {
- warn $svc{'LegacyBillingData'};
- die $error;
- }
-
- unless ( $svc{'username'} ) {
- warn "Empty login";
- } else {
- #find svc_acct record (imported with bin/svc_acct.import) for this username
- my($svc_acct)=qsearchs('svc_acct',{'username'=>$svc{'username'}});
- unless ( $svc_acct ) {
- warn "username ", $svc{'username'}, " not found\n";
- } else {
- #link to the cust_pkg record we created above
-
- #find cust_svc record for this svc_acct record
- my($o_cust_svc)=qsearchs('cust_svc',{
- 'svcnum' => $svc_acct->svcnum,
- 'pkgnum' => '',
- } );
- unless ( $o_cust_svc ) {
- warn "No unlinked cust_svc for svcnum ", $svc_acct->svcnum;
- } else {
-
- #make sure this svcpart is in pkgpart
- my($pkg_svc)=qsearchs('pkg_svc',{
- 'pkgpart' => $pkgpart{$svc{'LegacyBillingData'}},
- 'svcpart' => $o_cust_svc->svcpart,
- 'quantity' => 1,
- });
- unless ( $pkg_svc ) {
- warn "login ", $svc{'username'}, ": No svcpart ", $o_cust_svc->svcpart,
- " for pkgpart ", $pkgpart{$svc{'Acct. Type'}}, "\n" ;
- } else {
-
- #create new cust_svc record linked to cust_pkg record
- my($n_cust_svc) = new FS::cust_svc ({
- 'svcnum' => $o_cust_svc->svcnum,
- 'pkgnum' => $cust_pkg->pkgnum,
- 'svcpart' => $pkg_svc->svcpart,
- });
- my($error) = $n_cust_svc->replace($o_cust_svc);
- die $error if $error;
- $link++;
- }
- }
- }
- }
-
- $line++;
-
-}
-
-warn "\n$link of $line lines linked\n";
-
-# ---
-
-sub usage {
- die "Usage:\n\n cust_main.import user\n";
-}
+++ /dev/null
-package FS::svc_table;
-
-use strict;
-use vars qw(@ISA);
-#use FS::Record qw( qsearch qsearchs );
-use FS::svc_Common;
-use FS::cust_svc;
-
-@ISA = qw(svc_Common);
-
-=head1 NAME
-
-FS::table_name - Object methods for table_name records
-
-=head1 SYNOPSIS
-
- use FS::table_name;
-
- $record = new FS::table_name \%hash;
- $record = new FS::table_name { 'column' => 'value' };
-
- $error = $record->insert;
-
- $error = $new_record->replace($old_record);
-
- $error = $record->delete;
-
- $error = $record->check;
-
- $error = $record->suspend;
-
- $error = $record->unsuspend;
-
- $error = $record->cancel;
-
-=head1 DESCRIPTION
-
-An FS::table_name object represents an example. FS::table_name inherits from
-FS::svc_Common. The following fields are currently supported:
-
-=over 4
-
-=item field - description
-
-=back
-
-=head1 METHODS
-
-=over 4
-
-=item new HASHREF
-
-Creates a new example. To add the example to the database, see L<"insert">.
-
-Note that this stores the hash reference, not a distinct copy of the hash it
-points to. You can ask the object for a copy with the I<hash> method.
-
-=cut
-
-sub table { 'table_name'; }
-
-=item insert
-
-Adds this record to the database. If there is an error, returns the error,
-otherwise returns false.
-
-The additional fields pkgnum and svcpart (see L<FS::cust_svc>) should be
-defined. An FS::cust_svc record will be created and inserted.
-
-=cut
-
-sub insert {
- my $self = shift;
- my $error;
-
- $error = $self->SUPER::insert;
- return $error if $error;
-
- '';
-}
-
-=item delete
-
-Delete this record from the database.
-
-=cut
-
-sub delete {
- my $self = shift;
- my $error;
-
- $error = $self->SUPER::delete;
- return $error if $error;
-
- '';
-}
-
-
-=item replace OLD_RECORD
-
-Replaces the OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-=cut
-
-sub replace {
- my ( $new, $old ) = ( shift, shift );
- my $error;
-
- $error = $new->SUPER::replace($old);
- return $error if $error;
-
- '';
-}
-
-=item suspend
-
-Called by the suspend method of FS::cust_pkg (see L<FS::cust_pkg>).
-
-=item unsuspend
-
-Called by the unsuspend method of FS::cust_pkg (see L<FS::cust_pkg>).
-
-=item cancel
-
-Called by the cancel method of FS::cust_pkg (see L<FS::cust_pkg>).
-
-=item check
-
-Checks all fields to make sure this is a valid example. If there is
-an error, returns the error, otherwise returns false. Called by the insert
-and repalce methods.
-
-=cut
-
-sub check {
- my $self = shift;
-
- my $x = $self->setfixed;
- return $x unless ref($x);
- my $part_svc = $x;
-
-
- ''; #no error
-}
-
-=back
-
-=head1 VERSION
-
-$Id: table_template-svc.pm,v 1.1 1999-08-04 08:03:03 ivan Exp $
-
-=head1 BUGS
-
-The author forgot to customize this manpage.
-
-=head1 SEE ALSO
-
-L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
-L<FS::cust_pkg>, schema.html from the base documentation.
-
-=head1 HISTORY
-
-ivan@voicenet.com 97-jul-21
-
-$Log: table_template-svc.pm,v $
-Revision 1.1 1999-08-04 08:03:03 ivan
-move table subclass examples out of production directory
-
-Revision 1.4 1998/12/30 00:30:48 ivan
-svc_ stuff is more properly OO - has a common superclass FS::svc_Common
-
-Revision 1.2 1998/11/15 04:33:01 ivan
-updates for newest versoin
-
-
-=cut
-
-1;
-
+++ /dev/null
-package FS::table_name;
-
-use strict;
-use vars qw( @ISA );
-use FS::Record qw( qsearch qsearchs );
-
-@ISA = qw(FS::Record);
-
-=head1 NAME
-
-FS::table_name - Object methods for table_name records
-
-=head1 SYNOPSIS
-
- use FS::table_name;
-
- $record = new FS::table_name \%hash;
- $record = new FS::table_name { 'column' => 'value' };
-
- $error = $record->insert;
-
- $error = $new_record->replace($old_record);
-
- $error = $record->delete;
-
- $error = $record->check;
-
-=head1 DESCRIPTION
-
-An FS::table_name object represents an example. FS::table_name inherits from
-FS::Record. The following fields are currently supported:
-
-=over 4
-
-=item field - description
-
-=back
-
-=head1 METHODS
-
-=over 4
-
-=item new HASHREF
-
-Creates a new example. To add the example to the database, see L<"insert">.
-
-Note that this stores the hash reference, not a distinct copy of the hash it
-points to. You can ask the object for a copy with the I<hash> method.
-
-=cut
-
-# the new method can be inherited from FS::Record, if a table method is defined
-
-sub table { 'table_name'; }
-
-=item insert
-
-Adds this record to the database. If there is an error, returns the error,
-otherwise returns false.
-
-=cut
-
-# the insert method can be inherited from FS::Record
-
-=item delete
-
-Delete this record from the database.
-
-=cut
-
-# the delete method can be inherited from FS::Record
-
-=item replace OLD_RECORD
-
-Replaces the OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-=cut
-
-# the replace method can be inherited from FS::Record
-
-=item check
-
-Checks all fields to make sure this is a valid example. If there is
-an error, returns the error, otherwise returns false. Called by the insert
-and replace methods.
-
-=cut
-
-# the check method should currently be supplied - FS::Record contains some
-# data checking routines
-
-sub check {
- my $self = shift;
-
- ''; #no error
-}
-
-=back
-
-=head1 VERSION
-
-$Id: table_template.pm,v 1.1 1999-08-04 08:03:03 ivan Exp $
-
-=head1 BUGS
-
-The author forgot to customize this manpage.
-
-=head1 SEE ALSO
-
-L<FS::Record>, schema.html from the base documentation.
-
-=head1 HISTORY
-
-ivan@voicenet.com 97-jul-1
-
-added hfields
-ivan@sisd.com 97-nov-13
-
-$Log: table_template.pm,v $
-Revision 1.1 1999-08-04 08:03:03 ivan
-move table subclass examples out of production directory
-
-Revision 1.4 1998/12/29 11:59:57 ivan
-mostly properly OO, some work still to be done with svc_ stuff
-
-Revision 1.3 1998/11/15 04:33:00 ivan
-updates for newest versoin
-
-Revision 1.2 1998/11/15 03:48:49 ivan
-update for current version
-
-
-=cut
-
-1;
-
+++ /dev/null
-#!/usr/bin/perl
-
-###
-# WHO WROTE THIS???
-###
-
-#require "perldb.pl";
-
-# Compute SLIP/PPP log times
-# Arguments -a Process entire file with totals
-# -t Process only totals
-# -f File to be processed if not current
-# -d processing start date (default is entire file)
-# -l to return all totals for dayuse
-# -w name of tmp work file for dayuse
-# user names
-
-require "time.pl";
-
-$space=' ';
-
-unless (@ARGV[0]) {
- print "Missing Arguments\n";
- print "-a - entire file\n";
- print "-t - totals only\n";
- print "-f - file name to be processed\n";
- print "-d - processing start date (yymmdd)\n";
- print "-l - return totals for dayuse\n";
- print "-w - tmp work file for dayuse\n";
- exit;
-} # end if test for missing arguments
-
-$infile = "/usr/annex/acp_logfile";
-$tmpfile = "/tmp/ppp";
-$n = $#ARGV;
-$start_yymmdd = "";
-for ($i = 0; $i <= $n; $i++) {
- if ($ARGV[$i] eq "-a") {
- $allflag = "true";
- }
- elsif ($ARGV[$i] eq "-t") {
- $totalflag = "true";
- }
- elsif ($ARGV[$i] eq "-f") {
- $i++;
- $infile = $ARGV[$i];
- }
- elsif ($ARGV[$i] eq "-d") {
- $i++;
- $start_yymmdd = $ARGV[$i];
- } #end start yymmdd
- elsif ($ARGV[$i] eq "-l") {
- $logflag = "true";
- $totalflag = "true";
- } # end log
- elsif ($ARGV[$i] eq "-w") {
- $i++;
- $tmpfile = $ARGV[$i];
- } # end tmp file
- else {
- ($arg_user,$arg_yymmdd) = split (/:/, $ARGV[$i]);
- $ip_user_date {$arg_user} = $ARGV[$i];
- $userflag = "true";
- } # end else
- } # end for 1 = 1 to n
-
-open (IN,$infile)
- || die "Can't open acp_logfile";
-
-NEXTUSER: while (<IN>) {
- chop;
- ($add,$ether,$port,$date,$time,$type,$action,$user) = split(/:/);
-
- if ($logflag) {
- $start_yymmdd = '';
- if ($ip_user_date{$user}) {
- ($ip_user, $start_yymmdd) =
- split (/:/, $ip_user_date{$user});
- } # end get date
- } # end log flag
- if ($start_yymmdd) {
- if ($date < $start_yymmdd) {
- next NEXTUSER;
- } #end date compare
- } #end if date
- if ($userflag){
- if (!$ip_user_date{$user}) {
- next NEXTUSER;
- } # end user test
- } # end by user or all
- if (($totalflag) ||
- ($allflag) ||
- ($ip_user_date{$user})) {
- if (($type eq 'ppp') || ($type eq 'slip')) {
-
- if ($action eq 'login') {
- $login{$user} = "$time:$date";
-
- }
- elsif ($action eq 'logout') {
- if (!$login{$user}) {
- $login{$user} = "010101:$date";
- } #end pad user if carry over
- ($stime,$sdate) = split(':',$login{$user});
- $start = &annex2sec($stime);
- $end = &annex2sec($time);
-
- #If we went through midnight, add a day;
- if ($end < $start) {$end += 86400;}
- $timeon = $end - $start;
-
- $elapsed{$user} += $timeon;
-
- if (!$totalflag) {
- print (&fmt_user($user),
- ' ', &fmt_date($sdate), ' In: ',
- &fmt_time($stime),' Out: ',
- &fmt_time($time),
- ' Elapsed: ', &fmt_sec($timeon), "\n");
- } # end total test
- } #end elsif action
- } # type = ppp of slip
- } # check arguments
-}
-close IN;
-
-if ($logflag) {
- open (TMPPPP, ">$tmpfile")
- || die "Can't open ppp tmp file";
- foreach $user ( sort((keys(%elapsed))) ) {
- $log_time = &fmt_sec($elapsed{$user});
- $tmp = join (':',
- $user,
- $log_time);
- print (TMPPPP "$tmp\n");
- }
- close (TMPPPP);
-}
- else {
- print "\n\nTotal Time On For Period:\n";
- print "-------------------------\n";
-
- foreach $user ( sort((keys(%elapsed))) ) {
- print (&fmt_user($user), " ",&fmt_sec($elapsed{$user}), "\n");
- }
- }
-exit(0);
-
-#-------------------------------------------------------
-#--------------- Subroutines Start Here ----------------
-#-------------------------------------------------------
-
-sub annex2sec {
- local($time) = @_;
- return( &time2sec( &break_annex($time) ) );
-}
-
-sub fmt_date {
- local($date) = @_;
-
- return( substr($date,2,2).'/'.substr($date,4,2).'/'.substr($date,0,2) );
-}
-
-sub fmt_time {
- local($time) = @_;
- local($s,$m,$h) = &break_annex($time);
- return ("$h:$m:$s");
-}
-
-
-sub break_annex {
- local($time) = @_;
- local($h,$m,$s);
-
- $h=substr($time,0,2);
- $m=substr($time,2,2);
- $s=substr($time,4,2);
-
- return ($s,$m,$h);
-}
-
-sub fmt_sec {
- local(@t) = &sec2time(@_);
- @t[2] += (@t[3]*24);
-
- foreach $a (@t) {
- if ($a < 10) {$a = "0$a";}
- }
-
- return ("@t[2]:@t[1]:@t[0]");
-}
-
-sub fmt_user {
- local($user) = @_;
- return( $user.substr($space,0,8 - length($user) ).' ' );
-}
-
+++ /dev/null
-AFGHANISTAN AF AFG 004
-ALBANIA AL ALB 008
-ALGERIA DZ DZA 012
-AMERICAN SAMOA AS ASM 016
-ANDORRA AD AND 020
-ANGOLA AO AGO 024
-ANGUILLA AI AIA 660
-ANTARCTICA AQ ATA 010
-ANTIGUA AND BARBUDA AG ATG 028
-ARGENTINA AR ARG 032
-ARMENIA AM ARM 051
-ARUBA AW ABW 533
-AUSTRALIA AU AUS 036
-AUSTRIA AT AUT 040
-AZERBAIJAN AZ AZE 031
-BAHAMAS BS BHS 044
-BAHRAIN BH BHR 048
-BANGLADESH BD BGD 050
-BARBADOS BB BRB 052
-BELARUS BY BLR 112
-BELGIUM BE BEL 056
-BELIZE BZ BLZ 084
-BENIN BJ BEN 204
-BERMUDA BM BMU 060
-BHUTAN BT BTN 064
-BOLIVIA BO BOL 068
-BOSNIA AND HERZEGOWINA BA BIH 070
-BOTSWANA BW BWA 072
-BOUVET ISLAND BV BVT 074
-BRAZIL BR BRA 076
-BRITISH INDIAN OCEAN TERRITORY IO IOT 086
-BRUNEI DARUSSALAM BN BRN 096
-BULGARIA BG BGR 100
-BURKINA FASO BF BFA 854
-BURUNDI BI BDI 108
-CAMBODIA KH KHM 116
-CAMEROON CM CMR 120
-CANADA CA CAN 124
-CAPE VERDE CV CPV 132
-CAYMAN ISLANDS KY CYM 136
-CENTRAL AFRICAN REPUBLIC CF CAF 140
-CHAD TD TCD 148
-CHILE CL CHL 152
-CHINA CN CHN 156
-CHRISTMAS ISLAND CX CXR 162
-COCOS (KEELING) ISLANDS CC CCK 166
-COLOMBIA CO COL 170
-COMOROS KM COM 174
-CONGO CG COG 178
-COOK ISLANDS CK COK 184
-COSTA RICA CR CRI 188
-COTE D'IVOIRE CI CIV 384
-CROATIA (local name: Hrvatska) HR HRV 191
-CUBA CU CUB 192
-CYPRUS CY CYP 196
-CZECH REPUBLIC CZ CZE 203
-DENMARK DK DNK 208
-DJIBOUTI DJ DJI 262
-DOMINICA DM DMA 212
-DOMINICAN REPUBLIC DO DOM 214
-EAST TIMOR TP TMP 626
-ECUADOR EC ECU 218
-EGYPT EG EGY 818
-EL SALVADOR SV SLV 222
-EQUATORIAL GUINEA GQ GNQ 226
-ERITREA ER ERI 232
-ESTONIA EE EST 233
-ETHIOPIA ET ETH 231
-FALKLAND ISLANDS (MALVINAS) FK FLK 238
-FAROE ISLANDS FO FRO 234
-FIJI FJ FJI 242
-FINLAND FI FIN 246
-FRANCE FR FRA 250
-FRANCE, METROPOLITAN FX FXX 249
-FRENCH GUIANA GF GUF 254
-FRENCH POLYNESIA PF PYF 258
-FRENCH SOUTHERN TERRITORIES TF ATF 260
-GABON GA GAB 266
-GAMBIA GM GMB 270
-GEORGIA GE GEO 268
-GERMANY DE DEU 276
-GHANA GH GHA 288
-GIBRALTAR GI GIB 292
-GREECE GR GRC 300
-GREENLAND GL GRL 304
-GRENADA GD GRD 308
-GUADELOUPE GP GLP 312
-GUAM GU GUM 316
-GUATEMALA GT GTM 320
-GUINEA GN GIN 324
-GUINEA-BISSAU GW GNB 624
-GUYANA GY GUY 328
-HAITI HT HTI 332
-HEARD AND MC DONALD ISLANDS HM HMD 334
-HONDURAS HN HND 340
-HONG KONG HK HKG 344
-HUNGARY HU HUN 348
-ICELAND IS ISL 352
-INDIA IN IND 356
-INDONESIA ID IDN 360
-IRAN (ISLAMIC REPUBLIC OF) IR IRN 364
-IRAQ IQ IRQ 368
-IRELAND IE IRL 372
-ISRAEL IL ISR 376
-ITALY IT ITA 380
-JAMAICA JM JAM 388
-JAPAN JP JPN 392
-JORDAN JO JOR 400
-KAZAKHSTAN KZ KAZ 398
-KENYA KE KEN 404
-KIRIBATI KI KIR 296
-KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF KP PRK 408
-KOREA, REPUBLIC OF KR KOR 410
-KUWAIT KW KWT 414
-KYRGYZSTAN KG KGZ 417
-LAO PEOPLE'S DEMOCRATIC REPUBLIC LA LAO 418
-LATVIA LV LVA 428
-LEBANON LB LBN 422
-LESOTHO LS LSO 426
-LIBERIA LR LBR 430
-LIBYAN ARAB JAMAHIRIYA LY LBY 434
-LIECHTENSTEIN LI LIE 438
-LITHUANIA LT LTU 440
-LUXEMBOURG LU LUX 442
-MACAU MO MAC 446
-MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF MK MKD 807
-MADAGASCAR MG MDG 450
-MALAWI MW MWI 454
-MALAYSIA MY MYS 458
-MALDIVES MV MDV 462
-MALI ML MLI 466
-MALTA MT MLT 470
-MARSHALL ISLANDS MH MHL 584
-MARTINIQUE MQ MTQ 474
-MAURITANIA MR MRT 478
-MAURITIUS MU MUS 480
-MAYOTTE YT MYT 175
-MEXICO MX MEX 484
-MICRONESIA, FEDERATED STATES OF FM FSM 583
-MOLDOVA, REPUBLIC OF MD MDA 498
-MONACO MC MCO 492
-MONGOLIA MN MNG 496
-MONTSERRAT MS MSR 500
-MOROCCO MA MAR 504
-MOZAMBIQUE MZ MOZ 508
-MYANMAR MM MMR 104
-NAMIBIA NA NAM 516
-NAURU NR NRU 520
-NEPAL NP NPL 524
-NETHERLANDS NL NLD 528
-NETHERLANDS ANTILLES AN ANT 530
-NEW CALEDONIA NC NCL 540
-NEW ZEALAND NZ NZL 554
-NICARAGUA NI NIC 558
-NIGER NE NER 562
-NIGERIA NG NGA 566
-NIUE NU NIU 570
-NORFOLK ISLAND NF NFK 574
-NORTHERN MARIANA ISLANDS MP MNP 580
-NORWAY NO NOR 578
-OMAN OM OMN 512
-PAKISTAN PK PAK 586
-PALAU PW PLW 585
-PANAMA PA PAN 591
-PAPUA NEW GUINEA PG PNG 598
-PARAGUAY PY PRY 600
-PERU PE PER 604
-PHILIPPINES PH PHL 608
-PITCAIRN PN PCN 612
-POLAND PL POL 616
-PORTUGAL PT PRT 620
-PUERTO RICO PR PRI 630
-QATAR QA QAT 634
-REUNION RE REU 638
-ROMANIA RO ROM 642
-RUSSIAN FEDERATION RU RUS 643
-RWANDA RW RWA 646
-SAINT KITTS AND NEVIS KN KNA 659
-SAINT LUCIA LC LCA 662
-SAINT VINCENT AND THE GRENADINES VC VCT 670
-SAMOA WS WSM 882
-SAN MARINO SM SMR 674
-SAO TOME AND PRINCIPE ST STP 678
-SAUDI ARABIA SA SAU 682
-SENEGAL SN SEN 686
-SEYCHELLES SC SYC 690
-SIERRA LEONE SL SLE 694
-SINGAPORE SG SGP 702
-SLOVAKIA (Slovak Republic) SK SVK 703
-SLOVENIA SI SVN 705
-SOLOMON ISLANDS SB SLB 090
-SOMALIA SO SOM 706
-SOUTH AFRICA ZA ZAF 710
-SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS GS SGS 239
-SPAIN ES ESP 724
-SRI LANKA LK LKA 144
-ST. HELENA SH SHN 654
-ST. PIERRE AND MIQUELON PM SPM 666
-SUDAN SD SDN 736
-SURINAME SR SUR 740
-SVALBARD AND JAN MAYEN ISLANDS SJ SJM 744
-SWAZILAND SZ SWZ 748
-SWEDEN SE SWE 752
-SWITZERLAND CH CHE 756
-SYRIAN ARAB REPUBLIC SY SYR 760
-TAIWAN, PROVINCE OF CHINA TW TWN 158
-TAJIKISTAN TJ TJK 762
-TANZANIA, UNITED REPUBLIC OF TZ TZA 834
-THAILAND TH THA 764
-TOGO TG TGO 768
-TOKELAU TK TKL 772
-TONGA TO TON 776
-TRINIDAD AND TOBAGO TT TTO 780
-TUNISIA TN TUN 788
-TURKEY TR TUR 792
-TURKMENISTAN TM TKM 795
-TURKS AND CAICOS ISLANDS TC TCA 796
-TUVALU TV TUV 798
-UGANDA UG UGA 800
-UKRAINE UA UKR 804
-UNITED ARAB EMIRATES AE ARE 784
-UNITED KINGDOM GB GBR 826
-UNITED STATES US USA 840
-UNITED STATES MINOR OUTLYING ISLANDS UM UMI 581
-URUGUAY UY URY 858
-UZBEKISTAN UZ UZB 860
-VANUATU VU VUT 548
-VATICAN CITY STATE (HOLY SEE) VA VAT 336
-VENEZUELA VE VEN 862
-VIET NAM VN VNM 704
-VIRGIN ISLANDS (BRITISH) VG VGB 092
-VIRGIN ISLANDS (U.S.) VI VIR 850
-WALLIS AND FUTUNA ISLANDS WF WLF 876
-WESTERN SAHARA EH ESH 732
-YEMEN YE YEM 887
-YUGOSLAVIA YU YUG 891
-ZAIRE ZR ZAR 180
-ZAMBIA ZM ZMB 894
-ZIMBABWE ZW ZWE 716
+++ /dev/null
-[ URL ftp://rs.internic.net/templates/domain-template.txt ] [ 03/98 ]
-
-******* Please DO NOT REMOVE Version Number or Sections A-Q ********
-
-Domain Version Number: 4.0
-
-******* Email completed agreement to hostmaster@internic.net *******
-
- NETWORK SOLUTIONS, INC.
-
- DOMAIN NAME REGISTRATION AGREEMENT
-
-
-A. Introduction. This domain name registration agreement
-("Registration Agreement") is submitted to NETWORK SOLUTIONS, INC.
-("NSI") for the purpose of applying for and registering a domain name
-on the Internet. If this Registration Agreement is accepted by NSI,
-and a domain name is registered in NSI's domain name database and
-assigned to the Registrant, Registrant ("Registrant") agrees to be
-bound by the terms of this Registration Agreement and the terms of
-NSI's Domain Name Dispute Policy ("Dispute Policy") which is
-incorporated herein by reference and made a part of this Registration
-Agreement. This Registration Agreement shall be accepted at the
-offices of NSI.
-
-B. Fees and Payments.
-
-1) Registration or renewal (re-registration) date through March 31, 1998:
-Registrant agrees to pay a registration fee of One Hundred United States
-Dollars (US$100) as consideration for the registration of each new domain
-name or Fifty United States Dollars (US$50) to renew (re-register) an
-existing registration.
-2) Registration or renewal date on and after April 1, 1998: Registrant
-agrees to pay a registration fee of Seventy United States Dollars (US$70)
-as consideration for the registration of each new domain name or the
-applicable renewal (re-registration) fee (currently Thirty-Five United
-States Dollars (US$35)) at the time of renewal (re-registration).
-3) Period of Service: The non-refundable fee covers a period of two (2)
-years for each new registration, and one (1) year for each renewal,
-and includes any permitted modification(s) to the domain name record
-during the covered period.
-4) Payment: Payment is due to Network Solutions within thirty (30)
-days from the date of the invoice.
-
-C. Dispute Policy. Registrant agrees, as a condition to
-submitting this Registration Agreement, and if the Registration
-Agreement is accepted by NSI, that the Registrant shall be bound by
-NSI's current Dispute Policy. The current version of the Dispute
-Policy may be found at the InterNIC Registration Services web site:
-"http://www.netsol.com/rs/dispute-policy.html".
-
-D. Dispute Policy Changes or Modifications. Registrant agrees
-that NSI, in its sole discretion, may change or modify the Dispute
-Policy, incorporated by reference herein, at any time. Registrant
-agrees that Registrant's maintaining the registration of a domain name
-after changes or modifications to the Dispute Policy become effective
-constitutes Registrant's continued acceptance of these changes or
-modifications. Registrant agrees that if Registrant considers any such
-changes or modifications to be unacceptable, Registrant may request
-that the domain name be deleted from the domain name database.
-
-E. Disputes. Registrant agrees that, if the registration of its
-domain name is challenged by any third party, the Registrant will be
-subject to the provisions specified in the Dispute Policy.
-
-F. Agents. Registrant agrees that if this Registration Agreement
-is completed by an agent for the Registrant, such as an ISP or
-Administrative Contact/Agent, the Registrant is nonetheless bound as a
-principal by all terms and conditions herein, including the Dispute
-Policy.
-
-G. Limitation of Liability. Registrant agrees that NSI shall have
-no liability to the Registrant for any loss Registrant may incur in
-connection with NSI's processing of this Registration Agreement, in
-connection with NSI's processing of any authorized modification to the
-domain name's record during the covered period, as a result of the
-Registrant's ISP's failure to pay either the initial registration fee
-or renewal fee, or as a result of the application of the provisions of
-the Dispute Policy. Registrant agrees that in no event shall the
-maximum liability of NSI under this Agreement for any matter exceed
-Five Hundred United States Dollars (US$500).
-
-H. Indemnity. Registrant agrees, in the event the Registration
-Agreement is accepted by NSI and a subsequent dispute arises with any
-third party, to indemnify and hold NSI harmless pursuant to the terms
-and conditions contained in the Dispute Policy.
-
-I. Breach. Registrant agrees that failure to abide by any
-provision of this Registration Agreement or the Dispute Policy may be
-considered by NSI to be a material breach and that NSI may provide a
-written notice, describing the breach, to the Registrant. If, within
-thirty (30) days of the date of mailing such notice, the Registrant
-fails to provide evidence, which is reasonably satisfactory to NSI,
-that it has not breached its obligations, then NSI may delete
-Registrant's registration of the domain name. Any such breach by a
-Registrant shall not be deemed to be excused simply because NSI did
-not act earlier in response to that, or any other, breach by the
-Registrant.
-
-J. No Guaranty. Registrant agrees that, by registration of a
-domain name, such registration does not confer immunity from objection
-to either the registration or use of the domain name.
-
-K. Warranty. Registrant warrants by submitting this Registration
-Agreement that, to the best of Registrant's knowledge and belief, the
-information submitted herein is true and correct, and that any future
-changes to this information will be provided to NSI in a timely manner
-according to the domain name modification procedures in place at that
-time. Breach of this warranty will constitute a material breach.
-
-L. Revocation. Registrant agrees that NSI may delete a
-Registrant's domain name if this Registration Agreement, or subsequent
-modification(s) thereto, contains false or misleading information, or
-conceals or omits any information NSI would likely consider material
-to its decision to approve this Registration Agreement.
-
-M. Right of Refusal. NSI, in its sole discretion, reserves the
-right to refuse to approve the Registration Agreement for any
-Registrant. Registrant agrees that the submission of this Registration
-Agreement does not obligate NSI to accept this Registration Agreement.
-Registrant agrees that NSI shall not be liable for loss or damages
-that may result from NSI's refusal to accept this Registration
-Agreement.
-
-N. Severability. Registrant agrees that the terms of this
-Registration Agreement are severable. If any term or provision is
-declared invalid, it shall not affect the remaining terms or
-provisions which shall continue to be binding.
-
-O. Entirety. Registrant agrees that this Registration Agreement
-and the Dispute Policy is the complete and exclusive agreement between
-Registrant and NSI regarding the registration of Registrant's domain
-name. This Registration Agreement and the Dispute Policy supersede all
-prior agreements and understandings, whether established by custom,
-practice, policy, or precedent.
-
-P. Governing Law. Registrant agrees that this Registration
-Agreement shall be governed in all respects by and construed in
-accordance with the laws of the Commonwealth of Virginia, United
-States of America. By submitting this Registration Agreement,
-Registrant consents to the exclusive jurisdiction and venue of the
-United States District Court for the Eastern District of Virginia,
-Alexandria Division. If there is no jurisdiction in the United States
-District Court for the Eastern District of Virginia, Alexandria
-Division, then jurisdiction shall be in the Circuit Court of Fairfax
-County, Fairfax, Virginia.
-
-Q. This is Domain Name Registration Agreement Version
-Number 4.0. This Registration Agreement is only for registrations
-under top-level domains: COM, ORG, NET, and EDU. By completing
-and submitting this Registration Agreement for consideration and
-acceptance by NSI, the Registrant agrees that he/she has read and
-agrees to be bound by A through P above.
-
-
-Authorization
-0a. (N)ew (M)odify (D)elete....:###action###
-0b. Auth Scheme................:
-0c. Auth Info..................:
-
-1. Comments...................:###purpose###
-
-2. Complete Domain Name.......:###domain###
-
-Organization Using Domain Name
-
-3a. Organization Name..........:###company###
-###LOOP###
-3b. Street Address.............:###address###
-###ENDLOOP###
-3c. City.......................:###city###
-3d. State......................:###state###
-3e. Postal Code................:###zip###
-3f. Country....................:###country###
-
-Administrative Contact
-4a. NIC Handle (if known)......:
-4b. (I)ndividual (R)ole........:I
-4c. Name (Last, First).........:###last###, ###first###
-4d. Organization Name..........:###company###
-###LOOP###
-4e. Street Address.............:###address###
-###ENDLOOP###
-4f. City.......................:###city###
-4g. State......................:###state###
-4h. Postal Code................:###zip###
-4i. Country....................:###country###
-4j. Phone Number...............:###daytime###
-4k. Fax Number.................:###fax###
-4l. E-Mailbox..................:###email###
-
-Technical Contact
-5a. NIC Handle (if known)......:###tech_contact###
-5b. (I)ndividual (R)ole........:
-5c. Name (Last, First).........:
-5d. Organization Name..........:
-5e. Street Address.............:
-5f. City.......................:
-5g. State......................:
-5h. Postal Code................:
-5i. Country....................:
-5j. Phone Number...............:
-5k. Fax Number.................:
-5l. E-Mailbox..................:
-
-Billing Contact
-6a. NIC Handle (if known)......:
-6b. (I)ndividual (R)ole........:
-6c. Name (Last, First).........:
-6d. Organization Name..........:
-6e. Street Address.............:
-6f. City.......................:
-6g. State......................:
-6h. Postal Code................:
-6i. Country....................:
-6j. Phone Number...............:
-6k. Fax Number.................:
-6l. E-Mailbox..................:
-
-Prime Name Server
-7a. Primary Server Hostname....:###primary###
-7b. Primary Server Netaddress..:###primary_ip###
-
-Secondary Name Server(s)
-###LOOP###
-8a. Secondary Server Hostname..:###secondary###
-8b. Secondary Server Netaddress:###secondary_ip###
-###ENDLOOP###
-
-END OF AGREEMENT
-
+++ /dev/null
-#!/usr/local/bin/perl
-
-###
-# THIS IS FROM CYBERCASH (is there a newer version?)
-###
-
-$paymentserverhost = 'localhost';
-$paymentserverport = 8000;
-$paymentserversecret = 'two-turntables';
-use CCLib qw(sendmserver);
-
-# first lets fake up some data
-# use time of day and pid to give me my pretend
-# order number
-# you obviously need to get real data from somewhere...
-
-$oid = "test$$"; #fake order number.
-$amount = 'usd 42.42';
-$ramount = 'usd 24.24';
-$pan = '4111111111111111';
-$name = 'John Q. Doe';
-$addr = '17 Richard Rd.';
-$city = 'Ivyland';
-$state = 'PA';
-$zip = '18974';
-$country = 'USA';
-$exp = '7/97';
-
-
-%result = &sendmserver('mauthcapture',
- 'Order-ID', $oid,
- 'Amount', $amount,
- 'Card-Number', $pan,
- 'Card-Name', $name,
- 'Card-Address', $addr,
- 'Card-City', $city,
- 'Card-State', $state,
- 'Card-Zip', $zip,
- 'Card-Country', $country,
- 'Card-Exp', $exp);
-
-#
-# just dump results to stdout.
-# you should process them...
-# to allow results to affect operation of your fulfillment...
-#
-foreach (keys(%result)) {
- print " $_ ==> $result{$_}\n";
-}
-
-print "\n";
-
-exit;
-
-$trans=$result{'MTransactionNumber'};
-$code=$result{'MRetrievalCode'};
-
-%result = &sendmserver('return',
- 'Order-ID', $oid,
- 'Return-Amount',$ramount,
- 'Amount',$amount,
- );
-
-foreach (keys(%result)) {
- print " $_ ==> $result{$_}\n";
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: megapop.pl,v 1.1 1999-04-19 10:32:44 ivan Exp $
-#
-# this will break when megapop changes the URL or format of their listing page.
-# that's stupid. perhaps they can provide a machine-readable listing?
-
-use strict;
-use LWP::UserAgent;
-use FS::UID qw(adminsuidsetup);
-use FS::svc_acct_pop;
-
-my $url = "http://www.megapop.com/location.htm";
-
-my $user = shift or die &usage;
-adminsuidsetup($user);
-
-my %state2usps = &state2usps;
-$state2usps{'WASHINGTON STATE'} = 'WA'; #megapop's on crack
-$state2usps{'CANADA'} = 'CANADA'; #freeside's on crack
-
-my $ua = new LWP::UserAgent;
-my $request = new HTTP::Request('GET', $url);
-my $response = $ua->request($request);
-die $response->error_as_HTML unless $response->is_success;
-my $line;
-my $usps = '';
-foreach $line ( split("\n", $response->content) ) {
- if ( $line =~ /\W(\w[\w\s]*\w)\s+LOCATIONS/i ) {
- $usps = $state2usps{uc($1)}
- or warn "warning: unknown state $1\n";
- } elsif ( $line =~ /(\d{3})\-(\d{3})\-(\d{4})\s+(\w[\w\s]*\w)/ ) {
- print "$1 $2 $3 $4 $usps\n";
- my $svc_acct_pop = new FS::svc_acct_pop ( {
- 'city' => $4,
- 'state' => $usps,
- 'ac' => $1,
- 'exch' => $2,
- } );
- my $error = $svc_acct_pop->insert;
- die $error if $error;
- }
-}
-
-sub usage {
- die "Usage:\n $0 user\n";
-}
-
-sub state2usps{ (
- 'ALABAMA' => 'AL',
- 'ALASKA' => 'AK',
- 'AMERICAN SAMOA' => 'AS',
- 'ARIZONA' => 'AZ',
- 'ARKANSAS' => 'AR',
- 'CALIFORNIA' => 'CA',
- 'COLORADO' => 'CO',
- 'CONNECTICUT' => 'CT',
- 'DELAWARE' => 'DE',
- 'DISTRICT OF COLUMBIA' => 'DC',
- 'FEDERATED STATES OF MICRONESIA' => 'FM',
- 'FLORIDA' => 'FL',
- 'GEORGIA' => 'GA',
- 'GUAM' => 'GU',
- 'HAWAII' => 'HI',
- 'IDAHO' => 'ID',
- 'ILLINOIS' => 'IL',
- 'INDIANA' => 'IN',
- 'IOWA' => 'IA',
- 'KANSAS' => 'KS',
- 'KENTUCKY' => 'KY',
- 'LOUISIANA' => 'LA',
- 'MAINE' => 'ME',
- 'MARSHALL ISLANDS' => 'MH',
- 'MARYLAND' => 'MD',
- 'MASSACHUSETTS' => 'MA',
- 'MICHIGAN' => 'MI',
- 'MINNESOTA' => 'MN',
- 'MISSISSIPPI' => 'MS',
- 'MISSOURI' => 'MO',
- 'MONTANA' => 'MT',
- 'NEBRASKA' => 'NE',
- 'NEVADA' => 'NV',
- 'NEW HAMPSHIRE' => 'NH',
- 'NEW JERSEY' => 'NJ',
- 'NEW MEXICO' => 'NM',
- 'NEW YORK' => 'NY',
- 'NORTH CAROLINA' => 'NC',
- 'NORTH DAKOTA' => 'ND',
- 'NORTHERN MARIANA ISLANDS' => 'MP',
- 'OHIO' => 'OH',
- 'OKLAHOMA' => 'OK',
- 'OREGON' => 'OR',
- 'PALAU' => 'PW',
- 'PENNSYLVANIA' => 'PA',
- 'PUERTO RICO' => 'PR',
- 'RHODE ISLAND' => 'RI',
- 'SOUTH CAROLINA' => 'SC',
- 'SOUTH DAKOTA' => 'SD',
- 'TENNESSEE' => 'TN',
- 'TEXAS' => 'TX',
- 'UTAH' => 'UT',
- 'VERMONT' => 'VT',
- 'VIRGIN ISLANDS' => 'VI',
- 'VIRGINIA' => 'VA',
- 'WASHINGTON' => 'WA',
- 'WEST VIRGINIA' => 'WV',
- 'WISCONSIN' => 'WI',
- 'WYOMING' => 'WY',
- 'ARMED FORCES AFRICA' => 'AE',
- 'ARMED FORCES AMERICAS' => 'AA',
- 'ARMED FORCES CANADA' => 'AE',
- 'ARMED FORCES EUROPE' => 'AE',
- 'ARMED FORCES MIDDLE EAST' => 'AE',
- 'ARMED FORCES PACIFIC' => 'AP',
-) }
-
+++ /dev/null
-From http://epoch.cs.berkeley.edu:8000/sequoia/dba/montage/FAQ/SQL.html
- by Jean Anderson (jta@postgres.berkeley.edu)
-
-What are the SQL reserved words?
-
-I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
-SQL3 words are not set in stone, but you'd do well to avoid them.
-
- From sql1992.txt:
-
- AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
- COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
- EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
- NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
- PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
- REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
- ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
- SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
- UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
-
- From sql1992.txt (Annex E):
-
- ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
- BIT, BIT
-
-What are the SQL reserved words?
-
-I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
-SQL3 words are not set in stone, but you'd do well to avoid them.
-
- From sql1992.txt:
-
- AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
- COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
- EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
- NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
- PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
- REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
- ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
- SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
- UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
-
- From sql1992.txt (Annex E):
-
- ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
- BIT, BIT
-
-What are the SQL reserved words?
-
-I grep'd the following list out of the sql docs available via anonymous ftp to speckle.ncsl.nist.gov:/isowg3.
-SQL3 words are not set in stone, but you'd do well to avoid them.
-
- From sql1992.txt:
-
- AFTER, ALIAS, ASYNC, BEFORE, BOOLEAN, BREADTH,
- COMPLETION, CALL, CYCLE, DATA, DEPTH, DICTIONARY, EACH, ELSEIF,
- EQUALS, GENERAL, IF, IGNORE, LEAVE, LESS, LIMIT, LOOP, MODIFY,
- NEW, NONE, OBJECT, OFF, OID, OLD, OPERATION, OPERATORS, OTHERS,
- PARAMETERS, PENDANT, PREORDER, PRIVATE, PROTECTED, RECURSIVE, REF,
- REFERENCING, REPLACE, RESIGNAL, RETURN, RETURNS, ROLE, ROUTINE,
- ROW, SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SIGNAL, SIMILAR,
- SQLEXCEPTION, SQLWARNING, STRUCTURE, TEST, THERE, TRIGGER, TYPE,
- UNDER, VARIABLE, VIRTUAL, VISIBLE, WAIT, WHILE, WITHOUT
-
- From sql1992.txt (Annex E):
-
- ABSOLUTE, ACTION, ADD, ALLOCATE, ALTER, ARE, ASSERTION, AT, BETWEEN,
- BIT, BIT_LENGTH, BOTH, CASCADE, CASCADED, CASE, CAST, CATALOG,
- CHAR_LENGTH, CHARACTER_LENGTH, COALESCE, COLLATE, COLLATION, COLUMN,
- CONNECT, CONNECTION, CONSTRAINT, CONSTRAINTS, CONVERT, CORRESPONDING,
- CROSS, CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, CURRENT_USER,
- DATE, DAY, DEALLOCATE, DEFERRABLE, DEFERRED, DESCRIBE, DESCRIPTOR,
- DIAGNOSTICS, DISCONNECT, DOMAIN, DROP, ELSE, END-EXEC, EXCEPT,
- EXCEPTION, EXECUTE, EXTERNAL, EXTRACT, FALSE, FIRST, FULL, GET,
- GLOBAL, HOUR, IDENTITY, IMMEDIATE, INITIALLY, INNER, INPUT,
- INSENSITIVE, INTERSECT, INTERVAL, ISOLATION, JOIN, LAST, LEADING,
- LEFT, LEVEL, LOCAL, LOWER, MATCH, MINUTE, MONTH, NAMES, NATIONAL,
- NATURAL, NCHAR, NEXT, NO, NULLIF, OCTET_LENGTH, ONLY, OUTER, OUTPUT,
- OVERLAPS, PAD, PARTIAL, POSITION, PREPARE, PRESERVE, PRIOR, READ,
- RELATIVE, RESTRICT, REVOKE, RIGHT, ROWS, SCROLL, SECOND, SESSION,
- SESSION_USER, SIZE, SPACE, SQLSTATE, SUBSTRING, SYSTEM_USER,
- TEMPORARY, THEN, TIME, TIMESTAMP, TIMEZONE_HOUR, TIMEZONE_MINUTE,
- TRAILING, TRANSACTION, TRANSLATE, TRANSLATION, TRIM, TRUE, UNKNOWN,
- UPPER, USAGE, USING, VALUE, VARCHAR, VARYING, WHEN, WRITE, YEAR, ZONE
-
- From sql3part2.txt (Annex E)
-
- ACTION, ACTOR, AFTER, ALIAS, ASYNC, ATTRIBUTES, BEFORE, BOOLEAN,
- BREADTH, COMPLETION, CURRENT_PATH, CYCLE, DATA, DEPTH, DESTROY,
- DICTIONARY, EACH, ELEMENT, ELSEIF, EQUALS, FACTOR, GENERAL, HOLD,
- IGNORE, INSTEAD, LESS, LIMIT, LIST, MODIFY, NEW, NEW_TABLE, NO,
- NONE, OFF, OID, OLD, OLD_TABLE, OPERATION, OPERATOR, OPERATORS,
- PARAMETERS, PATH, PENDANT, POSTFIX, PREFIX, PREORDER, PRIVATE,
- PROTECTED, RECURSIVE, REFERENCING, REPLACE, ROLE, ROUTINE, ROW,
- SAVEPOINT, SEARCH, SENSITIVE, SEQUENCE, SESSION, SIMILAR, SPACE,
- SQLEXCEPTION, SQLWARNING, START, STATE, STRUCTURE, SYMBOL, TERM,
- TEST, THERE, TRIGGER, TYPE, UNDER, VARIABLE, VIRTUAL, VISIBLE,
- WAIT, WITHOUT
-
- sql3part4.txt (ANNEX E):
-
- CALL, DO, ELSEIF, EXCEPTION, IF, LEAVE, LOOP, OTHERS, RESIGNAL,
- RETURN, RETURNS, SIGNAL, TUPLE, WHILE
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# fs_passwd
-#
-# portions of this script are copied from the `passwd' script in the original
-# (perl 4) camel book, now archived at
-# http://www.perl.com/CPAN/scripts/nutshell/ch6/passwd
-#
-# ivan@sisd.com 98-mar-8
-#
-# password lengths 0,255 instead of 6,8 - we'll let the server process
-# check the data ivan@sisd.com 98-jul-17
-
-use strict;
-use Getopt::Std;
-use Socket;
-use IO::Handle;
-use vars qw($opt_f $opt_s);
-
-my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket";
-my($freeside_uid)=scalar(getpwnam('freeside'));
-
-$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin';
-$ENV{'SHELL'} = '/bin/sh';
-$ENV{'IFS'} = " \t\n";
-$ENV{'CDPATH'} = '';
-$ENV{'ENV'} = '';
-$ENV{'BASH_ENV'} = '';
-
-$SIG{__DIE__}= sub { system '/bin/stty', 'echo'; };
-
-die "passwd program isn't running setuid to freeside\n" if $> != $freeside_uid;
-
-unshift @ARGV, "-f" if $0 =~ /chfn$/;
-unshift @ARGV, "-s" if $0 =~ /chsh$/;
-
-getopts('fs');
-
-my($me)='';
-if ( $_ = shift(@ARGV) ) {
- /^(\w{2,8})$/;
- $me = $1;
-}
-die "You can't change the password for $me." if $me && $<;
-$me = (getpwuid($<))[0] unless $me;
-
-my($name,$passwd,$uid,$gid,$quota,$comment,$gcos,$dir,$shell)=
- getpwnam $me;
-
-my($old_password,$new_password,$new_gecos,$new_shell);
-
-if ( $opt_f || $opt_s ) {
- system '/bin/stty', '-echo';
- print "Password:";
- $old_password=<STDIN>;
- system '/bin/stty', 'echo';
- chop($old_password);
- #$old_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n";
- $old_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n";
- $old_password = $1;
-
- $new_password = '';
-
- if ( $opt_f ) {
- print "\nChanging gecos for $me.\n";
- print "Gecos [", $gcos, "]: ";
- $new_gecos=<STDIN>;
- chop($new_gecos);
- $new_gecos ||= $gcos;
- $new_gecos =~ /^(.{0,255})$/ or die "\nIllegal gecos.\n";
- } else {
- $new_gecos = '';
- }
-
- if ( $opt_s ) {
- print "\nChanging shell for $me.\n";
- print "Shell [", $shell, "]: ";
- $new_shell=<STDIN>;
- chop($new_shell);
- $new_shell ||= $shell;
- $new_shell =~ /^(.{0,255})$/ or die "\nIllegal shell.\n";
- } else {
- $new_shell = '';
- }
-
-} else {
-
- print "Changing password for $me.\n";
- print "Old password:";
- system '/bin/stty', '-echo';
- $old_password=<STDIN>;
- chop $old_password;
- #$old_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n";
- $old_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n";
- $old_password = $1;
- print "\nEnter the new password (minimum of 6, maximum of 8 characters)\n";
- print "Please use a combination of upper and lowercase letters and numbers.\n";
- print "New password:";
- $new_password=<STDIN>;
- chop($new_password);
- #$new_password =~ /^(.{6,8})$/ or die "\nIllegal password.\n";
- $new_password =~ /^(.{0,255})$/ or die "\nIllegal password.\n";
- $new_password = $1;
- print "\nRe-enter new password:";
- my($check_new_password);
- $check_new_password=<STDIN>;
- chop($check_new_password);
- die "\nThey don't match; try again.\n" unless $check_new_password eq $new_password;
-
- $new_gecos='';
- $new_shell='';
-}
-print "\n";
-
-system '/bin/stty', 'echo';
-
-socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
-connect(SOCK, sockaddr_un($fs_passwdd_socket)) or die "connect: $!";
-print SOCK join("\n",$me,$old_password,$new_password,$new_gecos,$new_shell),"\n";
-SOCK->flush;
-my($error);
-$error = <SOCK>;
-chop $error;
-
-if ($error) {
- print "\nUpdate error: $error\n";
-} else {
- print "\nUpdate sucessful.\n";
-}
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# fs_passwd_server
-#
-# portions of this script are copied from the `passwd' script in the original
-# (perl 4) camel book, now archived at
-# http://www.perl.com/CPAN/scripts/nutshell/ch6/passwd
-#
-# ivan@sisd.com 98-mar-9
-#
-# crypt-aware, s/password/_password/; ivan@sisd.com 98-aug-23
-
-use strict;
-use IO::Handle;
-use FS::SSH qw(sshopen2);
-use FS::UID qw(adminsuidsetup);
-use FS::Record qw(qsearchs);
-use FS::svc_acct;
-
-my $user = shift or die &usage;
-adminsuidsetup $user;
-
-my($shellmachine)=shift or die &usage;
-
-$SIG{CHLD} = sub { wait() };
-
-my($fs_passwdd)="/usr/local/sbin/fs_passwdd";
-
-while (1) {
- my($reader,$writer)=(new IO::Handle, new IO::Handle);
- $writer->autoflush(1);
- sshopen2($shellmachine,$reader,$writer,$fs_passwdd);
- while (1) {
- my($username,$old_password,$new_password,$new_gecos,$new_shell);
- defined($username=<$reader>) or last;
- defined($old_password=<$reader>) or last;
- defined($new_password=<$reader>) or last;
- defined($new_gecos=<$reader>) or last;
- defined($new_shell=<$reader>) or last;
- chop($username);
- chop($old_password);
- chop($new_password);
- chop($new_gecos);
- chop($new_shell);
- my($svc_acct);
-
- #need to try both $old_password and encrypted $old_password
- #maybe the crypt function in svc_acct.export needs to be a library?
- my $salt = substr($old_password,0,2);
- my $cold_password = crypt($old_password,$salt);
- $svc_acct=qsearchs('svc_acct',{'username'=>$username,
- '_password'=>$old_password,
- } )
- || qsearchs('svc_acct',{'username'=>$username,
- '_password'=>$cold_password,
- } );
- unless ( $svc_acct ) { print $writer "Incorrect password.\n"; next; }
-
- my(%hash)=$svc_acct->hash;
- my($new_svc_acct) = new FS::svc_acct ( \%hash );
- $new_svc_acct->setfield('_password',$new_password)
- if $new_password && $new_password ne $old_password;
- $new_svc_acct->setfield('finger',$new_gecos) if $new_gecos;
- $new_svc_acct->setfield('shell',$new_shell) if $new_shell;
- my($error)=$new_svc_acct->replace($svc_acct);
- print $writer $error,"\n";
- }
- close $writer;
- close $reader;
- sleep 60;
- warn "Connection to $shellmachine lost! Reconnecting...\n";
-}
-
-sub usage {
- die "Usage:\n\n fs_passwd_server user shellmachine\n";
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# fs_passwdd
-#
-# This is run REMOTELY over ssh by fs_passwd_server.
-#
-# ivan@sisd.com 98-mar-9
-
-use strict;
-use Socket;
-
-my($fs_passwdd_socket)="/usr/local/freeside/fs_passwdd_socket";
-
-$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
-$ENV{'SHELL'} = '/bin/sh';
-$ENV{'IFS'} = " \t\n";
-$ENV{'CDPATH'} = '';
-$ENV{'ENV'} = '';
-$ENV{'BASH_ENV'} = '';
-
-$|=1;
-
-my $uaddr = sockaddr_un($fs_passwdd_socket);
-my $proto = getprotobyname('tcp');
-
-socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!";
-unlink($fs_passwdd_socket);
-bind(Server, $uaddr) or die "bind: $!";
-listen(Server,SOMAXCONN) or die "listen: $!";
-
-my($paddr);
-for ( ; $paddr = accept(Client,Server); close Client) {
- my($me,$old_password,$new_password,$new_gecos,$new_shell);
-
- $me=<Client>;
- $old_password=<Client>;
- $new_password=<Client>;
- $new_gecos=<Client>;
- $new_shell=<Client>;
-
- print $me,$old_password,$new_password,$new_gecos,$new_shell;
- my($error);
-
- $error=<STDIN>;
-
- print Client $error;
- close Client;
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# ivan@sisd.com 98-mar-23
-
-use strict;
-use Date::Parse; #but hopefully not
-
-$|=1;
-
-my($file,$pos)=@_;
-open(FILE,"<$file") or die "Can't open $file: $!";
-seek(FILE,$pos,0) or die "Can't seek: $!";
-
-my($datestr);
-my(%param);
-
-$SIG{'HUP'} = sub { print "EOF\n"; exit; };
-
-while (1) {
-
- while (<FILE>) {
- next if /^$/;
- if ( /^\S/ ) {
- chop($datestr=$_);
- undef %param;
- } else {
- warn "Unexpected line: $_";
- }
- while (<FILE>) {
- if ( /^$/ ) {
- #if ( $param{'Acct-Status-Type'} eq 'Stop' ) {
- print join("\t",
- tell FILE,
- %param,
- ),"\n";
- #}
- last;
- } elsif ( /^\s+([\w\-]+)\s\=\s\"?([\w\.\-]+)\"?\s*$/ ) {
- $param{$1}=$2;
- } else {
- warn "Unexpected line: $_";
- }
-
- }
-
- }
- sleep 1;
- seek(FILE,0,1);
-}
-
-
+++ /dev/null
-Revision history for Perl extension FS::SignupClient.
-
-0.01 Mon Aug 23 01:12:46 1999
- - original version; created by h2xs 1.19
-
+++ /dev/null
-Changes
-MANIFEST
-MANIFEST.SKIP
-Makefile.PL
-SignupClient.pm
-test.pl
-fs_signupd
-cgi/signup.cgi
+++ /dev/null
-use ExtUtils::MakeMaker;
-# See lib/ExtUtils/MakeMaker.pm for details of how to influence
-# the contents of the Makefile that is written.
-WriteMakefile(
- 'NAME' => 'FS::SignupClient',
- 'VERSION_FROM' => 'SignupClient.pm', # finds $VERSION
- 'EXE_FILES' => [ 'fs_signupd' ],
- 'INSTALLSCRIPT' => '/usr/local/sbin',
- 'PERM_RWX' => '750',
-);
+++ /dev/null
-package FS::SignupClient;
-
-use strict;
-use vars qw($VERSION @ISA @EXPORT_OK $fs_signupd_socket);
-use Exporter;
-use Socket;
-use FileHandle;
-use IO::Handle;
-
-$VERSION = '0.01';
-
-@ISA = qw( Exporter );
-@EXPORT_OK = qw( signup_info new_customer );
-
-$fs_signupd_socket = "/usr/local/freeside/fs_signupd_socket";
-
-$ENV{'PATH'} ='/usr/bin:/usr/ucb:/bin';
-$ENV{'SHELL'} = '/bin/sh';
-$ENV{'IFS'} = " \t\n";
-$ENV{'CDPATH'} = '';
-$ENV{'ENV'} = '';
-$ENV{'BASH_ENV'} = '';
-
-my $freeside_uid = scalar(getpwnam('freeside'));
-die "not running as the freeside user\n" if $> != $freeside_uid;
-
-=head1 NAME
-
-FS::SignupClient - Freeside signup client API
-
-=head1 SYNOPSIS
-
- use FS::SignupClient qw( signup_info new_customer );
-
- ( $locales, $packages, $pops ) = signup_info;
-
- $error = new_customer ( {
- 'first' => $first,
- 'last' => $last,
- 'ss' => $ss,
- 'comapny' => $company,
- 'address1' => $address1,
- 'address2' => $address2,
- 'city' => $city,
- 'county' => $county,
- 'state' => $state,
- 'zip' => $zip,
- 'country' => $country,
- 'daytime' => $daytime,
- 'night' => $night,
- 'fax' => $fax,
- 'payby' => $payby,
- 'payinfo' => $payinfo,
- 'paydate' => $paydate,
- 'payname' => $payname,
- 'invoicing_list' => $invoicing_list,
- 'pkgpart' => $pkgpart,
- 'username' => $username,
- '_password' => $password,
- 'popnum' => $popnum,
- } );
-
-=head1 DESCRIPTION
-
-This module provides an API for a remote signup server.
-
-It needs to be run as the freeside user. Because of this, the program which
-calls these subroutines should be written very carefully.
-
-=head1 SUBROUTINES
-
-=over 4
-
-=item signup_info
-
-Returns three array references of hash references.
-
-The first set of hash references is of allowable locales. Each hash reference
-has the following keys:
- taxnum
- state
- county
- country
-
-The second set of hash references is of allowable packages. Each hash
-reference has the following keys:
- pkgpart
- pkg
-
-The third set of hash references is of allowable POPs (Points Of Presence).
-Each hash reference has the following keys:
- popnum
- city
- state
- ac
- exch
-
-=cut
-
-sub signup_info {
- socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
- connect(SOCK, sockaddr_un($fs_signupd_socket)) or die "connect: $!";
- print SOCK "signup_info\n";
- SOCK->flush;
-
- chop ( my $n_cust_main_county = <SOCK> );
- my @cust_main_county = map {
- chop ( my $taxnum = <SOCK> );
- chop ( my $state = <SOCK> );
- chop ( my $county = <SOCK> );
- chop ( my $country = <SOCK> );
- {
- 'taxnum' => $taxnum,
- 'state' => $state,
- 'county' => $county,
- 'country' => $country,
- };
- } 1 .. $n_cust_main_county;
-
- chop ( my $n_part_pkg = <SOCK> );
- my @part_pkg = map {
- chop ( my $pkgpart = <SOCK> );
- chop ( my $pkg = <SOCK> );
- {
- 'pkgpart' => $pkgpart,
- 'pkg' => $pkg,
- };
- } 1 .. $n_part_pkg;
-
- chop ( my $n_svc_acct_pop = <SOCK> );
- my @svc_acct_pop = map {
- chop ( my $popnum = <SOCK> );
- chop ( my $city = <SOCK> );
- chop ( my $state = <SOCK> );
- chop ( my $ac = <SOCK> );
- chop ( my $exch = <SOCK> );
- chop ( my $loc = <SOCK> );
- {
- 'popnum' => $popnum,
- 'city' => $city,
- 'state' => $state,
- 'ac' => $ac,
- 'exch' => $exch,
- 'loc' => $loc,
- };
- } 1 .. $n_svc_acct_pop;
-
- close SOCK;
-
- \@cust_main_county, \@part_pkg, \@svc_acct_pop;
-}
-
-=item new_customer HASHREF
-
-Adds a customer to the remote Freeside system. Requires a hash reference as
-a paramater with the following keys:
- first
- last
- ss
- comapny
- address1
- address2
- city
- county
- state
- zip
- country
- daytime
- night
- fax
- payby
- payinfo
- paydate
- payname
- invoicing_list
- pkgpart
- username
- _password
- popnum
-
-Returns a scalar error message, or the empty string for success.
-
-=cut
-
-sub new_customer {
- my $hashref = shift;
-
- socket(SOCK, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
- connect(SOCK, sockaddr_un($fs_signupd_socket)) or die "connect: $!";
- print SOCK "new_customer\n";
-
- print SOCK join("\n", map { $hashref->{$_} } qw(
- first last ss company address1 address2 city county state zip country
- daytime night fax payby payinfo paydate payname invoicing_list
- pkgpart username _password popnum
- ) ), "\n";
- SOCK->flush;
-
- chop( my $error = <SOCK> );
- $error;
-}
-
-=back
-
-=head1 VERSION
-
-$Id: SignupClient.pm,v 1.3 2000-02-02 07:44:00 ivan Exp $
-
-=head1 BUGS
-
-=head1 SEE ALSO
-
-L<fs_signupd>, L<FS::SignupServer>, L<FS::cust_main>
-
-=cut
-
-1;
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: signup.cgi,v 1.5 2000-02-02 07:44:00 ivan Exp $
-
-use strict;
-use vars qw( @payby $cgi $locales $packages $pops $r $error
- $last $first $ss $company $address1 $address2 $city $state $county
- $country $zip $daytime $night $fax $invoicing_list $payby $payinfo
- $paydate $payname $pkgpart $username $password $popnum
- $ieak_file $ieak_template $ac $exch $loc
- );
- #$ieak_docroot $ieak_baseurl
-use subs qw( print_form print_okay expselect );
-
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use HTTP::Headers::UserAgent 2.00;
-use FS::SignupClient qw( signup_info new_customer );
-use Text::Template;
-
-#acceptable payment methods
-#
-#@payby = qw( CARD BILL COMP );
-#@payby = qw( CARD BILL );
-#@payby = qw( CARD );
-@payby = qw( CARD PREPAY );
-
-$ieak_file = '/usr/local/freeside/ieak.template';
-
-if ( -e $ieak_file ) {
- $ieak_template = new Text::Template ( TYPE => 'FILE', SOURCE => $ieak_file )
- or die "Couldn't construct template: $Text::Template::ERROR";
-} else {
- $ieak_template = '';
-}
-
-# #to enable ieak signups, you need to specify a directory in the web server's
-# #document space and the equivalent base URL
-# #
-# $ieak_docroot = "/var/www/sisd.420.am/freeside/ieak";
-# $ieak_baseurl = "http://sisd.420.am/freeside/ieak";
-
-#srand (time ^ $$ ^ unpack "%L*", `ps axww | gzip`);
-
-( $locales, $packages, $pops ) = signup_info();
-
-$cgi = new CGI;
-
-if ( defined $cgi->param('magic') ) {
- if ( $cgi->param('magic') eq 'process' ) {
-
- $cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/
- or die "Oops, illegal \"state\" param: ". $cgi->param('state');
- $state = $1;
- $county = $3 || '';
- $country = $4;
-
- $payby = $cgi->param('payby');
- $payinfo = $cgi->param( $payby. '_payinfo' );
- $paydate =
- $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' );
- $payname = $cgi->param( $payby. '_payname' );
-
- if ( $invoicing_list = $cgi->param('invoicing_list') ) {
- $invoicing_list .= ', POST' if $cgi->param('invoicing_list_POST');
- } else {
- $invoicing_list = 'POST';
- }
-
- ( $error = new_customer ( {
- 'last' => $last = $cgi->param('last'),
- 'first' => $first = $cgi->param('first'),
- 'ss' => $ss = $cgi->param('ss'),
- 'company' => $company = $cgi->param('company'),
- 'address1' => $address1 = $cgi->param('address1'),
- 'address2' => $address2 = $cgi->param('address2'),
- 'city' => $city = $cgi->param('city'),
- 'county' => $county,
- 'state' => $state,
- 'zip' => $zip = $cgi->param('zip'),
- 'country' => $country,
- 'daytime' => $daytime = $cgi->param('daytime'),
- 'night' => $night = $cgi->param('night'),
- 'fax' => $fax = $cgi->param('fax'),
- 'payby' => $payby,
- 'payinfo' => $payinfo,
- 'paydate' => $paydate,
- 'payname' => $payname,
- 'invoicing_list' => $invoicing_list,
- 'pkgpart' => $pkgpart = $cgi->param('pkgpart'),
- 'username' => $username = $cgi->param('username'),
- '_password' => $password = $cgi->param('_password'),
- 'popnum' => $popnum = $cgi->param('popnum'),
- } ) )
- ? print_form()
- : print_okay();
- } else {
- die "unrecognized magic: ". $cgi->param('magic');
- }
-} else {
- $error = '';
- $last = '';
- $first = '';
- $ss = '';
- $company = '';
- $address1 = '';
- $address2 = '';
- $city = '';
- $state = '';
- $county = '';
- $country = '';
- $zip = '';
- $daytime = '';
- $night = '';
- $fax = '';
- $invoicing_list = '';
- $payby = '';
- $payinfo = '';
- $paydate = '';
- $payname = '';
- $pkgpart = '';
- $username = '';
- $password = '';
- $popnum = '';
-
- print_form;
-}
-
-sub print_form {
-
- my $r = qq!<font color="#ff0000">*</font>!;
- my $self_url = $cgi->self_url;
-
- print $cgi->header( '-expires' => 'now' ), <<END;
-<HTML><HEAD><TITLE>ISP Signup form</TITLE></HEAD>
-<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>ISP Signup form</FONT><BR><BR>
-END
-
- print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: $error</FONT>! if $error;
-
- print <<END;
-<FORM ACTION="$self_url" METHOD=POST>
-<INPUT TYPE="hidden" NAME="magic" VALUE="process">
-Contact Information
-<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
-<TR>
- <TH ALIGN="right">${r}Contact name<BR>(last, first)</TH>
- <TD COLSPAN=3><INPUT TYPE="text" NAME="last" VALUE="$last">,
- <INPUT TYPE="text" NAME="first" VALUE="$first"></TD>
- <TD ALIGN="right">SS#</TD>
- <TD><INPUT TYPE="text" NAME="ss" SIZE=11 VALUE="$ss"></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Company</TD>
- <TD COLSPAN=5><INPUT TYPE="text" NAME="company" SIZE=70 VALUE="$company"></TD>
-</TR>
-<TR>
- <TH ALIGN="right">${r}Address</TH>
- <TD COLSPAN=5><INPUT TYPE="text" NAME="address1" SIZE=70 VALUE="$address1"></TD>
-</TR>
-<TR>
- <TD ALIGN="right"> </TD>
- <TD COLSPAN=5><INPUT TYPE="text" NAME="address2" SIZE=70 VALUE="$address2"></TD>
-</TR>
-<TR>
- <TH ALIGN="right">${r}City</TH>
- <TD><INPUT TYPE="text" NAME="city" VALUE="$city"></TD>
- <TH ALIGN="right">${r}State/Country</TH>
- <TD><SELECT NAME="state" SIZE="1">
-END
-
- foreach ( @{$locales} ) {
- print "<OPTION";
- print " SELECTED" if ( $state eq $_->{'state'}
- && $county eq $_->{'county'}
- && $country eq $_->{'country'}
- );
- print ">", $_->{'state'};
- print " (",$_->{'county'},")" if $_->{'county'};
- print " / ", $_->{'country'};
- }
-
- print <<END;
- </SELECT></TD>
- <TH>${r}Zip</TH>
- <TD><INPUT TYPE="text" NAME="zip" SIZE=10 VALUE="$zip"></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Day Phone</TD>
- <TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="$daytime" SIZE=18></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Night Phone</TD>
- <TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="$night" SIZE=18></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Fax</TD>
- <TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="$fax" SIZE=12></TD>
-</TR>
-</TABLE>$r required fields<BR>
-<BR>Billing information<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
-<TR><TD>
-END
-
- print qq!<INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST"!;
- my @invoicing_list = split(', ', $invoicing_list );
- print ' CHECKED'
- if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list;
- print '>Postal mail invoice</TD></TR><TR><TD>Email invoice ',
- qq!<INPUT TYPE="text" NAME="invoicing_list" VALUE="!,
- join(', ', grep { $_ ne 'POST' } @invoicing_list ),
- qq!"></TD></TR>!;
-
- print <<END;
-<TR><TD>Billing type</TD></TR></TABLE>
-<TABLE BGCOLOR="#c0c0c0" BORDER=1 WIDTH="100%">
-<TR>
-END
-
- my %payby = (
- 'CARD' => qq!Credit card<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD"). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
- 'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""><BR>${r}Exp !. expselect("BILL", "12-2037"). qq!<BR>${r}Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="Accounts Payable">!,
- 'COMP' => qq!Complimentary<BR>${r}Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""><BR>${r}Exp !. expselect("COMP"),
- 'PREPAY' => qq!Prepaid card<BR>${r}<INPUT TYPE="text" NAME="PREPAY_payinfo" VALUE="" MAXLENGTH=80>!,
- );
-
- my %paybychecked = (
- 'CARD' => qq!Credit card<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD", $paydate). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
- 'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE="$payinfo"><BR>${r}Exp !. expselect("BILL", $paydate). qq!<BR>${r}Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="$payname">!,
- 'COMP' => qq!Complimentary<BR>${r}Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE="$payinfo"><BR>${r}Exp !. expselect("COMP", $paydate),
- 'PREPAY' => qq!Prepaid card<BR>${r}<INPUT TYPE="text" NAME="PREPAY_payinfo" VALUE="$payinfo" MAXLENGTH=80>!,
- );
-
- for (@payby) {
- print qq!<TD VALIGN=TOP><INPUT TYPE="radio" NAME="payby" VALUE="$_"!;
- if ($payby eq $_) {
- print qq! CHECKED> $paybychecked{$_}</TD>!;
- } else {
- print qq!> $payby{$_}</TD>!;
- }
- }
-
- print <<END;
-</TR></TABLE>$r required fields for each billing type
-<BR><BR>First package
-<TABLE BGCOLOR="#c0c0c0" BORDER=0 CELLSPACING=0 WIDTH="100%">
-<TR>
- <TD COLSPAN=2><SELECT NAME="pkgpart"><OPTION VALUE="">(none)
-END
-
- foreach my $package ( @{$packages} ) {
- print qq!<OPTION VALUE="!, $package->{'pkgpart'}, '"';
- print " SELECTED" if $pkgpart && ( $package->{'pkgpart'} == $pkgpart );
- print ">", $package->{'pkg'};
- }
-
- print <<END;
- </SELECT></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Username</TD>
- <TD><INPUT TYPE="text" NAME="username" VALUE="$username"></TD>
-</TR>
-<TR>
- <TD ALIGN="right">Password</TD>
- <TD><INPUT TYPE="text" NAME="_password" VALUE="$password">
- (blank to generate)</TD>
-</TR>
-<TR>
- <TD ALIGN="right">POP</TD>
- <TD><SELECT NAME="popnum" SIZE=1><OPTION>
-END
-
- foreach my $pop ( @{$pops} ) {
- print qq!<OPTION VALUE="!, $pop->{'popnum'}, '"',
- ( $popnum && $pop->{'popnum'} == $popnum ) ? ' SELECTED' : '', ">",
- $pop->{'popnum'}, ": ",
- $pop->{'city'}, ", ",
- $pop->{'state'},
- " (", $pop->{'ac'}, ")/",
- $pop->{'exch'}, "\n"
- ;
- }
- print <<END;
- </SELECT></TD>
-</TR>
-</TABLE>
-<BR><BR><INPUT TYPE="submit" VALUE="Signup">
-</FORM></BODY></HTML>
-END
-
-}
-
-sub print_okay {
- my $user_agent = new HTTP::Headers::UserAgent $ENV{HTTP_USER_AGENT};
- if ( $ieak_template
- && $user_agent->platform eq 'ia32'
- && $user_agent->os =~ /^win/
- && ($user_agent->browser)[0] eq 'IE'
- )
- { #send an IEAK config
- my $username = $cgi->param('username');
- my $password = $cgi->param('_password');
- my $email_name = $cgi->param('first'). ' '. $cgi->param('last');
-
- print $cgi->header('application/x-Internet-signup'),
- $ieak_template->fill_in();
-
-# my $ins_file = rand(4294967296). ".ins";
-# open(INS_FILE, ">$ieak_docroot/$ins_file");
-# print INS_FILE <<END;
-# close INS_FILE;
-# print $cgi->redirect("$ieak_docroot/$ins_file");
-
- } else { #send a simple confirmation
- print $cgi->header( '-expires' => 'now' ), <<END;
-<HTML><HEAD><TITLE>Signup successful</TITLE></HEAD>
-<BODY BGCOLOR="#e8e8e8"><FONT SIZE=7>Signup successful</FONT><BR><BR>
-blah blah blah
-</BODY>
-</HTML>
-END
- }
-}
-
-sub expselect {
- my $prefix = shift;
- my $date = shift || '';
- my( $m, $y ) = ( 0, 0 );
- if ( $date =~ /^(\d{4})-(\d{2})-\d{2}$/ ) { #PostgreSQL date format
- ( $m, $y ) = ( $2, $1 );
- } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
- ( $m, $y ) = ( $1, $3 );
- }
- my $return = qq!<SELECT NAME="$prefix!. qq!_month" SIZE="1">!;
- for ( 1 .. 12 ) {
- $return .= "<OPTION";
- $return .= " SELECTED" if $_ == $m;
- $return .= ">$_";
- }
- $return .= qq!</SELECT>/<SELECT NAME="$prefix!. qq!_year" SIZE="1">!;
- for ( 1999 .. 2037 ) {
- $return .= "<OPTION";
- $return .= " SELECTED" if $_ == $y;
- $return .= ">$_";
- }
- $return .= "</SELECT>";
-
- $return;
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# fs_signupd
-#
-# This is run REMOTELY over ssh by fs_signup_server.
-#
-
-use strict;
-use Socket;
-
-use vars qw( $Debug );
-
-$Debug = 0;
-
-my($fs_signupd_socket)="/usr/local/freeside/fs_signupd_socket";
-
-$ENV{'PATH'} ='/usr/local/bin:/usr/bin:/usr/ucb:/bin';
-$ENV{'SHELL'} = '/bin/sh';
-$ENV{'IFS'} = " \t\n";
-$ENV{'CDPATH'} = '';
-$ENV{'ENV'} = '';
-$ENV{'BASH_ENV'} = '';
-
-$|=1;
-
-warn "[fs_signupd] Reading locales...\n" if $Debug;
-chomp( my $n_cust_main_county = <STDIN> );
-my @cust_main_county = map {
- chomp( my $taxnum = <STDIN> );
- chomp( my $state = <STDIN> );
- chomp( my $county = <STDIN> );
- chomp( my $country = <STDIN> );
- {
- 'taxnum' => $taxnum,
- 'state' => $state,
- 'county' => $county,
- 'country' => $country,
- };
-} ( 1 .. $n_cust_main_county );
-
-warn "[fs_signupd] Reading package definitions...\n" if $Debug;
-chomp( my $n_part_pkg = <STDIN> );
-my @part_pkg = map {
- chomp( my $pkgpart = <STDIN> );
- chomp( my $pkg = <STDIN> );
- {
- 'pkgpart' => $pkgpart,
- 'pkg' => $pkg,
- };
-} ( 1 .. $n_part_pkg );
-
-warn "[fs_signupd] Reading POPs...\n" if $Debug;
-chomp( my $n_svc_acct_pop = <STDIN> );
-my @svc_acct_pop = map {
- chomp( my $popnum = <STDIN> );
- chomp( my $city = <STDIN> );
- chomp( my $state = <STDIN> );
- chomp( my $ac = <STDIN> );
- chomp( my $exch = <STDIN> );
- chomp( my $loc = <STDIN> );
- {
- 'popnum' => $popnum,
- 'city' => $city,
- 'state' => $state,
- 'ac' => $ac,
- 'exch' => $exch,
- 'loc' => $loc,
- };
-} ( 1 .. $n_svc_acct_pop );
-
-warn "[fs_signupd] Creating $fs_signupd_socket\n" if $Debug;
-my $uaddr = sockaddr_un($fs_signupd_socket);
-my $proto = getprotobyname('tcp');
-socket(Server,PF_UNIX,SOCK_STREAM,0) or die "socket: $!";
-unlink($fs_signupd_socket);
-bind(Server, $uaddr) or die "bind: $!";
-listen(Server,SOMAXCONN) or die "listen: $!";
-
-warn "[fs_signupd] Entering main loop...\n" if $Debug;
-my $paddr;
-for ( ; $paddr = accept(Client,Server); close Client) {
-
- chop( my $command = <Client> );
-
- if ( $command eq "signup_info" ) {
- warn "[fs_signupd] sending signup info...\n" if $Debug;
- print Client join("\n", $n_cust_main_county,
- map {
- $_->{taxnum},
- $_->{state},
- $_->{county},
- $_->{country},
- } @cust_main_county
- ), "\n";
-
- print Client join("\n", $n_part_pkg,
- map {
- $_->{pkgpart},
- $_->{pkg},
- } @part_pkg
- ), "\n";
-
- print Client join("\n", $n_svc_acct_pop,
- map {
- $_->{popnum},
- $_->{city},
- $_->{state},
- $_->{ac},
- $_->{exch},
- $_->{loc},
- } @svc_acct_pop
- ), "\n";
-
- } elsif ( $command eq "new_customer" ) {
- warn "[fs_signupd] reading customer signup...\n" if $Debug;
- my(
- $first, $last, $ss, $company, $address1, $address2, $city, $county,
- $state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo,
- $paydate, $payname, $invoicing_list, $pkgpart, $username, $password,
- $popnum,
- ) = map { scalar(<Client>) } ( 1 .. 23 );
-
- warn "[fs_signupd] sending customer data to remote server...\n" if $Debug;
- print
- $first, $last, $ss, $company, $address1, $address2, $city, $county,
- $state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo,
- $paydate, $payname, $invoicing_list, $pkgpart, $username, $password,
- $popnum,
- ;
-
- warn "[fs_signupd] reading error from remote server...\n" if $Debug;
- my $error = <STDIN>;
-
- warn "[fs_signupd] sending error to local client...\n" if $Debug;
- print Client $error;
-
- } else {
- die "unexpected command from client: $command";
- }
-
-}
-
+++ /dev/null
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl test.pl'
-
-######################### We start with some black magic to print on failure.
-
-# Change 1..1 below to 1..last_test_to_print .
-# (It may become useful if the test is moved to ./t subdirectory.)
-
-BEGIN { $| = 1; print "1..1\n"; }
-END {print "not ok 1\n" unless $loaded;}
-use FS::SignupClient;
-$loaded = 1;
-print "ok 1\n";
-
-######################### End of black magic.
-
-# Insert your test code below (better if it prints "ok 13"
-# (correspondingly "not ok 13") depending on the success of chunk 13
-# of the test code):
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# fs_signup_server
-#
-
-use strict;
-use IO::Handle;
-use FS::SSH qw(sshopen2);
-use FS::UID qw(adminsuidsetup);
-use FS::Record qw( qsearch qsearchs );
-use FS::cust_main_county;
-use FS::cust_main;
-
-use vars qw( $opt $Debug );
-
-$Debug = 0;
-
-my @payby = qw(CARD PREPAY);
-
-my $user = shift or die &usage;
-&adminsuidsetup( $user );
-
-my $machine = shift or die &usage;
-
-my $agentnum = shift or die &usage;
-my $agent = qsearchs( 'agent', { 'agentnum' => $agentnum } ) or die &usage;
-my $pkgpart = $agent->pkgpart_hashref;
-
-my $refnum = shift or die &usage;
-
-$SIG{CHLD} = sub { wait() };
-
-my($fs_signupd)="/usr/local/sbin/fs_signupd";
-
-while (1) {
- my($reader,$writer)=(new IO::Handle, new IO::Handle);
- $writer->autoflush(1);
- warn "[fs_signup_server] Connecting to $machine...\n" if $Debug;
- sshopen2($machine,$reader,$writer,$fs_signupd);
-
- my $data;
-
- warn "[fs_signup_server] Sending locales...\n" if $Debug;
- my @cust_main_county = qsearch('cust_main_county', {} );
- print $writer $data = join("\n",
- ( scalar(@cust_main_county) || die "no tax rates (cust_main_county records)" ),
- map {
- $_->taxnum,
- $_->state,
- $_->county,
- $_->country,
- } @cust_main_county
- ),"\n";
- warn "[fs_signup_server] $data\n" if $Debug > 2;
-
- warn "[fs_signup_server] Sending package definitions...\n" if $Debug;
- my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } }
- qsearch( 'part_pkg', {} );
- print $writer $data = join("\n",
- ( scalar(@part_pkg) || die "no usable package definitions, agent $agentnum" ),
- map {
- $_->pkgpart,
- $_->pkg,
- } @part_pkg
- ), "\n";
- warn "[fs_signup_server] $data\n" if $Debug > 2;
-
- warn "[fs_signup_server] Sending POPs...\n" if $Debug;
- my @svc_acct_pop = qsearch ('svc_acct_pop',{} );
- print $writer $data = join("\n",
- ( scalar(@svc_acct_pop) || die "No points of presence (svc_acct_pop records)" ),
- map {
- $_->popnum,
- $_->city,
- $_->state,
- $_->ac,
- $_->exch,
- $_->loc,
- } @svc_acct_pop
- ), "\n";
- warn "[fs_signup_server] $data\n" if $Debug > 2;
-
- warn "[fs_signup_server] Entering main loop...\n" if $Debug;
- while (1) {
- warn "[fs_signup_server] Reading (waiting for) signup data...\n" if $Debug;
- chop( my(
- $first, $last, $ss, $company, $address1, $address2, $city, $county,
- $state, $zip, $country, $daytime, $night, $fax, $payby, $payinfo,
- $paydate, $payname, $invoicing_list, $pkgpart, $username, $password,
- $popnum,
- ) = map { scalar(<$reader>) } ( 1 .. 23 ) );
-
- warn "[fs_signup_server] Processing signup...\n" if $Debug;
-
- my $error = '';
-
- #shares some stuff with htdocs/edit/process/cust_main.cgi... take any
- # common that are still here and library them.
- my $cust_main = new FS::cust_main ( {
- 'custnum' => '',
- 'agentnum' => $agentnum,
- 'refnum' => $refnum,
- 'last' => $last,
- 'first' => $first,
- 'ss' => $ss,
- 'company' => $company,
- 'address1' => $address1,
- 'address2' => $address2,
- 'city' => $city,
- 'county' => $county,
- 'state' => $state,
- 'zip' => $zip,
- 'country' => $country,
- 'daytime' => $daytime,
- 'night' => $night,
- 'fax' => $fax,
- 'payby' => $payby,
- 'payinfo' => $payinfo,
- 'paydate' => $paydate,
- 'payname' => $payname,
- } );
-
- $error = "Illegal payment type" unless grep { $_ eq $payby } @payby;
-
- my @invoicing_list = split( /\s*\,\s*/, $invoicing_list );
-
- $error ||= $cust_main->check_invoicing_list( \@invoicing_list );
-
- my $part_pkg = qsearchs( 'part_pkg', { 'pkgpart' => $pkgpart } )
- or $error ||= "WARNING: unknown pkgpart $pkgpart";
- my $svcpart = $part_pkg->svcpart unless $error;
-
- # this should wind up in FS::cust_pkg!
- my $agent = qsearchs( 'agent', { 'agentnum' => $agentnum } );
- my $pkgpart_href = $agent->pkgpart_hashref;
- $error ||= "WARNING: agent $agentnum can't purchase pkgpart $pkgpart"
- unless $pkgpart_href->{ $pkgpart };
-
- my $cust_pkg = new FS::cust_pkg ( {
- #later#'custnum' => $custnum,
- 'pkgpart' => $pkgpart,
- } );
- $error ||= $cust_pkg->check;
-
- my $svc_acct = new FS::svc_acct ( {
- 'svcpart' => $svcpart,
- 'username' => $username,
- '_password' => $password,
- 'popnum' => $popnum,
- } );
-
- my $y = $svc_acct->setdefault; # arguably should be in new method
- $error ||= $y unless ref($y);
- #and just in case you were silly
- $svc_acct->svcpart($svcpart);
- $svc_acct->username($username);
- $svc_acct->_password($password);
- $svc_acct->popnum($popnum);
-
- $error ||= $svc_acct->check;
-
- $error ||= $cust_main->insert;
- if ( $cust_pkg && ! $error ) { #in this case, $cust_pkg should always
- #be definied, but....
- $cust_pkg->custnum( $cust_main->custnum );
- $error ||= $cust_pkg->insert;
- warn "WARNING: $error on pre-checked cust_pkg record!" if $error;
- $svc_acct->pkgnum( $cust_pkg->pkgnum );
- $error ||= $svc_acct->insert;
- warn "WARNING: $error on pre-checked svc_acct record!" if $error;
- }
-
- warn "[fs_signup_server] Sending results...\n" if $Debug;
- print $writer $error, "\n";
-
- $cust_main->invoicing_list( \@invoicing_list ) unless $error;
-
- }
- close $writer;
- close $reader;
- warn "connection to $machine lost! waiting 60 seconds...\n";
- sleep 60;
- warn "reconnecting...\n";
-}
-
-sub usage {
- die "Usage:\n\n fs_signup_server user machine agentnum refnum\n";
-}
-
+++ /dev/null
-[Entry]\r
-Entry_Name = The Internet\r
-[Phone]\r
-Dial_As_Is=no\r
-Phone_Number = { $exch. $loc }\r
-Area_Code = { $ac }\r
-Country_Code = 1\r
-Country_Id = 1\r
-[Server]\r
-Type = PPP\r
-SW_Compress = Yes\r
-PW_Encrypt = Yes\r
-Negotiate_TCP/IP = Yes\r
-Disable_LCP = No\r
-[TCP/IP]\r
-Specify_IP_Address = No\r
-Specity_Server_Address = No\r
-IP_Header_Compress = Yes\r
-Gateway_On_Remote = Yes\r
-[User]\r
-Name = { $username }\r
-Password = { $password }\r
-Display_Password = Yes\r
-[Internet_Mail]\r
-Email_Name = { $email_name }\r
-Email_Address = { $username }\@domain.tld\r
-POP_Server = mail.domain.tld\r
-POP_Server_Port_Number = 110\r
-POP_Login_Name = { $username }\r
-POP_Login_Password = { $password }\r
-SMTP_Server = mail.domain.tld\r
-SMTP_Server_Port_Number = 25\r
-Install_Mail = 1\r
-[Internet_News]\r
-NNTP_Server = news.domain.tld\r
-NNTP_Server_Port_Number = 119\r
-Logon_Required = No\r
-Install_News = 1\r
-[Branding]\r
-Window_Title = The Internet\r
+++ /dev/null
-AuthName Freeside
-AuthType Basic
-require valid-user
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: agent.cgi,v 1.13 1999-04-09 04:22:34 ivan Exp $
-#
-# ivan@sisd.com 97-dec-12
-#
-# changes to allow pages to load from a relative location in the web tree.
-# bmccane@maxbaud.net 98-mar-25
-#
-# changed 'type' to 'atype' because type is reserved word in Pg6.3
-# bmccane@maxbaud.net 98-apr-3
-#
-# agent type was linking to wrong cgi ivan@sisd.com 98-jul-18
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: agent.cgi,v $
-# Revision 1.13 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.12 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.11 1999/01/20 09:43:16 ivan
-# comment out future UI code (but look at it, it's neat!)
-#
-# Revision 1.10 1999/01/19 05:13:24 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.9 1999/01/18 09:41:14 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.8 1999/01/18 09:22:26 ivan
-# changes to track email addresses for email invoicing
-#
-# Revision 1.7 1998/12/17 05:25:16 ivan
-# fix visual and other bugs
-#
-# Revision 1.6 1998/11/23 05:29:46 ivan
-# use CGI::Carp
-#
-# Revision 1.5 1998/11/23 05:27:31 ivan
-# to eliminate warnings
-#
-# Revision 1.4 1998/11/20 08:50:36 ivan
-# s/CGI::Base/CGI.pm, visual fixes
-#
-# Revision 1.3 1998/11/08 10:11:02 ivan
-# CGI.pm
-#
-# Revision 1.2 1998/11/07 10:24:22 ivan
-# don't use depriciated FS::Bill and FS::Invoice, other miscellania
-#
-
-use strict;
-use vars qw( $ui $cgi $p $agent );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup swapuid);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar table popurl);
-use FS::agent;
-use FS::agent_type;
-
-#Begin silliness
-#
-#use FS::UI::CGI;
-#use FS::UI::agent;
-#
-#$ui = new FS::UI::agent;
-#$ui->browse;
-#exit;
-#__END__
-#End silliness
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-$p = popurl(2);
-
-print $cgi->header( '-expires' => 'now' ), header('Agent Listing', menubar(
- 'Main Menu' => $p,
- 'Agent Types' => $p. 'browse/agent_type.cgi',
-# 'Add new agent' => '../edit/agent.cgi'
-)), <<END;
-Agents are resellers of your service. Agents may be limited to a subset of your
-full offerings (via their type).<BR><BR>
-END
-print &table(), <<END;
- <TR>
- <TH COLSPAN=2>Agent</TH>
- <TH>Type</TH>
- <TH><FONT SIZE=-1>Freq. (unimp.)</FONT></TH>
- <TH><FONT SIZE=-1>Prog. (unimp.)</FONT></TH>
- </TR>
-END
-# <TH><FONT SIZE=-1>Agent #</FONT></TH>
-# <TH>Agent</TH>
-
-foreach $agent ( sort {
- $a->getfield('agentnum') <=> $b->getfield('agentnum')
-} qsearch('agent',{}) ) {
- my($hashref)=$agent->hashref;
- my($typenum)=$hashref->{typenum};
- my($agent_type)=qsearchs('agent_type',{'typenum'=>$typenum});
- my($atype)=$agent_type->getfield('atype');
- print <<END;
- <TR>
- <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}">
- $hashref->{agentnum}</A></TD>
- <TD><A HREF="${p}edit/agent.cgi?$hashref->{agentnum}">
- $hashref->{agent}</A></TD>
- <TD><A HREF="${p}edit/agent_type.cgi?$typenum">$atype</A></TD>
- <TD>$hashref->{freq}</TD>
- <TD>$hashref->{prog}</TD>
- </TR>
-END
-
-}
-
-print <<END;
- <TR>
- <TD COLSPAN=2><A HREF="${p}edit/agent.cgi"><I>Add new agent</I></A></TD>
- <TD><A HREF="${p}edit/agent_type.cgi"><I>Add new agent type</I></A></TD>
- </TR>
- </TABLE>
-
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: agent_type.cgi,v 1.8 1999-04-09 04:22:34 ivan Exp $
-#
-# ivan@sisd.com 97-dec-10
-#
-# Changes to allow page to work at a relative position in server
-# Changes to make "Packages" display 2-wide in table (old way was too vertical)
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: agent_type.cgi,v $
-# Revision 1.8 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.7 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.6 1999/04/07 11:10:46 ivan
-# harmless typo
-#
-# Revision 1.5 1999/01/19 05:13:25 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:15 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/17 05:25:17 ivan
-# fix visual and other bugs
-#
-# Revision 1.2 1998/11/21 07:39:52 ivan
-# visual
-#
-
-use strict;
-use vars qw( $cgi $p $agent_type );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup swapuid);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar popurl table);
-use FS::agent_type;
-use FS::type_pkgs;
-use FS::part_pkg;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-$p = popurl(2);
-print $cgi->header( '-expires' => 'now' ), header("Agent Type Listing", menubar(
- 'Main Menu' => $p,
-)), "Agent types define groups of packages that you can then assign to".
- " particular agents.<BR><BR>", &table(), <<END;
- <TR>
- <TH COLSPAN=2>Agent Type</TH>
- <TH COLSPAN="2">Packages</TH>
- </TR>
-END
-
-foreach $agent_type ( sort {
- $a->getfield('typenum') <=> $b->getfield('typenum')
-} qsearch('agent_type',{}) ) {
- my($hashref)=$agent_type->hashref;
- my(@type_pkgs)=qsearch('type_pkgs',{'typenum'=> $hashref->{typenum} });
- my($rowspan)=scalar(@type_pkgs);
- $rowspan = int($rowspan/2+0.5) ;
- print <<END;
- <TR>
- <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">
- $hashref->{typenum}
- </A></TD>
- <TD ROWSPAN=$rowspan><A HREF="${p}edit/agent_type.cgi?$hashref->{typenum}">$hashref->{atype}</A></TD>
-END
-
- my($type_pkgs);
- my($tdcount) = -1 ;
- foreach $type_pkgs ( @type_pkgs ) {
- my($pkgpart)=$type_pkgs->getfield('pkgpart');
- my($part_pkg) = qsearchs('part_pkg',{'pkgpart'=> $pkgpart });
- print qq!<TR>! if ($tdcount == 0) ;
- $tdcount = 0 if ($tdcount == -1) ;
- print qq!<TD><A HREF="${p}edit/part_pkg.cgi?$pkgpart">!,
- $part_pkg->getfield('pkg'),"</A></TD>";
- $tdcount ++ ;
- if ($tdcount == 2)
- {
- print qq!</TR>\n! ;
- $tdcount = 0 ;
- }
- }
-
- print "</TR>";
-}
-
-print <<END;
- <TR><TD COLSPAN=2><I><A HREF="${p}edit/agent_type.cgi">Add new agent type</A></I></TD></TR>
- </TABLE>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main_county.cgi,v 1.7 1999-04-09 04:22:34 ivan Exp $
-#
-# ivan@sisd.com 97-dec-13
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: cust_main_county.cgi,v $
-# Revision 1.7 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.6 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.5 1999/01/19 05:13:26 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:16 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/17 05:25:18 ivan
-# fix visual and other bugs
-#
-# Revision 1.2 1998/11/18 09:01:34 ivan
-# i18n! i18n!
-#
-
-use strict;
-use vars qw( $cgi $p $cust_main_county );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup swapuid);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar popurl table);
-use FS::cust_main_county;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-$p = popurl(2);
-
-print $cgi->header( '-expires' => 'now' ), header("Tax Rate Listing", menubar(
- 'Main Menu' => $p,
- 'Edit tax rates' => $p. "edit/cust_main_county.cgi",
-)),<<END;
- Click on <u>expand country</u> to specify a country's tax rates by state.
- <BR>Click on <u>expand state</u> to specify a state's tax rates by county.
- <BR><BR>
-END
-print &table(), <<END;
- <TR>
- <TH><FONT SIZE=-1>Country</FONT></TH>
- <TH><FONT SIZE=-1>State</FONT></TH>
- <TH>County</TH>
- <TH><FONT SIZE=-1>Tax</FONT></TH>
- </TR>
-END
-
-foreach $cust_main_county ( qsearch('cust_main_county',{}) ) {
- my($hashref)=$cust_main_county->hashref;
- print <<END;
- <TR>
- <TD>$hashref->{country}</TD>
-END
- print "<TD>", $hashref->{state}
- ? $hashref->{state}
- : qq!(ALL) <FONT SIZE=-1>!.
- qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
- qq!">expand country</A></FONT>!
- , "</TD>";
- print "<TD>";
- if ( $hashref->{county} ) {
- print $hashref->{county};
- } else {
- print "(ALL)";
- if ( $hashref->{state} ) {
- print qq!<FONT SIZE=-1>!.
- qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
- qq!">expand state</A></FONT>!;
- }
- }
- print "</TD>";
-
- print <<END;
- <TD>$hashref->{tax}%</TD>
- </TR>
-END
-
-}
-
-print <<END;
- </TABLE>
- </CENTER>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_pkg.cgi,v 1.8 1999-04-09 04:22:34 ivan Exp $
-#
-# ivan@sisd.com 97-dec-5,9
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: part_pkg.cgi,v $
-# Revision 1.8 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.7 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.6 1999/01/19 05:13:27 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:17 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1998/12/17 05:25:19 ivan
-# fix visual and other bugs
-#
-# Revision 1.3 1998/11/21 07:23:45 ivan
-# visual
-#
-# Revision 1.2 1998/11/21 07:00:32 ivan
-# visual
-#
-
-use strict;
-use vars qw( $cgi $p $part_pkg );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup swapuid);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar popurl table);
-use FS::part_pkg;
-use FS::pkg_svc;
-use FS::part_svc;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-$p = popurl(2);
-
-print $cgi->header( '-expires' => 'now' ), header("Package Part Listing",menubar(
- 'Main Menu' => $p,
-)), "One or more services are grouped together into a package and given",
- " pricing information. Customers purchase packages, not services.<BR><BR>",
- &table(), <<END;
- <TABLE BORDER>
- <TR>
- <TH COLSPAN=2>Package</TH>
- <TH>Comment</TH>
- <TH><FONT SIZE=-1>Setup Fee</FONT></TH>
- <TH><FONT SIZE=-1>Freq.</FONT></TH>
- <TH><FONT SIZE=-1>Recur. Fee</FONT></TH>
- <TH>Service</TH>
- <TH><FONT SIZE=-1>Quan.</FONT></TH>
- </TR>
-END
-
-foreach $part_pkg ( sort {
- $a->getfield('pkgpart') <=> $b->getfield('pkgpart')
-} qsearch('part_pkg',{}) ) {
- my($hashref)=$part_pkg->hashref;
- my(@pkg_svc)=grep $_->getfield('quantity'),
- qsearch('pkg_svc',{'pkgpart'=> $hashref->{pkgpart} });
- my($rowspan)=scalar(@pkg_svc);
- print <<END;
- <TR>
- <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}">
- $hashref->{pkgpart}
- </A></TD>
- <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_pkg.cgi?$hashref->{pkgpart}">$hashref->{pkg}</A></TD>
- <TD ROWSPAN=$rowspan>$hashref->{comment}</TD>
- <TD ROWSPAN=$rowspan>$hashref->{setup}</TD>
- <TD ROWSPAN=$rowspan>$hashref->{freq}</TD>
- <TD ROWSPAN=$rowspan>$hashref->{recur}</TD>
-END
-
- my($pkg_svc);
- my($n)="";
- foreach $pkg_svc ( @pkg_svc ) {
- my($svcpart)=$pkg_svc->getfield('svcpart');
- my($part_svc) = qsearchs('part_svc',{'svcpart'=> $svcpart });
- print $n,qq!<TD><A HREF="${p}edit/part_svc.cgi?$svcpart">!,
- $part_svc->getfield('svc'),"</A></TD><TD>",
- $pkg_svc->getfield('quantity'),"</TD></TR>\n";
- $n="<TR>";
- }
-
- print "</TR>";
-}
-
-print <<END;
- <TR><TD COLSPAN=2><I><A HREF="${p}edit/part_pkg.cgi">Add new package</A></I></TD></TR>
- </TABLE>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_referral.cgi,v 1.9 1999-04-09 04:22:34 ivan Exp $
-#
-# ivan@sisd.com 98-feb-23
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: part_referral.cgi,v $
-# Revision 1.9 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.8 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.7 1999/01/19 05:13:28 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.6 1999/01/18 09:41:18 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.5 1998/12/17 05:25:20 ivan
-# fix visual and other bugs
-#
-# Revision 1.4 1998/12/17 04:32:55 ivan
-# print $cgi->header
-#
-# Revision 1.3 1998/12/17 04:31:36 ivan
-# use CGI::Carp
-#
-# Revision 1.2 1998/12/17 04:26:04 ivan
-# use CGI; no relative URLs
-#
-
-use strict;
-use vars qw( $cgi $p $part_referral );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup swapuid);
-use FS::Record qw(qsearch);
-use FS::CGI qw(header menubar popurl table);
-use FS::part_referral;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-$p = popurl(2);
-
-print $cgi->header( '-expires' => 'now' ), header("Referral Listing", menubar(
- 'Main Menu' => $p,
-# 'Add new referral' => "../edit/part_referral.cgi",
-)), "Where a customer heard about your service. Tracked for informational purposes.<BR><BR>", &table(), <<END;
- <TR>
- <TH COLSPAN=2>Referral</TH>
- </TR>
-END
-
-foreach $part_referral ( sort {
- $a->getfield('refnum') <=> $b->getfield('refnum')
-} qsearch('part_referral',{}) ) {
- my($hashref)=$part_referral->hashref;
- print <<END;
- <TR>
- <TD><A HREF="${p}edit/part_referral.cgi?$hashref->{refnum}">
- $hashref->{refnum}</A></TD>
- <TD><A HREF="${p}edit/part_referral.cgi?$hashref->{refnum}">
- $hashref->{referral}</A></TD>
- </TR>
-END
-
-}
-
-print <<END;
- <TR>
- <TD COLSPAN=2><A HREF="${p}edit/part_referral.cgi"><I>Add new referral</I></A></TD>
- </TR>
- </TABLE>
- </CENTER>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_svc.cgi,v 1.11 1999-04-09 04:22:34 ivan Exp $
-#
-# ivan@sisd.com 97-nov-14, 97-dec-9
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: part_svc.cgi,v $
-# Revision 1.11 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.10 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.9 1999/01/19 05:13:29 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.8 1999/01/18 09:41:19 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.7 1998/12/30 23:06:22 ivan
-# typo
-#
-# Revision 1.6 1998/12/30 23:03:20 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.5 1998/12/17 05:25:21 ivan
-# fix visual and other bugs
-#
-# Revision 1.4 1998/11/21 02:26:22 ivan
-# visual
-#
-# Revision 1.3 1998/11/20 23:10:57 ivan
-# visual
-#
-# Revision 1.2 1998/11/20 08:50:37 ivan
-# s/CGI::Base/CGI.pm, visual fixes
-#
-
-use strict;
-use vars qw( $cgi $p $part_svc );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch fields);
-use FS::part_svc;
-use FS::CGI qw(header menubar popurl table);
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-$p = popurl(2);
-
-print $cgi->header( '-expires' => 'now' ), header('Service Part Listing', menubar(
- 'Main Menu' => $p,
-)),<<END;
- Services are items you offer to your customers.<BR><BR>
-END
-print &table(), <<END;
- <TR>
- <TH COLSPAN=2>Service</TH>
- <TH>Table</TH>
- <TH>Field</TH>
- <TH COLSPAN=2>Modifier</TH>
- </TR>
-END
-
-foreach $part_svc ( sort {
- $a->getfield('svcpart') <=> $b->getfield('svcpart')
-} qsearch('part_svc',{}) ) {
- my($hashref)=$part_svc->hashref;
- my($svcdb)=$hashref->{svcdb};
- my(@rows)=
- grep $hashref->{${svcdb}.'__'.$_.'_flag'},
- map { /^${svcdb}__(.*)$/; $1 }
- grep ! /_flag$/,
- grep /^${svcdb}__/,
- fields('part_svc')
- ;
- my($rowspan)=scalar(@rows) || 1;
- print <<END;
- <TR>
- <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_svc.cgi?$hashref->{svcpart}">
- $hashref->{svcpart}</A></TD>
- <TD ROWSPAN=$rowspan><A HREF="${p}edit/part_svc.cgi?$hashref->{svcpart}"> $hashref->{svc}</A></TD>
- <TD ROWSPAN=$rowspan>$hashref->{svcdb}</TD>
-END
-
- my($n1)='';
- my($row);
- foreach $row ( @rows ) {
- my($flag)=$part_svc->getfield($svcdb.'__'.$row.'_flag');
- print $n1,"<TD>$row</TD><TD>";
- if ( $flag eq "D" ) { print "Default"; }
- elsif ( $flag eq "F" ) { print "Fixed"; }
- else { print "(Unknown!)"; }
- print "</TD><TD>",$part_svc->getfield($svcdb."__".$row),"</TD>";
- $n1="</TR><TR>";
- }
-print "</TR>";
-}
-
-print <<END;
- <TR>
- <TD COLSPAN=2><A HREF="${p}edit/part_svc.cgi"><I>Add new service</I></A></TD>
- </TR>
- </TABLE>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct_pop.cgi,v 1.8 2000-01-28 22:56:13 ivan Exp $
-#
-# ivan@sisd.com 98-mar-8
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: svc_acct_pop.cgi,v $
-# Revision 1.8 2000-01-28 22:56:13 ivan
-# track full phone number
-#
-# Revision 1.7 1999/04/09 04:22:34 ivan
-# also table()
-#
-# Revision 1.6 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.5 1999/01/19 05:13:30 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:20 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/17 05:25:22 ivan
-# fix visual and other bugs
-#
-# Revision 1.2 1998/12/17 04:36:59 ivan
-# use CGI;, use CGI::Carp, visual changes, relative URLs
-#
-
-use strict;
-use vars qw( $cgi $p $svc_acct_pop );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup swapuid);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar table popurl);
-use FS::svc_acct_pop;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-$p = popurl(2);
-
-print $cgi->header( '-expires' => 'now' ), header('POP Listing', menubar(
- 'Main Menu' => $p,
-)), "Points of Presence<BR><BR>", &table(), <<END;
- <TR>
- <TH></TH>
- <TH>City</TH>
- <TH>State</TH>
- <TH>Area code</TH>
- <TH>Exchange</TH>
- <TH>Local</TH>
- </TR>
-END
-
-foreach $svc_acct_pop ( sort {
- $a->getfield('popnum') <=> $b->getfield('popnum')
-} qsearch('svc_acct_pop',{}) ) {
- my($hashref)=$svc_acct_pop->hashref;
- print <<END;
- <TR>
- <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
- $hashref->{popnum}</A></TD>
- <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
- $hashref->{city}</A></TD>
- <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
- $hashref->{state}</A></TD>
- <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
- $hashref->{ac}</A></TD>
- <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
- $hashref->{exch}</A></TD>
- <TD><A HREF="${p}edit/svc_acct_pop.cgi?$hashref->{popnum}">
- $hashref->{loc}</A></TD>
- </TR>
-END
-
-}
-
-print <<END;
- <TR>
- <TD COLSPAN=5><A HREF="${p}edit/svc_acct_pop.cgi"><I>Add new POP</I></A></TD>
- </TR>
- </TABLE>
- </CENTER>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-<head>
- <title>Administration</title>
-</head>
-<body>
- <h1>Administration</h1>
-</body>
+++ /dev/null
-<head>
- <title>Billing</title>
-</head>
-<body>
- <h1>Billing</h1>
- The freeside-bill script can be run daily to bill all customers. Usage: bill [ -c [ i ] ] [ -d <i>date</i> ] [ -b ]
- <ul>
- <li>-c: Turn on collecting (you probably want this).
- <li>-i: Real-time billing (as opposed to bacth billing). Only relevant for credit cards. Not available without modifying site_perl/Bill.pm
- <li>-d: Pretend it is <i>date</i> (parsed by Date::Parse)
- <li>-b: N/A
- </ul>
- Printing should be configured on your freeside machine to print invoices.
- <br><br>Batch credit card processing
- <ul>
- <li>After this script is run, a credit card batch will be in the <a href="schema.html#cust_pay_batch">cust_pay_batch</a> table. Export this table to your credit card batching.
- <li>When your batch completes, erase the cust_pay_batch records in that batch and add any necessary paymants to the <a href="schema.html#cust_pay">cust_pay</a> table. Example code to add payments is:
- <pre>use FS::cust_pay;
-
-# loop over all records in batch
-
-my $payment=create FS::cust_pay (
- 'invnum' => $invnum,
- 'paid' => $paid,
- '_date' => $_date,
- 'payby' => $payby,
- 'payinfo' => $payinfo,
- 'paybatch' => $paybatch,
-);
-
-my $error=$payment->insert;
-if ( $error ) {
- #process error
-}
-
-# end loop
-</pre>
-All fields except paybatch are contained in the cust_pay_batch table. You can use paybatch field to track particular batches and/or particular transactions within a batch.
- </ul>
-</body>
+++ /dev/null
-<head>
- <title>Configuration files</title>
-</head>
-<body>
- <h1>Configuration files</h1>
-Configuration file layout has changed in 1.2.x.
-<ul>
- <li>First, the file `/usr/local/etc/freeside/mapsecrets' is read. Each line
-in this file contains a username and filename, separated by whitespace. Note
-that these are not local usernames - they are passed from Apache (you _did_
-setup <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">
-user authetication</a>, correct?). Filenames are located in
-`/usr/local/etc/freeside/'. The specified filename is parsed exactly
-the same as the pre-1.2.x `secrets' file:
- <li>Three lines: Database engine datasource (for example,
- `DBI:mysql:freeside' or `DBI:Pg:dbname=freeside'), username, and password.
- This file should not be world readable. See the DBI manpage and the manpage
- for your DBD for the exact syntax.
-</ul>
-All further configuration files and directories are located in
-`/usr/local/etc/freeside/conf.<i>datasource</i>', for example,
-`/usr/local/etc/freeside/conf.DBI:Pg:dbname=freeside'
-<ul>
- <li>address - Your company name and address, four lines.
- <li>bsdshellmachines - Your BSD flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd' and `/etc/master.passwd'.
- <li>cybercash2 - <a href="http://www.cybercash.com/cybercash/services/cashreg214.html">CyberCash v2</a> support, four lines: paymentserverhost, paymentserverport, paymentserversecret, and transaction type (`mauthonly' or `mauthcapture'). CCLib.pm is required.
- <li>cybercash3.2 - <a href="http://www.cybercash.com/cybercash/services/technology.html">CyberCash v3.2</a> support. Two lines: the full path and name of your merchant_conf file, and the transaction type (`mauthonly' or `mauthcapture'). CCMckLib3_2.pm, CCMckDirectLib3_2.pm and CCMckErrno3_2 are required.
- <li>deletecustomers - The existance of this file will enable customer deletions. Be very careful! Deleting a customer will remove all traces that this customer ever existed! It should probably only be used when auditing a legacy database. Normally, you cancel all of a customers' packages if they cancel service.
- <li>domain - Your domain name.
- <li>editreferrals - The existance of this file will allow you to change the referral of existing customers.
- <li>erpcdmachines - Your ERPCD authenticaion machines, one per line. This enables export of `/usr/annex/acp_passwd' and `/usr/annex/acp_dialup'.
- <li>hidecancelledpackages - The existance of this file will prevent cancelled packages from showing up in listings (though they will still be in the database)
- <li>hidecancelledcustomers - The existance of this file will prevent customers with only cancelled packages from showing up in listings (though they will still be in the database)
- <li>home - For new users, prefixed to usrename to create a directory name. Should have a leading but not a trailing slash.
- <li>invoice_from - Return address on email invoices.
- <li>lpr - Print command for paper invoices, for example `lpr -h'.
- <li>nismachines - Your NIS master (not slave master) machines, one per line. This enables export of `/etc/global/passwd' and `/etc/global/shadow'.
- <li>passwordmin - Minimum password length (default 6);
- <li>qmailmachines - Your qmail machines, one per line. This enables export of `/var/qmail/control/virtualdomains', `/var/qmail/control/recipientmap', and `/var/qmail/control/rcpthosts'. The existance of this file (even if empty) also turns on user `.qmail-extension' file maintenance in conjunction with `shellmachine'.
- <li>radiusmachines - Your RADIUS authentication machines, one per line. This enables export of `/etc/raddb/users'.
- <li>registries - Directory which contains domain registry information. Each registry is a directory.
- <ul>
- <li>registries/internic - Currently the only supported registry
- <ul>
- <li>registries/internic/from - Email address from which InterNIC domain registrations are sent.
- <li>regestries/internic/nameservers - The nameservers for InterNIC domain registrations, one per line. Each line contains an IP address and hostname, separated by whitespace.
- <li>registries/internic/tech_contact - Technical contact NIC handle for domain registrations.
- <li>registries/internic/template - Template for InterNIC domain registrations with special markup. A suitable copy of the InterNIC domain template v4.0 is in `fs-x.y.z/etc/domain-template.txt'.
- <li>registries/internic/to - Email address to which InterNIC domain registrations are sent.
- </ul>
- </ul>
- <li>sendmailmachines - Your sendmail machines, one per line. This enables export of `/etc/virtusertable' and `/etc/sendmail.cw'.
- <li>shellmachine - A single machine with user home directories mounted. This enables home directory creation, renaming and archiving/deletion. In conjunction with `qmailmachines', it also enables `.qmail-extension' file maintenance.
- <li>shellmachines - Your Linux and System V flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd' and `/etc/shadow' files.
- <li>shells - Legal shells (think /etc/shells). You probably want to `cut -d: -f7 /etc/passwd | sort | uniq' initially so that importing doesn't fail with `Illegal shell' errors, then remove any special entries afterwords. A blank line specifies that an empty shell is permitted.
- <li>showpasswords - The existance of this file will allow unencrypted user passwords to be displayed.
- <li>smtpmachine - SMTP relay for Freeside's outgoing mail.
- <li>usernamemin - Minimum username length (default 2);
- <li>usernamemax - Maximum username length (default is the size of the SQL column, probably specified when fs-setup was run)
-</ul>
-</body>
-
+++ /dev/null
-<head>
- <title>File exporting</title>
-</head>
-<body>
- <h1>File exporting</h1>
- <ul>
- <li>bin/svc_acct.export will create UNIX <b>passwd</b>, <b>shadow</b> and <b>master.passwd</b> files, ERPCD <b>acp_passwd</b> and <b>acp_dialup</b> files and a RADIUS <b>users</b> file in the <b>/usr/local/etc/freeside/export.<i>datasrc</i></b> directory. Using the appropriate <a href="config.html">configuration files</a>, you can export these files to your remote machines unattended; see below. Some RADIUS servers (such as <a href="http://www.open.com.au/radiator/">Radiator</a>) will authenticate directly out of an SQL database. In these cases,
-it is reccommended that you copy the svc_acct table to an external RADIUS machine rather than run the RADIUS server on your Freeside machine.
- <ul>
- <li>shellmachines - <b>passwd</b> and <b>shadow</b> are copied to the remote machine as <b>/etc/passwd.new</b> and <b>/etc/shadow.new</b> and then moved to <b>/etc/passwd</b> and <b>/etc/shadow</b> if no errors occur.
- <li>bsdshellmachines - <b>passwd</b> and <b>master.passwd</b> are copied to the remote machine as <b>/etc/passwd.new</b> and <b>/etc/master.passwd.new</b> and moved to <b>/etc/passwd</b> and <b>/etc/master.passwd</b> if no errors occur.
- <li>nismachines - <b>passwd</b> and <b>shadow</b> are copied to the <b>/etc/global</b> directory on the remote machine. If no errors occur, the command <b>( cd /var/yp; make; )</b> is executed on the remote machine.
- <li>erpcdmachines - <b>acp_passwd</b> and <b>acp_dialup</b> are copied to the <b>/usr/annex</b> directory on the remote machine. If no errors occur, the command <b>( kill -USR1 `cat /usr/annex/erpcd.pid` )</b> is executed on the remote machine.
- <li>radiusmachines - <b>users</b> is copied to the <b>/etc/raddb</b> directory on the remote machine. If no errors occur, the command <b>( builddbm )</b> is executed on the remote machine.
- </ul>
- <li>site_perl/svc_acct.pm - If a shellmachine is defined, users can be created, modified and deleted remotely; see below.
- <ul>
- <li>The command <b>useradd -d <i>homedir</i> -s <i>shell</i> -u <i>uid</i> <i>username</i></b> is executed when a user is added.
- <li>The command <b>userdel <i>username</i></b> is executed with a user is deleted.
- <li>If a user's home directory changes, the command <b>[ -d <i>old_homedir</i> && ( chmod u+t <i>old_homedir</i>; umask 022; mkdir <i>new_homedir</i>; cd <i>old_homedir</i>; find . -depth -print | cpio -pdm <i>new_homedir</i>; chmod u-t <i>new_homedir</i>; chown -R <i>uid</i>.<i>gid</i> <i>new_homedir</i>; rm -rf <i>old_homedir</i> )</b> is executed.
- </ul>
- <li>bin/svc_acct_sm.export will create <a href="http://www.qmail.org">Qmail</a> <b>rcpthosts</b>, <b>recipientmap</b> and <b>virtualdomains</b> files and <a href="http://www.sendmail.org">Sendmail</a> <b>virtusertable</b> and <b>sendmail.cw</b> files in the <b>/usr/local/etc/freeside/export.<i>datasrc</i></b> directory. Using the appropriate <a href="config.html">configuration files</a>, you can export these files to your remote machines unattemded; see below.
- <ul>
- <li>qmailmachines - <b>recipientmap</b>, <b>virtualdomains</b> and <b>rcpthosts</b> are copied to the <b>/var/qmail/control</b> directory on the remote machine. Note: If you <a href="legacy.html#svc_acct_sm">imported</a> qmail configuration files, run the generated <b>/usr/local/etc/freeside/export.<i>datasrc</i>/virtualdomains.FIX</b> on a machine with your user home directories before exporting qmail configuration files.
- <li>shellmachine - The command <b>[ -e <i>homedir</i>/.qmail-default ] || { touch <i>homedir</i>/.qmail-default; chown <i>uid</i>.<i>gid</i> <i>homedir</i>/.qmail-default; }</b> will be run on this machine for users in the virtualdomains file.
- <li>sendmailmachines - <b>sendmail.cw</b> and <b>virtusertable</b> are copied to the remote machine as <b>/etc/sendmail.cw.new</b> and <b>/etc/virtusertable.new</b> and moved to <b>/etc/sendmail.cw</b> and <b>/etc/virtusertable</b> if no errors occur.
- </ul>
- <li>site_perl/svc_acct_sm.pm - If the qmailmachines configuration file exists and a shellmachine is defined, user <b>.qmail-</b> files can be updated.
- <ul>
- <li>The command <b>[ -e <i>homedir</i>/.qmail-<i>domain</i>-default ] || { touch <i>homedir</i>/.qmail-<i>domain</i>-default; chown <i>uid</i>.<i>gid</i> <i>homedir</i>/.qmail-<i>domain</i>-default; }</b> is run.
- </ul>
- </ul>
- <br><a name=ssh>Unattended remote login</a> - Freeside can login to remote machines unattended using SSH. This can pose a security risk if not configured correctly, and will allow an intruder who breaks into your freeside machine full access to your remote machines. <b>Do not use this feature unless you understand what you are doing!</b>
- <ul>
- <li>As the freeside user (on your freeside machine), generate an authentication key using <a href="http://www.tac.nyc.ny.us/cgi-bin/man-cgi?ssh-keygen+1">ssh-keygen</a>. Since this is for unattended operation, you need to use a blank passphrase.
- <li>Append the newly-created identity.pub file to root's authorized_keys on the remote machine(s).
- </ul>
-
-</body>
-
+++ /dev/null
-<head>
- <title>Documentation</title>
-</head>
-<body>
- <h1>Documentation</h1>
-<ul>
- <li><a href="install.html">New Installation</a>
- <li><a href="upgrade.html">Upgrading from 1.0.x to 1.1.x</a>
- <li><a href="upgrade2.html">Upgrading from 1.1.x to 1.1.4</a>
- <li><a href="upgrade3.html">Upgrading from 1.1.x to 1.2.x</a>
- <li><a href="upgrade4.html">Upgrading from 1.2.x to 1.2.2</a>
- <li><a href="upgrade5.html">Upgrading from 1.2.2 to 1.3.0</a>
- <li><a href="config.html">Configuration files</a>
-<!--
- <li><a href="admin.html">Administration</a>
-!-->
- <li><a href="../index.html#admin">Administration</a>
- <li><a href="legacy.html">Importing legacy data</a>
- <li><a href="export.html">File exporting and remote setup</a>
- <li><a href="passwd.html">fs_passwd</a>
- <li><a href="signup.html">Signup server</a>
- <li><a href="billing.html">Billing</a>
- <li><a href="trouble.html">Troubleshooting</a>
- <li><a href="schema.html">Schema reference</a>
- <li><a href="man/FS.html">Perl API</a>
-</ul>
-</body>
+++ /dev/null
-<head>
- <title>Installation</title>
-</head>
-<body>
-<h1>Installation</h1>
-Before installing, you need:
-<ul>
- <li>A web server, such as <a href="http://www.apache-ssl.org">Apache-SSL</a> or <a href="http://www.apache.org">Apache</a>
- <li><a href="ftp://ftp.cs.hut.fi/pub/ssh/">SSH</a>
- <li><a href="http://www.perl.com/CPAN/doc/relinfo/INSTALL.html">Perl</a> (at least 5.004_05 for the 5.004 series or 5.005_03 for the 5.005 series. Don't enable experimental features like threads or the PerlIO abstraction layer.)
- <li>A database engine supported by Perl's <a href="http://www.hermetica.com/technologia/DBI/">DBI</a>, such as <a href="http://www.tcx.se/">MySQL</a> or <a href="http://www.postgresql.org/">PostgreSQL</a> (verstion 6.5 or higher) (see the <a href="postgresql.html">PostgreSQL notes</a>)
- <li>Perl modules (<a href="http://www.perl.com/CPAN/doc/manual/html/lib/CPAN.html">CPAN</a> will query, download and build perl modules automatically)
- <ul>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Array/">Array-PrintCols</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Term/">Term-Query</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/MIME/">MIME-Base64</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Data">Data-Dumper</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/MD5">Digest-MD5</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/URI">URI</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/HTTP">HTML-Parser</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Net">libnet</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Locale">Locale-Codes</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Net">Net-Whois</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/LWP/">libwww-perl</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Business/">Business-CreditCard</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Data/">Data-ShowTable</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Mail/">MailTools</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Time/">TimeDate</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Date/">DateManip</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/File/">File-CounterFile</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/FreezeThaw/">FreezeThaw</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/String/">String-Approx</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-module/DBI/">DBI
- <li><a href="http://www.perl.com/CPAN/modules/by-module/DBD/">DBD for your database engine</a>
- </ul>
-</ul>
-Install the Freeside distribution:
-<ul>
- <li>Add the user `freeside' to your system.
- <li>Add the freeside database to your database engine. (with <a href="http://www.mysql.com/Manual_chapter/manual_Syntax.html#Create_database">MySQL</a>) (with <a href="http://www.postgresql.org/docs/admin/manage-ag.htm#AEN854">PostgreSQL</a>)
- <li>Allow the freeside user full access to the freeside database. (with <a href="http://www.mysql.com/Manual_chapter/manual_Privilege_system.html#Privilege_system">MySQL</a>) (with <a href="http://www.postgresql.org/docs/admin/newuser.htm">PostgreSQL</a>)
- <li>Unpack the tarball: <pre>gunzip -c fs-x.y.z.tar.gz | tar xvf -</pre>
- <li>Build and install the Perl libraries:
- <pre>
-$ cd FS/
-$ perl Makefile.PL
-$ make
-$ su
-# make install</pre>
- <li>Copy or link fs-x.y.z/htdocs to your web server's document space. <pre>mkdir /usr/local/apache/htdocs/freeside
-cp -r fs-x.y.z/htdocs/* /usr/local/apache/htdocs/freeside</pre> or <pre>ln -s /full/path/to/fs-x.y.z/htdocs /usr/local/apache/htdocs/freeside</pre>
- <li>Restrict access to this web interface. (with <a href="http://www.apache.org/docs/misc/FAQ.html#user-authentication">Apache</a>)
- <li>Enable CGI execution for files with the `.cgi' extension. (with <a href="http://www.apache.org/docs/mod/mod_mime.html#addhandler">Apache</a>)
- <li>Set ownership and permissions for the web interface. The web interface needs to run as the freeside user - there are several ways to do this.
- <ul>
- <li>Use Perl's setuid emulation: see the <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html#Security_Bugs">Security Bugs</a> section of the <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html">perlsec</a> manpage.
-<pre>cd /usr/local/apache/htdocs/freeside
-chown -R freeside .
-chmod 4755 browse/*.cgi edit/*.cgi edit/process/*.cgi misc/*.cgi misc/process/*.cgi search/*.cgi view/*.cgi</pre>
- <li>Use Apache's <a href="http://www.apache.org/docs/suexec.html">suEXEC</a>.
-<pre>cd /usr/local/apache/htdocs/freeside
-chown -R freeside .
-chmod 755 browse/*.cgi edit/*.cgi edit/process/*.cgi misc/*.cgi misc/process/*.cgi search/*.cgi view/*.cgi</pre>
- <li>Use <a href="http://perl.apache.org/">mod_perl</a>. You should run a separate iteration of Apache[-SSL] as the freeside user. (Warning: The redirect method of CGI.pm 2.36 [as distributed with Perl 5.004_04] is broken under mod_perl. Downlaod the current version from <a href="http://www.perl.com/CPAN/modules/by-module/CGI">CPAN</a>. Apache 1.3.6 is also highly recommended because of signal handling problems in earlier versions.)
-<pre>cd /usr/local/apache/htdocs/freeside
-chown -R root .
-chmod 755 browse/*.cgi edit/*.cgi edit/process/*.cgi misc/*.cgi misc/process/*.cgi search/*.cgi view/*.cgi</pre>
- </ul>
-<li>Create the necessary <a href="config.html">configuration files</a>.
-<li>Create the `/usr/local/etc/freeside/counters.<i>datasrc</i>', and
- `/usr/local/etc/freeside/export.<i>datasrc</i>' directories for each <i>datasrc</i> (owned by the freeside user).
- <li>As the freeside user, run bin/fs-setup to create the database tables.
-</ul>
-</body>
+++ /dev/null
-<head>
- <title>Importing legacy data</title>
-</head>
-<body>
- <h1>Importing legacy data</h1>
-<ul>
- <li><a name="svc_acct">bin/svc_acct.import</a> - Import `passwd', ( `shadow' or `master.passwd' ) and RADIUS `users'. Before running bin/svc_acct.import, you need <a href="../browse/part_svc.cgi">services</a> (with table svc_acct) as follows:
- <ul>
- <li>Most accounts probably have entries in passwd and users (with Port-Limit nonexistant or 1)
- <li>Some accounts have entries in passwd and users, but with Port-Limit 2 (or more)
- <li>Some accounts might have entries in users only (Port-Limit 1)
- <li>Some accounts might have entries in users only (Port-Limit >= 2)
- <li>POP mail accounts have entries in passwd only, and have a particular shell.
- <li>Everything else in passwd is a shell account.
- </ul>
- <li><a name="svc_acct_sm">bin/svc_acct_sm.import</a> - Import qmail ( `virtualdomains' and `rcpthosts' ), or sendmail ( `virtusertable' and `sendmail.cw' ) files. Before running bin/svc_acct_sm.import, you need <a href="../browse/part_svc.cgi">services</a> as follows:
- <ul>
- <li>Domain (table svc_acct)
- <li>Mail alias (table svc_acct_sm)
- </ul>
- <li><a name="cust_main">Importing customer data</a>
- <ul>
- <li>Manually
- <ul>
- <li>Add a <a href="../edit/cust_main.cgi">new customer</a>
- <li>Add one or more packages for this customer
- <li>Enter a package by clicking on the package number
- <li>Pick the `Link to existing' option
- </ul>
- <li>Batch - You will need to write a script to import your particular legacy data. You can use eg/TEMPLATE_cust_main.import as a starting point.
- </ul>
-</ul>
-</body>
-
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS - Freeside Perl modules</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <UL>
-
- <LI><A HREF="#Database_metadata_classes">Database metadata classes</A>
- <LI><A HREF="#Utility_classes">Utility classes</A>
- <LI><A HREF="#Database_record_classes">Database record classes</A>
- <LI><A HREF="#User_Interface_classes_under_de">User Interface classes (under development; not yet usable)</A>
- <LI><A HREF="#Notes">Notes</A>
- </UL>
-
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#SUPPORT">SUPPORT</A>
- <LI><A HREF="#AUTHOR">AUTHOR</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
- <LI><A HREF="#BUGS">BUGS</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS - Freeside Perl modules
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-FS is the temporary prefix for many disparate modules written for the
-Freeside ISP billing software. This includes:
-
-<P>
-<HR>
-<H2><A NAME="Database_metadata_classes">Database metadata classes</A></H2>
-<P>
-<A HREF="./FS/dbdef.html">FS::dbdef</A> - Database class
-
-<P>
-<A HREF="./FS/dbdef_table.html">FS::dbdef_table</A> - Database table class
-
-<P>
-<A HREF="./FS/dbdef_column.html">FS::dbdef_column</A> - Database column class
-
-<P>
-<A HREF="./FS/dbdef_colgroup.html">FS::dbdef_colgroup</A> - Database column group class
-
-<P>
-<A HREF="./FS/dbdef_index.html">FS::dbdef_index</A> - Database index class
-
-<P>
-<A HREF="./FS/dbdef_unique.html">FS::dbdef_unique</A> - Database unique index class
-
-<P>
-<HR>
-<H2><A NAME="Utility_classes">Utility classes</A></H2>
-<P>
-<A HREF="./FS/SSH.html">FS::SSH</A> - Simple wrappers around ssh and scp commands.
-
-<P>
-<A HREF="./FS/Conf.html">FS::Conf</A> - Freeside configuration values
-
-<P>
-<A HREF="./FS/UID.html">FS::UID</A> - User class (not yet OO)
-
-<P>
-<A HREF="./FS/CGI.html">FS::CGI</A> - Non OO-subroutines for the web interface. This is depriciated. Future
-development will be focused on the FS::UI user-interface classes (see
-below).
-
-<P>
-<HR>
-<H2><A NAME="Database_record_classes">Database record classes</A></H2>
-<P>
-<A HREF="./FS/Record.html">FS::Record</A> - Database record base class
-
-<P>
-<A HREF="./FS/svc_acct_pop.html">FS::svc_acct_pop</A> - POP (Point of Presence, not Post Office Protocol) class
-
-<P>
-<A HREF="./FS/part_referral.html">FS::part_referral</A> - Referral class
-
-<P>
-<A HREF="./FS/cust_main_county.html">FS::cust_main_county</A> - Locale (tax rate) class
-
-<P>
-<A HREF="./FS/svc_Common.html">FS::svc_Common</A> - Service base class
-
-<P>
-<A HREF="./FS/svc_acct.html">FS::svc_acct</A> - Account (shell, RADIUS, POP3) class
-
-<P>
-<A HREF="./FS/svc_domain.html">FS::svc_domain</A> - Domain class
-
-<P>
-<A HREF="./FS/svc_acct_sm.html">FS::svc_acct_sm</A> - Vitual mail alias class
-
-<P>
-<A HREF="./FS/part_svc.html">FS::part_svc</A> - Service definition class
-
-<P>
-<A HREF="./FS/part_pkg.html">FS::part_pkg</A> - Package (billing item) definition class
-
-<P>
-<A HREF="./FS/pkg_svc.html">FS::pkg_svc</A> - Class linking package (billing item) definitions (see <A HREF="./FS/part_pkg.html">FS::part_pkg</A>) with service definitions (see <A HREF="./FS/part_svc.html">FS::part_svc</A>)
-
-<P>
-<A HREF="./FS/agent.html">FS::agent</A> - Agent (reseller) class
-
-<P>
-<A HREF="./FS/agent_type.html">FS::agent_type</A> - Agent type class
-
-<P>
-<A HREF="./FS/type_pkgs.html">FS::type_pkgs</A> - Class linking agent types (see
-<A HREF="./FS/agent_type.html">FS::agent_type</A>) with package (billing item) definitions (see <A HREF="./FS/part_pkg.html">FS::part_pkg</A>)
-
-<P>
-<A HREF="./FS/cust_svc.html">FS::cust_svc</A> - Service class
-
-<P>
-<A HREF="./FS/cust_pkg.html">FS::cust_pkg</A> - Package (billing item) class
-
-<P>
-<A HREF="./FS/cust_main.html">FS::cust_main</A> - Customer class
-
-<P>
-<A HREF="./FS/cust_main_invoice.html">FS::cust_main_invoice</A> - Invoice destination class
-
-<P>
-<A HREF="./FS/cust_bill.html">FS::cust_bill</A> - Invoice class
-
-<P>
-<A HREF="./FS/cust_bill_pkg.html">FS::cust_bill_pkg</A> - Invoice line item class
-
-<P>
-<A HREF="./FS/cust_pay.html">FS::cust_pay</A> - Payment class
-
-<P>
-<A HREF="./FS/cust_credit.html">FS::cust_credit</A> - Credit class
-
-<P>
-<A HREF="./FS/cust_refund.html">FS::cust_refund</A> - Refund class
-
-<P>
-<A HREF="./FS/cust_pay_batch.html">FS::cust_pay_batch</A> - Credit card transaction queue class
-
-<P>
-<HR>
-<H2><A NAME="User_Interface_classes_under_de">User Interface classes (under development; not yet usable)</A></H2>
-<P>
-<A HREF="./FS/UI/Base.html">FS::UI::Base</A> - User-interface base class
-
-<P>
-<A HREF="./FS/UI/Gtk.html">FS::UI::Gtk</A> - Gtk user-interface class
-
-<P>
-<A HREF="./FS/UI/CGI.html">FS::UI::CGI</A> - CGI (HTML) user-interface class
-
-<P>
-<A HREF="./FS/UI/agent.html">FS::UI::agent</A> - agent table user-interface class
-
-<P>
-<HR>
-<H2><A NAME="Notes">Notes</A></H2>
-<P>
-To quote <CODE>perl(1),</CODE> ``If you're intending to read these straight
-through for the first time, the suggested order will tend to reduce the
-number of forward references.''
-
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-Freeside is a billing and administration package for Internet Service
-Providers.
-
-<P>
-The Freeside home page is at <http://www.sisd.com/freeside>.
-
-<P>
-The main documentation is in htdocs/docs.
-
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: FS.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="SUPPORT">SUPPORT</A></H1>
-<P>
-A mailing list for users and developers is available. Send a blank message
-to <<A
-HREF="mailto:ivan-freeside-subscribe@sisd.com">ivan-freeside-subscribe@sisd.com</A>>
-to subscribe.
-
-<P>
-Commercial support is available; see
-<http://www.sisd.com/freeside/commercial.html>.
-
-<P>
-<HR>
-<H1><A NAME="AUTHOR">AUTHOR</A></H1>
-<P>
-Primarily Ivan Kohler <<A
-HREF="mailto:ivan@sisd.com">ivan@sisd.com</A>>, with help from many kind
-folks.
-
-<P>
-See the CREDITS file in the Freeside distribution for a (hopefully)
-complete list and the individal files for details.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<CODE>perl(1),</CODE> main Freeside documentation in htdocs/docs/
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The version number of the FS Perl extension differs from the version of the
-Freeside distribution, which are both different from the CVS version tag
-for each file, which appears under the VERSION heading.
-
-<P>
-Those modules which would be useful separately should be pulled out,
-renamed appropriately and uploaded to CPAN.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::Bill - Legacy stub</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::Bill - Legacy stub
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-The functionality of FS::Bill has been integrated into FS::cust_main.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::CGI - Subroutines for the web interface</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#SUBROUTINES">SUBROUTINES</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::CGI - Subroutines for the web interface
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::CGI qw(header menubar idiot eidiot popurl);
-</PRE>
-<P>
-<PRE> print header( 'Title', '' );
- print header( 'Title', menubar('item', 'URL', ... ) );
-</PRE>
-<P>
-<PRE> idiot "error message";
- eidiot "error message";
-</PRE>
-<P>
-<PRE> $url = popurl; #returns current url
- $url = popurl(3); #three levels up
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-Provides a few common subroutines for the web interface.
-
-<P>
-<HR>
-<H1><A NAME="SUBROUTINES">SUBROUTINES</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_header">header TITLE, MENUBAR</A></STRONG><DD>
-<P>
-Returns an HTML header.
-
-<DT><STRONG><A NAME="item_menubar">menubar ITEM, URL, ...</A></STRONG><DD>
-<P>
-Returns an HTML menubar.
-
-<DT><STRONG><A NAME="item_idiot">idiot ERROR</A></STRONG><DD>
-<P>
-This is depriciated. Don't use it.
-
-<P>
-Sends headers and an HTML error message.
-
-<DT><STRONG><A NAME="item_eidiot">eidiot ERROR</A></STRONG><DD>
-<P>
-This is depriciated. Don't use it.
-
-<P>
-Sends headers and an HTML error message, then exits.
-
-<DT><STRONG><A NAME="item_popurl">popurl LEVEL</A></STRONG><DD>
-<P>
-Returns current URL with LEVEL levels of path removed from the end (default
-0).
-
-<DT><STRONG><A NAME="item_table">table</A></STRONG><DD>
-<P>
-Returns HTML tag for beginning a table.
-
-<DT><STRONG><A NAME="item_itable">itable</A></STRONG><DD>
-<P>
-Returns HTML tag for beginning an (invisible) table.
-
-<DT><STRONG><A NAME="item_ntable">ntable</A></STRONG><DD>
-<P>
-This is getting silly.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Not OO.
-
-<P>
-Not complete.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF=".././FS/CGI.html#">the CGI manpage</A>, <A HREF="../CGI/Base.html">CGI::Base</A>
-
-
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::Conf - Read access to Freeside configuration values</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::Conf - Read access to Freeside configuration values
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::Conf;
-</PRE>
-<P>
-<PRE> $conf = new FS::Conf "/config/directory";
-</PRE>
-<P>
-<PRE> $FS::Conf::default_dir = "/config/directory";
- $conf = new FS::Conf;
-</PRE>
-<P>
-<PRE> $dir = $conf->dir;
-</PRE>
-<P>
-<PRE> $value = $conf->config('key');
- @list = $conf->config('key');
- $bool = $conf->exists('key');
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-Read access to Freeside configuration values. Keys currently map to
-filenames, but this may change in the future.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new [ DIRECTORY ]</A></STRONG><DD>
-<P>
-Create a new configuration object. A directory arguement is required if
-$FS::Conf::default_dir has not been set.
-
-<DT><STRONG><A NAME="item_dir">dir</A></STRONG><DD>
-<P>
-Returns the directory.
-
-<DT><STRONG><A NAME="item_config">config</A></STRONG><DD>
-<P>
-Returns the configuration value or values (depending on context) for key.
-
-<DT><STRONG><A NAME="item_exists">exists</A></STRONG><DD>
-<P>
-Returns true if the specified key exists, even if the corresponding value
-is undefined.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Write access (with locking) should be implemented.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-config.html from the base documentation contains a list of configuration
-files.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::Invoice - Legacy stub</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::Invoice - Legacy stub
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-The functionality of FS::Invoice has been integrated in FS::cust_bill.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::Record - Database record objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#CONSTRUCTORS">CONSTRUCTORS</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#SUBROUTINES">SUBROUTINES</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::Record - Database record objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::Record;
- use FS::Record qw(dbh fields qsearch qsearchs dbdef);
-</PRE>
-<P>
-<PRE> $record = new FS::Record 'table', \%hash;
- $record = new FS::Record 'table', { 'column' => 'value', ... };
-</PRE>
-<P>
-<PRE> $record = qsearchs FS::Record 'table', \%hash;
- $record = qsearchs FS::Record 'table', { 'column' => 'value', ... };
- @records = qsearch FS::Record 'table', \%hash;
- @records = qsearch FS::Record 'table', { 'column' => 'value', ... };
-</PRE>
-<P>
-<PRE> $table = $record->table;
- $dbdef_table = $record->dbdef_table;
-</PRE>
-<P>
-<PRE> $value = $record->get('column');
- $value = $record->getfield('column');
- $value = $record->column;
-</PRE>
-<P>
-<PRE> $record->set( 'column' => 'value' );
- $record->setfield( 'column' => 'value' );
- $record->column('value');
-</PRE>
-<P>
-<PRE> %hash = $record->hash;
-</PRE>
-<P>
-<PRE> $hashref = $record->hashref;
-</PRE>
-<P>
-<PRE> $error = $record->insert;
- #$error = $record->add; #depriciated
-</PRE>
-<P>
-<PRE> $error = $record->delete;
- #$error = $record->del; #depriciated
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
- #$error = $new_record->rep($old_record); #depriciated
-</PRE>
-<P>
-<PRE> $value = $record->unique('column');
-</PRE>
-<P>
-<PRE> $value = $record->ut_float('column');
- $value = $record->ut_number('column');
- $value = $record->ut_numbern('column');
- $value = $record->ut_money('column');
- $value = $record->ut_text('column');
- $value = $record->ut_textn('column');
- $value = $record->ut_alpha('column');
- $value = $record->ut_alphan('column');
- $value = $record->ut_phonen('column');
- $value = $record->ut_anythingn('column');
-</PRE>
-<P>
-<PRE> $dbdef = reload_dbdef;
- $dbdef = reload_dbdef "/non/standard/filename";
- $dbdef = dbdef;
-</PRE>
-<P>
-<PRE> $quoted_value = _quote($value,'table','field');
-</PRE>
-<P>
-<PRE> #depriciated
- $fields = hfields('table');
- if ( $fields->{Field} ) { # etc.
-</PRE>
-<P>
-<PRE> @fields = fields 'table'; #as a subroutine
- @fields = $record->fields; #as a method call
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-(Mostly) object-oriented interface to database records. Records are
-currently implemented on top of DBI. FS::Record is intended as a base class
-for table-specific classes to inherit from, i.e. FS::cust_main.
-
-<P>
-<HR>
-<H1><A NAME="CONSTRUCTORS">CONSTRUCTORS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new [ TABLE, ] HASHREF</A></STRONG><DD>
-<P>
-Creates a new record. It doesn't store it in the database, though. See
-<A HREF="#insert">insert</A> for that.
-
-<P>
-Note that the object stores this hash reference, not a distinct copy of the
-hash it points to. You can ask the object for a copy with the <EM>hash</EM>
-method.
-
-<P>
-TABLE can only be omitted when a dervived class overrides the table method.
-
-<DT><STRONG><A NAME="item_qsearch">qsearch TABLE, HASHREF</A></STRONG><DD>
-<P>
-Searches the database for all records matching (at least) the key/value
-pairs in HASHREF. Returns all the records found as `FS::TABLE' objects if
-that module is loaded (i.e. via `use FS::cust_main;'), otherwise returns
-FS::Record objects.
-
-<DT><STRONG><A NAME="item_qsearchs">qsearchs TABLE, HASHREF</A></STRONG><DD>
-<P>
-Same as qsearch, except that if more than one record matches, it <STRONG>carp</STRONG>s but returns the first. If this happens, you either made a logic error in
-asking for a single item, or your data is corrupted.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_table">table</A></STRONG><DD>
-<P>
-Returns the table name.
-
-<DT><STRONG><A NAME="item_dbdef_table">dbdef_table</A></STRONG><DD>
-<P>
-Returns the FS::dbdef_table object for the table.
-
-<DT><STRONG><A NAME="item_get">get, getfield COLUMN</A></STRONG><DD>
-<P>
-Returns the value of the column/field/key COLUMN.
-
-<DT><STRONG><A NAME="item_set">set, setfield COLUMN, VALUE</A></STRONG><DD>
-<P>
-Sets the value of the column/field/key COLUMN to VALUE. Returns VALUE.
-
-<DT><STRONG><A NAME="item_AUTLOADED">AUTLOADED METHODS</A></STRONG><DD>
-<P>
-$record->column is a synonym for $record->get('column');
-
-<P>
-$record->column('value') is a synonym for
-$record->set('column','value');
-
-<DT><STRONG><A NAME="item_hash">hash</A></STRONG><DD>
-<P>
-Returns a list of the column/value pairs, usually for assigning to a new
-hash.
-
-<P>
-To make a distinct duplicate of an FS::Record object, you can do:
-
-<P>
-<PRE> $new = new FS::Record ( $old->table, { $old->hash } );
-</PRE>
-<DT><STRONG><A NAME="item_hashref">hashref</A></STRONG><DD>
-<P>
-Returns a reference to the column/value hash.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Inserts this record to the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_add">add</A></STRONG><DD>
-<P>
-Depriciated (use insert instead).
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Delete this record from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_del">del</A></STRONG><DD>
-<P>
-Depriciated (use delete instead).
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replace the OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_rep">rep</A></STRONG><DD>
-<P>
-Depriciated (use replace instead).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Not yet implemented, croaks. Derived classes should provide a check method.
-
-<DT><STRONG><A NAME="item_unique">unique COLUMN</A></STRONG><DD>
-<P>
-Replaces COLUMN in record with a unique number. Called by the <STRONG>add</STRONG> method on primary keys and single-field unique columns (see <A HREF="../FS/dbdef_table.html">FS::dbdef_table</A>). Returns the new value.
-
-<DT><STRONG><A NAME="item_ut_float">ut_float COLUMN</A></STRONG><DD>
-<P>
-Check/untaint floating point numeric data: 1.1, 1, 1.1e10, 1e10. May not be
-null. If there is an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_ut_number">ut_number COLUMN</A></STRONG><DD>
-<P>
-Check/untaint simple numeric data (whole numbers). May not be null. If
-there is an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_ut_numbern">ut_numbern COLUMN</A></STRONG><DD>
-<P>
-Check/untaint simple numeric data (whole numbers). May be null. If there is
-an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_ut_money">ut_money COLUMN</A></STRONG><DD>
-<P>
-Check/untaint monetary numbers. May be negative. Set to 0 if null. If there
-is an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_ut_text">ut_text COLUMN</A></STRONG><DD>
-<P>
-Check/untaint text. Alphanumerics, spaces, and the following punctuation
-symbols are currently permitted: ! @ # $ % & ( ) - + ; : ' `` , . ? /
-May not be null. If there is an error, returns the error, otherwise returns
-false.
-
-<DT><STRONG><A NAME="item_ut_textn">ut_textn COLUMN</A></STRONG><DD>
-<P>
-Check/untaint text. Alphanumerics, spaces, and the following punctuation
-symbols are currently permitted: ! @ # $ % & ( ) - + ; : ' `` , . ? /
-May be null. If there is an error, returns the error, otherwise returns
-false.
-
-<DT><STRONG><A NAME="item_ut_alpha">ut_alpha COLUMN</A></STRONG><DD>
-<P>
-Check/untaint alphanumeric strings (no spaces). May not be null. If there
-is an error, returns the error, otherwise returns false.
-
-<DT><STRONG>ut_alpha COLUMN</STRONG><DD>
-<P>
-Check/untaint alphanumeric strings (no spaces). May be null. If there is an
-error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_ut_phonen">ut_phonen COLUMN</A></STRONG><DD>
-<P>
-Check/untaint phone numbers. May be null. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_ut_anything">ut_anything COLUMN</A></STRONG><DD>
-<P>
-Untaints arbitrary data. Be careful.
-
-<DT><STRONG><A NAME="item_fields">fields [ TABLE ]</A></STRONG><DD>
-<P>
-This can be used as both a subroutine and a method call. It returns a list
-of the columns in this record's table, or an explicitly specified table.
-(See <A HREF="../FS/dbdef_table.html">FS::dbdef_table</A>).
-
-<H1><A NAME="SUBROUTINES">SUBROUTINES</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_reload_dbdef">reload_dbdef([FILENAME])</A></STRONG><DD>
-<P>
-Load a database definition (see <A HREF="../FS/dbdef.html">FS::dbdef</A>), optionally from a non-default filename. This command is executed at
-startup unless
-<EM>$FS::Record::setup_hack</EM> is true. Returns a FS::dbdef object.
-
-<DT><STRONG><A NAME="item_dbdef">dbdef</A></STRONG><DD>
-<P>
-Returns the current database definition. See <A HREF="../FS/dbdef.html">FS::dbdef</A>.
-
-<DT><STRONG><A NAME="item__quote">_quote VALUE, TABLE, COLUMN</A></STRONG><DD>
-<P>
-This is an internal function used to construct SQL statements. It returns
-VALUE DBI-quoted (see <EM>DBI</EM>) unless VALUE is a number and the column type (see <A HREF="../FS/dbdef_column.html">FS::dbdef_column</A>) does not end in `char' or `binary'.
-
-<DT><STRONG><A NAME="item_hfields">hfields TABLE</A></STRONG><DD>
-<P>
-This is depriciated. Don't use it.
-
-<P>
-It returns a hash-type list with the fields of this record's table set
-true.
-
-</DL>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: Record.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-This module should probably be renamed, since much of the functionality is
-of general use. It is not completely unlike Adapter::DBI (see below).
-
-<P>
-Exported qsearch and qsearchs should be depriciated in favor of method
-calls (against an FS::Record object like the old search and searchs that
-qsearch and qsearchs were on top of.)
-
-<P>
-The whole fields / hfields mess should be removed.
-
-<P>
-The various WHERE clauses should be subroutined.
-
-<P>
-table string should be depriciated in favor of FS::dbdef_table.
-
-<P>
-No doubt we could benefit from a Tied hash. Documenting how exists /
-defined true maps to the database (and WHERE clauses) would also help.
-
-<P>
-The ut_ methods should ask the dbdef for a default length.
-
-<P>
-ut_sqltype (like ut_varchar) should all be defined
-
-<P>
-A fallback check method should be provided whith uses the dbdef.
-
-<P>
-The ut_money method assumes money has two decimal digits.
-
-<P>
-The Pg money kludge in the new method only strips `$'.
-
-<P>
-The ut_phonen method assumes US-style phone numbers.
-
-<P>
-The _quote function should probably use ut_float instead of a regex.
-
-<P>
-All the subroutines probably should be methods, here or elsewhere.
-
-<P>
-Probably should borrow/use some dbdef methods where appropriate (like sub
-fields)
-
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/dbdef.html">FS::dbdef</A>, <A HREF="../FS/UID.html">FS::UID</A>, <EM>DBI</EM>
-
-
-
-<P>
-Adapter::DBI from Ch. 11 of Advanced Perl Programming by Sriram Srinivasan.
-
-</DL>
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::SSH - Subroutines to call ssh and scp</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#SUBROUTINES">SUBROUTINES</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::SSH - Subroutines to call ssh and scp
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::SSH qw(ssh scp issh iscp sshopen2 sshopen3);
-</PRE>
-<P>
-<PRE> ssh($host, $command);
-</PRE>
-<P>
-<PRE> issh($host, $command);
-</PRE>
-<P>
-<PRE> scp($source, $destination);
-</PRE>
-<P>
-<PRE> iscp($source, $destination);
-</PRE>
-<P>
-<PRE> sshopen2($host, $reader, $writer, $command);
-</PRE>
-<P>
-<PRE> sshopen3($host, $reader, $writer, $error, $command);
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-<PRE> Simple wrappers around ssh and scp commands.
-</PRE>
-<P>
-<HR>
-<H1><A NAME="SUBROUTINES">SUBROUTINES</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_ssh">ssh HOST, COMMAND</A></STRONG><DD>
-<P>
-Calls ssh in batch mode.
-
-<DT><STRONG><A NAME="item_issh">issh HOST, COMMAND</A></STRONG><DD>
-<P>
-Prints the ssh command to be executed, waits for the user to confirm, and
-(optionally) executes the command.
-
-<DT><STRONG><A NAME="item_scp">scp SOURCE, DESTINATION</A></STRONG><DD>
-<P>
-Calls scp in batch mode.
-
-<DT><STRONG><A NAME="item_iscp">iscp SOURCE, DESTINATION</A></STRONG><DD>
-<P>
-Prints the scp command to be executed, waits for the user to confirm, and
-(optionally) executes the command.
-
-<DT><STRONG><A NAME="item_sshopen2">sshopen2 HOST, READER, WRITER, COMMAND</A></STRONG><DD>
-<P>
-Connects the supplied filehandles to the ssh process (in batch mode).
-
-<DT><STRONG><A NAME="item_sshopen3">sshopen3 HOST, WRITER, READER, ERROR, COMMAND</A></STRONG><DD>
-<P>
-Connects the supplied filehandles to the ssh process (in batch mode).
-
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Not OO.
-
-<P>
-scp stuff should transparantly use rsync-over-ssh instead.
-
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<EM>ssh</EM>, <EM>scp</EM>, <A HREF="../IPC/Open2.html">IPC::Open2</A>, <A HREF="../IPC/Open3.html">IPC::Open3</A>
-
-
-
-</DL>
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::UI::Base - Base class for all user-interface objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
- <LI><A HREF="#HISTORY">HISTORY</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::UI::Base - Base class for all user-interface objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::UI::SomeInterface;
- use FS::UI::some_table;
-</PRE>
-<P>
-<PRE> $interface = new FS::UI::some_table;
-</PRE>
-<P>
-<PRE> $error = $interface->browse;
- $error = $interface->search;
- $error = $interface->view;
- $error = $interface->edit;
- $error = $interface->process;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::UI::Base object represents a user interface object. FS::UI::Base is
-intended as a base class for table-specfic classes to inherit from, i.e.
-FS::UI::cust_main. The simplest case, which will provide a default UI for
-your new table, is as follows:
-
-<P>
-<PRE> package FS::UI::table_name;
- use vars qw ( @ISA );
- use FS::UI::Base;
- @ISA = qw( FS::UI::Base );
- sub db_table { 'table_name'; }
-</PRE>
-<P>
-Currently available interfaces are: FS::UI::Gtk, an X-Windows UI
-implemented using the Gtk+ toolkit FS::UI::CGI, a web interface implemented
-using CGI.pm, etc.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new</A></STRONG><DD>
-<DT><STRONG><A NAME="item_browse">browse</A></STRONG><DD>
-<DT><STRONG><A NAME="item_title">title</A></STRONG><DD>
-<DT><STRONG><A NAME="item_addwidget">addwidget</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: Base.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-This documentation is incomplete.
-
-<P>
-There should be some sort of per-(freeside)-user preferences and the
-ability for specific FS::UI:: modules to put their own values there as
-well.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../../FS/UI/Gtk.html">FS::UI::Gtk</A>, <A HREF="../../FS/UI/CGI.html">FS::UI::CGI</A>
-
-
-
-<P>
-<HR>
-<H1><A NAME="HISTORY">HISTORY</A></H1>
-<P>
-$Log: Base.html,v $
-Revision 1.1 1999-08-04 12:13:27 ivan
-new HTML manpages
- Revision 1.1 1999/08/04 09:03:53 ivan initial checkin of
-module files for proper perl installation
-
-<P>
-Revision 1.1 1999/01/20 09:30:36 ivan skeletal cross-UI UI code.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::UI::CGI - Base class for CGI user-interface objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
- <LI><A HREF="#HISTORY">HISTORY</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::UI::CGI - Base class for CGI user-interface objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::UI::CGI;
- use FS::UI::some_table;
-</PRE>
-<P>
-<PRE> $interface = new FS::UI::some_table;
-</PRE>
-<P>
-<PRE> $error = $interface->browse;
- $error = $interface->search;
- $error = $interface->view;
- $error = $interface->edit;
- $error = $interface->process;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::UI::CGI object represents a CGI interface object.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new</A></STRONG><DD>
-<DT><STRONG><A NAME="item__header">_header</A></STRONG><DD>
-<DT><STRONG><A NAME="item__footer">_footer</A></STRONG><DD>
-<DT><STRONG><A NAME="item_interface">interface</A></STRONG><DD>
-<P>
-Returns the string `CGI'. Useful for the author of a table-specific UI
-class to conditionally specify certain behaviour.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: CGI.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-This documentation is incomplete.
-
-<P>
-In _Tableborder, headers should be links that sort on their fields.
-
-<P>
-_Link uses a constant <CODE>$BASE_URL</CODE>
-
-<P>
-_Link passes the arguments as a manually-constructed GET string instead of
-POSTing, for compatability while the web interface is upgraded. Once this
-is done it should pass arguements properly (i.e. as a POST, 8-bit clean)
-
-<P>
-Still some small bits of widget code same as FS::UI::Gtk.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../../FS/UI/Base.html">FS::UI::Base</A>
-
-
-
-<P>
-<HR>
-<H1><A NAME="HISTORY">HISTORY</A></H1>
-<P>
-$Log: CGI.html,v $
-Revision 1.1 1999-08-04 12:13:27 ivan
-new HTML manpages
- Revision 1.1 1999/08/04 09:03:53 ivan initial checkin of
-module files for proper perl installation
-
-<P>
-Revision 1.1 1999/01/20 09:30:36 ivan skeletal cross-UI UI code.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::UI::Gtk - Base class for Gtk user-interface objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
- <LI><A HREF="#HISTORY">HISTORY</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::UI::Gtk - Base class for Gtk user-interface objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::UI::Gtk;
- use FS::UI::some_table;
-</PRE>
-<P>
-<PRE> $interface = new FS::UI::some_table;
-</PRE>
-<P>
-<PRE> $error = $interface->browse;
- $error = $interface->search;
- $error = $interface->view;
- $error = $interface->edit;
- $error = $interface->process;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::UI::Gtk object represents a Gtk user interface object.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new</A></STRONG><DD>
-<DT><STRONG><A NAME="item_interface">interface</A></STRONG><DD>
-<P>
-Returns the string `Gtk'. Useful for the author of a table-specific UI
-class to conditionally specify certain behaviour.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: Gtk.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-This documentation is incomplete.
-
-<P>
-_Tableborder is just a _Table now. _Tableborders should scroll (but not the
-headers) and need and need more decoration. (data in white section ala
-gtksql and sliding field widths) headers should be buttons that callback to
-sort on their fields.
-
-<P>
-There should be a persistant, per-(freeside)-user store for window
-positions and sizes and sort fields etc (see <A HREF="../../FS/UI/CGI.html#BUGS">BUGS</A>.
-
-<P>
-Still some small bits of widget code same as FS::UI::CGI.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../../FS/UI/Base.html">FS::UI::Base</A>
-
-
-
-<P>
-<HR>
-<H1><A NAME="HISTORY">HISTORY</A></H1>
-<P>
-$Log: Gtk.html,v $
-Revision 1.1 1999-08-04 12:13:27 ivan
-new HTML manpages
- Revision 1.1 1999/08/04 09:03:53 ivan initial checkin of
-module files for proper perl installation
-
-<P>
-Revision 1.1 1999/01/20 09:30:36 ivan skeletal cross-UI UI code.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::UID - Subroutines for database login and assorted other stuff</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#SUBROUTINES">SUBROUTINES</A>
- <LI><A HREF="#CALLBACKS">CALLBACKS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::UID - Subroutines for database login and assorted other stuff
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::UID qw(adminsuidsetup cgisuidsetup dbh datasrc getotaker
- checkeuid checkruid swapuid);
-</PRE>
-<P>
-<PRE> adminsuidsetup $user;
-</PRE>
-<P>
-<PRE> $cgi = new CGI;
- $dbh = cgisuidsetup($cgi);
-</PRE>
-<P>
-<PRE> $dbh = dbh;
-</PRE>
-<P>
-<PRE> $datasrc = datasrc;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-Provides a hodgepodge of subroutines.
-
-<P>
-<HR>
-<H1><A NAME="SUBROUTINES">SUBROUTINES</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_adminsuidsetup">adminsuidsetup USER</A></STRONG><DD>
-<P>
-Sets the user to USER (see config.html from the base documentation). Cleans
-the environment. Make sure the script is running as freeside, or setuid
-freeside. Opens a connection to the database. Swaps real and effective
-UIDs. Runs any defined callbacks (see below). Returns the DBI database
-handle (usually you don't need this).
-
-<DT><STRONG><A NAME="item_cgisuidsetup">cgisuidsetup CGI_object</A></STRONG><DD>
-<P>
-Stores the CGI (see <A HREF=".././FS/CGI.html#">the CGI manpage</A>) object for later use. (CGI::Base is depriciated) Runs adminsuidsetup.
-
-<DT><STRONG><A NAME="item_cgi">cgi</A></STRONG><DD>
-<P>
-Returns the CGI (see <A HREF=".././FS/CGI.html#">the CGI manpage</A>) object.
-
-<DT><STRONG><A NAME="item_dbh">dbh</A></STRONG><DD>
-<P>
-Returns the DBI database handle.
-
-<DT><STRONG><A NAME="item_datasrc">datasrc</A></STRONG><DD>
-<P>
-Returns the DBI data source.
-
-<DT><STRONG><A NAME="item_getotaker">getotaker</A></STRONG><DD>
-<P>
-Returns the current Freeside user.
-
-<DT><STRONG><A NAME="item_cgisetotaker">cgisetotaker</A></STRONG><DD>
-<P>
-Sets and returns the CGI REMOTE_USER. <A HREF="#item__cgi">$cgi</A> should
-be defined as a CGI.pm object. Support for CGI::Base and derived classes is
-depriciated.
-
-<DT><STRONG><A NAME="item_checkeuid">checkeuid</A></STRONG><DD>
-<P>
-Returns true if effective UID is that of the freeside user.
-
-<DT><STRONG><A NAME="item_checkruid">checkruid</A></STRONG><DD>
-<P>
-Returns true if the real UID is that of the freeside user.
-
-<DT><STRONG><A NAME="item_swapuid">swapuid</A></STRONG><DD>
-<P>
-Swaps real and effective UIDs.
-
-<DT><STRONG><A NAME="item_getsecrets">getsecrets [ USER ]</A></STRONG><DD>
-<P>
-Sets the user to USER, if supplied. Sets and returns the DBI datasource,
-username and password for this user from the
-`/usr/local/etc/freeside/mapsecrets' file.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="CALLBACKS">CALLBACKS</A></H1>
-<P>
-Warning: this interface is likely to change in future releases.
-
-<P>
-A package can install a callback to be run in adminsuidsetup by putting a
-coderef into the hash %FS::UID::callback :
-
-<P>
-<PRE> $coderef = sub { warn "Hi, I'm returning your call!" };
- $FS::UID::callback{'Package::Name'};
-</PRE>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: UID.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Too many package-global variables.
-
-<P>
-Not OO.
-
-<P>
-No capabilities yet. When mod_perl and Authen::DBI are implemented,
-cgisuidsetup will go away as well.
-
-<P>
-Goes through contortions to support non-OO syntax with multiple datasrc's.
-
-<P>
-Callbacks are inelegant.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF=".././FS/CGI.html#">the CGI manpage</A>, <EM>DBI</EM>, config.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::agent - Object methods for agent records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::agent - Object methods for agent records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::agent;
-</PRE>
-<P>
-<PRE> $record = new FS::agent \%hash;
- $record = new FS::agent { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> $agent_type = $record->agent_type;
-</PRE>
-<P>
-<PRE> $hashref = $record->pkgpart_hashref;
- #may purchase $pkgpart if $hashref->{$pkgpart};
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::agent object represents an agent. Every customer has an agent.
-Agents can be used to track things like resellers or salespeople. FS::agent
-inherits from FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_agemtnum">agemtnum - primary key (assigned automatically for new agents)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_agent">agent - Text name of this agent</A></STRONG><DD>
-<DT><STRONG><A NAME="item_typenum">typenum - Agent type. See FS::agent_type</A></STRONG><DD>
-<DT><STRONG><A NAME="item_prog">prog - For future use.</A></STRONG><DD>
-<DT><STRONG><A NAME="item_freq">freq - For future use.</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new agent. To add the agent to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this agent to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this agent from the database. Only agents with no customers can be
-deleted. If there is an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid agent. If there is an error,
-returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-<DT><STRONG><A NAME="item_agent_type">agent_type</A></STRONG><DD>
-<P>
-Returns the FS::agent_type object (see <A HREF="../FS/agent_type.html">FS::agent_type</A>) for this agent.
-
-<DT><STRONG><A NAME="item_pkgpart_hashref">pkgpart_hashref</A></STRONG><DD>
-<P>
-Returns a hash reference. The keys of the hash are pkgparts. The value is
-true iff this agent may purchase the specified package definition. See
-<A HREF="../FS/part_pkg.html">FS::part_pkg</A>.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: agent.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/agent_type.html">FS::agent_type</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>, <A HREF="../FS/part_pkg.html">FS::part_pkg</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::agent_type - Object methods for agent_type records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::agent_type - Object methods for agent_type records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::agent_type;
-</PRE>
-<P>
-<PRE> $record = new FS::agent_type \%hash;
- $record = new FS::agent_type { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> $hashref = $record->pkgpart_hashref;
- #may purchase $pkgpart if $hashref->{$pkgpart};
-</PRE>
-<P>
-<PRE> @type_pkgs = $record->type_pkgs;
-</PRE>
-<P>
-<PRE> @pkgparts = $record->pkgpart;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::agent_type object represents an agent type. Every agent (see
-<A HREF="../FS/agent.html">FS::agent</A>) has an agent type. Agent types define which packages (see
-<A HREF="../FS/part_pkg.html">FS::part_pkg</A>) may be purchased by customers (see <A HREF="../FS/cust_main.html">FS::cust_main</A>), via FS::type_pkgs records (see <A HREF="../FS/type_pkgs.html">FS::type_pkgs</A>). FS::agent_type inherits from FS::Record. The following fields are
-currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_typenum">typenum - primary key (assigned automatically for new agent types)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_atype">atype - Text name of this agent type</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new agent type. To add the agent type to the database, see
-<A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this agent type to the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this agent type from the database. Only agent types with no agents
-can be deleted. If there is an error, returns the error, otherwise returns
-false.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid agent type. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-<DT><STRONG><A NAME="item_pkgpart_hashref">pkgpart_hashref</A></STRONG><DD>
-<P>
-Returns a hash reference. The keys of the hash are pkgparts. The value is
-true iff this agent may purchase the specified package definition. See
-<A HREF="../FS/part_pkg.html">FS::part_pkg</A>.
-
-<DT><STRONG><A NAME="item_type_pkgs">type_pkgs</A></STRONG><DD>
-<P>
-Returns all FS::type_pkgs objects (see <A HREF="../FS/type_pkgs.html">FS::type_pkgs</A>) for this agent type.
-
-<DT><STRONG><A NAME="item_pkgpart">pkgpart</A></STRONG><DD>
-<P>
-Returns the pkgpart of all package definitions (see <A HREF="../FS/part_pkg.html">FS::part_pkg</A>) for this agent type.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: agent_type.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/agent.html">FS::agent</A>, <A HREF="../FS/type_pkgs.html">FS::type_pkgs</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>,
-<A HREF="../FS/part_pkg.html">FS::part_pkg</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_bill - Object methods for cust_bill records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_bill - Object methods for cust_bill records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_bill;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_bill \%hash;
- $record = new FS::cust_bill { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> ( $total_previous_balance, @previous_cust_bill ) = $record->previous;
-</PRE>
-<P>
-<PRE> @cust_bill_pkg_objects = $cust_bill->cust_bill_pkg;
-</PRE>
-<P>
-<PRE> ( $total_previous_credits, @previous_cust_credit ) = $record->cust_credit;
-</PRE>
-<P>
-<PRE> @cust_pay_objects = $cust_bill->cust_pay;
-</PRE>
-<P>
-<PRE> @lines = $cust_bill->print_text;
- @lines = $cust_bill->print_text $time;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_bill object represents an invoice. FS::cust_bill inherits from
-FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_invnum">invnum - primary key (assigned automatically for new invoices)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_custnum">custnum - customer (see FS::cust_main)</A></STRONG><DD>
-<DT><STRONG><A NAME="item__date">_date - specified as a UNIX timestamp; see perlfunc/"time". Also see
-Time::Local and Date::Parse for conversion functions.</A></STRONG><DD>
-<DT><STRONG><A NAME="item_charged">charged - amount of this invoice</A></STRONG><DD>
-<DT><STRONG><A NAME="item_owed">owed - amount still outstanding on this invoice, which is charged minus
-all payments (see FS::cust_pay).</A></STRONG><DD>
-<DT><STRONG><A NAME="item_printed">printed - how many times this invoice has been printed automatically
-(see FS::cust_main/"collect").</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new invoice. To add the invoice to the database, see <A HREF="#insert">insert</A>. Invoices are normally created by calling the bill method of a customer
-object (see <A HREF="../FS/cust_main.html">FS::cust_main</A>).
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this invoice to the database (``Posts'' the invoice). If there is an
-error, returns the error, otherwise returns false.
-
-<P>
-When adding new invoices, owed must be charged (or null, in which case it
-is automatically set to charged).
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented. I don't remove invoices because there would then
-be no record you ever posted this invoice (which is bad, no?)
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces the OLD_RECORD with this one in the database. If there is an
-error, returns the error, otherwise returns false.
-
-<P>
-Only owed and printed may be changed. Owed is normally updated by creating
-and inserting a payment (see <A HREF="../FS/cust_pay.html">FS::cust_pay</A>). Printed is normally updated by calling the collect method of a customer
-object (see <A HREF="../FS/cust_main.html">FS::cust_main</A>).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid invoice. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-<DT><STRONG><A NAME="item_previous">previous</A></STRONG><DD>
-<P>
-Returns a list consisting of the total previous balance for this customer,
-followed by the previous outstanding invoices (as FS::cust_bill objects
-also).
-
-<DT><STRONG><A NAME="item_cust_bill_pkg">cust_bill_pkg</A></STRONG><DD>
-<P>
-Returns the line items (see <A HREF="../FS/cust_bill_pkg.html">FS::cust_bill_pkg</A>) for this invoice.
-
-<DT><STRONG><A NAME="item_cust_credit">cust_credit</A></STRONG><DD>
-<P>
-Returns a list consisting of the total previous credited (see
-<A HREF="../FS/cust_credit.html">FS::cust_credit</A>) for this customer, followed by the previous outstanding credits
-(FS::cust_credit objects).
-
-<DT><STRONG><A NAME="item_cust_pay">cust_pay</A></STRONG><DD>
-<P>
-Returns all payments (see <A HREF="../FS/cust_pay.html">FS::cust_pay</A>) for this invoice.
-
-<DT><STRONG><A NAME="item_print_text">print_text [TIME];</A></STRONG><DD>
-<P>
-Returns an ASCII invoice, as a list of lines.
-
-<P>
-TIME an optional value used to control the printing of overdue messages.
-The default is now. It isn't the date of the invoice; that's the `_date'
-field. It is specified as a UNIX timestamp; see <EM>perlfunc</EM>. Also see
-<A HREF="../Time/Local.html">Time::Local</A> and <A HREF="../Date/Parse.html">Date::Parse</A> for conversion functions.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_bill.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The delete method.
-
-<P>
-print_text formatting (and some logic :/) is in source, but needs to be
-slurped in from a file. Also number of lines ($=).
-
-<P>
-missing print_ps for a nice postscript copy (maybe HylaFAX-cover-page-style
-or something similar so the look can be completely customized?)
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>, <A HREF="../FS/cust_pay.html">FS::cust_pay</A>, <A HREF="../FS/cust_bill_pkg.html">FS::cust_bill_pkg</A>,
-<A HREF="../FS/cust_credit.html">FS::cust_credit</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_bill_pkg - Object methods for cust_bill_pkg records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_bill_pkg - Object methods for cust_bill_pkg records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_bill_pkg;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_bill_pkg \%hash;
- $record = new FS::cust_bill_pkg { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_bill_pkg object represents an invoice line item.
-FS::cust_bill_pkg inherits from FS::Record. The following fields are
-currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_invnum">invnum - invoice (see FS::cust_bill)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_pkgnum">pkgnum - package (see FS::cust_pkg)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_setup">setup - setup fee</A></STRONG><DD>
-<DT><STRONG><A NAME="item_recur">recur - recurring fee</A></STRONG><DD>
-<DT><STRONG><A NAME="item_sdate">sdate - starting date of recurring fee</A></STRONG><DD>
-<DT><STRONG><A NAME="item_edate">edate - ending date of recurring fee</A></STRONG><DD>
-</DL>
-<P>
-sdate and edate are specified as UNIX timestamps; see <EM>perlfunc</EM>. Also see <A HREF="../Time/Local.html">Time::Local</A> and <A HREF="../Date/Parse.html">Date::Parse</A> for conversion functions.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new line item. To add the line item to the database, see
-<A HREF="#insert">insert</A>. Line items are normally created by calling the bill method of a customer
-object (see <A HREF="../FS/cust_main.html">FS::cust_main</A>).
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this line item to the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented. I don't remove line items because there would then
-be no record the items ever existed (which is bad, no?)
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Currently unimplemented. This would be even more of an accounting nightmare
-than deleteing the items. Just don't do it.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid line item. If there is an
-error, returns the error, otherwise returns false. Called by the insert
-method.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_bill_pkg.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_bill.html">FS::cust_bill</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_credit - Object methods for cust_credit records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_credit - Object methods for cust_credit records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_credit;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_credit \%hash;
- $record = new FS::cust_credit { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_credit object represents a credit. FS::cust_credit inherits
-from FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_crednum">crednum - primary key (assigned automatically for new credits)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_custnum">custnum - customer (see FS::cust_main)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_amount">amount - amount of the credit</A></STRONG><DD>
-<DT><STRONG><A NAME="item_credited">credited - how much of this credit that is still outstanding, which is
-amount minus all refunds (see FS::cust_refund).</A></STRONG><DD>
-<DT><STRONG><A NAME="item__date">_date - specified as a UNIX timestamp; see perlfunc/"time". Also see
-Time::Local and Date::Parse for conversion functions.</A></STRONG><DD>
-<DT><STRONG><A NAME="item_otaker">otaker - order taker (assigned automatically, see FS::UID)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_reason">reason - text</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new credit. To add the credit to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this credit to the database (``Posts'' the credit). If there is an
-error, returns the error, otherwise returns false.
-
-<P>
-When adding new invoices, credited must be amount (or null, in which case
-it is automatically set to amount).
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces the OLD_RECORD with this one in the database. If there is an
-error, returns the error, otherwise returns false.
-
-<P>
-Only credited may be changed. Credited is normally updated by creating and
-inserting a refund (see <A HREF="../FS/cust_refund.html">FS::cust_refund</A>).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid credit. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_credit.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The delete method.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_refund.html">FS::cust_refund</A>, <A HREF="../FS/cust_bill.html">FS::cust_bill</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_main - Object methods for cust_main records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_main - Object methods for cust_main records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_main;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_main \%hash;
- $record = new FS::cust_main { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> @cust_pkg = $record->all_pkgs;
-</PRE>
-<P>
-<PRE> @cust_pkg = $record->ncancelled_pkgs;
-</PRE>
-<P>
-<PRE> $error = $record->bill;
- $error = $record->bill %options;
- $error = $record->bill 'time' => $time;
-</PRE>
-<P>
-<PRE> $error = $record->collect;
- $error = $record->collect %options;
- $error = $record->collect 'invoice_time' => $time,
- 'batch_card' => 'yes',
- 'report_badcard' => 'yes',
- ;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_main object represents a customer. FS::cust_main inherits from
-FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_custnum">custnum - primary key (assigned automatically for new customers)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_agentnum">agentnum - agent (see FS::agent)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_refnum">refnum - referral (see FS::part_referral)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_first">first - name</A></STRONG><DD>
-<DT><STRONG><A NAME="item_last">last - name</A></STRONG><DD>
-<DT><STRONG><A NAME="item_ss">ss - social security number (optional)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_company">company - (optional)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_address1">address1</A></STRONG><DD>
-<DT><STRONG><A NAME="item_address2">address2 - (optional)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_city">city</A></STRONG><DD>
-<DT><STRONG><A NAME="item_county">county - (optional, see FS::cust_main_county)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_state">state - (see FS::cust_main_county)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_zip">zip</A></STRONG><DD>
-<DT><STRONG><A NAME="item_country">country - (see FS::cust_main_county)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_daytime">daytime - phone (optional)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_night">night - phone (optional)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_fax">fax - phone (optional)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_payby">payby - `CARD' (credit cards), `BILL' (billing), or `COMP' (free)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_payinfo">payinfo - card number, P.O.#, or comp issuer (4-8 lowercase alphanumerics; think username)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_paydate">paydate - expiration date, mm/yyyy, m/yyyy, mm/yy or m/yy</A></STRONG><DD>
-<DT><STRONG><A NAME="item_payname">payname - name on card or billing name</A></STRONG><DD>
-<DT><STRONG><A NAME="item_tax">tax - tax exempt, empty or `Y'</A></STRONG><DD>
-<DT><STRONG><A NAME="item_otaker">otaker - order taker (assigned automatically, see FS::UID)</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new customer. To add the customer to the database, see <A HREF="#insert">insert</A>.
-
-<P>
-Note that this stores the hash reference, not a distinct copy of the hash
-it points to. You can ask the object for a copy with the <EM>hash</EM> method.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this customer to the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete NEW_CUSTNUM</A></STRONG><DD>
-<P>
-This deletes the customer. If there is an error, returns the error,
-otherwise returns false.
-
-<P>
-This will completely remove all traces of the customer record. This is not
-what you want when a customer cancels service; for that, cancel all of the
-customer's packages (see <A HREF="../FS/cust_pkg.html#cancel">cancel</A>).
-
-<P>
-If the customer has any packages, you need to pass a new (valid) customer
-number for those packages to be transferred to.
-
-<P>
-You can't delete a customer with invoices (see <A HREF="../FS/cust_bill.html">FS::cust_bill</A>), or credits (see <A HREF="../FS/cust_credit.html">FS::cust_credit</A>).
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces the OLD_RECORD with this one in the database. If there is an
-error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid customer record. If there is
-an error, returns the error, otherwise returns false. Called by the insert
-and repalce methods.
-
-<DT><STRONG><A NAME="item_all_pkgs">all_pkgs</A></STRONG><DD>
-<P>
-Returns all packages (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>) for this customer.
-
-<DT><STRONG><A NAME="item_ncancelled_pkgs">ncancelled_pkgs</A></STRONG><DD>
-<P>
-Returns all non-cancelled packages (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>) for this customer.
-
-<DT><STRONG><A NAME="item_bill">bill OPTIONS</A></STRONG><DD>
-<P>
-Generates invoices (see <A HREF="../FS/cust_bill.html">FS::cust_bill</A>) for this customer. Usually used in conjunction with the collect method.
-
-<P>
-The only currently available option is `time', which bills the customer as
-if it were that time. It is specified as a UNIX timestamp; see
-<EM>perlfunc</EM>). Also see <A HREF="../Time/Local.html">Time::Local</A> and <A HREF="../Date/Parse.html">Date::Parse</A> for conversion functions.
-
-<P>
-If there is an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_collect">collect OPTIONS</A></STRONG><DD>
-<P>
-(Attempt to) collect money for this customer's outstanding invoices (see
-<A HREF="../FS/cust_bill.html">FS::cust_bill</A>). Usually used after the bill method.
-
-<P>
-Depending on the value of `payby', this may print an invoice (`BILL'),
-charge a credit card (`CARD'), or just add any necessary (pseudo-)payment
-(`COMP').
-
-<P>
-If there is an error, returns the error, otherwise returns false.
-
-<P>
-Currently available options are:
-
-<P>
-invoice_time - Use this time when deciding when to print invoices and late
-notices on those invoices. The default is now. It is specified as a UNIX
-timestamp; see <EM>perlfunc</EM>). Also see <A HREF="../Time/Local.html">Time::Local</A> and <A HREF="../Date/Parse.html">Date::Parse</A>
-for conversion functions.
-
-<P>
-batch_card - Set this true to batch cards (see <A HREF=".././FS/cust_pay_batch.html#">the cust_pay_batch manpage</A>). By default, cards are processed immediately, which will generate an
-error if CyberCash is not installed.
-
-<P>
-report_badcard - Set this true if you want bad card transactions to return
-an error. By default, they don't.
-
-<DT><STRONG><A NAME="item_total_owed">total_owed</A></STRONG><DD>
-<P>
-Returns the total owed for this customer on all invoices (see <A HREF="../FS/cust_bill.html">FS::cust_bill</A>).
-
-<DT><STRONG><A NAME="item_total_credited">total_credited</A></STRONG><DD>
-<P>
-Returns the total credits (see <A HREF="../FS/cust_credit.html">FS::cust_credit</A>) for this customer.
-
-<DT><STRONG><A NAME="item_balance">balance</A></STRONG><DD>
-<P>
-Returns the balance for this customer (total owed minus total credited).
-
-<DT><STRONG><A NAME="item_invoicing_list">invoicing_list [ ARRAYREF ]</A></STRONG><DD>
-<P>
-If an arguement is given, sets these email addresses as invoice recipients
-(see <A HREF="../FS/cust_main_invoice.html">FS::cust_main_invoice</A>). Errors are not fatal and are not reported (except as warnings), so use
-check_invoicing_list first.
-
-<P>
-Returns a list of email addresses (with svcnum entries expanded).
-
-<P>
-Note: You can clear the invoicing list by passing an empty ARRAYREF. You
-can check it without disturbing anything by passing nothing.
-
-<P>
-This interface may change in the future.
-
-<DT><STRONG><A NAME="item_check_invoicing_list">check_invoicing_list ARRAYREF</A></STRONG><DD>
-<P>
-Checks these arguements as valid input for the invoicing_list method. If
-there is an error, returns the error, otherwise returns false.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_main.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The delete method.
-
-<P>
-The delete method should possibly take an FS::cust_main object reference
-instead of a scalar customer number.
-
-<P>
-Bill and collect options should probably be passed as references instead of
-a list.
-
-<P>
-CyberCash v2 forces us to define some variables in package main.
-
-<P>
-There should probably be a configuration file with a list of allowed credit
-card types.
-
-<P>
-CyberCash is the only processor.
-
-<P>
-No multiple currency support (probably a larger project than just this
-module).
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/cust_bill.html">FS::cust_bill</A>, <A HREF="../FS/cust_credit.html">FS::cust_credit</A>
-
-<A HREF="../FS/cust_pay_batch.html">FS::cust_pay_batch</A>, <A HREF="../FS/agent.html">FS::agent</A>, <A HREF="../FS/part_referral.html">FS::part_referral</A>,
-<A HREF="../FS/cust_main_county.html">FS::cust_main_county</A>, <A HREF="../FS/cust_main_invoice.html">FS::cust_main_invoice</A>,
-<A HREF="../FS/UID.html">FS::UID</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_main_county - Object methods for cust_main_county objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_main_county - Object methods for cust_main_county objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_main_county;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_main_county \%hash;
- $record = new FS::cust_main_county { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_main_county object represents a tax rate, defined by locale.
-FS::cust_main_county inherits from FS::Record. The following fields are
-currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_taxnum">taxnum - primary key (assigned automatically for new tax rates)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_state">state</A></STRONG><DD>
-<DT><STRONG><A NAME="item_county">county</A></STRONG><DD>
-<DT><STRONG><A NAME="item_country">country</A></STRONG><DD>
-<DT><STRONG><A NAME="item_tax">tax - percentage</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new tax rate. To add the tax rate to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this tax rate to the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this tax rate from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces the OLD_RECORD with this one in the database. If there is an
-error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid tax rate. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_main_county.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>, <A HREF="../FS/cust_bill.html">FS::cust_bill</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_main_invoice - Object methods for cust_main_invoice records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_main_invoice - Object methods for cust_main_invoice records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_main_invoice;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_main_invoice \%hash;
- $record = new FS::cust_main_invoice { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> $email_address = $record->address;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_main_invoice object represents an invoice destination.
-FS::cust_main_invoice inherits from FS::Record. The following fields are
-currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_destnum">destnum - primary key</A></STRONG><DD>
-<DT><STRONG><A NAME="item_custnum">custnum - customer (see FS::cust_main)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_dest">dest - Invoice destination: If numeric, a <a href="#svc_acct">svcnum</a>, if string, a literal email address, or `POST' to enable mailing (the default if no cust_main_invoice records exist)</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new invoice destination. To add the invoice destination to the
-database, see <A HREF="#insert">insert</A>.
-
-<P>
-Note that this stores the hash reference, not a distinct copy of the hash
-it points to. You can ask the object for a copy with the <EM>hash</EM> method.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this record to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Delete this record from the database.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces the OLD_RECORD with this one in the database. If there is an
-error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid invoice destination. If
-there is an error, returns the error, otherwise returns false. Called by
-the insert and repalce methods.
-
-<DT><STRONG><A NAME="item_checkdest">checkdest</A></STRONG><DD>
-<P>
-Checks the dest field only.
-
-<DT><STRONG><A NAME="item_address">address</A></STRONG><DD>
-<P>
-Returns the literal email address for this record (or `POST').
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_main_invoice.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>
-
-
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_pay - Object methods for cust_pay objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_pay - Object methods for cust_pay objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_pay;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_pay \%hash;
- $record = new FS::cust_pay { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_pay object represents a payment. FS::cust_pay inherits from
-FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_paynum">paynum - primary key (assigned automatically for new payments)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_invnum">invnum - Invoice (see FS::cust_bill)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_paid">paid - Amount of this payment</A></STRONG><DD>
-<DT><STRONG><A NAME="item__date">_date - specified as a UNIX timestamp; see perlfunc/"time". Also see
-Time::Local and Date::Parse for conversion functions.</A></STRONG><DD>
-<DT><STRONG><A NAME="item_payby">payby - `CARD' (credit cards), `BILL' (billing), or `COMP' (free)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_payinfo">payinfo - card number, P.O.#, or comp issuer (4-8 lowercase alphanumerics; think username)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_paybatch">paybatch - text field for tracking card processing</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new payment. To add the payment to the databse, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this payment to the databse, and updates the invoice (see
-<A HREF="../FS/cust_bill.html">FS::cust_bill</A>).
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented (accounting reasons).
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Currently unimplemented (accounting reasons).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid payment. If there is an
-error, returns the error, otherwise returns false. Called by the insert
-method.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_pay.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Delete and replace methods.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_bill.html">FS::cust_bill</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_pay_batch - Object methods for batch cards</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_pay_batch - Object methods for batch cards
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_pay_batch;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_pay_batch \%hash;
- $record = new FS::cust_pay_batch { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_pay_batch object represents a credit card transaction ready to
-be batched (sent to a processor). FS::cust_pay_batch inherits from
-FS::Record. Typically called by the collect method of an FS::cust_main
-object. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_trancode">trancode - 77 for charges</A></STRONG><DD>
-<DT><STRONG><A NAME="item_cardnum">cardnum</A></STRONG><DD>
-<DT><STRONG><A NAME="item_exp">exp - card expiration</A></STRONG><DD>
-<DT><STRONG><A NAME="item_amount">amount</A></STRONG><DD>
-<DT><STRONG><A NAME="item_invnum">invnum - invoice</A></STRONG><DD>
-<DT><STRONG><A NAME="item_custnum">custnum - customer</A></STRONG><DD>
-<DT><STRONG><A NAME="item_payname">payname - name on card</A></STRONG><DD>
-<DT><STRONG><A NAME="item_first">first - name</A></STRONG><DD>
-<DT><STRONG><A NAME="item_last">last - name</A></STRONG><DD>
-<DT><STRONG><A NAME="item_address1">address1</A></STRONG><DD>
-<DT><STRONG><A NAME="item_address2">address2</A></STRONG><DD>
-<DT><STRONG><A NAME="item_city">city</A></STRONG><DD>
-<DT><STRONG><A NAME="item_state">state</A></STRONG><DD>
-<DT><STRONG><A NAME="item_zip">zip</A></STRONG><DD>
-<DT><STRONG><A NAME="item_country">country</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new record. To add the record to the database, see <A HREF="#insert">insert</A>.
-
-<P>
-Note that this stores the hash reference, not a distinct copy of the hash
-it points to. You can ask the object for a copy with the <EM>hash</EM> method.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this record to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Delete this record from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-#inactive # #Replaces the OLD_RECORD with this one in the database. If
-there is an error, #returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid transaction. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-repalce methods.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_pay_batch.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-There should probably be a configuration file with a list of allowed credit
-card types.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/cust_main.html">FS::cust_main</A>, <A HREF="../FS/Record.html">FS::Record</A>
-
-
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_pkg - Object methods for cust_pkg objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#SUBROUTINES">SUBROUTINES</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_pkg - Object methods for cust_pkg objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_pkg;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_pkg \%hash;
- $record = new FS::cust_pkg { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> $error = $record->cancel;
-</PRE>
-<P>
-<PRE> $error = $record->suspend;
-</PRE>
-<P>
-<PRE> $error = $record->unsuspend;
-</PRE>
-<P>
-<PRE> $part_pkg = $record->part_pkg;
-</PRE>
-<P>
-<PRE> @labels = $record->labels;
-</PRE>
-<P>
-<PRE> $error = FS::cust_pkg::order( $custnum, \@pkgparts );
- $error = FS::cust_pkg::order( $custnum, \@pkgparts, \@remove_pkgnums ] );
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_pkg object represents a customer billing item. FS::cust_pkg
-inherits from FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_pkgnum">pkgnum - primary key (assigned automatically for new billing items)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_custnum">custnum - Customer (see FS::cust_main)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_pkgpart">pkgpart - Billing item definition (see FS::part_pkg)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_setup">setup - date</A></STRONG><DD>
-<DT><STRONG><A NAME="item_bill">bill - date</A></STRONG><DD>
-<DT><STRONG><A NAME="item_susp">susp - date</A></STRONG><DD>
-<DT><STRONG><A NAME="item_expire">expire - date</A></STRONG><DD>
-<DT><STRONG><A NAME="item_cancel">cancel - date</A></STRONG><DD>
-<DT><STRONG><A NAME="item_otaker">otaker - order taker (assigned automatically if null, see FS::UID)</A></STRONG><DD>
-</DL>
-<P>
-Note: setup, bill, susp, expire and cancel are specified as UNIX
-timestamps; see <EM>perlfunc</EM>. Also see <A HREF="../Time/Local.html">Time::Local</A> and <A HREF="../Date/Parse.html">Date::Parse</A> for conversion functions.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Create a new billing item. To add the item to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this billing item to the database (``Orders'' the item). If there is
-an error, returns the error, otherwise returns false.
-
-<P>
-sub insert { my <CODE>$self</CODE> = shift;
-
-<P>
-<PRE> # custnum might not have have been defined in sub check (for one-shot new
- # customers), so check it here instead
-</PRE>
-<P>
-<PRE> my $error = $self->ut_number('custnum');
- return $error if $error
-</PRE>
-<P>
-<PRE> return "Unknown customer"
- unless qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
-</PRE>
-<P>
-<PRE> $self->SUPER::insert;
-</PRE>
-<P>
-}
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented. You don't want to delete billing items, because
-there would then be no record the customer ever purchased the item.
-Instead, see the cancel method.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces the OLD_RECORD with this one in the database. If there is an
-error, returns the error, otherwise returns false.
-
-<P>
-Currently, custnum, setup, bill, susp, expire, and cancel may be changed.
-
-<P>
-Changing pkgpart may have disasterous effects. See the order subroutine.
-
-<P>
-setup and bill are normally updated by calling the bill method of a
-customer object (see <A HREF="../FS/cust_main.html">FS::cust_main</A>).
-
-<P>
-suspend is normally updated by the suspend and unsuspend methods.
-
-<P>
-cancel is normally updated by the cancel method (and also the order
-subroutine in some cases).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid billing item. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-<DT><STRONG>cancel</STRONG><DD>
-<P>
-Cancels and removes all services (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A> and <A HREF="../FS/part_svc.html">FS::part_svc</A>) in this package, then cancels the package itself (sets the cancel field
-to now).
-
-<P>
-If there is an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
-<P>
-Suspends all services (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A> and <A HREF="../FS/part_svc.html">FS::part_svc</A>) in this package, then suspends the package itself (sets the susp field to
-now).
-
-<P>
-If there is an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
-<P>
-Unsuspends all services (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A> and <A HREF="../FS/part_svc.html">FS::part_svc</A>) in this package, then unsuspends the package itself (clears the susp
-field).
-
-<P>
-If there is an error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_part_pkg">part_pkg</A></STRONG><DD>
-<P>
-Returns the definition for this billing item, as an FS::part_pkg object
-(see
-<A HREF="../FS/part_pkg.html">FS::part_pkg</A>).
-
-<DT><STRONG><A NAME="item_labels">labels</A></STRONG><DD>
-<P>
-Returns a list of lists, calling the label method for all services (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A>) of this billing item.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="SUBROUTINES">SUBROUTINES</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_order">order CUSTNUM, PKGPARTS_ARYREF, [ REMOVE_PKGNUMS_ARYREF ]</A></STRONG><DD>
-<P>
-CUSTNUM is a customer (see <A HREF="../FS/cust_main.html">FS::cust_main</A>)
-
-<P>
-PKGPARTS is a list of pkgparts specifying the the billing item definitions
-(see
-<A HREF="../FS/part_pkg.html">FS::part_pkg</A>) to order for this customer. Duplicates are of course permitted.
-
-<P>
-REMOVE_PKGNUMS is an optional list of pkgnums specifying the billing items
-to remove for this customer. The services (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A>) are moved to the new billing items. An error is returned if this is not
-possible (see
-<A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>).
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_pkg.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-sub order is not OO. Perhaps it should be moved to FS::cust_main and made
-so?
-
-<P>
-In sub order, the <CODE>@pkgparts</CODE> array (passed by reference) is
-clobbered.
-
-<P>
-Also in sub order, no money is adjusted. Once FS::part_pkg defines a
-standard method to pass dates to the recur_prog expression, it should do
-so.
-
-<P>
-FS::svc_acct, FS::svc_acct_sm, and FS::svc_domain are loaded via 'use' at
-compile time, rather than via 'require' in sub { setup, suspend, unsuspend,
-cancel } because they use %FS::UID::callback to load configuration values.
-Probably need a subroutine which decides what to do based on whether or not
-we've fetched the user yet, rather than a hash. See FS::UID and the TODO.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>, <A HREF="../FS/part_pkg.html">FS::part_pkg</A>, <A HREF="../FS/cust_svc.html">FS::cust_svc</A>
-, <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>, schema.html from the base documentation
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_refund - Object method for cust_refund objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_refund - Object method for cust_refund objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_refund;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_refund \%hash;
- $record = new FS::cust_refund { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_refund represents a refund. FS::cust_refund inherits from
-FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_refundnum">refundnum - primary key (assigned automatically for new refunds)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_crednum">crednum - Credit (see FS::cust_credit)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_refund">refund - Amount of the refund</A></STRONG><DD>
-<DT><STRONG><A NAME="item__date">_date - specified as a UNIX timestamp; see perlfunc/"time". Also see
-Time::Local and Date::Parse for conversion functions.</A></STRONG><DD>
-<DT><STRONG><A NAME="item_payby">payby - `CARD' (credit cards), `BILL' (billing), or `COMP' (free)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_payinfo">payinfo - card number, P.O.#, or comp issuer (4-8 lowercase alphanumerics; think username)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_otaker">otaker - order taker (assigned automatically, see FS::UID)</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new refund. To add the refund to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this refund to the database, and updates the credit (see
-<A HREF="../FS/cust_credit.html">FS::cust_credit</A>).
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented (accounting reasons).
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Currently unimplemented (accounting reasons).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid refund. If there is an
-error, returns the error, otherwise returns false. Called by the insert
-method.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_refund.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Delete and replace methods.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_credit.html">FS::cust_credit</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::cust_svc - Object method for cust_svc objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::cust_svc - Object method for cust_svc objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::cust_svc;
-</PRE>
-<P>
-<PRE> $record = new FS::cust_svc \%hash
- $record = new FS::cust_svc { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> ($label, $value) = $record->label;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::cust_svc represents a service. FS::cust_svc inherits from
-FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_svcnum">svcnum - primary key (assigned automatically for new services)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_pkgnum">pkgnum - Package (see FS::cust_pkg)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_svcpart">svcpart - Service definition (see FS::part_svc)</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new service. To add the refund to the database, see <A HREF="#insert">insert</A>. Services are normally created by creating FS::svc_ objects (see
-<A HREF="../FS/svc_acct.html">FS::svc_acct</A>, <A HREF="../FS/svc_domain.html">FS::svc_domain</A>, and <A HREF="../FS/svc_acct_sm.html">FS::svc_acct_sm</A>, among others).
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this service to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this service from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<P>
-Called by the cancel method of the package (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces the OLD_RECORD with this one in the database. If there is an
-error, returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid service. If there is an
-error, returns the error, otehrwise returns false. Called by the insert and
-replace methods.
-
-<DT><STRONG><A NAME="item_label">label</A></STRONG><DD>
-<P>
-Returns a list consisting of: - The name of this service (from part_svc) -
-A meaningful identifier (username, domain, or mail alias) - The table name
-(i.e. svc_domain) for this service
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: cust_svc.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Behaviour of changing the svcpart of cust_svc records is undefined and
-should possibly be prohibited, and pkg_svc records are not checked.
-
-<P>
-pkg_svc records are not checked in general (here).
-
-<P>
-Deleting this record doesn't check or delete the svc_* record associated
-with this record.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/part_svc.html">FS::part_svc</A>, <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>, schema.html from the base documentation
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::dbdef - Database objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::dbdef - Database objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::dbdef;
-</PRE>
-<P>
-<PRE> $dbdef = new FS::dbdef (@dbdef_table_objects);
- $dbdef = load FS::dbdef "filename";
-</PRE>
-<P>
-<PRE> $dbdef->save("filename");
-</PRE>
-<P>
-<PRE> $dbdef->addtable($dbdef_table_object);
-</PRE>
-<P>
-<PRE> @table_names = $dbdef->tables;
-</PRE>
-<P>
-<PRE> $FS_dbdef_table_object = $dbdef->table;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-FS::dbdef objects are collections of FS::dbdef_table objects and represnt a
-database (a collection of tables).
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new TABLE, TABLE, ...</A></STRONG><DD>
-<P>
-Creates a new FS::dbdef object
-
-<DT><STRONG><A NAME="item_load">load FILENAME</A></STRONG><DD>
-<P>
-Loads an FS::dbdef object from a file.
-
-<DT><STRONG><A NAME="item_save">save FILENAME</A></STRONG><DD>
-<P>
-Saves an FS::dbdef object to a file.
-
-<DT><STRONG><A NAME="item_addtable">addtable TABLE</A></STRONG><DD>
-<P>
-Adds this FS::dbdef_table object.
-
-<DT><STRONG><A NAME="item_tables">tables</A></STRONG><DD>
-<P>
-Returns the names of all tables.
-
-<DT><STRONG><A NAME="item_table">table TABLENAME</A></STRONG><DD>
-<P>
-Returns the named FS::dbdef_table object.
-
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Each FS::dbdef object should have a name which corresponds to its name
-within the SQL database engine.
-
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/dbdef_table.html">FS::dbdef_table</A>, <A HREF="../FS/Record.html">FS::Record</A>,
-
-</DL>
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::dbdef_colgroup - Column group objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::dbdef_colgroup - Column group objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::dbdef_colgroup;
-</PRE>
-<P>
-<PRE> $colgroup = new FS::dbdef_colgroup ( $lol );
- $colgroup = new FS::dbdef_colgroup (
- [
- [ 'single_column' ],
- [ 'multiple_columns', 'another_column', ],
- ]
- );
-</PRE>
-<P>
-<PRE> @sql_lists = $colgroup->sql_list;
-</PRE>
-<P>
-<PRE> @singles = $colgroup->singles;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-FS::dbdef_colgroup objects represent sets of sets of columns.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new</A></STRONG><DD>
-<P>
-Creates a new FS::dbdef_colgroup object.
-
-<DT><STRONG><A NAME="item_sql_list">sql_list</A></STRONG><DD>
-<P>
-Returns a flat list of comma-separated values, for SQL statements.
-
-<DT><STRONG><A NAME="item_singles">singles</A></STRONG><DD>
-<P>
-Returns a flat list of all single item lists.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/dbdef_table.html">FS::dbdef_table</A>, <A HREF="../FS/dbdef_unique.html">FS::dbdef_unique</A>, <A HREF="../FS/dbdef_index.html">FS::dbdef_index</A>,
-<A HREF="../FS/dbdef_column.html">FS::dbdef_column</A>, <A HREF="../FS/dbdef.html">FS::dbdef</A>, <EM>perldsc</EM>
-
-
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::dbdef_column - Column object</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
- <LI><A HREF="#VERSION">VERSION</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::dbdef_column - Column object
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::dbdef_column;
-</PRE>
-<P>
-<PRE> $column_object = new FS::dbdef_column ( $name, $sql_type, '' );
- $column_object = new FS::dbdef_column ( $name, $sql_type, 'NULL' );
- $column_object = new FS::dbdef_column ( $name, $sql_type, '', $length );
- $column_object = new FS::dbdef_column ( $name, $sql_type, 'NULL', $length );
-</PRE>
-<P>
-<PRE> $name = $column_object->name;
- $column_object->name ( 'name' );
-</PRE>
-<P>
-<PRE> $name = $column_object->type;
- $column_object->name ( 'sql_type' );
-</PRE>
-<P>
-<PRE> $name = $column_object->null;
- $column_object->name ( 'NOT NULL' );
-</PRE>
-<P>
-<PRE> $name = $column_object->length;
- $column_object->name ( $length );
-</PRE>
-<P>
-<PRE> $sql_line = $column->line;
- $sql_line = $column->line $datasrc;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-FS::dbdef::column objects represend columns in tables (see <A HREF="../FS/dbdef_table.html">FS::dbdef_table</A>).
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new</A></STRONG><DD>
-<P>
-Creates a new FS::dbdef_column object.
-
-<DT><STRONG><A NAME="item_name">name</A></STRONG><DD>
-<P>
-Returns or sets the column name.
-
-<DT><STRONG><A NAME="item_type">type</A></STRONG><DD>
-<P>
-Returns or sets the column type.
-
-<DT><STRONG><A NAME="item_null">null</A></STRONG><DD>
-<P>
-Returns or sets the column null flag.
-
-<DT><STRONG>type</STRONG><DD>
-<P>
-Returns or sets the column length.
-
-<DT><STRONG><A NAME="item_line">line [ $datasrc ]</A></STRONG><DD>
-<P>
-Returns an SQL column definition.
-
-<P>
-If passed a DBI <CODE>$datasrc</CODE> specifying <A HREF="../DBD/mysql.html">DBD::mysql</A> or <A HREF="../DBD/Pg.html">DBD::Pg</A>, will use engine-specific syntax.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/dbdef_table.html">FS::dbdef_table</A>, <A HREF="../FS/dbdef.html">FS::dbdef</A>, <EM>DBI</EM>
-
-
-
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: dbdef_column.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::dbdef_unique.pm - Index object</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::dbdef_unique.pm - Index object
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::dbdef_index;
-</PRE>
-<P>
-<PRE> # see FS::dbdef_colgroup methods
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-FS::dbdef_unique objects represent the (non-unique) indices of a table (<A HREF="../FS/dbdef_table.html">FS::dbdef_table</A>). FS::dbdef_unique inherits from FS::dbdef_colgroup.
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Is this empty subclass needed?
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/dbdef_colgroup.html">FS::dbdef_colgroup</A>, <A HREF="../FS/dbdef_record.html">FS::dbdef_record</A>, <A HREF="../FS/Record.html">FS::Record</A>
-
-
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::dbdef_table - Table objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
- <LI><A HREF="#VERSION">VERSION</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::dbdef_table - Table objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::dbdef_table;
-</PRE>
-<P>
-<PRE> $dbdef_table = new FS::dbdef_table (
- "table_name",
- "primary_key",
- $FS_dbdef_unique_object,
- $FS_dbdef_index_object,
- @FS_dbdef_column_objects,
- );
-</PRE>
-<P>
-<PRE> $dbdef_table->addcolumn ( $FS_dbdef_column_object );
-</PRE>
-<P>
-<PRE> $table_name = $dbdef_table->name;
- $dbdef_table->name ("table_name");
-</PRE>
-<P>
-<PRE> $table_name = $dbdef_table->primary_keye;
- $dbdef_table->primary_key ("primary_key");
-</PRE>
-<P>
-<PRE> $FS_dbdef_unique_object = $dbdef_table->unique;
- $dbdef_table->unique ( $FS_dbdef_unique_object );
-</PRE>
-<P>
-<PRE> $FS_dbdef_index_object = $dbdef_table->index;
- $dbdef_table->index ( $FS_dbdef_index_object );
-</PRE>
-<P>
-<PRE> @column_names = $dbdef->columns;
-</PRE>
-<P>
-<PRE> $FS_dbdef_column_object = $dbdef->column;
-</PRE>
-<P>
-<PRE> @sql_statements = $dbdef->sql_create_table;
- @sql_statements = $dbdef->sql_create_table $datasrc;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-FS::dbdef_table objects represent a single database table.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new</A></STRONG><DD>
-<P>
-Creates a new FS::dbdef_table object.
-
-<DT><STRONG><A NAME="item_addcolumn">addcolumn</A></STRONG><DD>
-<P>
-Adds this FS::dbdef_column object.
-
-<DT><STRONG><A NAME="item_name">name</A></STRONG><DD>
-<P>
-Returns or sets the table name.
-
-<DT><STRONG><A NAME="item_primary_key">primary_key</A></STRONG><DD>
-<P>
-Returns or sets the primary key.
-
-<DT><STRONG><A NAME="item_unique">unique</A></STRONG><DD>
-<P>
-Returns or sets the FS::dbdef_unique object.
-
-<DT><STRONG><A NAME="item_index">index</A></STRONG><DD>
-<P>
-Returns or sets the FS::dbdef_index object.
-
-<DT><STRONG><A NAME="item_columns">columns</A></STRONG><DD>
-<P>
-Returns a list consisting of the names of all columns.
-
-<DT><STRONG><A NAME="item_column">column "column"</A></STRONG><DD>
-<P>
-Returns the column object (see <A HREF="../FS/dbdef_column.html">FS::dbdef_column</A>) for ``column''.
-
-<DT><STRONG><A NAME="item_sql_create_table">sql_create_table [ $datasrc ]</A></STRONG><DD>
-<P>
-Returns an array of SQL statments to create this table.
-
-<P>
-If passed a DBI <CODE>$datasrc</CODE> specifying <A HREF="../DBD/mysql.html">DBD::mysql</A>, will use MySQL-specific syntax. Non-standard syntax for other engines (if
-applicable) may also be supported in the future.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/dbdef.html">FS::dbdef</A>, <A HREF="../FS/dbdef_unique.html">FS::dbdef_unique</A>, <A HREF="../FS/dbdef_index.html">FS::dbdef_index</A>, <A HREF="../FS/dbdef_unique.html">FS::dbdef_unique</A>,
-<EM>DBI</EM>
-
-
-
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: dbdef_table.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::dbdef_unique.pm - Unique object</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::dbdef_unique.pm - Unique object
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::dbdef_unique;
-</PRE>
-<P>
-<PRE> # see FS::dbdef_colgroup methods
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-FS::dbdef_unique objects represent the unique indices of a database table (<A HREF="../FS/dbdef_table.html">FS::dbdef_table</A>). FS::dbdef_unique inherits from FS::dbdef_colgroup.
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Is this empty subclass needed?
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/dbdef_colgroup.html">FS::dbdef_colgroup</A>, <A HREF="../FS/dbdef_record.html">FS::dbdef_record</A>, <A HREF="../FS/Record.html">FS::Record</A>
-
-
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::part_pkg - Object methods for part_pkg objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::part_pkg - Object methods for part_pkg objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::part_pkg;
-</PRE>
-<P>
-<PRE> $record = new FS::part_pkg \%hash
- $record = new FS::part_pkg { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $custom_record = $template_record->clone;
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> @pkg_svc = $record->pkg_svc;
-</PRE>
-<P>
-<PRE> $svcnum = $record->svcpart;
- $svcnum = $record->svcpart( 'svc_acct' );
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::part_pkg object represents a billing item definition. FS::part_pkg
-inherits from FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_pkgpart">pkgpart - primary key (assigned automatically for new billing item definitions)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_pkg">pkg - Text name of this billing item definition (customer-viewable)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_comment">comment - Text name of this billing item definition (non-customer-viewable)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_setup">setup - Setup fee</A></STRONG><DD>
-<DT><STRONG><A NAME="item_freq">freq - Frequency of recurring fee</A></STRONG><DD>
-<DT><STRONG><A NAME="item_recur">recur - Recurring fee</A></STRONG><DD>
-</DL>
-<P>
-setup and recur are evaluated as Safe perl expressions. You can use numbers
-just as you would normally. More advanced semantics are not yet defined.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new billing item definition. To add the billing item definition
-to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_clone">clone</A></STRONG><DD>
-<P>
-An alternate constructor. Creates a new billing item definition by
-duplicating an existing definition. A new pkgpart is assigned and `(CUSTOM)
-' is prepended to the comment field. To add the billing item definition to
-the database, see
-<A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this billing item definition to the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid billing item definition. If
-there is an error, returns the error, otherwise returns false. Called by
-the insert and replace methods.
-
-<DT><STRONG><A NAME="item_pkg_svc">pkg_svc</A></STRONG><DD>
-<P>
-Returns all FS::pkg_svc objects (see <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>) for this package definition.
-
-<DT><STRONG><A NAME="item_svcpart">svcpart [ SVCDB ]</A></STRONG><DD>
-<P>
-Returns the svcpart of a single service definition (see <A HREF="../FS/part_svc.html">FS::part_svc</A>) associated with this billing item definition (see <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>). Returns false if there not exactly one service definition with quantity
-1, or if SVCDB is specified and does not match the svcdb of the service
-definition,
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: part_pkg.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The delete method is unimplemented.
-
-<P>
-setup and recur semantics are not yet defined (and are implemented in
-FS::cust_bill. hmm.).
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/type_pkgs.html">FS::type_pkgs</A>, <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>, <EM>Safe</EM>. schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::part_referral - Object methods for part_referral objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::part_referral - Object methods for part_referral objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::part_referral;
-</PRE>
-<P>
-<PRE> $record = new FS::part_referral \%hash
- $record = new FS::part_referral { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::part_referral represents a referral - where a customer heard of your
-services. This can be used to track the effectiveness of a particular piece
-of advertising, for example. FS::part_referral inherits from FS::Record.
-The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_refnum">refnum - primary key (assigned automatically for new referrals)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_referral">referral - Text name of this referral</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new referral. To add the referral to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this referral to the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid referral. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: part_referral.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The delete method is unimplemented.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_main.html">FS::cust_main</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::part_svc - Object methods for part_svc objects</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::part_svc - Object methods for part_svc objects
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::part_svc;
-</PRE>
-<P>
-<PRE> $record = new FS::part_referral \%hash
- $record = new FS::part_referral { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::part_svc represents a service definition. FS::part_svc inherits from
-FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_svcpart">svcpart - primary key (assigned automatically for new service definitions)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_svc">svc - text name of this service definition</A></STRONG><DD>
-<DT><STRONG><A NAME="item_svcdb">svcdb - table used for this service. See FS::svc_acct,
-FS::svc_domain, and FS::svc_acct_sm, among others.</A></STRONG><DD>
-<DT><STRONG><A NAME="item_svcdb_field">svcdb__field - Default or fixed value for field in svcdb.</A></STRONG><DD>
-<DT><STRONG><A NAME="item_svcdb_field_flag">svcdb__field_flag - defines svcdb__field action: null, `D' for default, or `F' for fixed</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new service definition. To add the service definition to the
-database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this service definition to the database. If there is an error, returns
-the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Currently unimplemented.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid service definition. If there
-is an error, returns the error, otherwise returns false. Called by the
-insert and replace methods.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: part_svc.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-Delete is unimplemented.
-
-<P>
-The list of svc_* tables is hardcoded. When svc_acct_pop is renamed, this
-should be fixed.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/part_pkg.html">FS::part_pkg</A>, <A HREF="../FS/pkg_svc.html">FS::pkg_svc</A>, <A HREF="../FS/cust_svc.html">FS::cust_svc</A>,
-<A HREF="../FS/svc_acct.html">FS::svc_acct</A>, <A HREF="../FS/svc_acct_sm.html">FS::svc_acct_sm</A>, <A HREF="../FS/svc_domain.html">FS::svc_domain</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::pkg_svc - Object methods for pkg_svc records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::pkg_svc - Object methods for pkg_svc records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::pkg_svc;
-</PRE>
-<P>
-<PRE> $record = new FS::pkg_svc \%hash;
- $record = new FS::pkg_svc { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> $part_pkg = $record->part_pkg;
-</PRE>
-<P>
-<PRE> $part_svc = $record->part_svc;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::pkg_svc record links a billing item definition (see <A HREF="../FS/part_pkg.html">FS::part_pkg</A>) to a service definition (see <A HREF="../FS/part_svc.html">FS::part_svc</A>). FS::pkg_svc inherits from FS::Record. The following fields are currently
-supported:
-
-<DL>
-<DT><STRONG><A NAME="item_pkgpart">pkgpart - Billing item definition (see FS::part_pkg)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_svcpart">svcpart - Service definition (see FS::part_svc)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_quantity">quantity - Quantity of this service definition that this billing item
-definition includes</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Create a new record. To add the record to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this record to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this record from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid record. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-<DT><STRONG><A NAME="item_part_pkg">part_pkg</A></STRONG><DD>
-<P>
-Returns the FS::part_pkg object (see <A HREF="../FS/part_pkg.html">FS::part_pkg</A>).
-
-<DT><STRONG><A NAME="item_part_svc">part_svc</A></STRONG><DD>
-<P>
-Returns the FS::part_svc object (see <A HREF="../FS/part_svc.html">FS::part_svc</A>).
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: pkg_svc.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/part_pkg.html">FS::part_pkg</A>, <A HREF="../FS/part_svc.html">FS::part_svc</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::svc_Common - Object method for all svc_ records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::svc_Common - Object method for all svc_ records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-use FS::svc_Common;
-
-<P>
-<CODE>@ISA</CODE> = <CODE>qw(</CODE> FS::svc_Common );
-
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-FS::svc_Common is intended as a base class for table-specific classes to
-inherit from, i.e. FS::svc_acct. FS::svc_Common inherits from FS::Record.
-
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this record to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<P>
-The additional fields pkgnum and svcpart (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A>) should be defined. An FS::cust_svc record will be created and inserted.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this account from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<P>
-The corresponding FS::cust_svc record will be deleted as well.
-
-<DT><STRONG><A NAME="item_setfixed">setfixed</A></STRONG><DD>
-<P>
-Sets any fixed fields for this service (see <A HREF="../FS/part_svc.html">FS::part_svc</A>). If there is an error, returns the error, otherwise returns the
-FS::part_svc object (use <CODE>ref()</CODE> to test the return). Usually
-called by the check method.
-
-<DT><STRONG><A NAME="item_setdefault">setdefault</A></STRONG><DD>
-<P>
-Sets all fields to their defaults (see <A HREF="../FS/part_svc.html">FS::part_svc</A>), overriding their current values. If there is an error, returns the
-error, otherwise returns the FS::part_svc object (use <CODE>ref()</CODE> to
-test the return).
-
-<DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
-<DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
-<DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><DD>
-<P>
-Stubs - return false (no error) so derived classes don't need to define
-these methods. Called by the cancel method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: svc_Common.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The setfixed method return value.
-
-<P>
-The new method should set defaults from part_svc (like the check method
-sets fixed values)?
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/cust_svc.html">FS::cust_svc</A>, <A HREF="../FS/part_svc.html">FS::part_svc</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::svc_acct - Object methods for svc_acct records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::svc_acct - Object methods for svc_acct records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::svc_acct;
-</PRE>
-<P>
-<PRE> $record = new FS::svc_acct \%hash;
- $record = new FS::svc_acct { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> $error = $record->suspend;
-</PRE>
-<P>
-<PRE> $error = $record->unsuspend;
-</PRE>
-<P>
-<PRE> $error = $record->cancel;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::svc_acct object represents an account. FS::svc_acct inherits from
-FS::svc_Common. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_svcnum">svcnum - primary key (assigned automatcially for new accounts)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_username">username</A></STRONG><DD>
-<DT><STRONG><A NAME="item__password">_password - generated if blank</A></STRONG><DD>
-<DT><STRONG><A NAME="item_popnum">popnum - Point of presence (see FS::svc_acct_pop)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_uid">uid</A></STRONG><DD>
-<DT><STRONG><A NAME="item_gid">gid</A></STRONG><DD>
-<DT><STRONG><A NAME="item_finger">finger - GECOS</A></STRONG><DD>
-<DT><STRONG><A NAME="item_dir">dir - set automatically if blank (and uid is not)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_shell">shell</A></STRONG><DD>
-<DT><STRONG><A NAME="item_quota">quota - (unimplementd)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_slipip">slipip - IP address</A></STRONG><DD>
-<DT><STRONG><A NAME="item_radius_Radius_Attribute">radius_Radius_Attribute - Radius-Attribute</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new account. To add the account to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this account to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<P>
-The additional fields pkgnum and svcpart (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A>) should be defined. An FS::cust_svc record will be created and inserted.
-
-<P>
-If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, and the username, uid, and dir fields are defined,
-the command
-
-<P>
-<PRE> useradd -d $dir -m -s $shell -u $uid $username
-</PRE>
-<P>
-is executed on shellmachine via ssh. This behaviour can be surpressed by
-setting $FS::svc_acct::nossh_hack true.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this account from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<P>
-The corresponding FS::cust_svc record will be deleted as well.
-
-<P>
-If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, the command:
-
-<P>
-<PRE> userdel $username
-</PRE>
-<P>
-is executed on shellmachine via ssh. This behaviour can be surpressed by
-setting $FS::svc_acct::nossh_hack true.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<P>
-If the configuration value (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine exists, and the dir field has changed, the command:
-
-<P>
-<PRE> [ -d $old_dir ] && (
- chmod u+t $old_dir;
- umask 022;
- mkdir $new_dir;
- cd $old_dir;
- find . -depth -print | cpio -pdm $new_dir;
- chmod u-t $new_dir;
- chown -R $uid.$gid $new_dir;
- rm -rf $old_dir
- )
-</PRE>
-<P>
-is executed on shellmachine via ssh. This behaviour can be surpressed by
-setting $FS::svc_acct::nossh_hack true.
-
-<DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
-<P>
-Suspends this account by prefixing *SUSPENDED* to the password. If there is
-an error, returns the error, otherwise returns false.
-
-<P>
-Called by the suspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
-<P>
-Unsuspends this account by removing *SUSPENDED* from the password. If there
-is an error, returns the error, otherwise returns false.
-
-<P>
-Called by the unsuspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><DD>
-<P>
-Just returns false (no error) for now.
-
-<P>
-Called by the cancel method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid service. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-<P>
-Sets any fixed values; see <A HREF="../FS/part_svc.html">FS::part_svc</A>.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: svc_acct.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The remote commands should be configurable.
-
-<P>
-The bits which ssh should fork before doing so.
-
-<P>
-The <CODE>$recref</CODE> stuff in sub check should be cleaned up.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/svc_Common.html">FS::svc_Common</A>, <A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/Conf.html">FS::Conf</A>, <A HREF="../FS/cust_svc.html">FS::cust_svc</A>,
-<A HREF="../FS/part_svc.html">FS::part_svc</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/SSH.html">FS::SSH</A>, <EM>ssh</EM>, <A HREF="../FS/svc_acct_pop.html">FS::svc_acct_pop</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::svc_acct_pop - Object methods for svc_acct_pop records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::svc_acct_pop - Object methods for svc_acct_pop records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::svc_acct_pop;
-</PRE>
-<P>
-<PRE> $record = new FS::svc_acct_pop \%hash;
- $record = new FS::svc_acct_pop { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::svc_acct object represents an point of presence. FS::svc_acct_pop
-inherits from FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_popnum">popnum - primary key (assigned automatically for new accounts)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_city">city</A></STRONG><DD>
-<DT><STRONG><A NAME="item_state">state</A></STRONG><DD>
-<DT><STRONG><A NAME="item_ac">ac - area code</A></STRONG><DD>
-<DT><STRONG><A NAME="item_exch">exch - exchange</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new point of presence (if only it were that easy!). To add the
-point of presence to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this point of presence to the database. If there is an error, returns
-the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Removes this point of presence from the database.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid point of presence. If there
-is an error, returns the error, otherwise returns false. Called by the
-insert and replace methods.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: svc_acct_pop.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-It should be renamed to part_pop.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF=".././FS/svc_acct.html#">the svc_acct manpage</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::svc_acct_sm - Object methods for svc_acct_sm records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::svc_acct_sm - Object methods for svc_acct_sm records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::svc_acct_sm;
-</PRE>
-<P>
-<PRE> $record = new FS::svc_acct_sm \%hash;
- $record = new FS::svc_acct_sm { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> $error = $record->suspend;
-</PRE>
-<P>
-<PRE> $error = $record->unsuspend;
-</PRE>
-<P>
-<PRE> $error = $record->cancel;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::svc_acct object represents a virtual mail alias. FS::svc_acct
-inherits from FS::Record. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_svcnum">svcnum - primary key (assigned automatcially for new accounts)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_domsvc">domsvc - svcnum of the virtual domain (see FS::svc_domain)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_domuid">domuid - uid of the target account (see FS::svc_acct)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_domuser">domuser - virtual username</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new virtual mail alias. To add the virtual mail alias to the
-database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this virtual mail alias to the database. If there is an error, returns
-the error, otherwise returns false.
-
-<P>
-The additional fields pkgnum and svcpart (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A>) should be defined. An FS::cust_svc record will be created and inserted.
-
-<P>
-If the configuration values (see <A HREF="../FS/Conf.html">FS::Conf</A>) shellmachine and qmailmachines exist, and domuser is `*' (meaning a
-catch-all mailbox), the command:
-
-<P>
-<PRE> [ -e $dir/.qmail-$qdomain-default ] || {
- touch $dir/.qmail-$qdomain-default;
- chown $uid:$gid $dir/.qmail-$qdomain-default;
- }
-</PRE>
-<P>
-is executed on shellmachine via ssh (see <EM>dot-qmail</EM>). This behaviour can be surpressed by setting $FS::svc_acct_sm::nossh_hack
-true.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this virtual mail alias from the database. If there is an error,
-returns the error, otherwise returns false.
-
-<P>
-The corresponding FS::cust_svc record will be deleted as well.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
-<P>
-Just returns false (no error) for now.
-
-<P>
-Called by the suspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
-<P>
-Just returns false (no error) for now.
-
-<P>
-Called by the unsuspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><DD>
-<P>
-Just returns false (no error) for now.
-
-<P>
-Called by the cancel method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid virtual mail alias. If there
-is an error, returns the error, otherwise returns false. Called by the
-insert and replace methods.
-
-<P>
-Sets any fixed values; see <A HREF="../FS/part_svc.html">FS::part_svc</A>.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: svc_acct_sm.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-The remote commands should be configurable.
-
-<P>
-The <CODE>$recref</CODE> stuff in sub check should be cleaned up.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/Conf.html">FS::Conf</A>, <A HREF="../FS/cust_svc.html">FS::cust_svc</A>, <A HREF="../FS/part_svc.html">FS::part_svc</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>,
-<A HREF="../FS/svc_acct.html">FS::svc_acct</A>, <A HREF="../FS/svc_domain.html">FS::svc_domain</A>, <A HREF="../FS/SSH.html">FS::SSH</A>, <EM>ssh</EM>, <EM>dot-qmail</EM>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::svc_domain - Object methods for svc_domain records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::svc_domain - Object methods for svc_domain records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::svc_domain;
-</PRE>
-<P>
-<PRE> $record = new FS::svc_domain \%hash;
- $record = new FS::svc_domain { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<PRE> $error = $record->suspend;
-</PRE>
-<P>
-<PRE> $error = $record->unsuspend;
-</PRE>
-<P>
-<PRE> $error = $record->cancel;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::svc_domain object represents a domain. FS::svc_domain inherits from
-FS::svc_Common. The following fields are currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_svcnum">svcnum - primary key (assigned automatically for new accounts)</A></STRONG><DD>
-<DT><STRONG><A NAME="item_domain">domain</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Creates a new domain. To add the domain to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this domain to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<P>
-The additional fields <EM>pkgnum</EM> and <EM>svcpart</EM> (see <A HREF="../FS/cust_svc.html">FS::cust_svc</A>) should be defined. An FS::cust_svc record will be created and inserted.
-
-<P>
-The additional field <EM>action</EM> should be set to <EM>N</EM> for new domains or <EM>M</EM>
-for transfers.
-
-<P>
-A registration or transfer email will be submitted unless
-$FS::svc_domain::whois_hack is true.
-
-<P>
-The additional field <EM>email</EM> can be used to manually set the admin contact email address on this email.
-Otherwise, the svc_acct records for this package (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>) are searched. If there is exactly one svc_acct record in the same
-package, it is automatically used. Otherwise an error is returned.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this domain from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<P>
-The corresponding FS::cust_svc record will be deleted as well.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_suspend">suspend</A></STRONG><DD>
-<P>
-Just returns false (no error) for now.
-
-<P>
-Called by the suspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_unsuspend">unsuspend</A></STRONG><DD>
-<P>
-Just returns false (no error) for now.
-
-<P>
-Called by the unsuspend method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_cancel">cancel</A></STRONG><DD>
-<P>
-Just returns false (no error) for now.
-
-<P>
-Called by the cancel method of FS::cust_pkg (see <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>).
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid domain. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-<P>
-Sets any fixed values; see <A HREF="../FS/part_svc.html">FS::part_svc</A>.
-
-<DT><STRONG><A NAME="item_whois">whois</A></STRONG><DD>
-<P>
-Returns the Net::Whois object corresponding to this domain, or undef if the
-domain is not found in whois.
-
-<P>
-(If $FS::svc_domain::whois_hack is true, returns that in all cases
-instead.)
-
-<DT><STRONG><A NAME="item__whois">_whois</A></STRONG><DD>
-<P>
-Depriciated.
-
-<DT><STRONG><A NAME="item_submit_internic">submit_internic</A></STRONG><DD>
-<P>
-Submits a registration email for this domain.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: svc_domain.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-All BIND/DNS fields should be included (and exported).
-
-<P>
-Delete doesn't send a registration template.
-
-<P>
-All registries should be supported.
-
-<P>
-Should change action to a real field.
-
-<P>
-The <CODE>$recref</CODE> stuff in sub check should be cleaned up.
-
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/svc_Common.html">FS::svc_Common</A>, <A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/Conf.html">FS::Conf</A>, <A HREF="../FS/cust_svc.html">FS::cust_svc</A>,
-<A HREF="../FS/part_svc.html">FS::part_svc</A>, <A HREF="../FS/cust_pkg.html">FS::cust_pkg</A>, <A HREF="../FS/SSH.html">FS::SSH</A>, <A HREF="../Net/Whois.html">Net::Whois</A>, <EM>ssh</EM>,
-<EM>dot-qmail</EM>, schema.html from the base documentation, config.html from the base
-documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<HTML>
-<HEAD>
-<TITLE>FS::type_pkgs - Object methods for type_pkgs records</TITLE>
-<LINK REV="made" HREF="mailto:ivan@rootwood.sisd.com">
-</HEAD>
-
-<BODY>
-
-<!-- INDEX BEGIN -->
-
-<UL>
-
- <LI><A HREF="#NAME">NAME</A>
- <LI><A HREF="#SYNOPSIS">SYNOPSIS</A>
- <LI><A HREF="#DESCRIPTION">DESCRIPTION</A>
- <LI><A HREF="#METHODS">METHODS</A>
- <LI><A HREF="#VERSION">VERSION</A>
- <LI><A HREF="#BUGS">BUGS</A>
- <LI><A HREF="#SEE_ALSO">SEE ALSO</A>
-</UL>
-<!-- INDEX END -->
-
-<HR>
-<P>
-<H1><A NAME="NAME">NAME</A></H1>
-<P>
-FS::type_pkgs - Object methods for type_pkgs records
-
-<P>
-<HR>
-<H1><A NAME="SYNOPSIS">SYNOPSIS</A></H1>
-<P>
-<PRE> use FS::type_pkgs;
-</PRE>
-<P>
-<PRE> $record = new FS::type_pkgs \%hash;
- $record = new FS::type_pkgs { 'column' => 'value' };
-</PRE>
-<P>
-<PRE> $error = $record->insert;
-</PRE>
-<P>
-<PRE> $error = $new_record->replace($old_record);
-</PRE>
-<P>
-<PRE> $error = $record->delete;
-</PRE>
-<P>
-<PRE> $error = $record->check;
-</PRE>
-<P>
-<HR>
-<H1><A NAME="DESCRIPTION">DESCRIPTION</A></H1>
-<P>
-An FS::type_pkgs record links an agent type (see <A HREF="../FS/agent_type.html">FS::agent_type</A>) to a billing item definition (see <A HREF="../FS/part_pkg.html">FS::part_pkg</A>). FS::type_pkgs inherits from FS::Record. The following fields are
-currently supported:
-
-<DL>
-<DT><STRONG><A NAME="item_typenum">typenum - Agent type, see FS::agent_type</A></STRONG><DD>
-<DT><STRONG><A NAME="item_pkgpart">pkgpart - Billing item definition, see FS::part_pkg</A></STRONG><DD>
-</DL>
-<P>
-<HR>
-<H1><A NAME="METHODS">METHODS</A></H1>
-<DL>
-<DT><STRONG><A NAME="item_new">new HASHREF</A></STRONG><DD>
-<P>
-Create a new record. To add the record to the database, see <A HREF="#insert">insert</A>.
-
-<DT><STRONG><A NAME="item_insert">insert</A></STRONG><DD>
-<P>
-Adds this record to the database. If there is an error, returns the error,
-otherwise returns false.
-
-<DT><STRONG><A NAME="item_delete">delete</A></STRONG><DD>
-<P>
-Deletes this record from the database. If there is an error, returns the
-error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_replace">replace OLD_RECORD</A></STRONG><DD>
-<P>
-Replaces OLD_RECORD with this one in the database. If there is an error,
-returns the error, otherwise returns false.
-
-<DT><STRONG><A NAME="item_check">check</A></STRONG><DD>
-<P>
-Checks all fields to make sure this is a valid record. If there is an
-error, returns the error, otherwise returns false. Called by the insert and
-replace methods.
-
-</DL>
-<P>
-<HR>
-<H1><A NAME="VERSION">VERSION</A></H1>
-<P>
-$Id: type_pkgs.html,v 1.1 1999-08-04 12:13:27 ivan Exp $
-
-<P>
-<HR>
-<H1><A NAME="BUGS">BUGS</A></H1>
-<P>
-<HR>
-<H1><A NAME="SEE_ALSO">SEE ALSO</A></H1>
-<P>
-<A HREF="../FS/Record.html">FS::Record</A>, <A HREF="../FS/agent_type.html">FS::agent_type</A>, <A HREF="../FS/part_pkgs.html">FS::part_pkgs</A>, schema.html from the base documentation.
-
-</BODY>
-
-</HTML>
+++ /dev/null
-<head>
- <title>fs_passwd</title>
-</head>
-<body>
- <h1>fs_passwd</h1>
-You may use fs_passwd/fs_passwd as a "passwd", "chfn" and "chsh" replacement on your shell machine(s) to cause password, gecos and shell changes to update your freeside machine. This can pose a security risk if not configured correctly. <b>Do not use this feature unless you understand what you are doing!</b>
-<br><br>Currently it is assumed that the the crypt(3) function in the C library is the same on the Freeside machine as on the target machine.
-<ul>
- <li>Create a freeside account on the shell machine(s).
- <li>Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the shell machine(s).
- <li>Copy fs_passwd/fs_passwd to /usr/local/bin on the shell machine(s). (chown freeside, chmod 4755). You may link it to passwd, chfn and chsh as well.
- <li>Copy fs_passwd/fs_passwdd to /usr/local/sbin on the shell machine(s). (chown freeside, chmod 500)
- <li>Create /usr/local/freeside on the shell machine(s). (chown freeside, chmod 700)
- <li>Run an iteration of "fs_passwd/fs_passwd_server shell.machine" as the freeside user for each shell machine (this is a daemon process).
-</ul>
-</body>
+++ /dev/null
-<head>
- <title>PostgreSQL notes</title>
-</head>
-<body>
- <h1>PostgreSQL notes</h1>
-<p>
-PostgreSQL ships by default with a maximum of 31 character column names. If
-you use arbitrary RADIUS attributes longer than 9 characters, fs-setup will
-fail with `duplicate column' errors (in the part_svc table).
-Solution: use a different database
-engine, or recompile PostgreSQL with 64 character column names.
-</p>
-Future versions of Freeside will keep all column names under 31 characters to
-avoid this problem.
-</p>
-<p>
-( I've personally been unable to get PostgreSQL working with larger column names,
-though the process does look like it should be straightforward. If anyone is
-interested in assisting me with this, please get in touch.
- -Ivan <a href="mailto:ivan@sisd.com"><ivan@sisd.com</a>> )
-</p>
-</body>
-
+++ /dev/null
-<head>
- <title>Schema reference</title>
-</head>
-<body>
- <h1>Schema reference</h1>
- <ul>
- <li><a name="agent">agent</a> - Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their agent type).
- <ul>
- <li>agentnum - primary key
- <li>agent - name of this agent
- <li>typenum - <a href="#agent_type">agent type</a>
- <li>prog - (unimplemented)
- <li>freq - (unimplemented)
- </ul>
- <li><a name="agent_type">agent_type</a> - Agent types define groups of packages that you can then assign to particular agents.
- <ul>
- <li>typenum - primary key
- <li>atype - name of this agent type
- </ul>
- <li><a name="cust_bill">cust_bill</a> - Invoices
- <ul>
- <li>invnum - primary key
- <li>custnum - <a href="#cust_main">customer</a>
- <li>_date
- <li>charged - amount of this invoice
- <li>owed - amount still outstanding on this invoice
- <li>printed - how many times this invoice has been printed automatically
- </ul>
- <li><a name="cust_bill_pkg">cust_bill_pkg</a> - Invoice line items
- <ul>
- <li>invnum - (multiple) key
- <li>pkgnum - <a href="#cust_pkg">package</a>
- <li>setup - setup fee
- <li>recur - recurring fee
- <li>sdate - starting date
- <li>edate - ending date
- </ul>
- <li><a name="cust_credit">cust_credit</a> - Credits
- <ul>
- <li>crednum - primary key
- <li>custnum - <a href="#cust_main">customer</a>
- <li>amount - amount credited
- <li>credited - amount still outstanding (not yet refunded) on this credit
- <li>_date
- <li>otaker - order taker
- <li>reason
- </ul>
- <li><a name="cust_main">cust_main</a> - Customers
- <ul>
- <li>custnum - primary key
- <li>agentnum - <a href="#agent">agent</a>
- <li>refnum - <a href="#part_referral">referral</a>
- <li>titlenum - <a href="#part_title">title</a>
- <li>first - name
- <li>middle - name
- <li>last - name
- <li>ss - social security number
- <li>company
- <li>address1
- <li>address2
- <li>city
- <li>county
- <li>state
- <li>zip
- <li>country
- <li>daytime - phone
- <li>night - phone
- <li>fax - phone
- <li>payby - CARD, BILL, or COMP
- <li>payinfo - card number, P.O.#, or comp issuer
- <li>paydate - expiration date
- <li>payname - billing name (name on card)
- <li>tax - tax exempt, Y or null
- <li>otaker - order taker
- </ul>
- <li><a name="cust_main_invoice">cust_main_invoice</a> - Invoice destinations for email invoices
- <ul>
- <li>destnum - primary key
- <li>custnum - <a href="#cust_main">customer</a>
- <li>dest - Invoice destination: If numeric, a <a href="#svc_acct">svcnum</a>, if string, a literal email address, or `POST' to enable mailing (the default if no cust_main_invoice records exist)
- </ul>
- <li><a name="cust_main_county">cust_main_county</a> - Tax rates
- <ul>
- <li>taxnum - primary key
- <li>state
- <li>county
- <li>country
- <li>tax - % rate
- </ul>
- <li><a name="cust_pay">cust_pay</a> - Payments
- <ul>
- <li>paynum - primary key
- <li>invnum - <a href="#cust_bill">invoice</a>
- <li>paid - amount
- <li>_date
- <li>payby - CARD, BILL, or COMP
- <li>payinfo - card number, P.O.#, or comp issuer
- <li>paybatch - text field for tracking card processor batches
- </ul>
- <li><a name="cust_pay_batch">cust_pay_batch</a> - Pending batch
- <ul>
- <li>trancode - 77 for charges
- <li>cardnum
- <li>exp - card expiration
- <li>amount
- <li>invnum - <a href="#cust_bill">invoice</a>
- <li>custnum - <a href="#cust_main">customer</a>
- <li>payname - name on card
- <li>first - name
- <li>last - name
- <li>address1
- <li>address2
- <li>city
- <li>state
- <li>zip
- <li>country
- </ul>
- <li><a name="cust_pkg">cust_pkg</a> - Customer billing items
- <ul>
- <li>pkgnum - primary key
- <li>custnum - <a href="#cust_main">customer</a>
- <li>pkgpart - <a href="#part_pkg">Package definition</a>
- <li>setup - date
- <li>bill - next bill date
- <li>susp - (past) suspension date
- <li>expire - (future) cancellation date
- <li>cancel - (past) cancellation date
- <li>otaker - order taker
- </ul>
- <li><a name="cust_refund">cust_refund</a> - Refunds
- <ul>
- <li>refundnum - primary key
- <li>crednum - <a href="#cust_credit">credit</a>
- <li>refund - amount
- <li>_date
- <li>payby - CARD, BILL or COMP
- <li>payinfo - card number, P.O.#, or comp issuer
- <li>otaker - order taker
- </ul>
- <li><a name="cust_svc">cust_svc</a> - Customer services
- <ul>
- <li>svcnum - primary key
- <li>pkgnum - <a href="#cust_pkg">package</a>
- <li>svcpart - <a href="#part_svc">Service definition</a>
- </ul>
- <li><a name="part_pkg">part_pkg</a> - Package definitions
- <ul>
- <li>pkgpart - primary key
- <li>pkg - package name
- <li>comment - non-customer visable package comment
- <li>setup - setup fee
- <li>freq - recurring frequency (months)
- <li>recur - recurring fee
- </ul>
- <li><a name="part_referral">part_referral</a> - Referral listing
- <ul>
- <li>refnum - primary key
- <li>referral - referral
- </ul>
- <li><a name="part_svc">part_svc</a> - Service definitions
- <ul>
- <li>svcpart - primary key
- <li>svc - name of this service
- <li>svcdb - table used for this service: svc_acct, svc_acct_sm, svc_domain, svc_charge or svc_wo
- <li><i>table</i>__<i>field</i> - Default or fixed value for <i>field</i> in <i>table</i>
- <li><i>table</i>__<i>field</i>_flag - null, D or F
- </ul>
- <li><a name="part_title">part_title</a> - Personal titles
- <ul>
- <li>titlenum - primary key
- <li>title - personal title (`Dr.' or `Mr.')
- </ul>
- <li><a name="pkg_svc">pkg_svc</a>
- <ul>
- <li>pkgpart - <a href="#part_pkg">Package definition</a>
- <li>svcpart - <a href="#part_svc">Service definition</a>
- <li>quantity - quantity of this service that this package includes
- </ul>
- <li><a name="prepay_credit">prepay_credit</a>
- <ul>
- <li>prepaynum - primary key
- <li>identifier - text or numeric string used to receive this credit
- <li>amount - amount of credit
- </ul>
- <li><a name="svc_acct">svc_acct</a> - Accounts
- <ul>
- <li>svcnum - <a href="#cust_svc">primary key</a>
- <li>username
- <li>_password
- <li>popnum - <a href="#svc_acct_pop">Point of Presence</a>
- <li>uid
- <li>gid
- <li>finger - GECOS
- <li>dir
- <li>shell
- <li>quota - (unimplementd)
- <li>slipip - IP address
- <li>radius_<i>Radius_Attribute</i> - Radius-Attribute
- </ul>
- <li><a name="svc_acct_pop">svc_acct_pop</a> - Points of Presence
- <ul>
- <li>popnum - primary key
- <li>city
- <li>state
- <li>ac - area code
- <li>exch - exchange
- <li>loc - rest of number
- </ul>
- <li><a name="svc_acct_sm">svc_acct_sm</a> - Domain mail aliases
- <ul>
- <li>svcnum - <a href="#cust_svc">primary key</a>
- <li>domsvc - <a href="#svc_domain">Domain</a> (by svcnum)
- <li>domuid - <a href="#svc_acct">Account</a> (by uid)
- <li>domuser - domuser @ <a href="#svc_domain">Domain</a> forwards to <a href="#svc_acct">Account</a>
- </ul>
- <li><a name="svc_domain">svc_domain</a> - Domains
- <ul>
- <li>svcnum - <a href="#cust_svc">primary key</a>
- <li>domain
- </ul>
- <li><a name="type_pkgs">type_pkgs</a>
- <ul>
- <li>typenum - <a href="#agent_type">agent type</a>
- <li>pkgpart - <a href="#part_pkg">Package definition</a>
- </ul>
- </ul>
-</body>
+++ /dev/null
-<head>
- <title>Signup server</title>
-</head>
-<body>
- <h1>Signup server</h1>
-For security reasons, the signup server should run on an external public
-webserver. On this machine, install:
-<ul>
- <li>A web server, such as <a href="http://www.apache-ssl.org">Apache-SSL</a> or <a href="http://www.apache.org">Apache</a>
- <li><a href="ftp://ftp.cs.hut.fi/pub/ssh/">SSH</a>
- <li><a href="http://www.perl.com/CPAN/doc/relinfo/INSTALL.html">Perl</a> (at least 5.004_05 for the 5.004 series or 5.005_03 for the 5.005 series. Don't enable experimental features like threads or the PerlIO abstraction layer.)
- <li><a href="http://www.perl.com/CPAN/modules/by-module/Text/">Text::Template</a>
- <li><a href="http://www.perl.com/CPAN/modules/by-author/IVAN/">HTTP::Headers::UserAgent</a> (version 2.0 or higher; not yet indexed correctly on CPAN)
-
- <li><a href="man/FS/SignupClient.html">FS::SignupClient</a> (copy the fs_signup/FS-SignupClient directory to the external machine, then: perl Makefile.PL; make; make install)
-</ul>
-Then:
-<ul>
- <li>Add the user `freeside' to the the external machine.
- <li>Copy or symlink fs_signup/FS-SignupClient/cgi/signup.cgi into the web server's document space.
- <li>Enable CGI execution for files with the `.cgi' extension. (with <a href="http://www.apache.org/docs/mod/mod_mime.html#addhandler">Apache</a>)
- <li>Create the /usr/local/freeside directory on the external machine (owned by the freeside user).
- <li>touch /usr/local/freeside/fs_signupd_socket; chown freeside /usr/local/freeside/fs_signupd_socket; chmod 600 /usr/local/freeside/fs_signupd_socket
- <li>Use <a href="http://www.apache.org/docs/suexec.html">suEXEC</a> or <a href="http://www.perl.com/CPAN-local/doc/manual/html/pod/perlsec.html#Security_Bugs">setuid</a> (see <a href="install.html">install.html</a> for details) to run signup.cgi as the freeside user.
- <li>Append the identity.pub from the freeside user on your freeside machine to the authorized_keys file of the newly created freeside user on the external machine(s).
- <li>Run <pre>fs_signup_server <i>user</i> <i>machine</i> <i>agentnum</i> <i>refnum</i></pre> on the Freeside machine.
- <ul>
- <li><i>user</i> is a user from the mapsecrets file.
- <li><i>machine</i> is the name of the external machine.
- <li><i>agentnum</i> and <i>refnum</i> are the <a href="schema.html#agent">agent</a> and <a href="schema.html#part_referral">referral</a>, respectively, to use for customers who sign up via this signup server.
- </ul>
-</ul>
-Optional:
-<ul>
- <li>If you create a <b>/usr/local/freeside/ieak.template</b> file on the external machine, it will be sent to IE users with MIME type <i>application/x-Internet-signup</i>. This file will be processed with <a href="http://search.cpan.org/doc/MJD/Text-Template-1.23/Template.pm">Text::Template</a> with the following variables available:
- <ul>
- <li>$ac - area code of selected POP
- <li>$exch - exchange of selected POP
- <li>$loc - local part of selected POP
- <li>$username
- <li>$password
- <li>$email_name - first and last name
- </ul>
- (an example file is included as <b>fs_signup/ieak.template</b>)
- <li>If there are any entries in the <i>prepay_credit</i> table, a user can enter a string matching the <b>identifier</i> column to receive the credit specified in the <b>amount</b> column, after which that <b>identifier</b> is no longer valid. This can be used to implement pre-paid "calling card" type signups. The <i>bin/generate-prepay</i> script can be used to populate the <i>prepay_credit</i> table.
-</ul>
-</body>
+++ /dev/null
-<head>
- <title>Troubleshooting</title>
-</head>
-<body>
- <h1>Troubleshooting</h1>
- <ul>
- <li>When troubleshooting the web interface, helpful information is often in your web server's error log.
- <li>If bin/svc_acct.import fails with an "Out of memory!" error using MySQL, upgrede MySQL and recompile the Perl DBD. There was a memory leak in some older versions of MySQL.
- <li>If you get tons of errors in your web server's error log like this:
-<pre>
-Ambiguous use of value => resolved to "value" =>
-at /usr/lib/perl5/site_perl/File/CounterFile.pm line 132.
-</pre>
- This clutters up your log files but is otherwise harmless. Upgrade to the latest File::CounterFile.
- <li>If you get errors like this:
-<pre>
-UID.pm: Can't open /var/spool/freeside/conf/secrets: Permission denied
-at <i>/your/path</i>/site_perl/FS/UID.pm line 26.
-BEGIN failed--compilation aborted at
-<i>/your/path</i>/edit/process/part_svc.cgi line 15.
-</pre>
- Then the scripts are not running as the freeside freeside user. See
-the <a href="install.html">New Installation</a> section of the documentation.
- <li>If you receive `can not connect to server' errors using MySQL on a system that doesn't support native threading, you may need to specify the full hostname in your DBI datasource. See the <a href="http://www.mysql.com/Manual_chapter/manual_Problems.html#Can_not_connect_to_server">MySQL documentation</a>, DBI manpage and the DBD::mysql manpage for details.
- </ul>
-</body>
+++ /dev/null
-<head>
- <title>Upgrading to 1.1.x</title>
-</head>
-<body>
-<h1>Upgrading to 1.1.x</h1>
-<ul>
- <li>Back up your data and current Freeside installation.
- <li>Unpack a copy of the 1.0.0 distribution in a separate location.
- <li>Diff your current installation against the 1.0.0 distribution.
- <li>Apply all the diffs you found above, if applicable.
- <li>Apply (at least) the following changes to your database:
-<pre>
-ALTER TABLE cust_main CHANGE ss ss char(11) NULL;
-ALTER TABLE cust_main CHANGE day daytime varchar(20) NULL;
-ALTER TABLE svc_acct CHANGE password _password varchar(25) NOT NULL;
-ALTER TABLE part_svc CHANGE svc_acct__password svc_acct___password varchar(25) NULL;
-ALTER TABLE part_svc CHANGE svc_acct__password_flag svc_acct___password_flag char(1) NULL;
-ALTER TABLE agent_type CHANGE type atype varchar(80) NOT NULL;
-</pre>
- <li>Optionally change the field lengths and types to match a 1.1.x install; see `bin/fs-setup'.
- <li>Create the necessary <a href="config.html">configuration files</a>,
- <li>Copy or symlink htdocs and site_perl to the new 1.1.x copies.
- <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly.
-</body>
+++ /dev/null
-<head>
- <title>Upgrading to 1.1.4</title>
-</head>
-<body>
-<h1>Upgrading to 1.1.4 from 1.1.x</h1>
-<ul>
- <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first.
- <li>Back up your data and current Freeside installation.
- <li>If applicable, create the new <a href="config.html">configuration files</a>: lpr, cybercash2, cybercash3.2
- <li>Copy or symlink htdocs and site_perl to the new copies.
-</body>
+++ /dev/null
-<head>
- <title>Upgrading to 1.2.x</title>
-</head>
-<body>
-<h1>Upgrading to 1.2.x from 1.1.x</h1>
-<ul>
- <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first.
- <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first.
- <li>Back up your data and current Freeside installation.
- <li>Install the Perl module <a href="http://www.perl.com/CPAN/modules/by-module/String/">String-Approx</a>
- <li><a href="config.html">Configuration file</a> location has changed!
- <li>Move /var/spool/freeside/dbdef.<i>datasrc</i> to /usr/local/etc/freeside/dbdef.<i>datasrc</i>.
- <li>Move /var/spool/freeside/counters to /usr/local/etc/freeside/counters.<i>datasrc</i>.
- <li>Move /var/spool/freeside/export to /usr/local/etc/freeside/export.<i>datasrc</i>.
- <li>Apply the following changes to your database:
-<pre>
-<!-- ALTER TABLE cust_main ADD middle varchar(80) NULL;
-ALTER TABLE cust_main ADD titlenum int NULL;
--->ALTER TABLE cust_main CHANGE state state varchar(80) NULL;
-ALTER TABLE cust_main_county CHANGE state state varchar(80) NULL;
-ALTER TABLE cust_main_county ADD country char(2);
-ALTER TABLE cust_main CHANGE paydate paydate varchar(10);
-UPDATE cust_main SET country = "US" where country IS NULL OR country = '';
-UPDATE cust_main_county SET country = "US" where country IS NULL OR country = "";
-<!--CREATE TABLE part_title (
- titlenum int NOT NULL,
- title varchar(80) NOT NULL,
- PRIMARY KEY (titlenum)
-);
--->CREATE TABLE cust_main_invoice (
- destnum int NOT NULL,
- custnum int NOT NULL,
- dest varchar(80) NOT NULL,
- PRIMARY KEY (destnum),
- INDEX ( custnum )
-);
-</pre>
- <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly.
- <li>Copy or symlink htdocs and site_perl to the new copies.
-</body>
+++ /dev/null
-<head>
- <title>Upgrading to 1.2.2</title>
-</head>
-<body>
-<h1>Upgrading to 1.2.2 from 1.2.x</h1>
-<ul>
- <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first.
- <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first.
- <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first.
- <li>Back up your data and current Freeside installation.
- <li>Install the Perl modules <a href="http://www.perl.com/CPAN/modules/by-module/Locale/">Locale-Codes</a> and <a href="http://www.perl.com/CPAN/modules/by-module/Net/">Net-Whois</a>.
- <li>Apply the following changes to your database:
-<pre>
-ALTER TABLE cust_pay_batch CHANGE exp exp VARCHAR(11);
-</pre>
- <li>Copy or symlink htdocs to the new copy.
- <li>Remove the symlink or directory <i>(your_site_perl_directory)</i>/FS.
- <li>Change to the FS directory in the new tarball, and build and install the
- Perl modules:
- <pre>
-$ cd FS/
-$ perl Makefile.PL
-$ make
-$ su
-# make install</pre>
- <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly.
-</body>
+++ /dev/null
-<head>
- <title>Upgrading to 1.3.0</title>
-</head>
-<body>
-<h1>Upgrading to 1.3.0 from 1.2.2</h1>
-<ul>
- <li>If migrating from 1.0.0, see these <a href="upgrade.html">instructions</a> first.
- <li>If migrating from less than 1.1.4, see these <a href="upgrade2.html">instructions</a> first.
- <li>If migrating from less than 1.2.0, see these <a href="upgrade3.html">instructions</a> first.
- <li>If migrating from less than 1.2.2, see these <a href="upgrade4.html">instructions</a> first.
- <li>Back up your data and current Freeside installation.
- <li>Apply the following changes to your database:
-<pre>
-ALTER TABLE svc_acct_pop ADD loc CHAR(4);
-CREATE TABLE prepay_credit (
- prepaynum int NOT NULL,
- identifier varchar(80) NOT NULL,
- amount decimal(10,2) NOT NULL,
- PRIMARY KEY (prepaynum),
- INDEX (identifier)
-);
-</pre>
- <li>Copy or symlink htdocs to the new copy.
- <li>Remove the symlink or directory <i>(your_site_perl_directory)</i>/FS.
- <li>Change to the FS directory in the new tarball, and build and install the
- Perl modules:
- <pre>
-$ cd FS/
-$ perl Makefile.PL
-$ make
-$ su
-# make install</pre>
- <li>Run bin/dbdef-create. This file uses MySQL-specific syntax. If you are running a different database engine you will need to modify it slightly.
-</body>
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: agent.cgi,v 1.7 1999-04-07 11:27:50 ivan Exp $
-#
-# ivan@sisd.com 97-dec-12
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'type' to 'atype' because Pg6.3 reserves the type word
-# bmccane@maxbaud.net 98-apr-3
-#
-# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12
-#
-# $Log: agent.cgi,v $
-# Revision 1.7 1999-04-07 11:27:50 ivan
-# avoid perl's silly arguement not numeric error
-#
-# Revision 1.6 1999/01/25 12:09:50 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.5 1999/01/19 05:13:31 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:21 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/17 06:16:57 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.2 1998/11/23 07:52:08 ivan
-# *** empty log message ***
-#
-
-use strict;
-use vars qw ( $cgi $agent $action $hashref $p $agent_type );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header menubar popurl);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::agent;
-use FS::agent_type;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- $agent = new FS::agent ( {
- map { $_, scalar($cgi->param($_)) } fields('agent')
- } );
-} elsif ( $cgi->keywords ) {
- my($query) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $agent = qsearchs( 'agent', { 'agentnum' => $1 } );
-} else { #adding
- $agent = new FS::agent {};
-}
-$action = $agent->agentnum ? 'Edit' : 'Add';
-$hashref = $agent->hashref;
-
-$p = popurl(2);
-
-print $cgi->header( '-expires' => 'now' ), header("$action Agent", menubar(
- 'Main Menu' => $p,
- 'View all agents' => $p. 'browse/agent.cgi',
-));
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print '<FORM ACTION="', popurl(1), 'process/agent.cgi" METHOD=POST>',
- qq!<INPUT TYPE="hidden" NAME="agentnum" VALUE="$hashref->{agentnum}">!,
- "Agent #", $hashref->{agentnum} ? $hashref->{agentnum} : "(NEW)";
-
-print <<END;
-<PRE>
-Agent <INPUT TYPE="text" NAME="agent" SIZE=32 VALUE="$hashref->{agent}">
-Agent type <SELECT NAME="typenum" SIZE=1>
-END
-
-foreach $agent_type (qsearch('agent_type',{})) {
- print "<OPTION VALUE=". $agent_type->typenum;
- print " SELECTED"
- if $hashref->{typenum} && ( $hashref->{typenum} == $agent_type->typenum );
- print ">", $agent_type->getfield('typenum'), ": ",
- $agent_type->getfield('atype'),"\n";
-}
-
-print <<END;
-</SELECT>
-Frequency (unimplemented) <INPUT TYPE="text" NAME="freq" VALUE="$hashref->{freq}">
-Program (unimplemented) <INPUT TYPE="text" NAME="prog" VALUE="$hashref->{prog}">
-</PRE>
-END
-
-print qq!<BR><INPUT TYPE="submit" VALUE="!,
- $hashref->{agentnum} ? "Apply changes" : "Add agent",
- qq!">!;
-
-print <<END;
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: agent_type.cgi,v 1.11 1999-04-07 11:19:21 ivan Exp $
-#
-# agent_type.cgi: Add/Edit agent type (output form)
-#
-# ivan@sisd.com 97-dec-10
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'type' to 'atype' because Pg6.3 reserves the type word
-# bmccane@maxbaud.net 98-apr-3
-#
-# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12
-#
-# $Log: agent_type.cgi,v $
-# Revision 1.11 1999-04-07 11:19:21 ivan
-# silly HTML typo
-#
-# Revision 1.10 1999/01/25 12:09:51 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.9 1999/01/19 05:13:32 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.8 1999/01/18 09:41:22 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.7 1999/01/18 09:22:29 ivan
-# changes to track email addresses for email invoicing
-#
-# Revision 1.6 1998/12/17 06:16:58 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.5 1998/11/21 07:58:27 ivan
-# package names link to them
-#
-# Revision 1.4 1998/11/21 07:45:19 ivan
-# visual, use FS::table_name when doing qsearch('table_name')
-#
-# Revision 1.3 1998/11/15 11:20:12 ivan
-# s/CGI-Base/CGI.pm/ causes s/QUERY_STRING/keywords/;
-#
-# Revision 1.2 1998/11/13 09:56:46 ivan
-# change configuration file layout to support multiple distinct databases (with
-# own set of config files, export, etc.)
-#
-
-use strict;
-use vars qw( $cgi $agent_type $action $hashref $p $part_pkg );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::agent_type;
-use FS::CGI qw(header menubar popurl);
-use FS::agent_type;
-use FS::part_pkg;
-use FS::type_pkgs;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- $agent_type = new FS::agent_type ( {
- map { $_, scalar($cgi->param($_)) } fields('agent')
- } );
-} elsif ( $cgi->keywords ) { #editing
- my( $query ) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $agent_type=qsearchs('agent_type',{'typenum'=>$1});
-} else { #adding
- $agent_type = new FS::agent_type {};
-}
-$action = $agent_type->typenum ? 'Edit' : 'Add';
-$hashref = $agent_type->hashref;
-
-$p = popurl(2);
-print $cgi->header( '-expires' => 'now' ), header("$action Agent Type", menubar(
- 'Main Menu' => "$p",
- 'View all agent types' => "${p}browse/agent_type.cgi",
-));
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print '<FORM ACTION="', popurl(1), 'process/agent_type.cgi" METHOD=POST>',
- qq!<INPUT TYPE="hidden" NAME="typenum" VALUE="$hashref->{typenum}">!,
- "Agent Type #", $hashref->{typenum} ? $hashref->{typenum} : "(NEW)";
-
-print <<END;
-<BR><BR>Agent Type <INPUT TYPE="text" NAME="atype" SIZE=32 VALUE="$hashref->{atype}">
-<BR><BR>Select which packages agents of this type may sell to customers<BR>
-END
-
-foreach $part_pkg ( qsearch('part_pkg',{}) ) {
- print qq!<BR><INPUT TYPE="checkbox" NAME="pkgpart!,
- $part_pkg->getfield('pkgpart'), qq!" !,
- # ( 'CHECKED 'x scalar(
- qsearchs('type_pkgs',{
- 'typenum' => $agent_type->getfield('typenum'),
- 'pkgpart' => $part_pkg->getfield('pkgpart'),
- })
- ? 'CHECKED '
- : '',
- qq!VALUE="ON"> !,
- qq!<A HREF="${p}edit/part_pkg.cgi?!, $part_pkg->pkgpart,
- '">', $part_pkg->getfield('pkg'), '</A>',
- ;
-}
-
-print qq!<BR><INPUT TYPE="submit" VALUE="!,
- $hashref->{typenum} ? "Apply changes" : "Add agent type",
- qq!">!;
-
-print <<END;
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_credit.cgi,v 1.7 1999-02-28 00:03:33 ivan Exp $
-#
-# Usage: cust_credit.cgi custnum [ -paybatch ]
-# http://server.name/path/cust_credit?custnum [ -paybatch ]
-#
-# some hooks in here for modifications as well as additions, but needs (lots) more work.
-# also see process/cust_credit.cgi, the script that processes the form.
-#
-# ivan@voicenet.com 96-dec-05
-#
-# paybatch field, differentiates between credits & credits+refunds by commandline
-# ivan@voicenet.com 96-dec-08
-#
-# added (but commented out) sprintf("%.2f" in amount field. Hmm.
-# ivan@voicenet.com 97-jan-3
-#
-# paybatch stuff thrown out - has checkbox now instead.
-# (well, sort of. still passed around for backward compatability and possible editing hook)
-# ivan@voicenet.com 97-apr-21
-#
-# rewrite ivan@sisd.com 98-mar-16
-#
-# $Log: cust_credit.cgi,v $
-# Revision 1.7 1999-02-28 00:03:33 ivan
-# removed misleading comments
-#
-# Revision 1.6 1999/01/25 12:09:52 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.5 1999/01/19 05:13:33 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:23 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/23 02:26:06 ivan
-# *** empty log message ***
-#
-# Revision 1.2 1998/12/17 06:16:59 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-
-use strict;
-use vars qw( $cgi $query $custnum $otaker $p1 $crednum $_date $amount $reason );
-use Date::Format;
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup getotaker);
-use FS::CGI qw(header popurl);
-use FS::Record qw(fields);
-#use FS::cust_credit;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- #$cust_credit = new FS::cust_credit ( {
- # map { $_, scalar($cgi->param($_)) } fields('cust_credit')
- #} );
- $custnum = $cgi->param('custnum');
- $amount = $cgi->param('amount');
- #$refund = $cgi->param('refund');
- $reason = $cgi->param('reason');
-} else {
- ($query) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $custnum = $1;
- $amount = '';
- #$refund = 'yes';
- $reason = '';
-}
-$_date = time;
-
-$otaker = getotaker;
-
-$p1 = popurl(1);
-
-print $cgi->header( '-expires' => 'now' ), header("Post Credit", '');
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-print <<END;
- <FORM ACTION="${p1}process/cust_credit.cgi" METHOD=POST>
- <PRE>
-END
-
-$crednum = "";
-print qq!Credit #<B>!, $crednum ? $crednum : " <I>(NEW)</I>", qq!</B><INPUT TYPE="hidden" NAME="crednum" VALUE="$crednum">!;
-
-print qq!\nCustomer #<B>$custnum</B><INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
-
-print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
-
-print qq!\nDate: <B>!, time2str("%D",$_date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="">!;
-
-print qq!\nAmount \$<INPUT TYPE="text" NAME="amount" VALUE="$amount" SIZE=8 MAXLENGTH=8>!;
-print qq!<INPUT TYPE="hidden" NAME="credited" VALUE="">!;
-
-#print qq! <INPUT TYPE="checkbox" NAME="refund" VALUE="$refund">Also post refund!;
-
-print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!;
-
-print qq!\nReason <INPUT TYPE="text" NAME="reason" VALUE="$reason" SIZE=72>!;
-
-print <<END;
-</PRE>
-<BR>
-<CENTER><INPUT TYPE="submit" VALUE="Post"></CENTER>
-END
-
-print <<END;
-
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main.cgi,v 1.24 2000-01-30 06:54:50 ivan Exp $
-#
-# Usage: cust_main.cgi custnum
-# http://server.name/path/cust_main.cgi?custnum
-#
-# ivan@voicenet.com 96-nov-29 -> 96-dec-04
-#
-# Blank custnum for new customer.
-# ivan@voicenet.com 96-dec-16
-#
-# referral defaults to blank, to force people to pick something
-# ivan@voicenet.com 97-jun-4
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-28
-#
-# new customer is null, not '#'
-# otaker gotten from &getotaker instead of $ENV{REMOTE_USER}
-# ivan@sisd.com 97-nov-12
-#
-# cgisuidsetup($cgi);
-# no need for old_ fields.
-# now state+county is a select field (took out PA hack)
-# used autoloaded $cust_main->field methods
-# ivan@sisd.com 97-dec-17
-#
-# fixed quoting problems ivan@sisd.com 98-feb-23
-#
-# paydate sql update ivan@sisd.com 98-mar-5
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'day' to 'daytime' because Pg6.3 reserves the day word
-# Added test for paydate in mm-dd-yyyy format for Pg6.3 default format
-# bmccane@maxbaud.net 98-apr-3
-#
-# fixed one missed day->daytime ivan@sisd.com 98-jul-13
-#
-# $Log: cust_main.cgi,v $
-# Revision 1.24 2000-01-30 06:54:50 ivan
-# credit card expiration dates not sticky bug fixed?
-#
-# Revision 1.23 2000/01/27 00:53:14 ivan
-# 5.004_04 workaround
-#
-# Revision 1.22 1999/12/17 02:33:23 ivan
-# argh
-#
-# Revision 1.21 1999/08/23 07:40:38 ivan
-# missing </TD> flag
-#
-# Revision 1.20 1999/08/23 07:08:11 ivan
-# no CGI::Switch for now
-#
-# Revision 1.19 1999/08/21 02:14:25 ivan
-# better error message for no agents
-#
-# Revision 1.18 1999/08/11 15:38:33 ivan
-# fix for perl 5.004_04
-#
-# Revision 1.17 1999/08/10 11:15:45 ivan
-# corrected a misleading comment
-#
-# Revision 1.15 1999/04/14 13:14:54 ivan
-# configuration option to edit referrals of existing customers
-#
-# Revision 1.14 1999/04/14 07:47:53 ivan
-# i18n fixes
-#
-# Revision 1.13 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.12 1999/04/06 11:16:16 ivan
-# give a meaningful error message if you try to create a customer before you've
-# created an agent
-#
-# Revision 1.11 1999/03/25 13:55:10 ivan
-# one-screen new customer entry (including package and service) for simple
-# packages with one svc_acct service
-#
-# Revision 1.10 1999/02/28 00:03:34 ivan
-# removed misleading comments
-#
-# Revision 1.9 1999/02/23 08:09:20 ivan
-# beginnings of one-screen new customer entry and some other miscellania
-#
-# Revision 1.8 1999/01/25 12:09:53 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.7 1999/01/19 05:13:34 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.6 1999/01/18 09:41:24 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.5 1999/01/18 09:22:30 ivan
-# changes to track email addresses for email invoicing
-#
-# Revision 1.4 1998/12/23 08:08:15 ivan
-# fix typo
-#
-# Revision 1.3 1998/12/17 06:17:00 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-
-use strict;
-use vars qw( $cgi $custnum $action $cust_main $p1 @agents $agentnum
- $last $first $ss $company $address1 $address2 $city $zip
- $daytime $night $fax @invoicing_list $invoicing_list $payinfo
- $payname %payby %paybychecked $refnum $otaker $r );
-use vars qw ( $conf $pkgpart $username $password $popnum $ulen $ulen2 );
-#use CGI::Switch;
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup getotaker);
-#use FS::Record qw(qsearch qsearchs fields);
-use FS::Record qw(qsearch qsearchs fields dbdef);
-use FS::CGI qw(header popurl itable table);
-use FS::cust_main;
-use FS::agent;
-use FS::part_referral;
-use FS::cust_main_county;
-
- #for misplaced logic below
- use FS::part_pkg;
-
- #for false laziness below
- use FS::svc_acct_pop;
-
- #for (other) false laziness below
- use FS::agent;
- use FS::type_pkgs;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-
-#get record
-
-if ( $cgi->param('error') ) {
- $cust_main = new FS::cust_main ( {
- map { $_, scalar($cgi->param($_)) } fields('cust_main')
- } );
- $custnum = $cust_main->custnum;
- $pkgpart = $cgi->param('pkgpart_svcpart') || '';
- if ( $pkgpart =~ /^(\d+)_/ ) {
- $pkgpart = $1;
- } else {
- $pkgpart = '';
- }
- $username = $cgi->param('username');
- $password = $cgi->param('_password');
- $popnum = $cgi->param('popnum');
-} elsif ( $cgi->keywords ) { #editing
- my( $query ) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $custnum=$1;
- $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } );
- $pkgpart = 0;
- $username = '';
- $password = '';
- $popnum = 0;
-} else {
- $custnum='';
- $cust_main = new FS::cust_main ( {} );
- $cust_main->setfield('otaker',&getotaker);
- $pkgpart = 0;
- $username = '';
- $password = '';
- $popnum = 0;
-}
-$action = $custnum ? 'Edit' : 'Add';
-
-# top
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("Customer $action", '');
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-print qq!<FORM ACTION="${p1}process/cust_main.cgi" METHOD=POST>!,
- qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!,
- qq!Customer # !, ( $custnum ? $custnum : " (NEW)" ),
-
-;
-
-# agent
-
-$r = qq!<font color="#ff0000">*</font>!;
-
-@agents = qsearch( 'agent', {} );
-#die "No agents created!" unless @agents;
-die "You have not created any agents. You must create at least one agent before adding a customer. Go to ". popurl(2). "browse/agent.cgi and create one or more agents." unless @agents;
-$agentnum = $cust_main->agentnum || $agents[0]->agentnum; #default to first
-if ( scalar(@agents) == 1 ) {
- print qq!<INPUT TYPE="hidden" NAME="agentnum" VALUE="$agentnum">!;
-} else {
- print qq!<BR><BR>${r}Agent <SELECT NAME="agentnum" SIZE="1">!;
- my $agent;
- foreach $agent (sort {
- $a->agent cmp $b->agent;
- } @agents) {
- print '<OPTION VALUE="', $agent->agentnum, '"',
- " SELECTED"x($agent->agentnum==$agentnum),
- ">", $agent->agentnum,": ", $agent->agent;
- }
- print "</SELECT>";
-}
-
-#referral
-
-$refnum = $cust_main->refnum || 0;
-if ( $custnum && ! $conf->exists('editreferrals') ) {
- print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$refnum">!;
-} else {
- my(@referrals) = qsearch('part_referral',{});
- if ( scalar(@referrals) == 1 ) {
- $refnum ||= $referrals[0]->refnum;
- print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$refnum">!;
- } else {
- print qq!<BR><BR>${r}Referral <SELECT NAME="refnum" SIZE="1">!;
- print "<OPTION> " unless $refnum;
- my($referral);
- foreach $referral (sort {
- $a->refnum <=> $b->refnum;
- } @referrals) {
- print "<OPTION" . " SELECTED"x($referral->refnum==$refnum),
- ">", $referral->refnum, ": ", $referral->referral;
- }
- print "</SELECT>";
- }
-}
-
-
-# contact info
-
-($last,$first,$ss,$company,$address1,$address2,$city,$zip)=(
- $cust_main->last,
- $cust_main->first,
- $cust_main->ss,
- $cust_main->company,
- $cust_main->address1,
- $cust_main->address2,
- $cust_main->city,
- $cust_main->zip,
-);
-
-print "<BR><BR>Contact information", &itable("#c0c0c0"), <<END;
-<TR><TH ALIGN="right">${r}Contact name<BR>(last, first)</TH><TD COLSPAN=3><INPUT TYPE="text" NAME="last" VALUE="$last">, <INPUT TYPE="text" NAME="first" VALUE="$first"></TD><TD ALIGN="right">SS#</TD><TD><INPUT TYPE="text" NAME="ss" VALUE="$ss" SIZE=11></TD></TR>
-<TR><TD ALIGN="right">Company</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="company" VALUE="$company" SIZE=70></TD></TR>
-<TR><TH ALIGN="right">${r}Address</TH><TD COLSPAN=5><INPUT TYPE="text" NAME="address1" VALUE="$address1" SIZE=70></TD></TR>
-<TR><TD ALIGN="right"> </TD><TD COLSPAN=5><INPUT TYPE="text" NAME="address2" VALUE="$address2" SIZE=70></TD></TR>
-<TR><TH ALIGN="right">${r}City</TH><TD><INPUT TYPE="text" NAME="city" VALUE="$city"></TD><TH ALIGN="right">${r}State/Country</TH><TD><SELECT NAME="state" SIZE="1">
-END
-
-$cust_main->country('US') unless $cust_main->country; #eww
-foreach ( qsearch('cust_main_county',{}) ) {
- print "<OPTION";
- print " SELECTED" if ( $cust_main->state eq $_->state
- && $cust_main->county eq $_->county
- && $cust_main->country eq $_->country
- );
- print ">",$_->state;
- print " (",$_->county,")" if $_->county;
- print " / ", $_->country;
-}
-print qq!</SELECT></TD><TH>${r}Zip</TH><TD><INPUT TYPE="text" NAME="zip" VALUE="$zip" SIZE=10></TD></TR>!;
-
-($daytime,$night,$fax)=(
- $cust_main->daytime,
- $cust_main->night,
- $cust_main->fax,
-);
-
-print <<END;
-<TR><TD ALIGN="right">Day Phone</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="daytime" VALUE="$daytime" SIZE=18></TD></TR>
-<TR><TD ALIGN="right">Night Phone</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="night" VALUE="$night" SIZE=18></TD></TR>
-<TR><TD ALIGN="right">Fax</TD><TD COLSPAN=5><INPUT TYPE="text" NAME="fax" VALUE="$fax" SIZE=12></TD></TR>
-END
-
-print "</TABLE>$r required fields<BR>";
-
-# billing info
-
-sub expselect {
- my $prefix = shift;
- my( $m, $y ) = (0, 0);
- if ( scalar(@_) ) {
- my $date = shift;
- if ( $date =~ /^(\d{4})-(\d{1,2})-\d{1,2}$/ ) { #PostgreSQL date format
- ( $m, $y ) = ( $2, $1 );
- } elsif ( $date =~ /^(\d{1,2})-(\d{1,2}-)?(\d{4}$)/ ) {
- ( $m, $y ) = ( $1, $3 );
- } else {
- die "unrecognized expiration date format: $date";
- }
- }
-
- my $return = qq!<SELECT NAME="$prefix!. qq!_month" SIZE="1">!;
- for ( 1 .. 12 ) {
- $return .= "<OPTION";
- $return .= " SELECTED" if $_ == $m;
- $return .= ">$_";
- }
- $return .= qq!</SELECT>/<SELECT NAME="$prefix!. qq!_year" SIZE="1">!;
- for ( 1999 .. 2037 ) {
- $return .= "<OPTION";
- $return .= " SELECTED" if $_ == $y;
- $return .= ">$_";
- }
- $return .= "</SELECT>";
-
- $return;
-}
-
-print "<BR>Billing information", &itable("#c0c0c0"),
- qq!<TR><TD><INPUT TYPE="checkbox" NAME="tax" VALUE="Y"!;
-print qq! CHECKED! if $cust_main->tax eq "Y";
-print qq!>Tax Exempt</TD></TR>!;
-print qq!<TR><TD><INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST"!;
-@invoicing_list = $cust_main->invoicing_list;
-print qq! CHECKED!
- if ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list;
-print qq!>Postal mail invoice</TD></TR>!;
-$invoicing_list = join(', ', grep { $_ ne 'POST' } @invoicing_list );
-print qq!<TR><TD>Email invoice <INPUT TYPE="text" NAME="invoicing_list" VALUE="$invoicing_list"></TD></TR>!;
-
-print "<TR><TD>Billing type</TD></TR>",
- "</TABLE>",
- &table("#c0c0c0"), "<TR>";
-
-($payinfo, $payname)=(
- $cust_main->payinfo,
- $cust_main->payname,
-);
-
-%payby = (
- 'CARD' => qq!Credit card<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD"). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
- 'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""><BR>${r}Exp !. expselect("BILL", "12-2037"). qq!<BR>${r}Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="Accounts Payable">!,
- 'COMP' => qq!Complimentary<BR>${r}Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""><BR>${r}Exp !. expselect("COMP"),
-);
-%paybychecked = (
- 'CARD' => qq!Credit card<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD", $cust_main->paydate). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
- 'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE="$payinfo"><BR>${r}Exp !. expselect("BILL", $cust_main->paydate). qq!<BR>${r}Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="$payname">!,
- 'COMP' => qq!Complimentary<BR>${r}Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE="$payinfo"><BR>${r}Exp !. expselect("COMP", $cust_main->paydate),
-);
-for (qw(CARD BILL COMP)) {
- print qq!<TD VALIGN=TOP><INPUT TYPE="radio" NAME="payby" VALUE="$_"!;
- if ($cust_main->payby eq "$_") {
- print qq! CHECKED> $paybychecked{$_}</TD>!;
- } else {
- print qq!> $payby{$_}</TD>!;
- }
-}
-
-print "</TR></TABLE>$r required fields for each billing type";
-
-unless ( $custnum ) {
- # pry the wrong place for this logic. also pretty expensive
- #use FS::part_pkg;
-
- #false laziness, copied from FS::cust_pkg::order
- my $pkgpart;
- if ( scalar(@agents) == 1 ) {
- # $pkgpart->{PKGPART} is true iff $custnum may purchase $pkgpart
- my($agent)=qsearchs('agent',{'agentnum'=> $agentnum });
- $pkgpart = $agent->pkgpart_hashref;
- } else {
- #can't know (agent not chosen), so, allow all
- my %typenum;
- foreach my $agent ( @agents ) {
- next if $typenum{$agent->typenum}++;
- #fixed in 5.004_05 #$pkgpart->{$_}++ foreach keys %{ $agent->pkgpart_hashref }
- foreach ( keys %{ $agent->pkgpart_hashref } ) { $pkgpart->{$_}++; } #5.004_04 workaround
- }
- }
- #eslaf
-
- my @part_pkg = grep { $_->svcpart('svc_acct') && $pkgpart->{ $_->pkgpart } }
- qsearch( 'part_pkg', {} );
-
- if ( @part_pkg ) {
-
- print "<BR><BR>First package", &itable("#c0c0c0"),
- qq!<TR><TD COLSPAN=2><SELECT NAME="pkgpart_svcpart">!;
-
- print qq!<OPTION VALUE="">(none)!;
-
- foreach my $part_pkg ( @part_pkg ) {
- print qq!<OPTION VALUE="!,
-# $part_pkg->pkgpart. "_". $pkgpart{ $part_pkg->pkgpart }, '"';
- $part_pkg->pkgpart. "_". $part_pkg->svcpart, '"';
- print " SELECTED" if $pkgpart && ( $part_pkg->pkgpart == $pkgpart );
- print ">", $part_pkg->pkg, " - ", $part_pkg->comment;
- }
- print "</SELECT></TD></TR>";
-
- #false laziness: (mostly) copied from edit/svc_acct.cgi
- #$ulen = $svc_acct->dbdef_table->column('username')->length;
- $ulen = dbdef->table('svc_acct')->column('username')->length;
- $ulen2 = $ulen+2;
- print <<END;
-<TR><TD ALIGN="right">Username</TD>
-<TD><INPUT TYPE="text" NAME="username" VALUE="$username" SIZE=$ulen2 MAXLENGTH=$ulen></TD></TR>
-<TR><TD ALIGN="right">Password</TD>
-<TD><INPUT TYPE="text" NAME="_password" VALUE="$password" SIZE=10 MAXLENGTH=8>
-(blank to generate)</TD></TR>
-END
- print qq!<TR><TD ALIGN="right">POP</TD><TD><SELECT NAME="popnum" SIZE=1><OPTION> !;
- my($svc_acct_pop);
- foreach $svc_acct_pop ( qsearch ('svc_acct_pop',{} ) ) {
- print qq!<OPTION VALUE="!, $svc_acct_pop->popnum, '"',
- ( $popnum && $svc_acct_pop->popnum == $popnum ) ? ' SELECTED' : '', ">",
- $svc_acct_pop->popnum, ": ",
- $svc_acct_pop->city, ", ",
- $svc_acct_pop->state,
- " (", $svc_acct_pop->ac, ")/",
- $svc_acct_pop->exch, "\n"
- ;
- }
- print "</SELECT></TD></TR></TABLE>";
- }
-}
-
-$otaker = $cust_main->otaker;
-print qq!<INPUT TYPE="hidden" NAME="otaker" VALUE="$otaker">!,
- qq!<BR><BR><INPUT TYPE="submit" VALUE="!,
- $custnum ? "Apply Changes" : "Add Customer", qq!">!,
- "</FORM></BODY></HTML>",
-;
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main_county-expand.cgi,v 1.6 1999-01-25 12:09:54 ivan Exp $
-#
-# ivan@sisd.com 97-dec-16
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: cust_main_county-expand.cgi,v $
-# Revision 1.6 1999-01-25 12:09:54 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.5 1999/01/19 05:13:35 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:25 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/17 06:17:01 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.2 1998/11/18 09:01:38 ivan
-# i18n! i18n!
-#
-
-use strict;
-use vars qw( $cgi $taxnum $cust_main_county $p1 $delim $expansion );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar popurl);
-use FS::cust_main_county;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- $taxnum = $cgi->param('taxnum');
- $delim = $cgi->param('delim');
- $expansion = $cgi->param('expansion');
-} else {
- my ($query) = $cgi->keywords;
- $query =~ /^(\d+)$/
- or die "Illegal taxnum!";
- $taxnum = $1;
- $delim = 'n';
- $expansion = '';
-}
-
-$cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum});
-die "Can't expand entry!" if $cust_main_county->getfield('county');
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("Tax Rate (expand)", menubar(
- 'Main Menu' => popurl(2),
-));
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print <<END;
- <FORM ACTION="${p1}process/cust_main_county-expand.cgi" METHOD=POST>
- <INPUT TYPE="hidden" NAME="taxnum" VALUE="$taxnum">
- Separate by
-END
-print '<INPUT TYPE="radio" NAME="delim" VALUE="n"';
-print ' CHECKED' if $delim eq 'n';
-print '>line (rumor has it broken on some browsers) or',
- '<INPUT TYPE="radio" NAME="delim" VALUE="s"';
-print ' CHECKED' if $delim eq 's';
-print '>whitespace.';
-print <<END;
- <BR><INPUT TYPE="submit" VALUE="Submit">
- <BR><TEXTAREA NAME="expansion" ROWS=100>$expansion</TEXTAREA>
- </FORM>
- </CENTER>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main_county.cgi,v 1.8 1999-04-09 04:22:34 ivan Exp $
-#
-# ivan@sisd.com 97-dec-13-16
-#
-# Changes to allow page to work at a relative position in server
-# Changed tax field to accept 6 chars (MO uses 6.1%)
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: cust_main_county.cgi,v $
-# Revision 1.8 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.7 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.6 1999/01/25 12:09:55 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.5 1999/01/19 05:13:36 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:26 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/17 06:17:02 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.2 1998/11/18 09:01:39 ivan
-# i18n! i18n!
-#
-
-use strict;
-use vars qw( $cgi $cust_main_county );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar popurl table);
-use FS::cust_main_county;
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-print $cgi->header( '-expires' => 'now' ), header("Edit tax rates", menubar(
- 'Main Menu' => popurl(2),
-));
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print qq!<FORM ACTION="!, popurl(1),
- qq!process/cust_main_county.cgi" METHOD=POST>!, &table(), <<END;
- <TR>
- <TH><FONT SIZE=-1>Country</FONT></TH>
- <TH><FONT SIZE=-1>State</FONT></TH>
- <TH>County</TH>
- <TH><FONT SIZE=-1>Tax</FONT></TH>
- </TR>
-END
-
-foreach $cust_main_county ( qsearch('cust_main_county',{}) ) {
- my($hashref)=$cust_main_county->hashref;
- print <<END;
- <TR>
- <TD>$hashref->{country}</TD>
-END
-
- print "<TD>", $hashref->{state}
- ? $hashref->{state}
- : '(ALL)'
- , "</TD>";
-
- print "<TD>", $hashref->{county}
- ? $hashref->{county}
- : '(ALL)'
- , "</TD>";
-
- print qq!<TD><INPUT TYPE="text" NAME="tax!, $hashref->{taxnum},
- qq!" VALUE="!, $hashref->{tax}, qq!" SIZE=6 MAXLENGTH=6>%</TD></TR>!;
-END
-
-}
-
-print <<END;
- </TABLE>
- <INPUT TYPE="submit" VALUE="Apply changes">
- </FORM>
- </CENTER>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_pay.cgi,v 1.6 1999-02-28 00:03:35 ivan Exp $
-#
-# Usage: cust_pay.cgi invnum
-# http://server.name/path/cust_pay.cgi?invnum
-#
-# some hooks for modifications as well as additions, but needs work.
-#
-# ivan@voicenet.com 96-dec-11
-#
-# rewrite ivan@sisd.com 98-mar-16
-#
-# $Log: cust_pay.cgi,v $
-# Revision 1.6 1999-02-28 00:03:35 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/01/25 12:09:56 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.4 1999/01/19 05:13:37 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1999/01/18 09:41:27 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.2 1998/12/17 06:17:03 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-
-use strict;
-use vars qw( $cgi $invnum $p1 $_date $payby $payinfo $paid );
-use Date::Format;
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header popurl);
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- $invnum = $cgi->param('invnum');
- $paid = $cgi->param('paid');
- $payby = $cgi->param('payby');
- $payinfo = $cgi->param('payinfo');
-} else {
- my ($query) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $invnum = $1;
- $paid = '';
- $payby = "BILL";
- $payinfo = "";
-}
-$_date = time;
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("Enter payment", '');
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print <<END;
- <FORM ACTION="${p1}process/cust_pay.cgi" METHOD=POST>
- <HR><PRE>
-END
-
-print qq!Invoice #<B>$invnum</B><INPUT TYPE="hidden" NAME="invnum" VALUE="$invnum">!;
-
-print qq!<BR>Date: <B>!, time2str("%D",$_date), qq!</B><INPUT TYPE="hidden" NAME="_date" VALUE="$_date">!;
-
-print qq!<BR>Amount \$<INPUT TYPE="text" NAME="paid" VALUE="$paid" SIZE=8 MAXLENGTH=8>!;
-
-print qq!<BR>Payby: <B>$payby</B><INPUT TYPE="hidden" NAME="payby" VALUE="$payby">!;
-
-#payinfo (check # now as payby="BILL" hardcoded.. what to do later?)
-print qq!<BR>Check #<INPUT TYPE="text" NAME="payinfo" VALUE="$payinfo">!;
-
-#paybatch
-print qq!<INPUT TYPE="hidden" NAME="paybatch" VALUE="">!;
-
-print <<END;
-</PRE>
-<BR>
-<INPUT TYPE="submit" VALUE="Post payment">
-END
-
-print <<END;
-
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_pkg.cgi,v 1.8 1999-07-21 07:34:13 ivan Exp $
-#
-# this is for changing packages around, not editing things within the package
-#
-# Usage: cust_pkg.cgi custnum
-# http://server.name/path/cust_pkg.cgi?custnum
-#
-# started with /sales/add/cust_pkg.cgi, which added packages
-# ivan@voicenet.com 97-jan-5, 97-mar-21
-#
-# Rewrote for new API
-# ivan@voicenet.com 97-jul-7
-#
-# FS::Search is no more, &cgisuidsetup needs $cgi, ivan@sisd.com 98-mar-7
-#
-# Changes to allow page to work at a relative position in server
-# Changed to display packages 2-wide in a table
-# bmccane@maxbaud.net 98-apr-3
-#
-# fixed a pretty cool bug from above which caused a visual glitch ivan@sisd.com
-# 98-jun-1
-#
-# $Log: cust_pkg.cgi,v $
-# Revision 1.8 1999-07-21 07:34:13 ivan
-# links to package browse and agent type edit if there aren't any packages to
-# order. thanks to "Tech Account" <techy@orac.hq.org>
-#
-# Revision 1.7 1999/04/14 01:03:01 ivan
-# oops, in 1.2 tree, can't do searches until [cgi|admin]suidsetup,
-# bug is hidden by mod_perl persistance
-#
-# Revision 1.6 1999/02/28 00:03:36 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/02/07 09:59:18 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.4 1999/01/19 05:13:38 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1999/01/18 09:41:28 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.2 1998/12/17 06:17:04 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-
-use strict;
-use vars qw( $cgi %pkg %comment $custnum $p1 @cust_pkg
- $cust_main $agent $type_pkgs $count %remove_pkg $pkgparts );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header popurl);
-use FS::part_pkg;
-use FS::type_pkgs;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-%pkg = ();
-%comment = ();
-foreach (qsearch('part_pkg', {})) {
- $pkg{ $_ -> getfield('pkgpart') } = $_->getfield('pkg');
- $comment{ $_ -> getfield('pkgpart') } = $_->getfield('comment');
-}
-
-if ( $cgi->param('error') ) {
- $custnum = $cgi->param('custnum');
- %remove_pkg = map { $_ => 1 } $cgi->param('remove_pkg');
-} else {
- my($query) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $custnum = $1;
- undef %remove_pkg;
-}
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("Add/Edit Packages", '');
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print qq!<FORM ACTION="${p1}process/cust_pkg.cgi" METHOD=POST>!;
-
-print qq!<INPUT TYPE="hidden" NAME="custnum" VALUE="$custnum">!;
-
-#current packages
-@cust_pkg = qsearch('cust_pkg',{ 'custnum' => $custnum, 'cancel' => '' } );
-
-if (@cust_pkg) {
- print <<END;
-Current packages - select to remove (services are moved to a new package below)
-<BR><BR>
-END
-
- my ($count) = 0 ;
- print qq!<TABLE>! ;
- foreach (@cust_pkg) {
- print '<TR>' if $count == 0;
- my($pkgnum,$pkgpart)=( $_->getfield('pkgnum'), $_->getfield('pkgpart') );
- print qq!<TD><INPUT TYPE="checkbox" NAME="remove_pkg" VALUE="$pkgnum"!;
- print " CHECKED" if $remove_pkg{$pkgnum};
- print qq!>$pkgnum: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n!;
- $count ++ ;
- if ($count == 2)
- {
- $count = 0 ;
- print qq!</TR>\n! ;
- }
- }
- print qq!</TABLE><BR><BR>!;
-}
-
-print <<END;
-Order new packages<BR><BR>
-END
-
-$cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
-$agent = qsearchs('agent',{'agentnum'=> $cust_main->agentnum });
-
-$count = 0;
-$pkgparts = 0;
-print qq!<TABLE>!;
-foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
- $pkgparts++;
- my($pkgpart)=$type_pkgs->pkgpart;
- print qq!<TR>! if ( $count == 0 );
- my $value = $cgi->param("pkg$pkgpart") || 0;
- print <<END;
- <TD>
- <INPUT TYPE="text" NAME="pkg$pkgpart" VALUE="$value" SIZE="2" MAXLENGTH="2">
- $pkgpart: $pkg{$pkgpart} - $comment{$pkgpart}</TD>\n
-END
- $count ++ ;
- if ( $count == 2 ) {
- print qq!</TR>\n! ;
- $count = 0;
- }
-}
-print qq!</TABLE>!;
-
-unless ( $pkgparts ) {
- my $p2 = popurl(2);
- my $typenum = $agent->typenum;
- my $agent_type = qsearchs( 'agent_type', { 'typenum' => $typenum } );
- my $atype = $agent_type->atype;
- print <<END;
-(No <a href="${p2}browse/part_pkg.cgi">package definitions</a>, or agent type
-<a href="${p2}edit/agent_type.cgi?$typenum">$atype</a> not allowed to purchase
-any packages.)
-END
-}
-
-#submit
-print <<END;
-<P><INPUT TYPE="submit" VALUE="Order">
- </FORM>
- </BODY>
-</HTML>
-END
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_pkg.cgi,v 1.9 1999-02-07 09:59:19 ivan Exp $
-#
-# part_pkg.cgi: Add/Edit package (output form)
-#
-# ivan@sisd.com 97-dec-10
-#
-# Changes to allow page to work at a relative position in server
-# Changed to display services 2-wide in table
-# bmccane@maxbaud.net 98-apr-3
-#
-# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12
-#
-# $Log: part_pkg.cgi,v $
-# Revision 1.9 1999-02-07 09:59:19 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.8 1999/01/19 05:13:39 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.7 1999/01/18 09:41:29 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.6 1998/12/17 06:17:05 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.5 1998/11/21 07:12:26 ivan
-# *** empty log message ***
-#
-# Revision 1.4 1998/11/21 07:11:08 ivan
-# *** empty log message ***
-#
-# Revision 1.3 1998/11/21 07:07:40 ivan
-# popurl, bugfix
-#
-# Revision 1.2 1998/11/15 13:14:55 ivan
-# first pass as per-user custom pricing
-#
-
-use strict;
-use vars qw( $cgi $part_pkg $action $query $hashref $part_svc $count );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::part_pkg;
-use FS::part_svc;
-use FS::pkg_svc;
-use FS::CGI qw(header menubar popurl);
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-if ( $cgi->param('clone') && $cgi->param('clone') =~ /^(\d+)$/ ) {
- $cgi->param('clone', $1);
-} else {
- $cgi->param('clone', '');
-}
-if ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
- $cgi->param('pkgnum', $1);
-} else {
- $cgi->param('pkgnum', '');
-}
-
-($query) = $cgi->keywords;
-$action = '';
-$part_pkg = '';
-if ( $cgi->param('error') ) {
- $part_pkg = new FS::part_pkg ( {
- map { $_, scalar($cgi->param($_)) } fields('part_pkg')
- } );
-}
-if ( $cgi->param('clone') ) {
- $action='Custom Pricing';
- my $old_part_pkg =
- qsearchs('part_pkg', { 'pkgpart' => $cgi->param('clone') } );
- $part_pkg ||= $old_part_pkg->clone;
-} elsif ( $query && $query =~ /^(\d+)$/ ) {
- $part_pkg ||= qsearchs('part_pkg',{'pkgpart'=>$1});
-} else {
- $part_pkg ||= new FS::part_pkg {};
-}
-$action ||= $part_pkg->pkgpart ? 'Edit' : 'Add';
-$hashref = $part_pkg->hashref;
-
-print $cgi->header( '-expires' => 'now' ), header("$action Package Definition", menubar(
- 'Main Menu' => popurl(2),
- 'View all packages' => popurl(2). 'browse/part_pkg.cgi',
-));
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print '<FORM ACTION="', popurl(1), 'process/part_pkg.cgi" METHOD=POST>';
-
-if ( $cgi->param('clone') ) {
- print qq!<INPUT TYPE="hidden" NAME="clone" VALUE="!, $cgi->param('clone'), qq!">!;
-}
-if ( $cgi->param('pkgnum') ) {
- print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="!, $cgi->param('pkgnum'), qq!">!;
-}
-
-print qq!<INPUT TYPE="hidden" NAME="pkgpart" VALUE="$hashref->{pkgpart}">!,
- "Package Part #", $hashref->{pkgpart} ? $hashref->{pkgpart} : "(NEW)";
-
-print <<END;
-<PRE>
-Package (customer-visable) <INPUT TYPE="text" NAME="pkg" SIZE=32 VALUE="$hashref->{pkg}">
-Comment (customer-hidden) <INPUT TYPE="text" NAME="comment" SIZE=32 VALUE="$hashref->{comment}">
-Setup fee for this package <INPUT TYPE="text" NAME="setup" VALUE="$hashref->{setup}">
-Recurring fee for this package <INPUT TYPE="text" NAME="recur" VALUE="$hashref->{recur}">
-Frequency (months) of recurring fee <INPUT TYPE="text" NAME="freq" VALUE="$hashref->{freq}">
-
-</PRE>
-
-END
-
-unless ( $cgi->param('clone') ) {
- print <<END;
-Enter the quantity of each service this package includes.<BR><BR>
-<TABLE BORDER><TR><TH><FONT SIZE=-1>Quan.</FONT></TH><TH>Service</TH>
- <TH><FONT SIZE=-1>Quan.</FONT></TH><TH>Service</TH></TR>
-END
-}
-
-$count = 0;
-foreach $part_svc ( ( qsearch( 'part_svc', {} ) ) ) {
- my $svcpart = $part_svc->svcpart;
- my $pkg_svc = qsearchs( 'pkg_svc', {
- 'pkgpart' => $cgi->param('clone') || $part_pkg->pkgpart,
- 'svcpart' => $svcpart,
- } ) || new FS::pkg_svc ( {
- 'pkgpart' => $cgi->param('clone') || $part_pkg->pkgpart,
- 'svcpart' => $svcpart,
- 'quantity' => 0,
- });
- #? #next unless $pkg_svc;
-
- unless ( defined ($cgi->param('clone')) && $cgi->param('clone') ) {
- print '<TR>' if $count == 0 ;
- print qq!<TD><INPUT TYPE="text" NAME="pkg_svc$svcpart" SIZE=3 VALUE="!,
- $cgi->param("pkg_svc$svcpart") || $pkg_svc->quantity || 0,
- qq!"></TD><TD><A HREF="part_svc.cgi?!,$part_svc->svcpart,
- qq!">!, $part_svc->getfield('svc'), "</A></TD>";
- $count++;
- if ($count == 2)
- {
- print '</TR>';
- $count = 0;
- }
- } else {
- print qq!<INPUT TYPE="hidden" NAME="pkg_svc$svcpart" VALUE="!,
- $cgi->param("pkg_svc$svcpart") || $pkg_svc->quantity || 0, qq!">\n!;
- }
-}
-
-unless ( $cgi->param('clone') ) {
- print qq!</TR>! if ($count != 0) ;
- print "</TABLE>";
-}
-
-print qq!<BR><INPUT TYPE="submit" VALUE="!,
- $hashref->{pkgpart} ? "Apply changes" : "Add package",
- qq!">!;
-
-print <<END;
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_referral.cgi,v 1.6 1999-04-07 11:43:23 ivan Exp $
-#
-# ivan@sisd.com 98-feb-23
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# confisuing typo on submit button ivan@sisd.com 98-jun-14
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: part_referral.cgi,v $
-# Revision 1.6 1999-04-07 11:43:23 ivan
-# pick up errors right away, leave input
-#
-# Revision 1.5 1999/02/07 09:59:20 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.4 1999/01/19 05:13:41 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1999/01/18 09:41:30 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.2 1998/12/17 06:17:06 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-
-use strict;
-use vars qw( $cgi $part_referral $action $hashref $p1 $query );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::part_referral;
-use FS::CGI qw(header menubar popurl);
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- $part_referral = new FS::part_referral ( {
- map { $_, scalar($cgi->param($_)) } fields('part_referral')
- } );
-} elsif ( $cgi->keywords ) {
- my($query) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $part_referral = qsearchs( 'part_referral', { 'refnum' => $1 } );
-} else { #adding
- $part_referral = new FS::part_referral {};
-}
-$action = $part_referral->refnum ? 'Edit' : 'Add';
-$hashref = $part_referral->hashref;
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("$action Referral", menubar(
- 'Main Menu' => popurl(2),
- 'View all referrals' => popurl(2). "browse/part_referral.cgi",
-));
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print qq!<FORM ACTION="${p1}process/part_referral.cgi" METHOD=POST>!;
-
-print qq!<INPUT TYPE="hidden" NAME="refnum" VALUE="$hashref->{refnum}">!,
- "Referral #", $hashref->{refnum} ? $hashref->{refnum} : "(NEW)";
-
-print <<END;
-<PRE>
-Referral <INPUT TYPE="text" NAME="referral" SIZE=32 VALUE="$hashref->{referral}">
-</PRE>
-END
-
-print qq!<BR><INPUT TYPE="submit" VALUE="!,
- $hashref->{refnum} ? "Apply changes" : "Add referral",
- qq!">!;
-
-print <<END;
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_svc.cgi,v 1.12 1999-04-09 04:22:34 ivan Exp $
-#
-# ivan@sisd.com 97-nov-14
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# use FS::CGI, added inline documentation ivan@sisd.com 98-jul-12
-#
-# $Log: part_svc.cgi,v $
-# Revision 1.12 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.11 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.10 1999/04/08 13:01:50 ivan
-# [ AND DOCUMENT! ] all svc_acct services should have a default
-# or fixed shell
-#
-# Revision 1.9 1999/02/23 08:09:21 ivan
-# beginnings of one-screen new customer entry and some other miscellania
-#
-# Revision 1.8 1999/02/07 09:59:21 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.7 1999/01/19 05:13:42 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.6 1999/01/18 09:41:31 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.5 1998/12/30 23:03:21 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.4 1998/12/17 06:17:07 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.3 1998/11/21 06:43:26 ivan
-# visual
-#
-
-use strict;
-use vars qw( $cgi $part_svc $action $query $hashref $p %defs $svcdb );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs fields);
-use FS::part_svc;
-use FS::CGI qw(header menubar popurl table);
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- $part_svc = new FS::part_svc ( {
- map { $_, scalar($cgi->param($_)) } fields('part_svc')
- } );
-} elsif ( $cgi->keywords ) {
- my ($query) = $cgi->keywords;
- $query =~ /^(\d+)$/;
- $part_svc=qsearchs('part_svc',{'svcpart'=>$1});
-} else { #adding
- $part_svc = new FS::part_svc {};
-}
-$action = $part_svc->svcpart ? 'Edit' : 'Add';
-$hashref = $part_svc->hashref;
-
-$p = popurl(2);
-print $cgi->header( '-expires' => 'now' ), header("$action Service Definition", menubar(
- 'Main Menu' => $p,
- 'View all services' => "${p}browse/part_svc.cgi",
-));
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print '<FORM ACTION="', popurl(1), 'process/part_svc.cgi" METHOD=POST>';
-
-print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$hashref->{svcpart}">!,
- "Service Part #", $hashref->{svcpart} ? $hashref->{svcpart} : "(NEW)";
-
-print <<END;
-<PRE>
-Service <INPUT TYPE="text" NAME="svc" VALUE="$hashref->{svc}">
-</PRE>
-Services are items you offer to your customers.
-<UL><LI>svc_acct - Shell accounts, POP mailboxes, SLIP/PPP and ISDN accounts
- <LI>svc_domain - Virtual domains
- <LI>svc_acct_sm - Virtual domain mail aliasing
-END
-# <LI>svc_charge - One-time charges (Partially unimplemented)
-# <LI>svc_wo - Work orders (Partially unimplemented)
-print <<END;
-</UL>
-For the selected table, you can give fields default or fixed (unchangable)
-values. For example, a SLIP/PPP account may have a default (or perhaps fixed)
-<B>slipip</B> of <B>0.0.0.0</B>, while a POP mailbox will probably have a fixed
-blank <B>slipip</B> as well as a fixed shell something like <B>/bin/true</B> or
-<B>/usr/bin/passwd</B>.
-<BR><BR>
-END
-print &table(), '<TR><TH>Table<SELECT NAME="svcdb" SIZE=1>',
- map '<OPTION'. ' SELECTED'x($_ eq $hashref->{svcdb}). ">$_\n", qw(
- svc_acct svc_domain svc_acct_sm
- );
- print "</SELECT>";
-# svc_acct svc_domain svc_acct_sm svc_charge svc_wo
-
-print <<END;
-</TH><TH>Field</TH>
-<TH COLSPAN=2>Modifier</TH></TR>
-END
-
-#these might belong somewhere else for other user interfaces
-#pry need to eventually create stuff that's shared amount UIs
-%defs = (
- 'svc_acct' => {
- 'dir' => 'Home directory',
- 'uid' => 'UID (set to fixed and blank for dial-only)',
- 'slipip' => 'IP address',
- 'popnum' => qq!<A HREF="$p/browse/svc_acct_pop.cgi/">POP number</A>!,
- 'username' => 'Username',
- 'quota' => '(unimplemented)',
- '_password' => 'Password',
- 'gid' => 'GID (when blank, defaults to UID)',
- 'shell' => 'Shell (all service definitions should have a default or fixed shell that is present in the <b>shells</b> configuration file)',
- 'finger' => 'GECOS',
- },
- 'svc_domain' => {
- 'domain' => 'Domain',
- },
- 'svc_acct_sm' => {
- 'domuser' => 'domuser@virtualdomain.com',
- 'domuid' => 'UID where domuser@virtualdomain.com mail is forwarded',
- 'domsvc' => 'svcnum from svc_domain for virtualdomain.com',
- },
- 'svc_charge' => {
- 'amount' => 'amount',
- },
- 'svc_wo' => {
- 'worker' => 'Worker',
- '_date' => 'Date',
- },
-);
-
-# svc_acct svc_domain svc_acct_sm svc_charge svc_wo
-foreach $svcdb ( qw(
- svc_acct svc_domain svc_acct_sm
-) ) {
-
- my(@rows)=map { /^${svcdb}__(.*)$/; $1 }
- grep ! /_flag$/,
- grep /^${svcdb}__/,
- fields('part_svc');
- my($rowspan)=scalar(@rows);
-
- my($ptmp)="<TD ROWSPAN=$rowspan>$svcdb</TD>";
- my($row);
- foreach $row (@rows) {
- my $value = $part_svc->getfield($svcdb. '__'. $row);
- my $flag = $part_svc->getfield($svcdb. '__'. $row. '_flag');
- print "<TR>$ptmp<TD>$row";
- print "- <FONT SIZE=-1>$defs{$svcdb}{$row}</FONT>"
- if defined $defs{$svcdb}{$row};
- print "</TD>";
- print qq!<TD><INPUT TYPE="radio" NAME="${svcdb}__${row}_flag" VALUE=""!.
- ' CHECKED'x($flag eq ''). ">Off</TD>";
- print qq!<TD><INPUT TYPE="radio" NAME="${svcdb}__${row}_flag" VALUE="D"!.
- ' CHECKED'x($flag eq 'D'). ">Default ";
- print qq!<INPUT TYPE="radio" NAME="${svcdb}__${row}_flag" VALUE="F"!.
- ' CHECKED'x($flag eq 'F'). ">Fixed ";
- print qq!<INPUT TYPE="text" NAME="${svcdb}__${row}" VALUE="$value">!,
- "</TD></TR>\n";
- $ptmp='';
- }
-}
-print "</TABLE>";
-
-print qq!\n<BR><INPUT TYPE="submit" VALUE="!,
- $hashref->{svcpart} ? "Apply changes" : "Add service",
- qq!">!;
-
-print <<END;
-
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: agent.cgi,v 1.7 1999-01-25 12:09:57 ivan Exp $
-#
-# ivan@sisd.com 97-dec-12
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: agent.cgi,v $
-# Revision 1.7 1999-01-25 12:09:57 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.6 1999/01/19 05:13:47 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 22:47:49 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.4 1998/12/30 23:03:26 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.3 1998/12/17 08:40:16 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-# Revision 1.2 1998/11/23 07:52:29 ivan
-# *** empty log message ***
-#
-
-use strict;
-use vars qw ( $cgi $agentnum $old $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::agent;
-use FS::CGI qw(popurl);
-
-$cgi = new CGI;
-
-&cgisuidsetup($cgi);
-
-$agentnum = $cgi->param('agentnum');
-
-$old = qsearchs('agent',{'agentnum'=>$agentnum}) if $agentnum;
-
-$new = new FS::agent ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('agent')
-} );
-
-if ( $agentnum ) {
- $error=$new->replace($old);
-} else {
- $error=$new->insert;
- $agentnum=$new->getfield('agentnum');
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "agent.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "browse/agent.cgi");
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: agent_type.cgi,v 1.7 1999-01-25 12:09:58 ivan Exp $
-#
-# ivan@sisd.com 97-dec-11
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: agent_type.cgi,v $
-# Revision 1.7 1999-01-25 12:09:58 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.6 1999/01/19 05:13:48 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 22:47:50 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.4 1998/12/30 23:03:27 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.3 1998/12/17 08:40:17 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-# Revision 1.2 1998/11/21 07:49:20 ivan
-# s/CGI::Request/CGI.pm/
-#
-
-use strict;
-use vars qw ( $cgi $typenum $old $new $error $part_pkg );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::CGI qw( popurl);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::agent_type;
-use FS::type_pkgs;
-use FS::part_pkg;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$typenum = $cgi->param('typenum');
-$old = qsearchs('agent_type',{'typenum'=>$typenum}) if $typenum;
-
-$new = new FS::agent_type ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('agent_type')
-} );
-
-if ( $typenum ) {
- $error=$new->replace($old);
-} else {
- $error=$new->insert;
- $typenum=$new->getfield('typenum');
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "agent_type.cgi?". $cgi->query_string );
- exit;
-}
-
-foreach $part_pkg (qsearch('part_pkg',{})) {
- my($pkgpart)=$part_pkg->getfield('pkgpart');
-
- my($type_pkgs)=qsearchs('type_pkgs',{
- 'typenum' => $typenum,
- 'pkgpart' => $pkgpart,
- });
- if ( $type_pkgs && ! $cgi->param("pkgpart$pkgpart") ) {
- my($d_type_pkgs)=$type_pkgs; #need to save $type_pkgs for below.
- $error=$d_type_pkgs->delete;
- die $error if $error;
-
- } elsif ( $cgi->param("pkgpart$pkgpart")
- && ! $type_pkgs
- ) {
- #ok to clobber it now (but bad form nonetheless?)
- $type_pkgs=new FS::type_pkgs ({
- 'typenum' => $typenum,
- 'pkgpart' => $pkgpart,
- });
- $error= $type_pkgs->insert;
- die $error if $error;
- }
-
-}
-
-print $cgi->redirect(popurl(3). "browse/agent_type.cgi");
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_credit.cgi,v 1.7 1999-04-07 15:23:05 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/cust_credit.cgi
-#
-# ivan@voicenet.com 96-dec-05 -> 96-dec-08
-#
-# post a refund if $new_paybatch
-# ivan@voicenet.com 96-dec-08
-#
-# refunds are no longer applied against a specific payment (paybatch)
-# paybatch field removed
-# ivan@voicenet.com 97-apr-22
-#
-# rewrite ivan@sisd.com 98-mar-16
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: cust_credit.cgi,v $
-# Revision 1.7 1999-04-07 15:23:05 ivan
-# don't use anchor in redirect
-#
-# Revision 1.6 1999/02/28 00:03:41 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/01/25 12:09:59 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.4 1999/01/19 05:13:49 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1999/01/18 22:47:51 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.2 1998/12/17 08:40:18 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-
-use strict;
-use vars qw( $cgi $custnum $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup getotaker);
-use FS::CGI qw(popurl);
-use FS::Record qw(fields);
-use FS::cust_credit;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$cgi->param('custnum') =~ /^(\d*)$/ or die "Illegal custnum!";
-$custnum = $1;
-
-$cgi->param('otaker',getotaker);
-
-$new = new FS::cust_credit ( {
- map {
- $_, scalar($cgi->param($_));
- #} qw(custnum _date amount otaker reason)
- } fields('cust_credit')
-} );
-
-$error=$new->insert;
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "cust_credit.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-}
-
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main.cgi,v 1.11 1999-08-10 12:54:06 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/cust_main.cgi
-#
-# ivan@voicenet.com 96-dec-04
-#
-# added referral check
-# ivan@voicenet.com 97-jun-4
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-28
-#
-# same as above (again) and clean up some stuff ivan@sisd.com 98-feb-23
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'day' to 'daytime' because Pg6.3 reserves the day word
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: cust_main.cgi,v $
-# Revision 1.11 1999-08-10 12:54:06 ivan
-# use FS::cust_pkg::pkgpart_href
-#
-# Revision 1.10 1999/04/14 07:47:53 ivan
-# i18n fixes
-#
-# Revision 1.9 1999/04/07 15:22:19 ivan
-# don't use anchor in redirect
-#
-# Revision 1.8 1999/03/25 13:55:10 ivan
-# one-screen new customer entry (including package and service) for simple
-# packages with one svc_acct service
-#
-# Revision 1.7 1999/02/28 00:03:42 ivan
-# removed misleading comments
-#
-# Revision 1.6 1999/01/25 12:10:00 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.5 1999/01/19 05:13:50 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:22:32 ivan
-# changes to track email addresses for email invoicing
-#
-# Revision 1.3 1998/12/17 08:40:19 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-# Revision 1.2 1998/11/18 08:57:36 ivan
-# i18n, s/CGI-modules/CGI.pm/, FS::CGI::idiot instead of inline, FS::CGI::popurl
-#
-
-use strict;
-use vars qw( $cgi $payby @invoicing_list $new $custnum $error );
-use vars qw( $cust_pkg $cust_svc $svc_acct );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup getotaker);
-use FS::CGI qw( popurl );
-use FS::Record qw( qsearch qsearchs fields );
-use FS::cust_main;
-use FS::type_pkgs;
-use FS::agent;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-#unmunge stuff
-
-$cgi->param('tax','') unless defined($cgi->param('tax'));
-
-$cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] );
-
-$cgi->param('state') =~ /^(\w*)( \(([\w ]+)\))? ?\/ ?(\w+)$/
- or die "Oops, illegal \"state\" param: ". $cgi->param('state');
-$cgi->param('state', $1);
-$cgi->param('county', $3 || '');
-$cgi->param('country', $4);
-
-if ( $payby = $cgi->param('payby') ) {
- $cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) );
- $cgi->param('paydate',
- $cgi->param( $payby. '_month' ). '-'. $cgi->param( $payby. '_year' ) );
- $cgi->param('payname', $cgi->param( $payby. '_payname' ) );
-}
-
-$cgi->param('otaker', &getotaker );
-
-@invoicing_list = split( /\s*\,\s*/, $cgi->param('invoicing_list') );
-push @invoicing_list, 'POST' if $cgi->param('invoicing_list_POST');
-
-#create new record object
-
-$new = new FS::cust_main ( {
- map {
- $_, scalar($cgi->param($_))
-# } qw(custnum agentnum last first ss company address1 address2 city county
-# state zip daytime night fax payby payinfo paydate payname tax
-# otaker refnum)
- } fields('cust_main')
-} );
-
-#perhaps the invocing_list magic should move to cust_main.pm?
-$error = $new->check_invoicing_list( \@invoicing_list );
-
-#perhaps this stuff should go to cust_main.pm as well
-$cust_pkg = '';
-$svc_acct = '';
-if ( $new->custnum eq '' ) {
-
- if ( $cgi->param('pkgpart_svcpart') ) {
- my $x = $cgi->param('pkgpart_svcpart');
- $x =~ /^(\d+)_(\d+)$/;
- my($pkgpart, $svcpart) = ($1, $2);
- #false laziness: copied from FS::cust_pkg::order (which should become a
- #FS::cust_main method)
- my(%part_pkg);
- # generate %part_pkg
- # $part_pkg{$pkgpart} is true iff $custnum may purchase $pkgpart
- my $agent = qsearchs('agent',{'agentnum'=> $new->agentnum });
- #my($type_pkgs);
- #foreach $type_pkgs ( qsearch('type_pkgs',{'typenum'=> $agent->typenum }) ) {
- # my($pkgpart)=$type_pkgs->pkgpart;
- # $part_pkg{$pkgpart}++;
- #}
- # $pkgpart_href->{PKGPART} is true iff $custnum may purchase $pkgpart
- my $pkgpart_href = $agent->pkgpart_hashref;
- #eslaf
-
- # this should wind up in FS::cust_pkg!
- $error ||= "Agent ". $new->agentnum. " (type ". $agent->typenum. ") can't".
- "purchase pkgpart ". $pkgpart
- #unless $part_pkg{ $pkgpart };
- unless $pkgpart_href->{ $pkgpart };
-
- $cust_pkg = new FS::cust_pkg ( {
- #later 'custnum' => $custnum,
- 'pkgpart' => $pkgpart,
- } );
- $error ||= $cust_pkg->check;
-
- #$cust_svc = new FS::cust_svc ( { 'svcpart' => $svcpart } );
-
- #$error ||= $cust_svc->check;
-
- $svc_acct = new FS::svc_acct ( {
- 'svcpart' => $svcpart,
- 'username' => $cgi->param('username'),
- '_password' => $cgi->param('_password'),
- 'popnum' => $cgi->param('popnum'),
- } );
-
- my $y = $svc_acct->setdefault; # arguably should be in new method
- $error ||= $y unless ref($y);
- #and just in case you were silly
- $svc_acct->svcpart($svcpart);
- $svc_acct->username($cgi->param('username'));
- $svc_acct->_password($cgi->param('_password'));
- $svc_acct->popnum($cgi->param('popnum'));
-
- $error ||= $svc_acct->check;
-
- } elsif ( $cgi->param('username') ) { #good thing to catch
- $error = "Can't assign username without a package!";
- }
-
- $error ||= $new->insert;
- if ( $cust_pkg && ! $error ) {
- $cust_pkg->custnum( $new->custnum );
- $error ||= $cust_pkg->insert;
- warn "WARNING: $error on pre-checked cust_pkg record!" if $error;
- $svc_acct->pkgnum( $cust_pkg->pkgnum );
- $error ||= $svc_acct->insert;
- warn "WARNING: $error on pre-checked svc_acct record!" if $error;
- }
-} else { #create old record object
- my $old = qsearchs( 'cust_main', { 'custnum' => $new->custnum } );
- $error ||= "Old record not found!" unless $old;
- $error ||= $new->replace($old);
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "cust_main.cgi?". $cgi->query_string );
-} else {
- $new->invoicing_list( \@invoicing_list );
- $custnum = $new->custnum;
- print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-}
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main_county-expand.cgi,v 1.6 1999-01-25 12:19:07 ivan Exp $
-#
-# ivan@sisd.com 97-dec-16
-#
-# Changes to allow page to work at a relative position in server
-# Added import of datasrc from UID.pm for Pg6.3
-# Default tax to 0.0 if using Pg6.3
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI
-# undo default tax to 0.0 if using Pg6.3: comes from pre-expanded record
-# for that state
-# ivan@sisd.com 98-sep-2
-#
-# $Log: cust_main_county-expand.cgi,v $
-# Revision 1.6 1999-01-25 12:19:07 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.5 1999/01/19 05:13:51 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 22:47:52 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.3 1998/12/17 08:40:20 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-# Revision 1.2 1998/11/18 09:01:40 ivan
-# i18n! i18n!
-#
-
-use strict;
-use vars qw ( $cgi $taxnum $cust_main_county @expansion $expansion );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup datasrc);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(popurl);
-use FS::cust_main_county;
-use FS::cust_main;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!";
-$taxnum = $1;
-$cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum})
- or die ("Unknown taxnum!");
-
-if ( $cgi->param('delim') eq 'n' ) {
- @expansion=split(/\n/,$cgi->param('expansion'));
-} elsif ( $cgi->param('delim') eq 's' ) {
- @expansion=split(/\s+/,$cgi->param('expansion'));
-} else {
- die "Illegal delim!";
-}
-
-@expansion=map {
- unless ( /^\s*([\w\- ]+)\s*$/ ) {
- $cgi->param('error', "Illegal item in expansion");
- print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string );
- exit;
- }
- $1;
-} @expansion;
-
-foreach ( @expansion) {
- my(%hash)=$cust_main_county->hash;
- my($new)=new FS::cust_main_county \%hash;
- $new->setfield('taxnum','');
- if ( ! $cust_main_county->state ) {
- $new->setfield('state',$_);
- } else {
- $new->setfield('county',$_);
- }
- #if (datasrc =~ m/Pg/)
- #{
- # $new->setfield('tax',0.0);
- #}
- my($error)=$new->insert;
- die $error if $error;
-}
-
-unless ( qsearch('cust_main',{
- 'state' => $cust_main_county->getfield('state'),
- 'county' => $cust_main_county->getfield('county'),
- 'country' => $cust_main_county->getfield('country'),
-} ) ) {
- my($error)=($cust_main_county->delete);
- die $error if $error;
-}
-
-print $cgi->redirect(popurl(3). "edit/cust_main_county.cgi");
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main_county.cgi,v 1.6 1999-01-25 12:19:08 ivan Exp $
-#
-# ivan@sisd.com 97-dec-16
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: cust_main_county.cgi,v $
-# Revision 1.6 1999-01-25 12:19:08 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.5 1999/01/19 05:13:52 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 22:47:53 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.3 1998/12/17 08:40:21 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-# Revision 1.2 1998/11/18 09:01:41 ivan
-# i18n! i18n!
-#
-
-use strict;
-use vars qw( $cgi );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl);
-use FS::Record qw(qsearch qsearchs);
-use FS::cust_main_county;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-foreach ( $cgi->param ) {
- /^tax(\d+)$/ or die "Illegal form $_!";
- my($taxnum)=$1;
- my($old)=qsearchs('cust_main_county',{'taxnum'=>$taxnum})
- or die "Couldn't find taxnum $taxnum!";
- next unless $old->getfield('tax') ne $cgi->param("tax$taxnum");
- my(%hash)=$old->hash;
- $hash{tax}=$cgi->param("tax$taxnum");
- my($new)=new FS::cust_main_county \%hash;
- my($error)=$new->replace($old);
- if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "cust_main_county.cgi?". $cgi->query_string );
- exit;
- }
-}
-
-print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_pay.cgi,v 1.7 1999-02-28 00:03:43 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/cust_pay.cgi
-#
-# ivan@voicenet.com 96-dec-11
-#
-# rewrite ivan@sisd.com 98-mar-16
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: cust_pay.cgi,v $
-# Revision 1.7 1999-02-28 00:03:43 ivan
-# removed misleading comments
-#
-# Revision 1.6 1999/01/25 12:19:09 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.5 1999/01/19 05:13:53 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 22:47:54 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.3 1998/12/30 23:03:28 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.2 1998/12/17 08:40:22 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-
-use strict;
-use vars qw( $cgi $invnum $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl);
-use FS::Record qw(fields);
-use FS::cust_pay;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$cgi->param('invnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
-$invnum = $1;
-
-$new = new FS::cust_pay ( {
- map {
- $_, scalar($cgi->param($_));
- #} qw(invnum paid _date payby payinfo paybatch)
- } fields('cust_pay')
-} );
-
-$error=$new->insert;
-
-if ($error) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). 'cust_pay.cgi?'. $cgi->query_string );
- exit;
-} else {
- print $cgi->redirect(popurl(3). "view/cust_bill.cgi?$invnum");
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_pkg.cgi,v 1.7 1999-04-07 15:24:06 ivan Exp $
-#
-# this is for changing packages around, not for editing things within the
-# package
-#
-# Usage: post form to:
-# http://server.name/path/cust_pkg.cgi
-#
-# ivan@voicenet.com 97-mar-21 - 97-mar-24
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-7 - 15
-#
-# &cgisuidsetup($cgi) ivan@sisd.com 98-mar-7
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: cust_pkg.cgi,v $
-# Revision 1.7 1999-04-07 15:24:06 ivan
-# don't use anchor in redirect
-#
-# Revision 1.6 1999/02/28 00:03:44 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/02/07 09:59:26 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.3 1999/01/19 05:13:54 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.2 1998/12/17 08:40:23 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-
-use strict;
-use vars qw( $cgi $custnum @remove_pkgnums @pkgparts $pkgpart $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl);
-use FS::cust_pkg;
-
-$cgi = new CGI; # create form object
-&cgisuidsetup($cgi);
-$error = '';
-
-#untaint custnum
-$cgi->param('custnum') =~ /^(\d+)$/;
-$custnum = $1;
-
-@remove_pkgnums = map {
- /^(\d+)$/ or die "Illegal remove_pkg value!";
- $1;
-} $cgi->param('remove_pkg');
-
-foreach $pkgpart ( map /^pkg(\d+)$/ ? $1 : (), $cgi->param ) {
- if ( $cgi->param("pkg$pkgpart") =~ /^(\d+)$/ ) {
- my $num_pkgs = $1;
- while ( $num_pkgs-- ) {
- push @pkgparts,$pkgpart;
- }
- } else {
- $error = "Illegal quantity";
- last;
- }
-}
-
-$error ||= FS::cust_pkg::order($custnum,\@pkgparts,\@remove_pkgnums);
-
-if ($error) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "cust_pkg.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "view/cust_main.cgi?$custnum");
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_pkg.cgi,v 1.8 1999-02-07 09:59:27 ivan Exp $
-#
-# process/part_pkg.cgi: Edit package definitions (process form)
-#
-# ivan@sisd.com 97-dec-10
-#
-# don't update non-changing records in part_svc (causing harmless but annoying
-# "Records identical" errors). ivan@sisd.com 98-feb-19
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# Added `|| 0 ' when getting quantity off web page ivan@sisd.com 98-jun-4
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: part_pkg.cgi,v $
-# Revision 1.8 1999-02-07 09:59:27 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.7 1999/01/19 05:13:55 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.6 1999/01/18 22:47:56 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.5 1998/12/30 23:03:29 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.4 1998/12/17 08:40:24 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-# Revision 1.3 1998/11/21 07:17:58 ivan
-# bugfix to work for regular aswell as custom pricing
-#
-# Revision 1.2 1998/11/15 13:16:15 ivan
-# first pass as per-user custom pricing
-#
-
-use strict;
-use vars qw( $cgi $pkgpart $old $new $part_svc $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::part_pkg;
-use FS::pkg_svc;
-use FS::cust_pkg;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$pkgpart = $cgi->param('pkgpart');
-
-$old = qsearchs('part_pkg',{'pkgpart'=>$pkgpart}) if $pkgpart;
-
-$new = new FS::part_pkg ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('part_pkg')
-} );
-
-#most of the stuff below should move to part_pkg.pm
-
-foreach $part_svc ( qsearch('part_svc', {} ) ) {
- my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0;
- unless ( $quantity =~ /^(\d+)$/ ) {
- $cgi->param('error', "Illegal quantity" );
- print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string );
- exit;
- }
-}
-
-local $SIG{HUP} = 'IGNORE';
-local $SIG{INT} = 'IGNORE';
-local $SIG{QUIT} = 'IGNORE';
-local $SIG{TERM} = 'IGNORE';
-local $SIG{TSTP} = 'IGNORE';
-local $SIG{PIPE} = 'IGNORE';
-
-if ( $pkgpart ) {
- $error = $new->replace($old);
-} else {
- $error = $new->insert;
- $pkgpart=$new->pkgpart;
-}
-if ( $error ) {
- $cgi->param('error', $error );
- print $cgi->redirect(popurl(2). "part_pkg.cgi?". $cgi->query_string );
- exit;
-}
-
-foreach $part_svc (qsearch('part_svc',{})) {
- my $quantity = $cgi->param('pkg_svc'. $part_svc->svcpart) || 0;
- my $old_pkg_svc = qsearchs('pkg_svc', {
- 'pkgpart' => $pkgpart,
- 'svcpart' => $part_svc->svcpart,
- } );
- my $old_quantity = $old_pkg_svc ? $old_pkg_svc->quantity : 0;
- next unless $old_quantity != $quantity; #!here
- my $new_pkg_svc = new FS::pkg_svc( {
- 'pkgpart' => $pkgpart,
- 'svcpart' => $part_svc->svcpart,
- 'quantity' => $quantity,
- } );
- if ( $old_pkg_svc ) {
- my $myerror = $new_pkg_svc->replace($old_pkg_svc);
- die $myerror if $myerror;
- } else {
- my $myerror = $new_pkg_svc->insert;
- die $myerror if $myerror;
- }
-}
-
-unless ( $cgi->param('pkgnum') && $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
- print $cgi->redirect(popurl(3). "browse/part_pkg.cgi");
-} else {
- my($old_cust_pkg) = qsearchs( 'cust_pkg', { 'pkgnum' => $1 } );
- my %hash = $old_cust_pkg->hash;
- $hash{'pkgpart'} = $pkgpart;
- my($new_cust_pkg) = new FS::cust_pkg \%hash;
- my $myerror = $new_cust_pkg->replace($old_cust_pkg);
- die "Error modifying cust_pkg record: $myerror\n" if $myerror;
- print $cgi->redirect(popurl(3). "view/cust_main.cgi?". $new_cust_pkg->custnum);
-}
-
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_referral.cgi,v 1.6 1999-02-07 09:59:28 ivan Exp $
-#
-# ivan@sisd.com 98-feb-23
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: part_referral.cgi,v $
-# Revision 1.6 1999-02-07 09:59:28 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.5 1999/01/19 05:13:56 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 22:47:57 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.3 1998/12/30 23:03:30 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.2 1998/12/17 08:40:25 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-
-use strict;
-use vars qw( $cgi $refnum $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs fields);
-use FS::part_referral;
-use FS::CGI qw(popurl);
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$refnum = $cgi->param('refnum');
-
-$new = new FS::part_referral ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('part_referral')
-} );
-
-if ( $refnum ) {
- my $old = qsearchs( 'part_referral', { 'refnum' =>$ refnum } );
- die "(Old) Record not found!" unless $old;
- $error = $new->replace($old);
-} else {
- $error = $new->insert;
-}
-$refnum=$new->refnum;
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "part_referral.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "browse/part_referral.cgi");
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: part_svc.cgi,v 1.7 1999-02-07 09:59:29 ivan Exp $
-#
-# ivan@sisd.com 97-nov-14
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: part_svc.cgi,v $
-# Revision 1.7 1999-02-07 09:59:29 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.6 1999/01/19 05:13:57 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 22:47:58 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.4 1998/12/30 23:03:31 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.3 1998/12/17 08:40:26 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-# Revision 1.2 1998/11/21 06:43:08 ivan
-# s/CGI::Request/CGI.pm/
-#
-
-use strict;
-use vars qw ( $cgi $svcpart $old $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs fields);
-use FS::part_svc;
-use FS::CGI qw(popurl);
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$svcpart = $cgi->param('svcpart');
-
-$old = qsearchs('part_svc',{'svcpart'=>$svcpart}) if $svcpart;
-
-$new = new FS::part_svc ( {
- map {
- $_, scalar($cgi->param($_));
-# } qw(svcpart svc svcdb)
- } fields('part_svc')
-} );
-
-if ( $svcpart ) {
- $error = $new->replace($old);
-} else {
- $error = $new->insert;
- $svcpart=$new->getfield('svcpart');
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "part_svc.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3)."browse/part_svc.cgi");
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct.cgi,v 1.7 1999-08-27 00:26:33 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/svc_acct.cgi
-#
-# ivan@voicenet.com 96-dec-18
-#
-# Changed /u to /u2
-# ivan@voicenet.com 97-may-6
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-17 - 21
-#
-# no FS::Search, FS::svc_acct creates FS::cust_svc record, used for adding
-# and editing ivan@sisd.com 98-mar-8
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'password' to '_password' because Pg6.3 reserves the password word
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: svc_acct.cgi,v $
-# Revision 1.7 1999-08-27 00:26:33 ivan
-# better error messages
-#
-# Revision 1.6 1999/02/28 00:03:45 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/02/07 09:59:30 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.4 1999/01/19 05:13:58 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1999/01/18 22:47:59 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.2 1998/12/17 08:40:27 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-
-use strict;
-use vars qw( $cgi $svcnum $old $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl);
-use FS::Record qw(qsearchs fields);
-use FS::svc_acct;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
-$svcnum = $1;
-
-if ( $svcnum ) {
- $old = qsearchs('svc_acct', { 'svcnum' => $svcnum } )
- or die "fatal: can't find account (svcnum $svcnum)!";
-} else {
- $old = '';
-}
-
-#unmunge popnum
-$cgi->param('popnum', (split(/:/, $cgi->param('popnum') ))[0] );
-
-#unmunge passwd
-if ( $cgi->param('_password') eq '*HIDDEN*' ) {
- die "fatal: no previous account to recall hidden password from!" unless $old;
- $cgi->param('_password',$old->getfield('_password'));
-}
-
-$new = new FS::svc_acct ( {
- map {
- $_, scalar($cgi->param($_));
- #} qw(svcnum pkgnum svcpart username _password popnum uid gid finger dir
- # shell quota slipip)
- } ( fields('svc_acct'), qw( pkgnum svcpart ) )
-} );
-
-if ( $svcnum ) {
- $error = $new->replace($old);
-} else {
- $error = $new->insert;
- $svcnum = $new->svcnum;
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "svc_acct.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "view/svc_acct.cgi?" . $svcnum );
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct_pop.cgi,v 1.6 1999-02-07 09:59:31 ivan Exp $
-#
-# ivan@sisd.com 98-mar-8
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: svc_acct_pop.cgi,v $
-# Revision 1.6 1999-02-07 09:59:31 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.5 1999/01/19 05:13:59 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 22:48:00 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.3 1998/12/30 23:03:32 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.2 1998/12/17 08:40:28 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-
-use strict;
-use vars qw( $cgi $popnum $old $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::svc_acct_pop;
-use FS::CGI qw(popurl);
-
-$cgi = new CGI; # create form object
-
-&cgisuidsetup($cgi);
-
-$popnum = $cgi->param('popnum');
-
-$old = qsearchs('svc_acct_pop',{'popnum'=>$popnum}) if $popnum;
-
-$new = new FS::svc_acct_pop ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('svc_acct_pop')
-} );
-
-if ( $popnum ) {
- $error = $new->replace($old);
-} else {
- $error = $new->insert;
- $popnum=$new->getfield('popnum');
-}
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "svc_acct_pop.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "browse/svc_acct_pop.cgi");
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct_sm.cgi,v 1.6 1999-02-28 00:03:46 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/svc_acct_sm.cgi
-#
-# lots of crufty stuff from svc_acct still in here, and modifications are (unelegantly) disabled.
-#
-# ivan@voicenet.com 97-jan-6
-#
-# enabled modifications
-#
-# ivan@voicenet.com 97-may-7
-#
-# fixed removal of cust_svc record on modifications!
-# ivan@voicenet.com 97-jun-5
-#
-# rewrite ivan@sisd.com 98-mar-15
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: svc_acct_sm.cgi,v $
-# Revision 1.6 1999-02-28 00:03:46 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/02/07 09:59:32 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.4 1999/01/19 05:14:00 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1999/01/18 22:48:01 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.2 1998/12/17 08:40:29 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-
-use strict;
-use vars qw( $cgi $svcnum $old $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs fields);
-use FS::svc_acct_sm;
-use FS::CGI qw(popurl);
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
-$svcnum =$1;
-
-$old = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum}) if $svcnum;
-
-#unmunge domsvc and domuid
-#$cgi->param('domsvc',(split(/:/, $cgi->param('domsvc') ))[0] );
-#$cgi->param('domuid',(split(/:/, $cgi->param('domuid') ))[0] );
-
-$new = new FS::svc_acct_sm ( {
- map {
- ($_, scalar($cgi->param($_)));
- #} qw(svcnum pkgnum svcpart domuser domuid domsvc)
- } ( fields('svc_acct_sm'), qw( pkgnum svcpart ) )
-} );
-
-if ( $svcnum ) {
- $error = $new->replace($old);
-} else {
- $error = $new->insert;
- $svcnum = $new->getfield('svcnum');
-}
-
-if ($error) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "svc_acct_sm.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "view/svc_acct_sm.cgi?$svcnum");
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_domain.cgi,v 1.6 1999-02-28 00:03:47 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/svc_domain.cgi
-#
-# lots of yucky stuff in this one... bleachlkjhui!
-#
-# ivan@voicenet.com 97-jan-6
-#
-# kludged for new domain template 3.5
-# ivan@voicenet.com 97-jul-24
-#
-# moved internic bits to svc_domain.pm ivan@sisd.com 98-mar-14
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: svc_domain.cgi,v $
-# Revision 1.6 1999-02-28 00:03:47 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/02/07 09:59:33 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.4 1999/01/19 05:14:01 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1999/01/18 22:48:02 ivan
-# s/create/new/g; and use fields('table_name')
-#
-# Revision 1.2 1998/12/17 08:40:30 ivan
-# s/CGI::Request/CGI.pm/; etc
-#
-
-use strict;
-use vars qw( $cgi $svcnum $new $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs fields);
-use FS::svc_domain;
-use FS::CGI qw(popurl);
-
-#remove this to actually test the domains!
-$FS::svc_domain::whois_hack = 1;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
-$svcnum = $1;
-
-$new = new FS::svc_domain ( {
- map {
- $_, scalar($cgi->param($_));
- #} qw(svcnum pkgnum svcpart domain action purpose)
- } ( fields('svc_domain'), qw( pkgnum svcpart action purpose ) )
-} );
-
-if ($cgi->param('legal') ne "Yes") {
- $error = "Customer did not agree to be bound by NSI's ".
- qq!<A HREF="http://rs.internic.net/help/agreement.txt">!.
- "Domain Name Resgistration Agreement</A>";
-} elsif ($cgi->param('svcnum')) {
- $error="Can't modify a domain!";
-} else {
- $error=$new->insert;
- $svcnum=$new->svcnum;
-}
-
-if ($error) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "svc_domain.cgi?". $cgi->query_string );
-} else {
- print $cgi->redirect(popurl(3). "view/svc_domain.cgi?$svcnum");
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct.cgi,v 1.10 1999-04-14 11:27:06 ivan Exp $
-#
-# Usage: svc_acct.cgi {svcnum} | pkgnum{pkgnum}-svcpart{svcpart}
-# http://server.name/path/svc_acct.cgi? {svcnum} | pkgnum{pkgnum}-svcpart{svcpart}
-#
-# ivan@voicenet.com 96-dec-18
-#
-# rewrite ivan@sisd.com 98-mar-8
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'password' to '_password' because Pg6.3 reserves the password word
-# bmccane@maxbaud.net 98-apr-3
-#
-# use conf/shells and dbdef username length ivan@sisd.com 98-jul-13
-#
-# $Log: svc_acct.cgi,v $
-# Revision 1.10 1999-04-14 11:27:06 ivan
-# showpasswords config option to show passwords
-#
-# Revision 1.9 1999/02/28 00:03:37 ivan
-# removed misleading comments
-#
-# Revision 1.8 1999/02/23 08:09:22 ivan
-# beginnings of one-screen new customer entry and some other miscellania
-#
-# Revision 1.7 1999/02/07 09:59:22 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.6 1999/01/19 05:13:43 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:32 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1998/12/30 23:03:22 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.3 1998/12/17 06:17:08 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-
-use strict;
-use vars qw( $conf $cgi @shells $action $svcnum $svc_acct $pkgnum $svcpart
- $part_svc $svc $otaker $username $password $ulen $ulen2 $p1
- $popnum $uid $gid $finger $dir $shell $quota $slipip );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup getotaker);
-use FS::CGI qw(header popurl);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::svc_acct;
-use FS::Conf;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-@shells = $conf->config('shells');
-
-if ( $cgi->param('error') ) {
- $svc_acct = new FS::svc_acct ( {
- map { $_, scalar($cgi->param($_)) } fields('svc_acct')
- } );
- $svcnum = $svc_acct->svcnum;
- $pkgnum = $cgi->param('pkgnum');
- $svcpart = $cgi->param('svcpart');
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-} else {
- my($query) = $cgi->keywords;
- if ( $query =~ /^(\d+)$/ ) { #editing
- $svcnum=$1;
- $svc_acct=qsearchs('svc_acct',{'svcnum'=>$svcnum})
- or die "Unknown (svc_acct) svcnum!";
-
- my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
- or die "Unknown (cust_svc) svcnum!";
-
- $pkgnum=$cust_svc->pkgnum;
- $svcpart=$cust_svc->svcpart;
-
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-
- } else { #adding
-
- $svc_acct = new FS::svc_acct({});
-
- foreach $_ (split(/-/,$query)) {
- $pkgnum=$1 if /^pkgnum(\d+)$/;
- $svcpart=$1 if /^svcpart(\d+)$/;
- }
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-
- $svcnum='';
-
- #set gecos
- my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
- if ($cust_pkg) {
- my($cust_main)=qsearchs('cust_main',{'custnum'=> $cust_pkg->custnum } );
- $svc_acct->setfield('finger',
- $cust_main->getfield('first') . " " . $cust_main->getfield('last')
- ) ;
- }
-
- #set fixed and default fields from part_svc
- my($field);
- foreach $field ( fields('svc_acct') ) {
- if ( $part_svc->getfield('svc_acct__'. $field. '_flag') ne '' ) {
- $svc_acct->setfield($field,$part_svc->getfield('svc_acct__'. $field) );
- }
- }
-
- }
-}
-$action = $svcnum ? 'Edit' : 'Add';
-
-$svc = $part_svc->getfield('svc');
-
-$otaker = getotaker;
-
-$username = $svc_acct->username;
-if ( $svc_acct->_password ) {
- if ( $conf->exists('showpasswords') ) {
- $password = $svc_acct->_password;
- } else {
- $password = "*HIDDEN*";
- }
-} else {
- $password = '';
-}
-
-$ulen = $svc_acct->dbdef_table->column('username')->length;
-$ulen2 = $ulen+2;
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("$action $svc account");
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print <<END;
- <FORM ACTION="${p1}process/svc_acct.cgi" METHOD=POST>
- <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">
- <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
- <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
-Username:
-<INPUT TYPE="text" NAME="username" VALUE="$username" SIZE=$ulen2 MAXLENGTH=$ulen>
-<BR>Password:
-<INPUT TYPE="text" NAME="_password" VALUE="$password" SIZE=10 MAXLENGTH=8>
-(blank to generate)
-END
-
-#pop
-$popnum = $svc_acct->popnum || 0;
-if ( $part_svc->svc_acct__popnum_flag eq "F" ) {
- print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$popnum">!;
-} else {
- print qq!<BR>POP: <SELECT NAME="popnum" SIZE=1><OPTION>\n!;
- my($svc_acct_pop);
- foreach $svc_acct_pop ( qsearch ('svc_acct_pop',{} ) ) {
- print "<OPTION", $svc_acct_pop->popnum == $popnum ? ' SELECTED' : '', ">",
- $svc_acct_pop->popnum, ": ",
- $svc_acct_pop->city, ", ",
- $svc_acct_pop->state,
- " (", $svc_acct_pop->ac, ")/",
- $svc_acct_pop->exch, "\n"
- ;
- }
- print "</SELECT>";
-}
-
-($uid,$gid,$finger,$dir)=(
- $svc_acct->uid,
- $svc_acct->gid,
- $svc_acct->finger,
- $svc_acct->dir,
-);
-
-print <<END;
-<INPUT TYPE="hidden" NAME="uid" VALUE="$uid">
-<INPUT TYPE="hidden" NAME="gid" VALUE="$gid">
-<BR>GECOS: <INPUT TYPE="text" NAME="finger" VALUE="$finger">
-<INPUT TYPE="hidden" NAME="dir" VALUE="$dir">
-END
-
-$shell = $svc_acct->shell;
-if ( $part_svc->svc_acct__shell_flag eq "F" ) {
- print qq!<INPUT TYPE="hidden" NAME="shell" VALUE="$shell">!;
-} else {
- print qq!<BR>Shell: <SELECT NAME="shell" SIZE=1>!;
- my($etc_shell);
- foreach $etc_shell (@shells) {
- print "<OPTION", $etc_shell eq $shell ? ' SELECTED' : '', ">",
- $etc_shell, "\n";
- }
- print "</SELECT>";
-}
-
-($quota,$slipip)=(
- $svc_acct->quota,
- $svc_acct->slipip,
-);
-
-print qq!<INPUT TYPE="hidden" NAME="quota" VALUE="$quota">!;
-
-if ( $part_svc->svc_acct__slipip_flag eq "F" ) {
- print qq!<INPUT TYPE="hidden" NAME="slipip" VALUE="$slipip">!;
-} else {
- print qq!<BR>IP: <INPUT TYPE="text" NAME="slipip" VALUE="$slipip">!;
-}
-
-#submit
-print qq!<P><INPUT TYPE="submit" VALUE="Submit">!;
-
-print <<END;
- </FORM>
- </BODY>
-</HTML>
-END
-
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct_pop.cgi,v 1.9 2000-01-28 23:02:48 ivan Exp $
-#
-# ivan@sisd.com 98-mar-8
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: svc_acct_pop.cgi,v $
-# Revision 1.9 2000-01-28 23:02:48 ivan
-# track full phone number
-#
-# Revision 1.8 1999/02/23 08:09:23 ivan
-# beginnings of one-screen new customer entry and some other miscellania
-#
-# Revision 1.7 1999/02/07 09:59:23 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.6 1999/01/19 05:13:44 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:33 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1998/12/23 02:57:45 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.3 1998/12/17 06:17:10 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.2 1998/11/13 09:56:47 ivan
-# change configuration file layout to support multiple distinct databases (with
-# own set of config files, export, etc.)
-#
-
-use strict;
-use vars qw( $cgi $svc_acct_pop $action $query $hashref $p1 );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::CGI qw(header menubar popurl);
-use FS::svc_acct_pop;
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- $svc_acct_pop = new FS::svc_acct_pop ( {
- map { $_, scalar($cgi->param($_)) } fields('svc_acct_pop')
- } );
-} elsif ( $cgi->keywords ) { #editing
- my($query)=$cgi->keywords;
- $query =~ /^(\d+)$/;
- $svc_acct_pop=qsearchs('svc_acct_pop',{'popnum'=>$1});
-} else { #adding
- $svc_acct_pop = new FS::svc_acct_pop {};
-}
-$action = $svc_acct_pop->popnum ? 'Edit' : 'Add';
-$hashref = $svc_acct_pop->hashref;
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("$action POP", menubar(
- 'Main Menu' => popurl(2),
- 'View all POPs' => popurl(2). "browse/svc_acct_pop.cgi",
-));
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print qq!<FORM ACTION="${p1}process/svc_acct_pop.cgi" METHOD=POST>!;
-
-#display
-
-print qq!<INPUT TYPE="hidden" NAME="popnum" VALUE="$hashref->{popnum}">!,
- "POP #", $hashref->{popnum} ? $hashref->{popnum} : "(NEW)";
-
-print <<END;
-<PRE>
-City <INPUT TYPE="text" NAME="city" SIZE=32 VALUE="$hashref->{city}">
-State <INPUT TYPE="text" NAME="state" SIZE=16 MAXLENGTH=16 VALUE="$hashref->{state}">
-Area Code <INPUT TYPE="text" NAME="ac" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{ac}">
-Exchange <INPUT TYPE="text" NAME="exch" SIZE=4 MAXLENGTH=3 VALUE="$hashref->{exch}">
-Local <INPUT TYPE="text" NAME="loc" SIZE=5 MAXLENGTH=4 VALUE="$hashref->{loc}">
-</PRE>
-END
-
-print qq!<BR><INPUT TYPE="submit" VALUE="!,
- $hashref->{popnum} ? "Apply changes" : "Add POP",
- qq!">!;
-
-print <<END;
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct_sm.cgi,v 1.9 1999-02-28 00:03:38 ivan Exp $
-#
-# Usage: svc_acct_sm.cgi {svcnum} | pkgnum{pkgnum}-svcpart{svcpart}
-# http://server.name/path/svc_acct_sm.cgi? {svcnum} | pkgnum{pkgnum}-svcpart{svcpart}
-#
-# use {svcnum} for edit, pkgnum{pkgnum}-svcpart{svcpart} for add
-#
-# should error out in a more CGI-friendly way, and should have more error checking (sigh).
-#
-# ivan@voicenet.com 97-jan-5
-#
-# added debugging code; fixed CPU-sucking problem with trying to edit an (unaudited) mail alias (no pkgnum)
-#
-# ivan@voicenet.com 97-may-7
-#
-# fixed uid selection
-# ivan@voicenet.com 97-jun-4
-#
-# uid selection across _CUSTOMER_, not just _PACKAGE_
-#
-# ( i need to be rewritten with fast searches)
-#
-# ivan@voicenet.com 97-oct-3
-#
-# added fast searches in some of the places where it is sorely needed...
-# I see DBI::mysql in your future...
-# ivan@voicenet.com 97-oct-23
-#
-# rewrite ivan@sisd.com 98-mar-15
-#
-# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-26
-#
-# $Log: svc_acct_sm.cgi,v $
-# Revision 1.9 1999-02-28 00:03:38 ivan
-# removed misleading comments
-#
-# Revision 1.8 1999/02/07 09:59:24 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.7 1999/01/19 05:13:45 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.6 1999/01/18 09:41:34 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.5 1998/12/30 23:03:24 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.4 1998/12/23 02:58:45 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.3 1998/12/17 06:17:11 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.2 1998/12/16 05:19:15 ivan
-# use FS::Conf
-#
-
-use strict;
-use vars qw( $conf $cgi $mydomain $action $svcnum $svc_acct_sm $pkgnum $svcpart
- $part_svc $query %username %domain $p1 $domuser $domsvc $domuid );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header popurl);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::svc_acct_sm;
-use FS::Conf;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-$mydomain = $conf->config('domain');
-
-if ( $cgi->param('error') ) {
- $svc_acct_sm = new FS::svc_acct_sm ( {
- map { $_, scalar($cgi->param($_)) } fields('svc_acct_sm')
- } );
- $svcnum = $svc_acct_sm->svcnum;
- $pkgnum = $cgi->param('pkgnum');
- $svcpart = $cgi->param('svcpart');
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-} else {
- my($query) = $cgi->keywords;
- if ( $query =~ /^(\d+)$/ ) { #editing
- $svcnum=$1;
- $svc_acct_sm=qsearchs('svc_acct_sm',{'svcnum'=>$svcnum})
- or die "Unknown (svc_acct_sm) svcnum!";
-
- my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
- or die "Unknown (cust_svc) svcnum!";
-
- $pkgnum=$cust_svc->pkgnum;
- $svcpart=$cust_svc->svcpart;
-
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-
- } else { #adding
-
- $svc_acct_sm = new FS::svc_acct_sm({});
-
- foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
- $pkgnum=$1 if /^pkgnum(\d+)$/;
- $svcpart=$1 if /^svcpart(\d+)$/;
- }
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-
- $svcnum='';
-
- #set fixed and default fields from part_svc
- my($field);
- foreach $field ( fields('svc_acct_sm') ) {
- if ( $part_svc->getfield('svc_acct_sm__'. $field. '_flag') ne '' ) {
- $svc_acct_sm->setfield($field,$part_svc->getfield('svc_acct_sm__'. $field) );
- }
- }
-
- }
-}
-$action = $svc_acct_sm->svcnum ? 'Edit' : 'Add';
-
-if ($pkgnum) {
-
- #find all possible uids (and usernames)
-
- my($u_part_svc,@u_acct_svcparts);
- foreach $u_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_acct'}) ) {
- push @u_acct_svcparts,$u_part_svc->getfield('svcpart');
- }
-
- my($cust_pkg)=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
- my($custnum)=$cust_pkg->getfield('custnum');
- my($i_cust_pkg);
- foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
- my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
- my($acct_svcpart);
- foreach $acct_svcpart (@u_acct_svcparts) { #now find the corresponding
- #record(s) in cust_svc ( for this
- #pkgnum ! )
- my($i_cust_svc);
- foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
- my($svc_acct)=qsearchs('svc_acct',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
- $username{$svc_acct->getfield('uid')}=$svc_acct->getfield('username');
- }
- }
- }
-
- #find all possible domains (and domsvc's)
-
- my($d_part_svc,@d_acct_svcparts);
- foreach $d_part_svc ( qsearch('part_svc',{'svcdb'=>'svc_domain'}) ) {
- push @d_acct_svcparts,$d_part_svc->getfield('svcpart');
- }
-
- foreach $i_cust_pkg ( qsearch('cust_pkg',{'custnum'=>$custnum}) ) {
- my($cust_pkgnum)=$i_cust_pkg->getfield('pkgnum');
- my($acct_svcpart);
- foreach $acct_svcpart (@d_acct_svcparts) {
- my($i_cust_svc);
- foreach $i_cust_svc ( qsearch('cust_svc',{'pkgnum'=>$cust_pkgnum,'svcpart'=>$acct_svcpart}) ) {
- my($svc_domain)=qsearch('svc_domain',{'svcnum'=>$i_cust_svc->getfield('svcnum')});
- $domain{$svc_domain->getfield('svcnum')}=$svc_domain->getfield('domain');
- }
- }
- }
-
-} elsif ( $action eq 'Edit' ) {
-
- my($svc_acct)=qsearchs('svc_acct',{'uid'=>$svc_acct_sm->domuid});
- $username{$svc_acct_sm->uid} = $svc_acct->username;
-
- my($svc_domain)=qsearchs('svc_domain',{'svcnum'=>$svc_acct_sm->domsvc});
- $domain{$svc_acct_sm->domsvc} = $svc_domain->domain;
-
-} else {
- die "\$action eq Add, but \$pkgnum is null!\n";
-}
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("Mail Alias $action", '');
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print qq!<FORM ACTION="${p1}process/svc_acct_sm.cgi" METHOD=POST>!;
-
-#display
-
- #formatting
- print "<PRE>";
-
-#svcnum
-print qq!<INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">!;
-print qq!Service #<FONT SIZE=+1><B>!, $svcnum ? $svcnum : " (NEW)", "</B></FONT>";
-
-#pkgnum
-print qq!<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">!;
-
-#svcpart
-print qq!<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">!;
-
-($domuser,$domsvc,$domuid)=(
- $svc_acct_sm->domuser,
- $svc_acct_sm->domsvc,
- $svc_acct_sm->domuid,
-);
-
-#domuser
-print qq!\n\nMail to <INPUT TYPE="text" NAME="domuser" VALUE="$domuser"> <I>( * for anything )</I>!;
-
-#domsvc
-print qq! \@ <SELECT NAME="domsvc" SIZE=1>!;
-foreach $_ (keys %domain) {
- print "<OPTION", $_ eq $domsvc ? " SELECTED" : "",
- qq! VALUE="$_">$domain{$_}!;
-}
-print "</SELECT>";
-
-#uid
-print qq!\nforwards to <SELECT NAME="domuid" SIZE=1>!;
-foreach $_ (keys %username) {
- print "<OPTION", ($_ eq $domuid) ? " SELECTED" : "",
- qq! VALUE="$_">$username{$_}!;
-}
-print "</SELECT>\@$mydomain mailbox.";
-
- #formatting
- print "</PRE>\n";
-
-print qq!<CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>!;
-
-print <<END;
-
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_domain.cgi,v 1.9 1999-02-28 00:03:39 ivan Exp $
-#
-# Usage: svc_domain.cgi pkgnum{pkgnum}-svcpart{svcpart}
-# http://server.name/path/svc_domain.cgi?pkgnum{pkgnum}-svcpart{svcpart}
-#
-# ivan@voicenet.com 97-jan-5 -> 97-jan-6
-#
-# changes for domain template 3.5
-# ivan@voicenet.com 97-jul-24
-#
-# rewrite ivan@sisd.com 98-mar-14
-#
-# no GOV in instructions ivan@sisd.com 98-jul-17
-#
-# $Log: svc_domain.cgi,v $
-# Revision 1.9 1999-02-28 00:03:39 ivan
-# removed misleading comments
-#
-# Revision 1.8 1999/02/07 09:59:25 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.7 1999/01/19 05:13:46 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.6 1999/01/18 09:41:35 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.5 1998/12/30 23:03:25 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.4 1998/12/23 03:00:16 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.3 1998/12/17 06:17:12 ivan
-# fix double // in relative URLs, s/CGI::Base/CGI/;
-#
-# Revision 1.2 1998/11/13 09:56:48 ivan
-# change configuration file layout to support multiple distinct databases (with
-# own set of config files, export, etc.)
-#
-
-use strict;
-use vars qw( $cgi $action $svcnum $svc_domain $pkgnum $svcpart $part_svc
- $svc $otaker $domain $p1 $kludge_action $purpose );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup getotaker);
-use FS::CGI qw(header popurl);
-use FS::Record qw(qsearch qsearchs fields);
-use FS::svc_domain;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-if ( $cgi->param('error') ) {
- $svc_domain = new FS::svc_domain ( {
- map { $_, scalar($cgi->param($_)) } fields('svc_domain')
- } );
- $svcnum = $svc_domain->svcnum;
- $pkgnum = $cgi->param('pkgnum');
- $svcpart = $cgi->param('svcpart');
- $kludge_action = $cgi->param('action');
- $purpose = $cgi->param('purpose');
- $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } );
- die "No part_svc entry!" unless $part_svc;
-} else {
- $kludge_action = '';
- $purpose = '';
- my($query) = $cgi->keywords;
- if ( $query =~ /^(\d+)$/ ) { #editing
- $svcnum=$1;
- $svc_domain=qsearchs('svc_domain',{'svcnum'=>$svcnum})
- or die "Unknown (svc_domain) svcnum!";
-
- my($cust_svc)=qsearchs('cust_svc',{'svcnum'=>$svcnum})
- or die "Unknown (cust_svc) svcnum!";
-
- $pkgnum=$cust_svc->pkgnum;
- $svcpart=$cust_svc->svcpart;
-
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-
- } else { #adding
-
- $svc_domain = new FS::svc_domain({});
-
- foreach $_ (split(/-/,$query)) {
- $pkgnum=$1 if /^pkgnum(\d+)$/;
- $svcpart=$1 if /^svcpart(\d+)$/;
- }
- $part_svc=qsearchs('part_svc',{'svcpart'=>$svcpart});
- die "No part_svc entry!" unless $part_svc;
-
- $svcnum='';
-
- #set fixed and default fields from part_svc
- my($field);
- foreach $field ( fields('svc_domain') ) {
- if ( $part_svc->getfield('svc_domain__'. $field. '_flag') ne '' ) {
- $svc_domain->setfield($field,$part_svc->getfield('svc_domain__'. $field) );
- }
- }
-
- }
-}
-$action = $svcnum ? 'Edit' : 'Add';
-
-$svc = $part_svc->getfield('svc');
-
-$otaker = getotaker;
-
-$domain = $svc_domain->domain;
-
-$p1 = popurl(1);
-print $cgi->header( '-expires' => 'now' ), header("$action $svc", '');
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print <<END;
- <FORM ACTION="${p1}process/svc_domain.cgi" METHOD=POST>
- <INPUT TYPE="hidden" NAME="svcnum" VALUE="$svcnum">
- <INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
- <INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
-END
-
-print qq!<INPUT TYPE="radio" NAME="action" VALUE="N"!;
-print ' CHECKED' if $kludge_action eq 'N';
-print qq!>New!;
-print qq!<BR><INPUT TYPE="radio" NAME="action" VALUE="M"!;
-print ' CHECKED' if $kludge_action eq 'M';
-print qq!>Transfer!;
-
-print <<END;
-<P>Customer agrees to be bound by NSI's
-<A HREF="http://rs.internic.net/help/agreement.txt">
-Domain Name Registration Agreement</A>
-<SELECT NAME="legal" SIZE=1><OPTION SELECTED>No<OPTION>Yes</SELECT>
-<P>Domain <INPUT TYPE="text" NAME="domain" VALUE="$domain" SIZE=28 MAXLENGTH=26>
-<BR>Purpose/Description: <INPUT TYPE="text" NAME="purpose" VALUE="$purpose" SIZE=64>
-<P><CENTER><INPUT TYPE="submit" VALUE="Submit"></CENTER>
-<UL>
- <LI>COM is for commercial, for-profit organziations
- <LI>ORG is for miscellaneous, usually, non-profit organizations
- <LI>NET is for network infrastructure machines and organizations
- <LI>EDU is for 4-year, degree granting institutions
-<!-- <LI>GOV is for United States federal government agencies
-!-->
-</UL>
-US state and local government agencies, schools, libraries, museums, and individuals should register under the US domain. See RFC 1480 for a complete description of the US domain
-and registration procedures.
-<!-- <P>GOV registrations are limited to top-level US Federal Government agencies (see RFC 1816).
-!-->
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-<HTML>
- <HEAD>
- <TITLE>
- Freeside Main Menu
- </TITLE>
- </HEAD>
- <BODY BGCOLOR="#FFFFFF">
- <table>
- <tr><td>
- <P ALIGN=CENTER>
- <IMG BORDER=0 ALT="Silicon Interactive Software Design" SRC="images/small-logo.gif">
- </td><td>
- <center><font color="#ff0000" size=7>freeside main menu</font></center>
- </td></tr>
- </table>
- <A HREF="http://www.sisd.com/freeside">
- Freeside home page
- </A>
- <BR><A HREF="docs/">
- Documentation
- </A>
- </P>
- <HR>
- <ul>
- <li><A HREF="edit/cust_main.cgi">New Customer</A>
- <li><A NAME="search">Search</A>
- <ul>
- <LI><A HREF="search/cust_main.html">
- customers (by last name and/or company)
- </A>
- <LI><A HREF="search/cust_main-payinfo.html">customers (by credit card number)</A>
- <LI><A HREF="search/svc_acct.html">accounts (by username)</A>
- <LI><A HREF="search/svc_domain.html">domains (by domain)</A>
- <LI><A HREF="search/svc_acct_sm.html">mail aliases (by domain, and optionally username)</A>
- <LI><A HREF="search/cust_bill.html">invoices (by invoice number)</A>
- </ul>
- <li><A NAME="browse">Browse</A>
- <ul>
- <LI><A HREF="search/cust_main.cgi?custnum">customers (by customer number)</A>
- <LI><A HREF="search/cust_main.cgi?last">customers (by last name)</A>
- <LI><A HREF="search/cust_main.cgi?company">customers (by company)</A>
- <LI><A HREF="search/cust_pkg.cgi?pkgnum">packages (by package number)</A>
- <LI><A HREF="search/cust_pkg.cgi?APKG_pkgnum">packages with unconfigured services (by package number)</A>
- <LI><A HREF="search/svc_acct.cgi?svcnum">accounts (by service number)</A>
- <LI><A HREF="search/svc_acct.cgi?username">accounts (by username)</A>
- <LI><A HREF="search/svc_acct.cgi?uid">accounts (by uid)</A>
- <LI><A HREF="search/svc_acct.cgi?UN_svcnum">unlinked accounts (by service number)</A>
- <LI><A HREF="search/svc_acct.cgi?UN_username">unlinked accounts (by username)</A>
- <LI><A HREF="search/svc_acct.cgi?UN_uid">unlinked accounts (by uid)</A>
- <LI><A HREF="search/svc_domain.cgi?svcnum">domains (by service number)</A>
- <LI><A HREF="search/svc_domain.cgi?domain">domains (by domain)</A>
- <LI><A HREF="search/svc_domain.cgi?UN_svcnum">unlinked domains (by service number)</A>
- <LI><A HREF="search/svc_domain.cgi?UN_domain">unlinked domains (by domain)</A>
- </ul>
- <li><A NAME="admin">Administration</a>
- <ul>
- <LI><A HREF="browse/part_svc.cgi">
- View/Edit service definitions
- </A>
- - Services are items you offer to your customers.
- <LI><A HREF="browse/part_pkg.cgi">
- View/Edit package definitions
- </A>
- - One or more services are grouped together into a package and
- given pricing information. Customers purchase packages, not
- services.
- <LI><A HREF="browse/agent_type.cgi">
- View/Edit agent types
- </A>
- - Agent types define groups of package definitions that you can
- then assign to particular agents.
- <LI><A HREF="browse/agent.cgi">
- View/Edit agents
- </A>
- - Agents are resellers of your service. Agents may be limited
- to a subset of your full offerings (via their type).
- <LI><A HREF="browse/part_referral.cgi">
- View/Edit referrals
- </A>
- - Where a customer heard about your service. Tracked for
- informational purposes.
- <LI><A HREF="browse/cust_main_county.cgi">
- View/Edit locales and tax rates
- </A>
- - Change tax rates, or break down a country into states, or a state
- into counties and assign different tax rates to each.
- <LI><A HREF="browse/svc_acct_pop.cgi">
- View/Edit POPs
- </A>
- - Points of Presence
- </ul>
- </ul>
- </BODY>
-</HTML>
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: bill.cgi,v 1.5 1999-08-12 04:32:21 ivan Exp $
-#
-# s/FS:Search/FS::Record/ and cgisuidsetup($cgi) ivan@sisd.com 98-mar-13
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: bill.cgi,v $
-# Revision 1.5 1999-08-12 04:32:21 ivan
-# hidecancelledcustomers
-#
-# Revision 1.4 1999/01/19 05:14:02 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1998/12/23 03:01:13 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:12:41 ivan
-# s/CGI::(Request|Base)/CGI.pm/;
-#
-
-use strict;
-use vars qw( $cgi $query $custnum $cust_main $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl eidiot);
-use FS::Record qw(qsearchs);
-use FS::cust_main;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-#untaint custnum
-($query) = $cgi->keywords;
-$query =~ /^(\d*)$/;
-$custnum = $1;
-$cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
-die "Can't find customer!\n" unless $cust_main;
-
-$error = $cust_main->bill(
-# 'time'=>$time
- );
-&eidiot($error) if $error;
-
-$error = $cust_main->collect(
-# 'invoice-time'=>$time,
-# 'batch_card'=> 'yes',
- 'batch_card'=> 'no',
- 'report_badcard'=> 'yes',
- );
-&eidiot($error) if $error;
-
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum");
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cancel-unaudited.cgi,v 1.6 1999-02-28 00:03:48 ivan Exp $
-#
-# Usage: cancel-unaudited.cgi svcnum
-# http://server.name/path/cancel-unaudited.cgi pkgnum
-#
-# ivan@voicenet.com 97-apr-23
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-21
-#
-# Search->Record, cgisuidsetup($cgi) ivan@sids.com 98-mar-19
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: cancel-unaudited.cgi,v $
-# Revision 1.6 1999-02-28 00:03:48 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/02/07 09:59:34 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.4 1999/01/19 05:14:03 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1998/12/23 03:02:05 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:12:42 ivan
-# s/CGI::(Request|Base)/CGI.pm/;
-#
-
-use strict;
-use vars qw( $cgi $query $svcnum $svc_acct $cust_svc $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl eidiot);
-use FS::Record qw(qsearchs);
-use FS::cust_svc;
-use FS::svc_acct;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-#untaint svcnum
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-$svcnum = $1;
-
-$svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
-die "Unknown svcnum!" unless $svc_acct;
-
-$cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
-&eidiot(qq!This account has already been audited. Cancel the
- <A HREF="!. popurl(2). qq!view/cust_pkg.cgi?! . $cust_svc->getfield('pkgnum') .
- qq!pkgnum"> package</A> instead.!)
- if $cust_svc->getfield('pkgnum') ne '';
-
-local $SIG{HUP} = 'IGNORE';
-local $SIG{INT} = 'IGNORE';
-local $SIG{QUIT} = 'IGNORE';
-local $SIG{TERM} = 'IGNORE';
-local $SIG{TSTP} = 'IGNORE';
-
-$error = $svc_acct->cancel;
-&eidiot($error) if $error;
-$error = $svc_acct->delete;
-&eidiot($error) if $error;
-
-$error = $cust_svc->delete;
-&eidiot($error) if $error;
-
-print $cgi->redirect(popurl(2));
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cancel_pkg.cgi,v 1.6 1999-04-08 10:35:02 ivan Exp $
-#
-# Usage: cancel_pkg.cgi pkgnum
-# http://server.name/path/cancel_pkg.cgi pkgnum
-#
-# IT DOESN'T RUN THE APPROPRIATE PROGRAMS YET!!!!
-#
-# probably should generalize this to do cancels, suspensions, unsuspensions, etc.
-#
-# ivan@voicenet.com 97-jan-2
-#
-# still kludgy, but now runs /dbin/cancel $pkgnum
-# ivan@voicenet.com 97-feb-27
-#
-# doesn't run if pkgnum doesn't match regex
-# ivan@voicenet.com 97-mar-6
-#
-# now redirects to enter comments
-# ivan@voicenet.com 97-may-8
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-21
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: cancel_pkg.cgi,v $
-# Revision 1.6 1999-04-08 10:35:02 ivan
-# import necessary subroutines from FS::CGI
-#
-# Revision 1.5 1999/02/28 00:03:49 ivan
-# removed misleading comments
-#
-# Revision 1.4 1999/01/19 05:14:04 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1998/12/23 03:02:54 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:12:43 ivan
-# s/CGI::(Request|Base)/CGI.pm/;
-#
-
-use strict;
-use vars qw ( $cgi $query $pkgnum $cust_pkg $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(eidiot popurl);
-use FS::Record qw(qsearchs);
-use FS::CGI qw(popurl eidiot);
-use FS::cust_pkg;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-#untaint pkgnum
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ || die "Illegal pkgnum";
-$pkgnum = $1;
-
-$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-
-$error = $cust_pkg->cancel;
-eidiot($error) if $error;
-
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: delete-customer.cgi,v 1.1 1999-04-15 16:44:36 ivan Exp $
-#
-# $Log: delete-customer.cgi,v $
-# Revision 1.1 1999-04-15 16:44:36 ivan
-# delete customers
-#
-
-use strict;
-use vars qw( $cgi $conf $query $custnum $new_custnum $cust_main );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header popurl);
-use FS::Record qw(qsearch qsearchs);
-use FS::cust_main;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
-
-if ( $cgi->param('error') ) {
- $custnum = $cgi->param('custnum');
- $new_custnum = $cgi->param('new_custnum');
-} else {
- ($query) = $cgi->keywords;
- $query =~ /^(\d+)$/ or die "Illegal query: $query";
- $custnum = $1;
- $new_custnum = '';
-}
-$cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
- or die "Customer not found: $custnum";
-
-print $cgi->header ( '-expires' => 'now' ), header('Delete customer');
-
-print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
- "</FONT>"
- if $cgi->param('error');
-
-print
- qq!<form action="!, popurl(1), qq!process/delete-customer.cgi" method=post>!,
- qq!<input type="hidden" name="custnum" value="$custnum">!;
-
-if ( qsearch('cust_pkg', { 'custnum' => $custnum, 'cancel' => '' } ) ) {
- print "Move uncancelled packages to customer number ",
- qq!<input type="text" name="new_custnum" value="$new_custnum"><br><br>!;
-}
-
-print <<END;
-This will <b>completely remove</b> all traces of this customer record.
-<br>Are you <b>absolutely sure</b> you want to delete this customer?
-<br><input type="submit" value="Yes">
-</form></body></html>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: expire_pkg.cgi,v 1.4 1999-02-28 00:03:50 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/expire_pkg.cgi
-#
-# based on susp_pkg
-# ivan@voicenet.com 97-jul-29
-#
-# ivan@sisd.com 98-mar-17 FS::Search->FS::Record
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: expire_pkg.cgi,v $
-# Revision 1.4 1999-02-28 00:03:50 ivan
-# removed misleading comments
-#
-# Revision 1.3 1999/01/19 05:14:05 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.2 1998/12/17 09:12:44 ivan
-# s/CGI::(Request|Base)/CGI.pm/;
-#
-
-use strict;
-use vars qw ( $cgi $date $pkgnum $cust_pkg %hash $new $error );
-use Date::Parse;
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl eidiot);
-use FS::Record qw(qsearchs);
-use FS::cust_pkg;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-#untaint date & pkgnum
-
-if ( $cgi->param('date') ) {
- str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date";
- $date=$1;
-} else {
- $date='';
-}
-
-$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum";
-$pkgnum = $1;
-
-$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-%hash = $cust_pkg->hash;
-$hash{expire}=$date;
-$new = new FS::cust_pkg ( \%hash );
-$error = $new->replace($cust_pkg);
-&eidiot($error) if $error;
-
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: link.cgi,v 1.7 1999-04-08 11:31:40 ivan Exp $
-#
-# ivan@voicenet.com 97-feb-5
-#
-# rewrite ivan@sisd.com 98-mar-17
-#
-# can also link on some other fields now (about time) ivan@sisd.com 98-jun-24
-#
-# $Log: link.cgi,v $
-# Revision 1.7 1999-04-08 11:31:40 ivan
-# *** empty log message ***
-#
-# Revision 1.6 1999/02/28 00:03:51 ivan
-# removed misleading comments
-#
-# Revision 1.5 1999/01/19 05:14:06 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:36 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/23 03:03:39 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:12:45 ivan
-# s/CGI::(Request|Base)/CGI.pm/;
-#
-
-use strict;
-use vars qw ( %link_field $cgi $pkgnum $svcpart $query $part_svc $svc $svcdb
- $link_field );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl header);
-use FS::Record qw(qsearchs);
-
-%link_field = (
- 'svc_acct' => 'username',
- 'svc_domain' => 'domain',
- 'svc_acct_sm' => '',
- 'svc_charge' => '',
- 'svc_wo' => '',
-);
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-($query) = $cgi->keywords;
-foreach $_ (split(/-/,$query)) { #get & untaint pkgnum & svcpart
- $pkgnum=$1 if /^pkgnum(\d+)$/;
- $svcpart=$1 if /^svcpart(\d+)$/;
-}
-
-$part_svc = qsearchs('part_svc',{'svcpart'=>$svcpart});
-$svc = $part_svc->getfield('svc');
-$svcdb = $part_svc->getfield('svcdb');
-$link_field = $link_field{$svcdb};
-
-print $cgi->header( '-expires' => 'now' ), header("Link to existing $svc"),
- qq!<FORM ACTION="!, popurl(1), qq!process/link.cgi" METHOD=POST>!;
-
-if ( $link_field ) {
- print <<END;
- <INPUT TYPE="hidden" NAME="svcnum" VALUE="">
- <INPUT TYPE="hidden" NAME="link_field" VALUE="$link_field">
- $link_field of existing service: <INPUT TYPE="text" NAME="link_value">
-END
-} else {
- print qq!Service # of existing service: <INPUT TYPE="text" NAME="svcnum" VALUE="">!;
-}
-
-print <<END;
-<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
-<INPUT TYPE="hidden" NAME="svcpart" VALUE="$svcpart">
-<P><CENTER><INPUT TYPE="submit" VALUE="Link"></CENTER>
- </FORM>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: print-invoice.cgi,v 1.4 1999-01-19 05:14:07 ivan Exp $
-#
-# just a kludge for now, since this duplicates in a way it shouldn't stuff from
-# Bill.pm (like $lpr) ivan@sisd.com 98-jun-16
-#
-# $Log: print-invoice.cgi,v $
-# Revision 1.4 1999-01-19 05:14:07 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1998/12/23 03:04:24 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:12:47 ivan
-# s/CGI::(Request|Base)/CGI.pm/;
-#
-
-use strict;
-use vars qw($conf $cgi $lpr $query $invnum $cust_bill $custnum );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl);
-use FS::Record qw(qsearchs);
-use FS::cust_bill;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-$lpr = $conf->config('lpr');
-
-#untaint invnum
-($query) = $cgi->keywords;
-$query =~ /^(\d*)$/;
-$invnum = $1;
-$cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
-die "Can't find invoice!\n" unless $cust_bill;
-
- open(LPR,"|$lpr") or die "Can't open $lpr: $!";
- print LPR $cust_bill->print_text; #( date )
- close LPR
- or die $! ? "Error closing $lpr: $!"
- : "Exit status $? from $lpr";
-
-$custnum = $cust_bill->getfield('custnum');
-
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history");
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: delete-customer.cgi,v 1.1 1999-04-15 16:44:36 ivan Exp $
-#
-# $Log: delete-customer.cgi,v $
-# Revision 1.1 1999-04-15 16:44:36 ivan
-# delete customers
-#
-
-use strict;
-use vars qw ( $cgi $conf $custnum $new_custnum $cust_main $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs);
-use FS::CGI qw(popurl);
-use FS::cust_main;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-die "Customer deletions not enabled" unless $conf->exists('deletecustomers');
-
-$cgi->param('custnum') =~ /^(\d+)$/;
-$custnum = $1;
-if ( $cgi->param('new_custnum') ) {
- $cgi->param('new_custnum') =~ /^(\d+)$/
- or die "Illegal new customer number: ". $cgi->param('new_custnum');
- $new_custnum = $1;
-} else {
- $new_custnum = '';
-}
-$cust_main = qsearchs( 'cust_main', { 'custnum' => $custnum } )
- or die "Customer not found: $custnum";
-
-$error = $cust_main->delete($new_custnum);
-
-if ( $error ) {
- $cgi->param('error', $error);
- print $cgi->redirect(popurl(2). "delete-customer.cgi?". $cgi->query_string );
-} elsif ( $new_custnum ) {
- print $cgi->redirect(popurl(3). "view/cust_main.cgi?$new_custnum");
-} else {
- print $cgi->redirect(popurl(3));
-}
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: link.cgi,v 1.5 1999-04-15 14:09:17 ivan Exp $
-#
-# ivan@voicenet.com 97-feb-5
-#
-# rewrite ivan@sisd.com 98-mar-18
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# can also link on some other fields now (about time) ivan@sisd.com 98-jun-24
-#
-# $Log: link.cgi,v $
-# Revision 1.5 1999-04-15 14:09:17 ivan
-# get rid of top-level my() variables
-#
-# Revision 1.4 1999/02/07 09:59:35 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.3 1999/01/19 05:14:10 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.2 1998/12/17 09:15:00 ivan
-# s/CGI::Request/CGI.pm/;
-#
-
-use strict;
-use vars qw ( $cgi $old $new $error $pkgnum $svcpart $svcnum );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::CGI qw(popurl idiot);
-use FS::UID qw(cgisuidsetup);
-use FS::cust_svc;
-use FS::Record qw(qsearchs);
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$cgi->param('pkgnum') =~ /^(\d+)$/;
-$pkgnum = $1;
-$cgi->param('svcpart') =~ /^(\d+)$/;
-$svcpart = $1;
-$cgi->param('svcnum') =~ /^(\d*)$/;
-$svcnum = $1;
-
-unless ( $svcnum ) {
- my($part_svc) = qsearchs('part_svc',{'svcpart'=>$svcpart});
- my($svcdb) = $part_svc->getfield('svcdb');
- $cgi->param('link_field') =~ /^(\w+)$/; my($link_field)=$1;
- my($svc_acct)=qsearchs($svcdb,{$link_field => $cgi->param('link_value') });
- eidiot("$link_field not found!") unless $svc_acct;
- $svcnum=$svc_acct->svcnum;
-}
-
-$old = qsearchs('cust_svc',{'svcnum'=>$svcnum});
-die "svcnum not found!" unless $old;
-$new = new FS::cust_svc ({
- 'svcnum' => $svcnum,
- 'pkgnum' => $pkgnum,
- 'svcpart' => $svcpart,
-});
-
-$error = $new->replace($old);
-
-unless ($error) {
- #no errors, so let's view this customer.
- print $cgi->redirect(popurl(3). "view/cust_pkg.cgi?$pkgnum");
-} else {
- idiot($error);
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: susp_pkg.cgi,v 1.6 1999-04-08 10:35:02 ivan Exp $
-#
-# Usage: susp_pkg.cgi pkgnum
-# http://server.name/path/susp_pkg.cgi pkgnum
-#
-# probably should generalize this to do cancels, suspensions, unsuspensions, etc.
-#
-# ivan@voicenet.com 97-feb-27
-#
-# now redirects to enter comments
-# ivan@voicenet.com 97-may-8
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-21
-#
-# FS::Search -> FS::Record ivan@sisd.com 98-mar-17
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: susp_pkg.cgi,v $
-# Revision 1.6 1999-04-08 10:35:02 ivan
-# import necessary subroutines from FS::CGI
-#
-# Revision 1.5 1999/02/28 00:03:52 ivan
-# removed misleading comments
-#
-# Revision 1.4 1999/01/19 05:14:08 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1998/12/23 03:04:56 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:12:48 ivan
-# s/CGI::(Request|Base)/CGI.pm/;
-#
-
-use strict;
-use vars qw( $cgi $query $pkgnum $cust_pkg $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs);
-use FS::CGI qw(popurl eidiot);
-use FS::cust_pkg;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-#untaint pkgnum
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ || die "Illegal pkgnum";
-$pkgnum = $1;
-
-$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-
-$error = $cust_pkg->suspend;
-&eidiot($error) if $error;
-
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: unsusp_pkg.cgi,v 1.5 1999-02-28 00:03:53 ivan Exp $
-#
-# Usage: susp_pkg.cgi pkgnum
-# http://server.name/path/susp_pkg.cgi pkgnum
-#
-# probably should generalize this to do cancels, suspensions, unsuspensions, etc.
-#
-# ivan@voicenet.com 97-feb-27
-#
-# now redirects to enter comments
-# ivan@voicenet.com 97-may-8
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-21
-#
-# FS::Search -> FS::Record ivan@sisd.com 98-mar-17
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: unsusp_pkg.cgi,v $
-# Revision 1.5 1999-02-28 00:03:53 ivan
-# removed misleading comments
-#
-# Revision 1.4 1999/01/19 05:14:09 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1998/12/23 03:05:25 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:12:49 ivan
-# s/CGI::(Request|Base)/CGI.pm/;
-#
-
-use strict;
-use vars qw( $cgi $query $pkgnum $cust_pkg $error );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl eidiot);
-use FS::Record qw(qsearchs);
-use FS::cust_pkg;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-#untaint pkgnum
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/ || die "Illegal pkgnum";
-$pkgnum = $1;
-
-$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-
-$error = $cust_pkg->unsuspend;
-&eidiot($error) if $error;
-
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum'));
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_bill.cgi,v 1.4 1999-02-28 00:03:54 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/cust_bill.cgi
-#
-# ivan@voicenet.com 97-apr-4
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: cust_bill.cgi,v $
-# Revision 1.4 1999-02-28 00:03:54 ivan
-# removed misleading comments
-#
-# Revision 1.3 1999/01/19 05:14:11 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.2 1998/12/17 09:41:07 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-
-use strict;
-use vars qw ( $cgi $invnum );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl idiot);
-use FS::Record qw(qsearchs);
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/;
-$invnum = $2;
-
-if ( qsearchs('cust_bill',{'invnum'=>$invnum}) ) {
- print $cgi->redirect(popurl(2). "view/cust_bill.cgi?$invnum"); #redirect
-} else { #error
- idiot("Invoice not found.");
-}
-
+++ /dev/null
-<HTML>
- <HEAD>
- <TITLE>Invoice Search</TITLE>
- </HEAD>
- <BODY>
- <CENTER>
- <H1>Invoice Search</H1>
- </CENTER>
- <HR>
- <FORM ACTION="cust_bill.cgi" METHOD="post">
- Search for <B>invoice #</B>:
- <INPUT TYPE="text" NAME="invnum">
-
- <P><INPUT TYPE="submit" VALUE="Search">
-
- </FORM>
-
- <HR>
- </BODY>
-</HTML>
-
+++ /dev/null
-<HTML>
- <HEAD>
- <TITLE>Customer Search</TITLE>
- </HEAD>
- <BODY BGCOLOR="#ffffff">
- <FONT COLOR="#ff0000" SIZE=7>
- Customer Search
- </FONT>
- <BR>
- <FORM ACTION="cust_main.cgi" METHOD="post">
- Search for <B>Credit card #</B>:
- <INPUT TYPE="hidden" NAME="card_on" VALUE="TRUE">
- <INPUT TYPE="text" NAME="card">
-
- <P><INPUT TYPE="submit" VALUE="Search">
-
- </FORM>
- </BODY>
-</HTML>
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main.cgi,v 1.14 1999-08-12 04:45:21 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/cust_main.cgi
-#
-# ivan@voicenet.com 96-dec-12
-#
-# rewrite ivan@sisd.com 98-mar-4
-#
-# now does browsing too ivan@sisd.com 98-mar-6
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# display total, use FS::CGI ivan@sisd.com 98-jul-17
-#
-# $Log: cust_main.cgi,v $
-# Revision 1.14 1999-08-12 04:45:21 ivan
-# typo - missed a paren
-#
-# Revision 1.13 1999/08/12 04:32:21 ivan
-# hidecancelledcustomers
-#
-# Revision 1.12 1999/07/17 10:38:52 ivan
-# scott nelson <scott@ultimanet.com> noticed this mod_perl-triggered bug and
-# gave me a great bugreport at the last rhythmethod
-#
-# Revision 1.11 1999/04/09 04:22:34 ivan
-# also table()
-#
-# Revision 1.10 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.9 1999/02/28 00:03:55 ivan
-# removed misleading comments
-#
-# Revision 1.8 1999/02/07 09:59:36 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.7 1999/01/25 12:19:11 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.6 1999/01/19 05:14:12 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:37 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1998/12/30 00:57:50 ivan
-# bug
-#
-# Revision 1.3 1998/12/17 09:41:08 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-# Revision 1.2 1998/11/12 08:10:22 ivan
-# CGI.pm instead of CGI-modules
-# relative URLs using popurl
-# got rid of lots of little tables
-# s/agrep/String::Approx/;
-# bubble up packages and services and link (slow)
-#
-
-use strict;
-#use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby );
-use vars qw( $conf %all_pkgs $cgi @cust_main $sortby );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use IO::Handle;
-use String::Approx qw(amatch);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header menubar eidiot popurl table);
-use FS::cust_main;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-
-if ( $cgi->keywords ) {
- my($query)=$cgi->keywords;
- if ( $query eq 'custnum' ) {
- $sortby=\*custnum_sort;
- @cust_main=qsearch('cust_main',{});
- } elsif ( $query eq 'last' ) {
- $sortby=\*last_sort;
- @cust_main=qsearch('cust_main',{});
- } elsif ( $query eq 'company' ) {
- $sortby=\*company_sort;
- @cust_main=qsearch('cust_main',{});
- }
-} else {
- @cust_main=();
- &cardsearch if ( $cgi->param('card_on') && $cgi->param('card') );
- &lastsearch if ( $cgi->param('last_on') && $cgi->param('last_text') );
- &companysearch if ( $cgi->param('company_on') && $cgi->param('company_text') );
-}
-
-@cust_main = grep { $_->ncancelled_pkgs || ! $_->all_pkgs } @cust_main
- if $conf->exists('hidecancelledcustomers');
-if ( $conf->exists('hidecancelledpackages' ) ) {
- %all_pkgs = map { $_->custnum => [ $_->ncancelled_pkgs ] } @cust_main;
-} else {
- %all_pkgs = map { $_->custnum => [ $_->all_pkgs ] } @cust_main;
-}
-
-if ( scalar(@cust_main) == 1 ) {
- print $cgi->redirect(popurl(2). "view/cust_main.cgi?". $cust_main[0]->custnum);
- exit;
-} elsif ( scalar(@cust_main) == 0 ) {
- eidiot "No matching customers found!\n";
-} else {
-
- my($total)=scalar(@cust_main);
- print $cgi->header( '-expires' => 'now' ), header("Customer Search Results",menubar(
- 'Main Menu', popurl(2)
- )), "$total matching customers found<BR>", &table(), <<END;
- <TR>
- <TH></TH>
- <TH>Contact name</TH>
- <TH>Company</TH>
- <TH>Packages</TH>
- <TH COLSPAN=2>Services</TH>
- </TR>
-END
-
- my(%saw,$cust_main);
- foreach $cust_main (
- sort $sortby grep(!$saw{$_->custnum}++, @cust_main)
- ) {
- my($custnum,$last,$first,$company)=(
- $cust_main->custnum,
- $cust_main->getfield('last'),
- $cust_main->getfield('first'),
- $cust_main->company,
- );
-
- my(@lol_cust_svc);
- my($rowspan)=0;#scalar( @{$all_pkgs{$custnum}} );
- foreach ( @{$all_pkgs{$custnum}} ) {
- my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } );
- push @lol_cust_svc, \@cust_svc;
- $rowspan += scalar(@cust_svc) || 1;
- }
-
- #my($rowspan) = scalar(@{$all_pkgs{$custnum}});
- my($view) = popurl(2). "view/cust_main.cgi?$custnum";
- print <<END;
- <TR>
- <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$custnum</FONT></A></TD>
- <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$last, $first</FONT></A></TD>
- <TD ROWSPAN=$rowspan><A HREF="$view"><FONT SIZE=-1>$company</FONT></A></TD>
-END
-
- my($n1)='';
- foreach ( @{$all_pkgs{$custnum}} ) {
- my($pkgnum) = ($_->pkgnum);
- my($pkg) = $_->part_pkg->pkg;
- my $comment = $_->part_pkg->comment;
- my($pkgview) = popurl(2). "/view/cust_pkg.cgi?$pkgnum";
- #my(@cust_svc) = shift @lol_cust_svc;
- my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } );
- my($rowspan) = scalar(@cust_svc) || 1;
-
- print $n1, qq!<TD ROWSPAN=$rowspan><A HREF="$pkgview"><FONT SIZE=-1>$pkg - $comment</FONT></A></TD>!;
- my($n2)='';
- foreach my $cust_svc ( @cust_svc ) {
- my($label, $value, $svcdb) = $cust_svc->label;
- my($svcnum) = $cust_svc->svcnum;
- my($sview) = popurl(2). "/view";
- print $n2,qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$label</FONT></A></TD>!,
- qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$value</FONT></A></TD>!;
- $n2="</TR><TR>";
- }
- #print qq!</TR><TR>\n!;
- $n1="</TR><TR>";
- }
- print "<\TR>";
- }
-
- print <<END;
- </TABLE>
- </BODY>
-</HTML>
-END
-
-}
-
-#
-
-sub last_sort {
- $a->getfield('last') cmp $b->getfield('last');
-}
-
-sub company_sort {
- return -1 if $a->company && ! $b->company;
- return 1 if ! $a->company && $b->company;
- $a->getfield('company') cmp $b->getfield('company');
-}
-
-sub custnum_sort {
- $a->getfield('custnum') <=> $b->getfield('custnum');
-}
-
-sub cardsearch {
-
- my($card)=$cgi->param('card');
- $card =~ s/\D//g;
- $card =~ /^(\d{13,16})$/ or eidiot "Illegal card number\n";
- my($payinfo)=$1;
-
- push @cust_main, qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'CARD'});
-
-}
-
-sub lastsearch {
- my(%last_type);
- foreach ( $cgi->param('last_type') ) {
- $last_type{$_}++;
- }
-
- $cgi->param('last_text') =~ /^([\w \,\.\-\']*)$/
- or eidiot "Illegal last name";
- my($last)=$1;
-
- if ( $last_type{'Exact'}
- && ! $last_type{'Fuzzy'}
- # && ! $last_type{'Sound-alike'}
- ) {
-
- push @cust_main, qsearch('cust_main',{'last'=>$last});
-
- } else {
-
- my(%last);
-
- my(@all_last)=map $_->getfield('last'), qsearch('cust_main',{});
- if ($last_type{'Fuzzy'}) {
- foreach ( amatch($last, [ qw(i) ], @all_last) ) {
- $last{$_}++;
- }
- }
-
- #if ($last_type{'Sound-alike'}) {
- #}
-
- foreach ( keys %last ) {
- push @cust_main, qsearch('cust_main',{'last'=>$_});
- }
-
- }
- $sortby=\*last_sort;
-}
-
-sub companysearch {
-
- my(%company_type);
- foreach ( $cgi->param('company_type') ) {
- $company_type{$_}++
- };
-
- $cgi->param('company_text') =~ /^([\w \,\.\-\']*)$/
- or eidiot "Illegal company";
- my($company)=$1;
-
- if ( $company_type{'Exact'}
- && ! $company_type{'Fuzzy'}
- # && ! $company_type{'Sound-alike'}
- ) {
-
- push @cust_main, qsearch('cust_main',{'company'=>$company});
-
- } else {
-
- my(%company);
- my(@all_company)=map $_->company, qsearch('cust_main',{});
-
- if ($company_type{'Fuzzy'}) {
- foreach ( amatch($company, [ qw(i) ], @all_company ) ) {
- $company{$_}++;
- }
- }
-
- #if ($company_type{'Sound-alike'}) {
- #}
-
- foreach ( keys %company ) {
- push @cust_main, qsearch('cust_main',{'company'=>$_});
- }
-
- }
- $sortby=\*company_sort;
-
-}
+++ /dev/null
-<HTML>
- <HEAD>
- <TITLE>Customer Search</TITLE>
- </HEAD>
- <BODY BGCOLOR="#ffffff">
- <FONT COLOR="#ff0000" SIZE=7>
- Customer Search
- </FONT>
- <BR>
- <FORM ACTION="cust_main.cgi" METHOD="post">
- <INPUT TYPE="checkbox" NAME="last_on" CHECKED> Search for <B>last name</B>:
- <INPUT TYPE="text" NAME="last_text">
- using search method: <SELECT NAME="last_type">
- <OPTION SELECTED>Fuzzy
- <OPTION>Exact
- </SELECT>
-
- <P><INPUT TYPE="checkbox" NAME="company_on" CHECKED> Search for <B>company</B>:
- <INPUT TYPE="text" NAME="company_text">
- using search methods: <SELECT NAME="company_type">
- <OPTION SELECTED>Fuzzy
- <OPTION>Exact
- </SELECT>
-
- <P><INPUT TYPE="submit" VALUE="Search"> Note: Fuzzy searching can take a while. Please be patient.
-
- </FORM>
-
- <HR>Explanation of search methods:
- <UL>
- <LI><B>Fuzzy</B> - Searches for matches that are close to your text.
- <LI><B>Exact</B> - Finds exact matches only, but much faster than the other search methods.
- </UL>
- </BODY>
-</HTML>
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_pkg.cgi,v 1.9 1999-07-17 10:38:52 ivan Exp $
-#
-# based on search/svc_acct.cgi ivan@sisd.com 98-jul-17
-#
-# $Log: cust_pkg.cgi,v $
-# Revision 1.9 1999-07-17 10:38:52 ivan
-# scott nelson <scott@ultimanet.com> noticed this mod_perl-triggered bug and
-# gave me a great bugreport at the last rhythmethod
-#
-# Revision 1.8 1999/02/09 09:22:57 ivan
-# visual and bugfixes
-#
-# Revision 1.7 1999/02/07 09:59:37 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.6 1999/01/19 05:14:13 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:38 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1999/01/18 09:22:33 ivan
-# changes to track email addresses for email invoicing
-#
-# Revision 1.3 1998/12/23 03:05:59 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:41:09 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-
-use strict;
-use vars qw ( $cgi @cust_pkg $sortby $query );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header eidiot popurl);
-use FS::cust_pkg;
-use FS::pkg_svc;
-use FS::cust_svc;
-use FS::cust_main;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-($query) = $cgi->keywords;
-#this tree is a little bit redundant
-if ( $query eq 'pkgnum' ) {
- $sortby=\*pkgnum_sort;
- @cust_pkg=qsearch('cust_pkg',{});
-} elsif ( $query eq 'APKG_pkgnum' ) {
- $sortby=\*pkgnum_sort;
- @cust_pkg=();
- #perhaps this should go in cust_pkg as a qsearch-like constructor?
- my($cust_pkg);
- foreach $cust_pkg (qsearch('cust_pkg',{})) {
- my($flag)=0;
- my($pkg_svc);
- PKG_SVC:
- foreach $pkg_svc (qsearch('pkg_svc',{ 'pkgpart' => $cust_pkg->pkgpart })) {
- if ( $pkg_svc->quantity
- > scalar(qsearch('cust_svc',{
- 'pkgnum' => $cust_pkg->pkgnum,
- 'svcpart' => $pkg_svc->svcpart,
- }))
- )
- {
- $flag=1;
- last PKG_SVC;
- }
- }
- push @cust_pkg, $cust_pkg if $flag;
- }
-} else {
- die "Empty QUERY_STRING!";
-}
-
-if ( scalar(@cust_pkg) == 1 ) {
- my($pkgnum)=$cust_pkg[0]->pkgnum;
- print $cgi->redirect(popurl(2). "view/cust_pkg.cgi?$pkgnum");
- exit;
-} elsif ( scalar(@cust_pkg) == 0 ) { #error
- eidiot("No packages found");
-} else {
- my($total)=scalar(@cust_pkg);
- print $cgi->header( '-expires' => 'now' ), header('Package Search Results',''), <<END;
- $total matching packages found
- <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0>
- <TR>
- <TH>Package #</TH>
- <TH>Customer #</TH>
- <TH>Contact name</TH>
- <TH>Company</TH>
- </TR>
-END
-
- my(%saw,$cust_pkg);
- foreach $cust_pkg (
- sort $sortby grep(!$saw{$_->pkgnum}++, @cust_pkg)
- ) {
- my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum});
- my($pkgnum,$custnum,$name,$company)=(
- $cust_pkg->pkgnum,
- $cust_main->custnum,
- $cust_main->last. ', '. $cust_main->first,
- $cust_main->company,
- );
- my $p = popurl(2);
- print <<END;
- <TR>
- <TD><A HREF="${p}view/cust_pkg.cgi?$pkgnum"><FONT SIZE=-1>$pkgnum</FONT></A></TD>
- <TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$custnum</A></FONT></TD>
- <TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$name</A></FONT></TD>
- <TD><FONT SIZE=-1><A HREF="${p}view/cust_main.cgi?$custnum">$company</A></FONT></TD>
- </TR>
-END
-
- }
-
- print <<END;
- </TABLE>
- </BODY>
-</HTML>
-END
- exit;
-
-}
-
-sub pkgnum_sort {
- $a->getfield('pkgnum') <=> $b->getfield('pkgnum');
-}
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct.cgi,v 1.11 1999-04-14 11:25:33 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/svc_acct.cgi
-#
-# Note: Should be run setuid freeside as user nobody.
-#
-# loosely (sp?) based on search/cust_main.cgi
-#
-# ivan@voicenet.com 96-jan-3 -> 96-jan-4
-#
-# rewrite (now does browsing too) ivan@sisd.com 98-mar-9
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# show unlinked accounts ivan@sisd.com 98-jun-22
-#
-# use FS::CGI, show total ivan@sisd.com 98-jul-17
-#
-# give service and customer info too ivan@sisd.com 98-aug-16
-#
-# $Log: svc_acct.cgi,v $
-# Revision 1.11 1999-04-14 11:25:33 ivan
-# *** empty log message ***
-#
-# Revision 1.10 1999/04/14 11:20:21 ivan
-# visual fix
-#
-# Revision 1.9 1999/04/10 01:53:18 ivan
-# oops, search usernames limited to 8 chars
-#
-# Revision 1.8 1999/04/09 23:43:29 ivan
-# just in case
-#
-# Revision 1.7 1999/02/07 09:59:38 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.6 1999/01/19 05:14:14 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:39 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1999/01/18 09:22:34 ivan
-# changes to track email addresses for email invoicing
-#
-# Revision 1.3 1998/12/23 03:06:28 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:41:10 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-
-use strict;
-use vars qw( $cgi @svc_acct $sortby $query );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header eidiot popurl table);
-use FS::svc_acct;
-use FS::cust_main;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-($query)=$cgi->keywords;
-$query ||= ''; #to avoid use of unitialized value errors
-#this tree is a little bit redundant
-if ( $query eq 'svcnum' ) {
- $sortby=\*svcnum_sort;
- @svc_acct=qsearch('svc_acct',{});
-} elsif ( $query eq 'username' ) {
- $sortby=\*username_sort;
- @svc_acct=qsearch('svc_acct',{});
-} elsif ( $query eq 'uid' ) {
- $sortby=\*uid_sort;
- @svc_acct=grep $_->uid ne '', qsearch('svc_acct',{});
-} elsif ( $query eq 'UN_svcnum' ) {
- $sortby=\*svcnum_sort;
- @svc_acct = grep qsearchs('cust_svc',{
- 'svcnum' => $_->svcnum,
- 'pkgnum' => '',
- }), qsearch('svc_acct',{});
-} elsif ( $query eq 'UN_username' ) {
- $sortby=\*username_sort;
- @svc_acct = grep qsearchs('cust_svc',{
- 'svcnum' => $_->svcnum,
- 'pkgnum' => '',
- }), qsearch('svc_acct',{});
-} elsif ( $query eq 'UN_uid' ) {
- $sortby=\*uid_sort;
- @svc_acct = grep qsearchs('cust_svc',{
- 'svcnum' => $_->svcnum,
- 'pkgnum' => '',
- }), qsearch('svc_acct',{});
-} else {
- $sortby=\*uid_sort;
- &usernamesearch;
-}
-
-if ( scalar(@svc_acct) == 1 ) {
- my($svcnum)=$svc_acct[0]->svcnum;
- print $cgi->redirect(popurl(2). "view/svc_acct.cgi?$svcnum"); #redirect
- exit;
-} elsif ( scalar(@svc_acct) == 0 ) { #error
- eidiot("Account not found");
-} else {
- my($total)=scalar(@svc_acct);
- print $cgi->header( '-expires' => 'now' ),
- header("Account Search Results",''),
- "$total matching accounts found",
- &table(), <<END;
- <TR>
- <TH><FONT SIZE=-1>Service #</FONT></TH>
- <TH><FONT SIZE=-1>Username</FONT></TH>
- <TH><FONT SIZE=-1>UID</FONT></TH>
- <TH><FONT SIZE=-1>Service</FONT></TH>
- <TH><FONT SIZE=-1>Customer #</FONT></TH>
- <TH><FONT SIZE=-1>Contact name</FONT></TH>
- <TH><FONT SIZE=-1>Company</FONT></TH>
- </TR>
-END
-
- my(%saw,$svc_acct);
- my $p = popurl(2);
- foreach $svc_acct (
- sort $sortby grep(!$saw{$_->svcnum}++, @svc_acct)
- ) {
- my $cust_svc = qsearchs('cust_svc', { 'svcnum' => $svc_acct->svcnum })
- or die "No cust_svc record for svcnum ". $svc_acct->svcnum;
- my $part_svc = qsearchs('part_svc', { 'svcpart' => $cust_svc->svcpart })
- or die "No part_svc record for svcpart ". $cust_svc->svcpart;
- my($cust_pkg,$cust_main);
- if ( $cust_svc->pkgnum ) {
- $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_svc->pkgnum })
- or die "No cust_pkg record for pkgnum ". $cust_svc->pkgnum;
- $cust_main = qsearchs('cust_main', { 'custnum' => $cust_pkg->custnum })
- or die "No cust_main record for custnum ". $cust_pkg->custnum;
- }
- my($svcnum,$username,$uid,$svc,$custnum,$last,$first,$company)=(
- $svc_acct->svcnum,
- $svc_acct->getfield('username'),
- $svc_acct->getfield('uid'),
- $part_svc->svc,
- $cust_svc->pkgnum ? $cust_main->custnum : '',
- $cust_svc->pkgnum ? $cust_main->getfield('last') : '',
- $cust_svc->pkgnum ? $cust_main->getfield('first') : '',
- $cust_svc->pkgnum ? $cust_main->company : '',
- );
- my($pcustnum) = $custnum
- ? "<A HREF=\"${p}view/cust_main.cgi?$custnum\"><FONT SIZE=-1>$custnum</FONT></A>"
- : "<I>(unlinked)</I>"
- ;
- my($pname) = $custnum ? "<A HREF=\"${p}view/cust_main.cgi?$custnum\">$last, $first</A>" : '';
- my $pcompany = $custnum ? "<A HREF=\"${p}view/cust_main.cgi?$custnum\">$company</A>" : '';
- print <<END;
- <TR>
- <TD><A HREF="${p}view/svc_acct.cgi?$svcnum"><FONT SIZE=-1>$svcnum</FONT></A></TD>
- <TD><A HREF="${p}view/svc_acct.cgi?$svcnum"><FONT SIZE=-1>$username</FONT></A></TD>
- <TD><A HREF="${p}view/svc_acct.cgi?$svcnum"><FONT SIZE=-1>$uid</FONT></A></TD>
- <TD><FONT SIZE=-1>$svc</FONT></TH>
- <TD><FONT SIZE=-1>$pcustnum</FONT></TH>
- <TD><FONT SIZE=-1>$pname<FONT></TH>
- <TD><FONT SIZE=-1>$pcompany</FONT></TH>
- </TR>
-END
-
- }
-
- print <<END;
- </TABLE>
- </CENTER>
- </BODY>
-</HTML>
-END
- exit;
-
-}
-
-sub svcnum_sort {
- $a->getfield('svcnum') <=> $b->getfield('svcnum');
-}
-
-sub username_sort {
- $a->getfield('username') cmp $b->getfield('username');
-}
-
-sub uid_sort {
- $a->getfield('uid') <=> $b->getfield('uid');
-}
-
-sub usernamesearch {
-
- $cgi->param('username') =~ /^([\w\d\-]+)$/; #untaint username_text
- my($username)=$1;
-
- @svc_acct=qsearch('svc_acct',{'username'=>$username});
-
-}
-
-
+++ /dev/null
-<HTML>
- <HEAD>
- <TITLE>Account Search</TITLE>
- </HEAD>
- <BODY>
- <CENTER>
- <H1>Account Search</H1>
- </CENTER>
- <HR>
- <FORM ACTION="svc_acct.cgi" METHOD="post">
- Search for <B>username</B>:
- <INPUT TYPE="text" NAME="username">
-
- <P><INPUT TYPE="submit" VALUE="Search">
-
- </FORM>
-
- <HR>
- </BODY>
-</HTML>
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct_sm.cgi,v 1.10 1999-07-20 06:03:36 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/svc_domain.cgi
-#
-# ivan@voicenet.com 96-mar-5
-#
-# need to look at table in results to make it more readable
-#
-# ivan@voicenet.com
-#
-# rewrite ivan@sisd.com 98-mar-15
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: svc_acct_sm.cgi,v $
-# Revision 1.10 1999-07-20 06:03:36 ivan
-# s/CGI::Request/CGI/; (how'd i miss that before?)
-#
-# Revision 1.9 1999/04/09 04:22:34 ivan
-# also table()
-#
-# Revision 1.8 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.7 1999/02/28 00:03:56 ivan
-# removed misleading comments
-#
-# Revision 1.6 1999/02/09 09:22:58 ivan
-# visual and bugfixes
-#
-# Revision 1.5 1999/01/19 05:14:16 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.4 1999/01/18 09:41:40 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.3 1998/12/17 09:41:11 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-
-use strict;
-use vars qw( $conf $cgi $mydomain $domuser $svc_domain $domsvc @svc_acct_sm );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl idiot header table);
-use FS::Record qw(qsearch qsearchs);
-use FS::Conf;
-use FS::svc_domain;
-use FS::svc_acct_sm;
-use FS::svc_acct;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-$mydomain = $conf->config('domain');
-
-$cgi->param('domuser') =~ /^([a-z0-9_\-]{0,32})$/;
-$domuser = $1;
-
-$cgi->param('domain') =~ /^([\w\-\.]+)$/ or die "Illegal domain";
-$svc_domain = qsearchs('svc_domain',{'domain'=>$1})
- or die "Unknown domain";
-$domsvc = $svc_domain->svcnum;
-
-if ($domuser) {
- @svc_acct_sm=qsearch('svc_acct_sm',{
- 'domuser' => $domuser,
- 'domsvc' => $domsvc,
- });
-} else {
- @svc_acct_sm=qsearch('svc_acct_sm',{'domsvc' => $domsvc});
-}
-
-if ( scalar(@svc_acct_sm) == 1 ) {
- my($svcnum)=$svc_acct_sm[0]->svcnum;
- print $cgi->redirect(popurl(2). "view/svc_acct_sm.cgi?$svcnum");
-} elsif ( scalar(@svc_acct_sm) > 1 ) {
- print $cgi->header( '-expires' => 'now' ),
- header('Mail Alias Search Results'),
- &table(), <<END;
- <TR>
- <TH>Mail to<BR><FONT SIZE=-1>(click to view mail alias)</FONT></TH>
- <TH>Forwards to<BR><FONT SIZE=-1>(click to view account)</FONT></TH>
- </TR>
-END
-
- my($svc_acct_sm);
- foreach $svc_acct_sm (@svc_acct_sm) {
- my($svcnum,$domuser,$domuid,$domsvc)=(
- $svc_acct_sm->svcnum,
- $svc_acct_sm->domuser,
- $svc_acct_sm->domuid,
- $svc_acct_sm->domsvc,
- );
-
- my $svc_domain = qsearchs( 'svc_domain', { 'svcnum' => $domsvc } );
- if ( $svc_domain ) {
- my $domain = $svc_domain->domain;
-
- print qq!<TR><TD><A HREF="!. popurl(2). qq!view/svc_acct_sm.cgi?$svcnum">!,
- #print '', ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser );
- ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ),
- qq!\@$domain</A> </TD>!,
- ;
- } else {
- my $warning = "couldn't find svc_domain.svcnum $svcnum ( svc_acct_sm.svcnum $svcnum";
- warn $warning;
- print "<TR><TD>WARNING: $warning</TD>";
- }
-
- my $svc_acct = qsearchs( 'svc_acct', { 'uid' => $domuid } );
- if ( $svc_acct ) {
- my $username = $svc_acct->username;
- my $svc_acct_svcnum =$svc_acct->svcnum;
- print qq!<TD><A HREF="!, popurl(2),
- qq!view/svc_acct.cgi?$svc_acct_svcnum">$username\@$mydomain</A>!,
- qq!</TD></TR>!
- ;
- } else {
- my $warning = "couldn't find svc_acct.uid $domuid (svc_acct_sm.svcnum $svcnum)!";
- warn $warning;
- print "<TD>WARNING: $warning</TD></TR>";
- }
-
- }
-
- print '</TABLE></BODY></HTML>';
-
-} else { #error
- idiot("Mail Alias not found");
-}
-
+++ /dev/null
-<HTML>
- <HEAD>
- <TITLE>Mail Alias Search</TITLE>
- </HEAD>
- <BODY>
- <CENTER>
- <H1>Mail Alias Search</H1>
- </CENTER>
- <HR>
- <FORM ACTION="svc_acct_sm.cgi" METHOD="post">
- Search for <B>mail alias</B>:
- <INPUT TYPE="text" NAME="domuser"><FONT SIZE=-1>(opt.)</FONT> @
- <INPUT TYPE="text" NAME="domain"><FONT SIZE=-1>(req.)</FONT>
-
- <P><INPUT TYPE="submit" VALUE="Search">
-
- </FORM>
-
- <HR>
-
- </BODY>
-</HTML>
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_domain.cgi,v 1.10 1999-07-17 10:38:52 ivan Exp $
-#
-# Usage: post form to:
-# http://server.name/path/svc_domain.cgi
-#
-# ivan@voicenet.com 97-mar-5
-#
-# rewrite ivan@sisd.com 98-mar-14
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# display total, use FS::CGI now does browsing too ivan@sisd.com 98-jul-17
-#
-# $Log: svc_domain.cgi,v $
-# Revision 1.10 1999-07-17 10:38:52 ivan
-# scott nelson <scott@ultimanet.com> noticed this mod_perl-triggered bug and
-# gave me a great bugreport at the last rhythmethod
-#
-# Revision 1.9 1999/04/15 13:39:16 ivan
-# $cgi->header( '-expires' => 'now' )
-#
-# Revision 1.8 1999/02/28 00:03:57 ivan
-# removed misleading comments
-#
-# Revision 1.7 1999/02/23 08:09:24 ivan
-# beginnings of one-screen new customer entry and some other miscellania
-#
-# Revision 1.6 1999/02/09 09:22:59 ivan
-# visual and bugfixes
-#
-# Revision 1.5 1999/02/07 09:59:39 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.4 1999/01/19 05:14:17 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.3 1998/12/23 03:06:50 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:41:12 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-
-use strict;
-use vars qw ( $cgi @svc_domain $sortby $query $conf $mydomain );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs);
-use FS::CGI qw(header eidiot popurl);
-use FS::svc_domain;
-use FS::cust_svc;
-use FS::svc_acct_sm;
-use FS::svc_acct;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-$mydomain = $conf->config('domain');
-
-($query)=$cgi->keywords;
-if ( $query eq 'svcnum' ) {
- $sortby=\*svcnum_sort;
- @svc_domain=qsearch('svc_domain',{});
-} elsif ( $query eq 'domain' ) {
- $sortby=\*domain_sort;
- @svc_domain=qsearch('svc_domain',{});
-} elsif ( $query eq 'UN_svcnum' ) {
- $sortby=\*svcnum_sort;
- @svc_domain = grep qsearchs('cust_svc',{
- 'svcnum' => $_->svcnum,
- 'pkgnum' => '',
- }), qsearch('svc_domain',{});
-} elsif ( $query eq 'UN_domain' ) {
- $sortby=\*domain_sort;
- @svc_domain = grep qsearchs('cust_svc',{
- 'svcnum' => $_->svcnum,
- 'pkgnum' => '',
- }), qsearch('svc_domain',{});
-} else {
- $cgi->param('domain') =~ /^([\w\-\.]+)$/;
- my($domain)=$1;
- #push @svc_domain, qsearchs('svc_domain',{'domain'=>$domain});
- @svc_domain = qsearchs('svc_domain',{'domain'=>$domain});
-}
-
-if ( scalar(@svc_domain) == 1 ) {
- print $cgi->redirect(popurl(2). "view/svc_domain.cgi?". $svc_domain[0]->svcnum);
- exit;
-} elsif ( scalar(@svc_domain) == 0 ) {
- eidiot "No matching domains found!\n";
-} else {
-
- my($total)=scalar(@svc_domain);
- print $cgi->header( '-expires' => 'now' ),
- header("Domain Search Results",''), <<END;
-
- $total matching domains found
- <TABLE BORDER=4 CELLSPACING=0 CELLPADDING=0>
- <TR>
- <TH>Service #</TH>
- <TH>Domain</TH>
- <TH>Mail to<BR><FONT SIZE=-1>(click to view mail alias)</FONT></TH>
- <TH>Forwards to<BR><FONT SIZE=-1>(click to view account)</FONT></TH>
- </TR>
-END
-
- my(%saw,$svc_domain);
- my $p = popurl(2);
- foreach $svc_domain (
- sort $sortby grep(!$saw{$_->svcnum}++, @svc_domain)
- ) {
- my($svcnum,$domain)=(
- $svc_domain->svcnum,
- $svc_domain->domain,
- );
- #my($malias);
- #if ( qsearch('svc_acct_sm',{'domsvc'=>$svcnum}) ) {
- # $malias=(
- # qq|<FORM ACTION="svc_acct_sm.cgi" METHOD="post">|.
- # qq|<INPUT TYPE="hidden" NAME="domuser" VALUE="">|.
- # qq|<INPUT TYPE="hidden" NAME="domain" VALUE="$domain">|.
- # qq|<INPUT TYPE="submit" VALUE="(mail aliases)">|.
- # qq|</FORM>|
- # );
- #} else {
- # $malias='';
- #}
-
- my @svc_acct_sm=qsearch('svc_acct_sm',{'domsvc' => $svcnum});
- my $rowspan = scalar(@svc_acct_sm) || 1;
-
- print <<END;
- <TR>
- <TD ROWSPAN=$rowspan><A HREF="${p}view/svc_domain.cgi?$svcnum"><FONT SIZE=-1>$svcnum</FONT></A></TD>
- <TD ROWSPAN=$rowspan>$domain</TD>
-END
-
- my $n1 = '';
- # false laziness: this was stolen from search/svc_acct_sm.cgi. but the
- # web interface in general needs to be rewritten in a mucho cleaner way
- my($svc_acct_sm);
- foreach $svc_acct_sm (@svc_acct_sm) {
- my($svcnum,$domuser,$domuid,$domsvc)=(
- $svc_acct_sm->svcnum,
- $svc_acct_sm->domuser,
- $svc_acct_sm->domuid,
- $svc_acct_sm->domsvc,
- );
- #my $svc_domain = qsearchs( 'svc_domain', { 'svcnum' => $domsvc } );
- #if ( $svc_domain ) {
- # my $domain = $svc_domain->domain;
-
- print qq!$n1<TD><A HREF="!. popurl(2). qq!view/svc_acct_sm.cgi?$svcnum">!,
- #print '', ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser );
- ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ),
- qq!\@$domain</A> </TD>!,
- ;
- #} else {
- # my $warning = "couldn't find svc_domain.svcnum $svcnum ( svc_acct_sm.svcnum $svcnum";
- # warn $warning;
- # print "$n1<TD>WARNING: $warning</TD>";
- #}
-
- my $svc_acct = qsearchs( 'svc_acct', { 'uid' => $domuid } );
- if ( $svc_acct ) {
- my $username = $svc_acct->username;
- my $svc_acct_svcnum =$svc_acct->svcnum;
- print qq!<TD><A HREF="!, popurl(2),
- qq!view/svc_acct.cgi?$svc_acct_svcnum">$username\@$mydomain</A>!,
- qq!</TD></TR>!
- ;
- } else {
- my $warning = "couldn't find svc_acct.uid $domuid (svc_acct_sm.svcnum $svcnum)!";
- warn $warning;
- print "<TD>WARNING: $warning</TD>";
- }
- $n1 = "</TR><TR>";
- }
- #end of false laziness
- print "</TR>";
-
- }
-
- print <<END;
- </TABLE>
- </BODY>
-</HTML>
-END
-
-}
-
-sub svcnum_sort {
- $a->getfield('svcnum') <=> $b->getfield('svcnum');
-}
-
-sub domain_sort {
- $a->getfield('domain') cmp $b->getfield('doimain');
-}
-
-
+++ /dev/null
-<HTML>
- <HEAD>
- <TITLE>Domain Search</TITLE>
- </HEAD>
- <BODY>
- <CENTER>
- <H1>Domain Search</H1>
- </CENTER>
- <HR>
- <FORM ACTION="svc_domain.cgi" METHOD="post">
- Search for <B>domain</B>:
- <INPUT TYPE="text" NAME="domain">
-
- <P><INPUT TYPE="submit" VALUE="Search">
-
- </FORM>
-
- <HR>
-
- </BODY>
-</HTML>
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_bill.cgi,v 1.8 1999-02-28 00:03:58 ivan Exp $
-#
-# this is a quick & ugly hack which does little more than add some formatting to the ascii output from /dbin/print-invoice
-#
-# ivan@voicenet.com 96-dec-05
-#
-# added navigation bar
-# ivan@voicenet.com 97-jan-30
-#
-# now uses Invoice.pm
-# ivan@voicenet.com 97-jun-30
-#
-# what to do if cust_bill search errors?
-# ivan@voicenet.com 97-jul-7
-#
-# s/FS::Search/FS::Record/; $cgisuidsetup($cgi); ivan@sisd.com 98-mar-14
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# also print 'printed' field ivan@sisd.com 98-jul-10
-#
-# $Log: cust_bill.cgi,v $
-# Revision 1.8 1999-02-28 00:03:58 ivan
-# removed misleading comments
-#
-# Revision 1.7 1999/01/25 12:26:03 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.6 1999/01/19 05:14:18 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:42 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1998/12/30 23:03:33 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.3 1998/12/23 03:07:49 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.2 1998/12/17 09:57:20 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-
-use strict;
-use vars qw ( $cgi $query $invnum $cust_bill $custnum $printed $p );
-use IO::File;
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header popurl menubar);
-use FS::Record qw(qsearchs);
-use FS::cust_bill;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-#untaint invnum
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-$invnum = $1;
-
-$cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
-die "Invoice #$invnum not found!" unless $cust_bill;
-$custnum = $cust_bill->getfield('custnum');
-
-$printed = $cust_bill->printed;
-
-$p = popurl(2);
-print $cgi->header( '-expires' => 'now' ), header('Invoice View', menubar(
- "Main Menu" => $p,
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
-)), <<END;
- <A HREF="${p}edit/cust_pay.cgi?$invnum">Enter payments (check/cash) against this invoice</A>
- <BR><A HREF="${p}misc/print-invoice.cgi?$invnum">Reprint this invoice</A>
- <BR><BR>(Printed $printed times)
- <PRE>
-END
-
-print $cust_bill->print_text;
-
- #formatting
- print <<END;
- </PRE></FONT>
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_main.cgi,v 1.18 1999-08-12 04:16:01 ivan Exp $
-#
-# Usage: cust_main.cgi custnum
-# http://server.name/path/cust_main.cgi?custnum
-#
-# the payment history section could use some work, see below
-#
-# ivan@voicenet.com 96-nov-29 -> 96-dec-11
-#
-# added navigation bar (go to main menu ;)
-# ivan@voicenet.com 97-jan-30
-#
-# changes to the way credits/payments are applied (the links are here).
-# ivan@voicenet.com 97-apr-21
-#
-# added debugging code to diagnose CPU sucking problem.
-# ivan@voicenet.com 97-may-19
-#
-# CPU sucking problem was in comment code? fixed?
-# ivan@voicenet.com 97-may-22
-#
-# rewrote for new API
-# ivan@voicenet.com 97-jul-22
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'day' to 'daytime' because Pg6.3 reserves the day word
-# bmccane@maxbaud.net 98-apr-3
-#
-# lose background, FS::CGI ivan@sisd.com 98-sep-2
-#
-# $Log: cust_main.cgi,v $
-# Revision 1.18 1999-08-12 04:16:01 ivan
-# hidecancelledpackages config option
-#
-# Revision 1.17 1999/04/15 16:44:36 ivan
-# delete customers
-#
-# Revision 1.16 1999/04/09 04:22:34 ivan
-# also table()
-#
-# Revision 1.15 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.14 1999/04/08 04:04:37 ivan
-# eliminate double // in links
-#
-# Revision 1.13 1999/02/28 00:04:00 ivan
-# removed misleading comments
-#
-# Revision 1.12 1999/02/07 09:59:40 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.11 1999/01/25 12:26:04 ivan
-# yet more mod_perl stuff
-#
-# Revision 1.10 1999/01/19 05:14:19 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.9 1999/01/18 09:41:43 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.8 1999/01/18 09:22:35 ivan
-# changes to track email addresses for email invoicing
-#
-# Revision 1.7 1998/12/30 23:03:34 ivan
-# bugfixes; fields isn't exported by derived classes
-#
-# Revision 1.6 1998/12/23 02:42:33 ivan
-# remove double '/' in link urls
-#
-# Revision 1.5 1998/12/23 02:36:28 ivan
-# use FS::cust_refund; to eliminate warning
-#
-# Revision 1.4 1998/12/17 09:57:21 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-# Revision 1.3 1998/11/15 13:14:20 ivan
-# first pass as per-customer custom pricing
-#
-# Revision 1.2 1998/11/13 11:28:08 ivan
-# s/CGI-modules/CGI.pm/;, relative URL's with popurl
-#
-
-use strict;
-use vars qw ( $cgi $query $custnum $cust_main $hashref $agent $referral
- @packages $package @history @bills $bill @credits $credit
- $balance $item @agents @referrals @invoicing_list $n1 $conf );
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use Date::Format;
-use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearchs qsearch);
-use FS::CGI qw(header menubar popurl table itable ntable);
-use FS::cust_credit;
-use FS::cust_pay;
-use FS::cust_bill;
-use FS::part_pkg;
-use FS::cust_pkg;
-use FS::part_referral;
-use FS::agent;
-use FS::cust_main;
-use FS::cust_refund;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-
-print $cgi->header( '-expires' => 'now' ), header("Customer View", menubar(
- 'Main Menu' => popurl(2)
-));
-
-die "No customer specified (bad URL)!" unless $cgi->keywords;
-($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
-$query =~ /^(\d+)$/;
-$custnum = $1;
-$cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
-die "Customer not found!" unless $cust_main;
-$hashref = $cust_main->hashref;
-
-print &itable(), '<TR><TD><A NAME="cust_main"></A>';
-
-print qq!<A HREF="!, popurl(2),
- qq!edit/cust_main.cgi?$custnum">Edit this customer</A>!;
-print qq! | <A HREF="!, popurl(2),
- qq!misc/delete-customer.cgi?$custnum"> Delete this customer</A>!
- if $conf->exists('deletecustomers');
-print &ntable("#c0c0c0"), "<TR><TD>", &ntable("#c0c0c0",2),
- '<TR><TD ALIGN="right">Customer number</TD><TD BGCOLOR="#ffffff">',
- $custnum, '</TD></TR>',
-;
-
-@agents = qsearch( 'agent', {} );
-unless ( scalar(@agents) == 1 ) {
- $agent = qsearchs('agent',{
- 'agentnum' => $cust_main->agentnum
- } );
- print '<TR><TD ALIGN="right">Agent</TD><TD BGCOLOR="#ffffff">',
- $agent->agentnum, ": ", $agent->agent, '</TD></TR>';
-}
-@referrals = qsearch( 'part_referral', {} );
-unless ( scalar(@referrals) == 1 ) {
- my $referral = qsearchs('part_referral', {
- 'refnum' => $cust_main->refnum
- } );
- print '<TR><TD ALIGN="right">Referral</TD><TD BGCOLOR="#ffffff">',
- $referral->refnum, ": ", $referral->referral, '</TD></TR>';
-}
-print '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
- $cust_main->otaker, '</TD></TR>';
-
-print '</TABLE></TD></TR></TABLE>';
-
-print '</TD><TD ROWSPAN=2>';
-
-print "Contact information", &ntable("#c0c0c0"), "<TR><TD>",
- &ntable("#c0c0c0",2),
- '<TR><TD ALIGN="right">Contact name<BR>(last, first)</TD>',
- '<TD COLSPAN=3 BGCOLOR="#ffffff">',
- $cust_main->last, ', ', $cust_main->first,
- '</TD><TD ALIGN="right">SS#</TD><TD BGCOLOR="#ffffff">',
- $cust_main->ss || ' ', '</TD></TR>',
- '<TR><TD ALIGN="right">Company</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
- $cust_main->company,
- '</TD></TR>',
- '<TR><TD ALIGN="right">Address</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
- $cust_main->address1,
- '</TD></TR>',
-;
-print '<TR><TD ALIGN="right"> </TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
- $cust_main->address2, '</TD></TR>'
- if $cust_main->address2;
-print '<TR><TD ALIGN="right">City</TD><TD BGCOLOR="#ffffff">',
- $cust_main->city,
- '</TD><TD ALIGN="right">State</TD><TD BGCOLOR="#ffffff">',
- $cust_main->state,
- '</TD><TD ALIGN="right">Zip</TD><TD BGCOLOR="#ffffff">',
- $cust_main->zip, '</TD></TR>',
- '<TR><TD ALIGN="right">Country</TD><TD BGCOLOR="#ffffff">',
- $cust_main->country,
- '</TD></TR>',
-;
-print '<TR><TD ALIGN="right">Day Phone</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
- $cust_main->daytime || ' ', '</TD></TR>',
- '<TR><TD ALIGN="right">Night Phone</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
- $cust_main->night || ' ', '</TD></TR>',
- '<TR><TD ALIGN="right">Fax</TD><TD COLSPAN=5 BGCOLOR="#ffffff">',
- $cust_main->fax || ' ', '</TD></TR>',
- '</TABLE>', "</TD></TR></TABLE>"
-;
-
-print '</TD></TR><TR><TD>';
-
-@invoicing_list = $cust_main->invoicing_list;
-print "Billing information (",
- qq!<A HREF="!, popurl(2), qq!/misc/bill.cgi?$custnum">!, "Bill now</A>)",
- &ntable("#c0c0c0"), "<TR><TD>", &ntable("#c0c0c0",2),
- '<TR><TD ALIGN="right">Tax exempt</TD><TD BGCOLOR="#ffffff">',
- $cust_main->tax ? 'yes' : 'no',
- '</TD></TR>',
- '<TR><TD ALIGN="right">Postal invoices</TD><TD BGCOLOR="#ffffff">',
- ( grep { $_ eq 'POST' } @invoicing_list ) ? 'yes' : 'no',
- '</TD></TR>',
- '<TR><TD ALIGN="right">Email invoices</TD><TD BGCOLOR="#ffffff">',
- join(', ', grep { $_ ne 'POST' } @invoicing_list ) || 'no',
- '</TD></TR>',
- '<TR><TD ALIGN="right">Billing type</TD><TD BGCOLOR="#ffffff">',
-;
-
-if ( $cust_main->payby eq 'CARD' ) {
- print 'Credit card</TD></TR>',
- '<TR><TD ALIGN="right">Card number</TD><TD BGCOLOR="#ffffff">',
- $cust_main->payinfo, '</TD></TR>',
- '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
- $cust_main->paydate, '</TD></TR>',
- '<TR><TD ALIGN="right">Name on card</TD><TD BGCOLOR="#ffffff">',
- $cust_main->payname, '</TD></TR>'
- ;
-} elsif ( $cust_main->payby eq 'BILL' ) {
- print 'Billing</TD></TR>';
- print '<TR><TD ALIGN="right">P.O. </TD><TD BGCOLOR="#ffffff">',
- $cust_main->payinfo, '</TD></TR>',
- if $cust_main->payinfo;
- print '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
- $cust_main->paydate, '</TD></TR>',
- '<TR><TD ALIGN="right">Attention</TD><TD BGCOLOR="#ffffff">',
- $cust_main->payname, '</TD></TR>',
- ;
-} elsif ( $cust_main->payby eq 'COMP' ) {
- print 'Complimentary</TD></TR>',
- '<TR><TD ALIGN="right">Authorized by</TD><TD BGCOLOR="#ffffff">',
- $cust_main->payinfo, '</TD></TR>',
- '<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
- $cust_main->paydate, '</TD></TR>',
- ;
-}
-
-print "</TABLE></TD></TR></TABLE></TD></TR></TABLE>";
-
-print qq!<BR><BR><A NAME="cust_pkg">Packages</A> !,
-# qq!<BR>Click on package number to view/edit package.!,
- qq!( <A HREF="!, popurl(2), qq!edit/cust_pkg.cgi?$custnum">Order and cancel packages</A> )!,
-;
-
-#display packages
-
-#formatting
-print qq!!, &table(), "\n",
- qq!<TR><TH COLSPAN=2 ROWSPAN=2>Package</TH><TH COLSPAN=5>!,
- qq!Dates</TH><TH COLSPAN=2 ROWSPAN=2>Services</TH></TR>\n!,
- qq!<TR><TH><FONT SIZE=-1>Setup</FONT></TH><TH>!,
- qq!<FONT SIZE=-1>Next bill</FONT>!,
- qq!</TH><TH><FONT SIZE=-1>Susp.</FONT></TH><TH><FONT SIZE=-1>Expire!,
- qq!</FONT></TH>!,
- qq!<TH><FONT SIZE=-1>Cancel</FONT></TH>!,
- qq!</TR>\n!;
-
-#get package info
-if ( $conf->exists('hidecancelledpackages') ) {
- @packages = $cust_main->ncancelled_pkgs;
-} else {
- @packages = $cust_main->all_pkgs;
-}
-
-$n1 = '<TR>';
-foreach $package (@packages) {
- my $pkgnum = $package->pkgnum;
- my $pkg = $package->part_pkg->pkg;
- my $comment = $package->part_pkg->comment;
- my $pkgview = popurl(2). "view/cust_pkg.cgi?$pkgnum";
- my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } );
- my $rowspan = scalar(@cust_svc) || 1;
-
- my $button_cgi = new CGI;
- $button_cgi->param('clone', $package->part_pkg->pkgpart);
- $button_cgi->param('pkgnum', $package->pkgnum);
- my $button_url = popurl(2). "edit/part_pkg.cgi?". $button_cgi->query_string;
-
- #print $n1, qq!<TD ROWSPAN=$rowspan><A HREF="$pkgview">$pkgnum</A></TD>!,
- print $n1, qq!<TD ROWSPAN=$rowspan>$pkgnum</TD>!,
- qq!<TD ROWSPAN=$rowspan><FONT SIZE=-1>!,
- #qq!<A HREF="$pkgview">$pkg - $comment</A>!,
- qq!$pkg - $comment!,
- qq! ( <A HREF="$pkgview">Edit</A> | <A HREF="$button_url">Customize pricing</A> )</FONT></TD>!,
- ;
- for ( qw( setup bill susp expire cancel ) ) {
- print "<TD ROWSPAN=$rowspan><FONT SIZE=-1>", ( $package->getfield($_)
- ? time2str("%D", $package->getfield($_) )
- : ' '
- ), '</FONT></TD>',
- ;
- }
-
- my $n2 = '';
- foreach my $cust_svc ( @cust_svc ) {
- my($label, $value, $svcdb) = $cust_svc->label;
- my($svcnum) = $cust_svc->svcnum;
- my($sview) = popurl(2). "view";
- print $n2,qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$label</FONT></A></TD>!,
- qq!<TD><A HREF="$sview/$svcdb.cgi?$svcnum"><FONT SIZE=-1>$value</FONT></A></TD>!;
- $n2="</TR><TR>";
- }
- $n1="</TR><TR>";
-}
-print "</TR>";
-
-#formatting
-print "</TABLE>";
-
-#formatting
-print qq!<BR><BR><A NAME="history">Payment History!,
- qq!</A>!,
- qq! ( Click on invoice to view invoice/enter payment. | !,
- qq!<A HREF="!, popurl(2), qq!edit/cust_credit.cgi?$custnum">!,
- qq!Post credit / refund</A> )!;
-
-#get payment history
-#
-# major problem: this whole thing is way too sloppy.
-# minor problem: the description lines need better formatting.
-
-@history = (); #needed for mod_perl :)
-
-@bills = qsearch('cust_bill',{'custnum'=>$custnum});
-foreach $bill (@bills) {
- my($bref)=$bill->hashref;
- push @history,
- $bref->{_date} . qq!\t<A HREF="!. popurl(2). qq!view/cust_bill.cgi?! .
- $bref->{invnum} . qq!">Invoice #! . $bref->{invnum} .
- qq! (Balance \$! . $bref->{owed} . qq!)</A>\t! .
- $bref->{charged} . qq!\t\t\t!;
-
- my(@payments)=qsearch('cust_pay',{'invnum'=> $bref->{invnum} } );
- my($payment);
- foreach $payment (@payments) {
- my($date,$invnum,$payby,$payinfo,$paid)=($payment->getfield('_date'),
- $payment->getfield('invnum'),
- $payment->getfield('payby'),
- $payment->getfield('payinfo'),
- $payment->getfield('paid'),
- );
- push @history,
- "$date\tPayment, Invoice #$invnum ($payby $payinfo)\t\t$paid\t\t";
- }
-}
-
-@credits = qsearch('cust_credit',{'custnum'=>$custnum});
-foreach $credit (@credits) {
- my($cref)=$credit->hashref;
- push @history,
- $cref->{_date} . "\tCredit #" . $cref->{crednum} . ", (Balance \$" .
- $cref->{credited} . ") by " . $cref->{otaker} . " - " .
- $cref->{reason} . "\t\t\t" . $cref->{amount} . "\t";
-
- my(@refunds)=qsearch('cust_refund',{'crednum'=> $cref->{crednum} } );
- my($refund);
- foreach $refund (@refunds) {
- my($rref)=$refund->hashref;
- push @history,
- $rref->{_date} . "\tRefund, Credit #" . $rref->{crednum} . " (" .
- $rref->{payby} . " " . $rref->{payinfo} . ") by " .
- $rref->{otaker} . " - ". $rref->{reason} . "\t\t\t\t" .
- $rref->{refund};
- }
-}
-
- #formatting
- print &table(), <<END;
-<TR>
- <TH>Date</TH>
- <TH>Description</TH>
- <TH><FONT SIZE=-1>Charge</FONT></TH>
- <TH><FONT SIZE=-1>Payment</FONT></TH>
- <TH><FONT SIZE=-1>In-house<BR>Credit</FONT></TH>
- <TH><FONT SIZE=-1>Refund</FONT></TH>
- <TH><FONT SIZE=-1>Balance</FONT></TH>
-</TR>
-END
-
-#display payment history
-
-$balance = 0;
-foreach $item (sort keyfield_numerically @history) {
- my($date,$desc,$charge,$payment,$credit,$refund)=split(/\t/,$item);
- $charge ||= 0;
- $payment ||= 0;
- $credit ||= 0;
- $refund ||= 0;
- $balance += $charge - $payment;
- $balance -= $credit - $refund;
-
- print "<TR><TD><FONT SIZE=-1>",time2str("%D",$date),"</FONT></TD>",
- "<TD><FONT SIZE=-1>$desc</FONT></TD>",
- "<TD><FONT SIZE=-1>",
- ( $charge ? "\$".sprintf("%.2f",$charge) : '' ),
- "</FONT></TD>",
- "<TD><FONT SIZE=-1>",
- ( $payment ? "- \$".sprintf("%.2f",$payment) : '' ),
- "</FONT></TD>",
- "<TD><FONT SIZE=-1>",
- ( $credit ? "- \$".sprintf("%.2f",$credit) : '' ),
- "</FONT></TD>",
- "<TD><FONT SIZE=-1>",
- ( $refund ? "\$".sprintf("%.2f",$refund) : '' ),
- "</FONT></TD>",
- "<TD><FONT SIZE=-1>\$" . sprintf("%.2f",$balance),
- "</FONT></TD>",
- "\n";
-}
-
-#formatting
-print "</TABLE>";
-
-#end
-
-#formatting
-print <<END;
-
- </BODY>
-</HTML>
-END
-
-#subroutiens
-sub keyfield_numerically { (split(/\t/,$a))[0] <=> (split(/\t/,$b))[0] ; }
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cust_pkg.cgi,v 1.11 1999-04-09 04:22:34 ivan Exp $
-#
-# Usage: cust_pkg.cgi pkgnum
-# http://server.name/path/cust_pkg.cgi?pkgnum
-#
-# ivan@voicenet.com 96-dec-15
-#
-# services section needs to be cleaned up, needs to display extraneous
-# entries in cust_pkg!
-# ivan@voicenet.com 96-dec-31
-#
-# added navigation bar
-# ivan@voicenet.com 97-jan-30
-#
-# changed and fixed up suspension and cancel stuff, now you can't add
-# services to a cancelled package
-# ivan@voicenet.com 97-feb-27
-#
-# rewrote for new API, still needs to be cleaned up!
-# ivan@voicenet.com 97-jul-29
-#
-# no FS::Search ivan@sisd.com 98-mar-7
-#
-# $Log: cust_pkg.cgi,v $
-# Revision 1.11 1999-04-09 04:22:34 ivan
-# also table()
-#
-# Revision 1.10 1999/04/09 03:52:55 ivan
-# explicit & for table/itable/ntable
-#
-# Revision 1.9 1999/04/08 12:00:19 ivan
-# aesthetic update
-#
-# Revision 1.8 1999/02/28 00:04:01 ivan
-# removed misleading comments
-#
-# Revision 1.7 1999/01/19 05:14:20 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.6 1999/01/18 09:41:44 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.5 1998/12/23 03:11:40 ivan
-# *** empty log message ***
-#
-# Revision 1.3 1998/12/17 09:57:22 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-# Revision 1.2 1998/11/13 09:56:49 ivan
-# change configuration file layout to support multiple distinct databases (with
-# own set of config files, export, etc.)
-#
-
-use strict;
-use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg
- $custnum $susp $cancel $expire $pkg $comment $setup $bill
- $otaker );
-use Date::Format;
-use CGI;
-use CGI::Carp qw(fatalsToBrowser);
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(popurl header menubar ntable table);
-use FS::Record qw(qsearch qsearchs);
-use FS::part_svc;
-use FS::cust_pkg;
-use FS::part_pkg;
-use FS::pkg_svc;
-use FS::cust_svc;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-foreach $part_svc ( qsearch('part_svc',{}) ) {
- $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi";
- $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi";
-}
-
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-$pkgnum = $1;
-
-#get package record
-$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
-die "No package!" unless $cust_pkg;
-$part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')});
-
-$custnum = $cust_pkg->getfield('custnum');
-print $cgi->header( '-expires' => 'now' ), header('Package View', menubar(
- "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum",
- 'Main Menu' => popurl(2)
-));
-
-#print info
-($susp,$cancel,$expire)=(
- $cust_pkg->getfield('susp'),
- $cust_pkg->getfield('cancel'),
- $cust_pkg->getfield('expire'),
-);
-($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment'));
-($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill'));
-$otaker = $cust_pkg->getfield('otaker');
-
-print "Package information";
-print ' (<A HREF="'. popurl(2). 'misc/unsusp_pkg.cgi?'. $pkgnum.
- '">unsuspend</A>)' if ( $susp && ! $cancel );
-print ' (<A HREF="'. popurl(2). 'misc/susp_pkg.cgi?'. $pkgnum.
- '">suspend</A>)' unless ( $susp || $cancel );
-print ' (<A HREF="'. popurl(2). 'misc/cancel_pkg.cgi?'. $pkgnum.
- '">cancel</A>)' unless $cancel;
-
-print &ntable("#c0c0c0"), '<TR><TD>', &ntable("#c0c0c0",2),
- '<TR><TD ALIGN="right">Package number</TD><TD BGCOLOR="#ffffff">',
- $pkgnum, '</TD></TR>',
- '<TR><TD ALIGN="right">Package</TD><TD BGCOLOR="#ffffff">',
- $pkg, '</TD></TR>',
- '<TR><TD ALIGN="right">Comment</TD><TD BGCOLOR="#ffffff">',
- $comment, '</TD></TR>',
- '<TR><TD ALIGN="right">Setup date</TD><TD BGCOLOR="#ffffff">',
- ( $setup ? time2str("%D",$setup) : "(Not setup)" ), '</TD></TR>',
- '<TR><TD ALIGN="right">Next bill date</TD><TD BGCOLOR="#ffffff">',
- ( $bill ? time2str("%D",$bill) : " " ), '</TD></TR>',
-;
-print '<TR><TD ALIGN="right">Suspension date</TD><TD BGCOLOR="#ffffff">',
- time2str("%D",$susp), '</TD></TR>' if $susp;
-print '<TR><TD ALIGN="right">Expiration date</TD><TD BGCOLOR="#ffffff">',
- time2str("%D",$expire), '</TD></TR>' if $expire;
-print '<TR><TD ALIGN="right">Cancellation date</TD><TD BGCOLOR="#ffffff">',
- time2str("%D",$cancel), '</TD></TR>' if $cancel;
-print '<TR><TD ALIGN="right">Order taker</TD><TD BGCOLOR="#ffffff">',
- $otaker, '</TD></TR>',
- '</TABLE></TD></TR></TABLE>'
-;
-
-# print <<END;
-#<FORM ACTION="../misc/expire_pkg.cgi" METHOD="post">
-#<INPUT TYPE="hidden" NAME="pkgnum" VALUE="$pkgnum">
-#Expire (date): <INPUT TYPE="text" NAME="date" VALUE="" >
-#<INPUT TYPE="submit" VALUE="Cancel later">
-#END
-
-unless ($cancel) {
-
- #services
- print '<BR>Service Information', &table();
-
- #list of services this pkgpart includes
- my $pkg_svc;
- my %pkg_svc = ();
- foreach $pkg_svc ( qsearch('pkg_svc',{'pkgpart'=> $cust_pkg->pkgpart }) ) {
- $pkg_svc{$pkg_svc->svcpart} = $pkg_svc->quantity if $pkg_svc->quantity;
- }
-
- #list of records from cust_svc
- my $svcpart;
- foreach $svcpart (sort {$a <=> $b} keys %pkg_svc) {
-
- my($svc)=qsearchs('part_svc',{'svcpart'=>$svcpart})->getfield('svc');
-
- my(@cust_svc)=qsearch('cust_svc',{'pkgnum'=>$pkgnum,
- 'svcpart'=>$svcpart,
- });
-
- my($enum);
- for $enum ( 1 .. $pkg_svc{$svcpart} ) {
-
- my($cust_svc);
- if ( $cust_svc=shift @cust_svc ) {
- my($svcnum)=$cust_svc->svcnum;
- my($label, $value, $svcdb) = $cust_svc->label;
- print <<END;
-<TR><TD><A HREF="$uiview{$svcpart}?$svcnum">(View) $svc: $value<A></TD></TR>
-END
- } else {
- print <<END;
-<TR>
- <TD><A HREF="$uiadd{$svcpart}?pkgnum$pkgnum-svcpart$svcpart">
- (Add) $svc</A>
- or <A HREF="../misc/link.cgi?pkgnum$pkgnum-svcpart$svcpart">
- (Link to existing) $svc</A>
- </TD>
-</TR>
-END
- }
-
- }
- warn "WARNING: Leftover services pkgnum $pkgnum!" if @cust_svc;;
- }
-
- print "</TABLE><FONT SIZE=-1>",
- "Choose (View) to view or edit an existing service<BR>",
- "Choose (Add) to setup a new service<BR>",
- "Choose (Link to existing) to link to a legacy (pre-Freeside) service",
- "</FONT>"
- ;
-}
-
-#formatting
-print <<END;
- </BODY>
-</HTML>
-END
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct.cgi,v 1.10 1999-04-14 11:27:06 ivan Exp $
-#
-# Usage: svc_acct.cgi svcnum
-# http://server.name/path/svc_acct.cgi?svcnum
-#
-# ivan@voicenet.com 96-dec-17
-#
-# added link to send info
-# ivan@voicenet.com 97-jan-4
-#
-# added navigation bar and ability to change username, etc.
-# ivan@voicenet.com 97-jan-30
-#
-# activate 800 service
-# ivan@voicenet.com 97-feb-10
-#
-# modified navbar code (should be a subroutine?), added link to cancel account (only if not audited)
-# ivan@voicenet.com 97-apr-16
-#
-# INCOMPLETELY rewrote some things for new API
-# ivan@voicenet.com 97-jul-29
-#
-# FS::Search became FS::Record, use strict, etc. ivan@sisd.com 98-mar-9
-#
-# Changes to allow page to work at a relative position in server
-# Changed 'password' to '_password' because Pg6.3 reserves the password word
-# bmccane@maxbaud.net 98-apr-3
-#
-# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17
-#
-# displays arbitrary radius attributes ivan@sisd.com 98-aug-16
-#
-# $Log: svc_acct.cgi,v $
-# Revision 1.10 1999-04-14 11:27:06 ivan
-# showpasswords config option to show passwords
-#
-# Revision 1.9 1999/04/08 12:00:19 ivan
-# aesthetic update
-#
-# Revision 1.8 1999/02/28 00:04:02 ivan
-# removed misleading comments
-#
-# Revision 1.7 1999/01/19 05:14:21 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.6 1999/01/18 09:41:45 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.5 1999/01/18 09:22:36 ivan
-# changes to track email addresses for email invoicing
-#
-# Revision 1.4 1998/12/23 03:09:19 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.3 1998/12/17 09:57:23 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-# Revision 1.2 1998/12/16 05:24:29 ivan
-# use FS::Conf;
-#
-
-use strict;
-use vars qw( $conf $cgi $mydomain $query $svcnum $svc_acct $cust_svc $pkgnum
- $cust_pkg $custnum $part_svc $p $svc_acct_pop $password );
-use CGI;
-use CGI::Carp qw( fatalsToBrowser );
-use FS::UID qw( cgisuidsetup );
-use FS::CGI qw( header popurl menubar);
-use FS::Record qw( qsearchs fields );
-use FS::Conf;
-use FS::svc_acct;
-use FS::cust_svc;
-use FS::cust_pkg;
-use FS::part_svc;
-use FS::svc_acct_pop;
-
-$cgi = new CGI;
-&cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-$mydomain = $conf->config('domain');
-
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-$svcnum = $1;
-$svc_acct = qsearchs('svc_acct',{'svcnum'=>$svcnum});
-die "Unkonwn svcnum" unless $svc_acct;
-
-$cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
-$pkgnum = $cust_svc->getfield('pkgnum');
-if ($pkgnum) {
- $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
- $custnum=$cust_pkg->getfield('custnum');
-} else {
- $cust_pkg = '';
- $custnum = '';
-}
-
-$part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
-die "Unkonwn svcpart" unless $part_svc;
-
-$p = popurl(2);
-print $cgi->header( '-expires' => 'now' ), header('Account View', menubar(
- ( ( $pkgnum || $custnum )
- ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
- )
- : ( "Cancel this (unaudited) account" =>
- "${p}misc/cancel-unaudited.cgi?$svcnum" )
- ),
- "Main menu" => $p,
-));
-
-#print qq!<BR><A HREF="../misc/sendconfig.cgi?$svcnum">Send account information</A>!;
-
-print qq!<A HREF="${p}edit/svc_acct.cgi?$svcnum">Edit this information</A>!,
- "<BR>Service #$svcnum",
- "<BR>Service: <B>", $part_svc->svc, "</B>",
- "<BR><BR>Username: <B>", $svc_acct->username, "</B>"
-;
-
-print "<BR>Password: ";
-$password = $svc_acct->_password;
-if ( $password =~ /^\*\w+\* (.*)$/ ) {
- $password = $1;
- print "<I>(login disabled)</I> ";
-}
-if ( $conf->exists('showpasswords') ) {
- print "<B>$password</B>";
-} else {
- print "<I>(hidden)</I>";
-}
-$password = '';
-
-$svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
-print "<BR>POP: <B>", $svc_acct_pop->city, ", ", $svc_acct_pop->state,
- " (", $svc_acct_pop->ac, ")/", $svc_acct_pop->exch, "<\B>"
- if $svc_acct_pop;
-
-if ($svc_acct->uid ne '') {
- print "<BR><BR>Uid: <B>", $svc_acct->uid, "</B>",
- "<BR>Gid: <B>", $svc_acct->gid, "</B>",
- "<BR>Finger name: <B>", $svc_acct->finger, "</B>",
- "<BR>Home directory: <B>", $svc_acct->dir, "</B>",
- "<BR>Shell: <B>", $svc_acct->shell, "</B>",
- "<BR>Quota: <B>", $svc_acct->quota, "</B> <I>(unimplemented)</I>"
- ;
-} else {
- print "<BR><BR>(No shell account)";
-}
-
-if ($svc_acct->slipip) {
- print "<BR><BR>IP address: <B>", ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' ) ? "<I>(Dynamic)</I>" : $svc_acct->slipip ,"</B>";
- my($attribute);
- foreach $attribute ( grep /^radius_/, fields('svc_acct') ) {
- #warn $attribute;
- $attribute =~ /^radius_(.*)$/;
- my($pattribute) = ($1);
- $pattribute =~ s/_/-/g;
- print "<BR>Radius $pattribute: <B>". $svc_acct->getfield($attribute), "</B>";
- }
-} else {
- print "<BR><BR>(No SLIP/PPP account)";
-}
-
-print "</BODY></HTML>";
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_acct_sm.cgi,v 1.10 1999-04-08 12:00:19 ivan Exp $
-#
-# Usage: svc_acct_sm.cgi svcnum
-# http://server.name/path/svc_acct_sm.cgi?svcnum
-#
-# based on view/svc_acct.cgi
-#
-# ivan@voicenet.com 97-jan-5
-#
-# added navigation bar
-# ivan@voicenet.com 97-jan-30
-#
-# rewrite ivan@sisd.com 98-mar-15
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# /var/spool/freeside/conf/domain ivan@sisd.com 98-jul-17
-#
-# $Log: svc_acct_sm.cgi,v $
-# Revision 1.10 1999-04-08 12:00:19 ivan
-# aesthetic update
-#
-# Revision 1.9 1999/02/28 00:04:03 ivan
-# removed misleading comments
-#
-# Revision 1.8 1999/02/09 09:23:00 ivan
-# visual and bugfixes
-#
-# Revision 1.7 1999/02/07 09:59:42 ivan
-# more mod_perl fixes, and bugfixes Peter Wemm sent via email
-#
-# Revision 1.6 1999/01/19 05:14:22 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:46 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1998/12/23 03:09:52 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.3 1998/12/17 09:57:24 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-# Revision 1.2 1998/12/16 05:24:30 ivan
-# use FS::Conf;
-#
-
-use strict;
-use vars qw($conf $cgi $mydomain $query $svcnum $svc_acct_sm $cust_svc
- $pkgnum $cust_pkg $custnum $part_svc $p $domsvc $domuid $domuser
- $svc $svc_domain $domain $svc_acct $username );
-use CGI;
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header popurl menubar );
-use FS::Record qw(qsearchs);
-use FS::Conf;
-use FS::svc_acct_sm;
-use FS::cust_svc;
-use FS::cust_pkg;
-use FS::part_svc;
-use FS::svc_domain;
-use FS::svc_acct;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-$conf = new FS::Conf;
-$mydomain = $conf->config('domain');
-
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-$svcnum = $1;
-$svc_acct_sm = qsearchs('svc_acct_sm',{'svcnum'=>$svcnum});
-die "Unknown svcnum" unless $svc_acct_sm;
-
-$cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
-$pkgnum = $cust_svc->getfield('pkgnum');
-if ($pkgnum) {
- $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
- $custnum=$cust_pkg->getfield('custnum');
-} else {
- $cust_pkg = '';
- $custnum = '';
-}
-
-$part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
-die "Unkonwn svcpart" unless $part_svc;
-
-$p = popurl(2);
-print $cgi->header( '-expires' => 'now' ), header('Mail Alias View', menubar(
- ( ( $pkgnum || $custnum )
- ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
- )
- : ( "Cancel this (unaudited) account" =>
- "${p}misc/cancel-unaudited.cgi?$svcnum" )
- ),
- "Main menu" => $p,
-));
-
-($domsvc,$domuid,$domuser) = (
- $svc_acct_sm->domsvc,
- $svc_acct_sm->domuid,
- $svc_acct_sm->domuser,
-);
-$svc = $part_svc->svc;
-$svc_domain = qsearchs('svc_domain',{'svcnum'=>$domsvc});
-$domain = $svc_domain->domain;
-$svc_acct = qsearchs('svc_acct',{'uid'=>$domuid});
-$username = $svc_acct->username;
-
-print qq!<A HREF="${p}edit/svc_acct_sm.cgi?$svcnum">Edit this information</A>!,
- "<BR>Service #$svcnum",
- "<BR>Service: <B>$svc</B>",
- qq!<BR>Mail to <B>!, ( ($domuser eq '*') ? "<I>(anything)</I>" : $domuser ) , qq!</B>\@<B>$domain</B> forwards to <B>$username</B>\@$mydomain mailbox.!,
- '</BODY></HTML>'
-;
-
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: svc_domain.cgi,v 1.10 1999-08-27 22:18:44 ivan Exp $
-#
-# Usage: svc_domain svcnum
-# http://server.name/path/svc_domain.cgi?svcnum
-#
-# ivan@voicenet.com 97-jan-6
-#
-# rewrite ivan@sisd.com 98-mar-14
-#
-# Changes to allow page to work at a relative position in server
-# bmccane@maxbaud.net 98-apr-3
-#
-# $Log: svc_domain.cgi,v $
-# Revision 1.10 1999-08-27 22:18:44 ivan
-# point to patrick instead of internic!
-#
-# Revision 1.9 1999/04/08 12:00:19 ivan
-# aesthetic update
-#
-# Revision 1.8 1999/02/28 00:04:04 ivan
-# removed misleading comments
-#
-# Revision 1.7 1999/02/23 08:09:25 ivan
-# beginnings of one-screen new customer entry and some other miscellania
-#
-# Revision 1.6 1999/01/19 05:14:23 ivan
-# for mod_perl: no more top-level my() variables; use vars instead
-# also the last s/create/new/;
-#
-# Revision 1.5 1999/01/18 09:41:47 ivan
-# all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
-# (good idea anyway)
-#
-# Revision 1.4 1998/12/23 03:10:19 ivan
-# $cgi->keywords instead of $cgi->query_string
-#
-# Revision 1.3 1998/12/17 09:57:25 ivan
-# s/CGI::(Base|Request)/CGI.pm/;
-#
-# Revision 1.2 1998/11/13 09:56:50 ivan
-# change configuration file layout to support multiple distinct databases (with
-# own set of config files, export, etc.)
-#
-
-use strict;
-use vars qw( $cgi $query $svcnum $svc_domain $domain $cust_svc $pkgnum
- $cust_pkg $custnum $part_svc $p );
-use CGI;
-use FS::UID qw(cgisuidsetup);
-use FS::CGI qw(header menubar popurl menubar);
-use FS::Record qw(qsearchs);
-use FS::svc_domain;
-use FS::cust_svc;
-use FS::cust_pkg;
-use FS::part_svc;
-
-$cgi = new CGI;
-cgisuidsetup($cgi);
-
-($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-$svcnum = $1;
-$svc_domain = qsearchs('svc_domain',{'svcnum'=>$svcnum});
-die "Unknown svcnum" unless $svc_domain;
-
-$cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum});
-$pkgnum = $cust_svc->getfield('pkgnum');
-if ($pkgnum) {
- $cust_pkg=qsearchs('cust_pkg',{'pkgnum'=>$pkgnum});
- $custnum=$cust_pkg->getfield('custnum');
-} else {
- $cust_pkg = '';
- $custnum = '';
-}
-
-$part_svc = qsearchs('part_svc',{'svcpart'=> $cust_svc->svcpart } );
-die "Unkonwn svcpart" unless $part_svc;
-
-$domain = $svc_domain->domain;
-
-$p = popurl(2);
-print $cgi->header( '-expires' => 'now' ), header('Domain View', menubar(
- ( ( $pkgnum || $custnum )
- ? ( "View this package (#$pkgnum)" => "${p}view/cust_pkg.cgi?$pkgnum",
- "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum",
- )
- : ( "Cancel this (unaudited) account" =>
- "${p}misc/cancel-unaudited.cgi?$svcnum" )
- ),
- "Main menu" => $p,
-)),
- "Service #$svcnum",
- "<BR>Service: <B>", $part_svc->svc, "</B>",
- "<BR>Domain name: <B>$domain</B>.",
- qq!<BR><BR><A HREF="http://209.133.38.12/step1.cgi?query=$domain">View whois information.</A>!,
- '</BODY></HTML>',
-;
+++ /dev/null
-#!/usr/bin/perl -Tw
-#
-# $Id: cgi-test,v 1.2 1999-08-23 12:26:37 ivan Exp $
-#
-# This is the beginning of a test suite for the web interface.
-# It's also excellent for populating your database with some meaningful test
-# data. (a derivative is used by the web demo)
-# It only works on an empty database (probably need empty counters too, and
-# no arbirary RADIUS attributes).
-# Usage: cgi-test http://base.freeside.url/with/path/ username password
-# (Yes, if you were properly paranoid and are using SSL, you'll need to get
-# libwww-perl working with SSL to use this.)
-#
-# $Log: cgi-test,v $
-# Revision 1.2 1999-08-23 12:26:37 ivan
-# need to untaint the command line
-#
-# Revision 1.1 1999/04/08 13:05:40 ivan
-# web interface tester / sample data creator
-#
-
-use strict;
-#use diagnostics;
-use subs qw( big_ugly_data_structure );
-use CGI;
-use LWP::UserAgent;
-
-my ( $base_url, $username, $password ) = ( shift, shift, shift );
-#trust 'em
-$base_url =~ /^(.*)$/; $base_url = $1;
-$username =~ /^(.*)$/; $username = $1;
-$password =~ /^(.*)$/; $password = $1;
-
-my @data = &big_ugly_data_structure;
-
-my $ua = new LWP::UserAgent;
-{
- local $^W = 0;
- eval '
- sub LWP::UserAgent::get_basic_credentials {
- #my $self = shift;
- ( $username, $password );
- }
- ';
-}
-
-my $data;
-while ( $data = shift @data ) {
- my $cgi = new CGI ( $data->{'params'} );
- my $full_url = $base_url. $data->{'url'}. '?'. $cgi->query_string;
- #my $request = new HTTP::Request( 'POST', $full_url );
- my $request = new HTTP::Request( 'GET', $full_url );
- my $response = $ua->request( $request );
- if ( $response->is_redirect ) {
- die "Unexpected redirect!\n".
- "URL: $full_url\n".
- "To: ". $response->base. "\n"
- ;
- } elsif ( $response->is_success ) {
- my $location = $response->base;
- my $expected_location = $data->{'location'};
- #if ( $location =~ /^$base_url$expected_location$/ ) {
- if ( $location eq $base_url. $expected_location ) {
- #warn "cool, got expected response $location from $full_url\n";
- } else {
- die "Strange, regular response, but unexpected base!\n".
- "URL: $full_url\n".
- "Base : ". $response->base. "\n".
- "Expected: $base_url$expected_location\n".
- "Output: ". $response->content. "\n"
- ;
- }
- } elsif ( $response->is_error ) {
- die "Strange, I got an error\n".
- "URL: $full_url\n".
- "Error: ". $response->error_as_HTML. "\n".
- "Output: ". $response->content. "\n"
- ;
- } elsif ( $response->is_info ) {
- die "Strange, I got an info reponse\n".
- "URL: $full_url\n".
- "Output: ". $response->content. "\n"
- ;
- } else {
- die "Really strange, got an unrecognized response from LWP::UserAgent!\n";
- }
-}
-
-#---
-
-sub big_ugly_data_structure {
-
- (
- { 'url' => 'edit/process/part_svc.cgi',
- 'params' => {
- 'svcpart' => '',
- 'svc' => 'Shell',
- 'svcdb' => 'svc_acct',
- 'svc_acct__popnum_flag' => '',
- 'svc_acct__popnum' => '',
- 'svc_acct__dir_flag' => '',
- 'svc_acct__dir' => '',
- 'svc_acct__username_flag' => '',
- 'svc_acct__username' => '',
- 'svc_acct__uid_flag' => '',
- 'svc_acct__uid' => '',
- 'svc_acct__quota_flag' => 'F',
- 'svc_acct__quota' => '10',
- 'svc_acct__slipip_flag' => 'F',
- 'svc_acct__slipip' => '',
- 'svc_acct___password_flag' => '',
- 'svc_acct___password' => '',
- 'svc_acct__gid_flag' => '',
- 'svc_acct__gid' => '',
- 'svc_acct__shell_flag' => 'D',
- 'svc_acct__shell' => '/bin/sh',
- 'svc_acct__finger_flag' => '',
- 'svc_acct__finger' => '',
- 'svc_domain__domain_flag' => '',
- 'svc_domain__domain' => '',
- 'svc_acct_sm__domuser_flag' => '',
- 'svc_acct_sm__domuser' => '',
- 'svc_acct_sm__domuid_flag' => '',
- 'svc_acct_sm__domuid' => '',
- 'svc_acct_sm__domsvc_flag' => '',
- 'svc_acct_sm__domsvc' => '',
- },
- 'location' => 'browse/part_svc.cgi',
- },
- { 'url' => 'edit/process/part_svc.cgi',
- 'params' => {
- 'svcpart' => '',
- 'svc' => 'SLIP/PPP',
- 'svcdb' => 'svc_acct',
- 'svc_acct__popnum_flag' => '',
- 'svc_acct__popnum' => '',
- 'svc_acct__dir_flag' => '',
- 'svc_acct__dir' => '',
- 'svc_acct__username_flag' => '',
- 'svc_acct__username' => '',
- 'svc_acct__uid_flag' => '',
- 'svc_acct__uid' => '',
- 'svc_acct__quota_flag' => 'F',
- 'svc_acct__quota' => '10',
- 'svc_acct__slipip_flag' => 'D',
- 'svc_acct__slipip' => '0.0.0.0',
- 'svc_acct___password_flag' => '',
- 'svc_acct___password' => '',
- 'svc_acct__gid_flag' => '',
- 'svc_acct__gid' => '',
- 'svc_acct__shell_flag' => 'D',
- 'svc_acct__shell' => '/bin/sh',
- 'svc_acct__finger_flag' => '',
- 'svc_acct__finger' => '',
- 'svc_domain__domain_flag' => '',
- 'svc_domain__domain' => '',
- 'svc_acct_sm__domuser_flag' => '',
- 'svc_acct_sm__domuser' => '',
- 'svc_acct_sm__domuid_flag' => '',
- 'svc_acct_sm__domuid' => '',
- 'svc_acct_sm__domsvc_flag' => '',
- 'svc_acct_sm__domsvc' => '',
- },
- 'location' => 'browse/part_svc.cgi',
- },
- { 'url' => 'edit/process/part_svc.cgi',
- 'params' => {
- 'svcpart' => '',
- 'svc' => 'POP Mailbox',
- 'svcdb' => 'svc_acct',,
- 'svc_acct__popnum_flag' => 'F',
- 'svc_acct__popnum' => '',
- 'svc_acct__dir_flag' => '',
- 'svc_acct__dir' => '',
- 'svc_acct__username_flag' => '',
- 'svc_acct__username' => '',
- 'svc_acct__uid_flag' => '',
- 'svc_acct__uid' => '',
- 'svc_acct__quota_flag' => 'F',
- 'svc_acct__quota' => '10',
- 'svc_acct__slipip_flag' => 'F',
- 'svc_acct__slipip' => '',
- 'svc_acct___password_flag' => '',
- 'svc_acct___password' => '',
- 'svc_acct__gid_flag' => '',
- 'svc_acct__gid' => '',
- 'svc_acct__shell_flag' => 'F',
- 'svc_acct__shell' => '/bin/passwd',
- 'svc_acct__finger_flag' => '',
- 'svc_acct__finger' => '',
- 'svc_domain__domain_flag' => '',
- 'svc_domain__domain' => '',
- 'svc_acct_sm__domuser_flag' => '',
- 'svc_acct_sm__domuser' => '',
- 'svc_acct_sm__domuid_flag' => '',
- 'svc_acct_sm__domuid' => '',
- 'svc_acct_sm__domsvc_flag' => '',
- 'svc_acct_sm__domsvc' => '',
- },
- 'location' => 'browse/part_svc.cgi',
- },
- { 'url' => 'edit/process/part_svc.cgi',
- 'params' => {
- 'svcpart' => '',
- 'svc' => 'Domain',
- 'svcdb' => 'svc_domain',,
- 'svc_acct__popnum_flag' => '',
- 'svc_acct__popnum' => '',
- 'svc_acct__dir_flag' => '',
- 'svc_acct__dir' => '',
- 'svc_acct__username_flag' => '',
- 'svc_acct__username' => '',
- 'svc_acct__uid_flag' => '',
- 'svc_acct__uid' => '',
- 'svc_acct__quota_flag' => '',
- 'svc_acct__quota' => '',
- 'svc_acct__slipip_flag' => '',
- 'svc_acct__slipip' => '',
- 'svc_acct___password_flag' => '',
- 'svc_acct___password' => '',
- 'svc_acct__gid_flag' => '',
- 'svc_acct__gid' => '',
- 'svc_acct__shell_flag' => '',
- 'svc_acct__shell' => '',
- 'svc_acct__finger_flag' => '',
- 'svc_acct__finger' => '',
- 'svc_domain__domain_flag' => '',
- 'svc_domain__domain' => '',
- 'svc_acct_sm__domuser_flag' => '',
- 'svc_acct_sm__domuser' => '',
- 'svc_acct_sm__domuid_flag' => '',
- 'svc_acct_sm__domuid' => '',
- 'svc_acct_sm__domsvc_flag' => '',
- 'svc_acct_sm__domsvc' => '',
- },
- 'location' => 'browse/part_svc.cgi',
- },
- { 'url' => 'edit/process/part_svc.cgi',
- 'params' => {
- 'svcpart' => '',
- 'svc' => 'Domain email alias',
- 'svcdb' => 'svc_acct_sm',,
- 'svc_acct__popnum_flag' => '',
- 'svc_acct__popnum' => '',
- 'svc_acct__dir_flag' => '',
- 'svc_acct__dir' => '',
- 'svc_acct__username_flag' => '',
- 'svc_acct__username' => '',
- 'svc_acct__uid_flag' => '',
- 'svc_acct__uid' => '',
- 'svc_acct__quota_flag' => '',
- 'svc_acct__quota' => '',
- 'svc_acct__slipip_flag' => '',
- 'svc_acct__slipip' => '',
- 'svc_acct___password_flag' => '',
- 'svc_acct___password' => '',
- 'svc_acct__gid_flag' => '',
- 'svc_acct__gid' => '',
- 'svc_acct__shell_flag' => '',
- 'svc_acct__shell' => '',
- 'svc_acct__finger_flag' => '',
- 'svc_acct__finger' => '',
- 'svc_domain__domain_flag' => '',
- 'svc_domain__domain' => '',
- 'svc_acct_sm__domuser_flag' => '',
- 'svc_acct_sm__domuser' => '',
- 'svc_acct_sm__domuid_flag' => '',
- 'svc_acct_sm__domuid' => '',
- 'svc_acct_sm__domsvc_flag' => '',
- 'svc_acct_sm__domsvc' => '',
- },
- 'location' => 'browse/part_svc.cgi',
- },
-
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'Personal SLIP/PPP',
- 'comment' => '$30/setup, $19.99/month',
- 'setup' => '30',
- 'recur' => '19.99',
- 'freq' => '1',
- 'pkg_svc1' => '0',
- 'pkg_svc2' => '1',
- 'pkg_svc3' => '0',
- 'pkg_svc4' => '0',
- 'pkg_svc5' => '0',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'Personal SLIP/PPP',
- 'comment' => '$0/setup, $179.88/year',
- 'setup' => '0',
- 'recur' => '179.88',
- 'freq' => '12',
- 'pkg_svc1' => '0',
- 'pkg_svc2' => '1',
- 'pkg_svc3' => '0',
- 'pkg_svc4' => '0',
- 'pkg_svc5' => '0',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'Personal POP mailbox',
- 'comment' => '$10/setup, $5/month',
- 'setup' => '10',
- 'recur' => '5',
- 'freq' => '1',
- 'pkg_svc1' => '0',
- 'pkg_svc2' => '0',
- 'pkg_svc3' => '1',
- 'pkg_svc4' => '0',
- 'pkg_svc5' => '0',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'Business SLIP/PPP',
- 'comment' => '$30/setup, $29.99/month',
- 'setup' => '30',
- 'recur' => '29.99',
- 'freq' => '1',
- 'pkg_svc1' => '0',
- 'pkg_svc2' => '1',
- 'pkg_svc3' => '0',
- 'pkg_svc4' => '1',
- 'pkg_svc5' => '1',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'Business SLIP/PPP',
- 'comment' => '$0/setup, $299.88/year',
- 'setup' => '0',
- 'recur' => '299.88',
- 'freq' => '12',
- 'pkg_svc1' => '0',
- 'pkg_svc2' => '1',
- 'pkg_svc3' => '0',
- 'pkg_svc4' => '1',
- 'pkg_svc5' => '1',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'Business POP mailbox',
- 'comment' => '$10/setup, $5/month',
- 'setup' => '10',
- 'recur' => '5',
- 'freq' => '1',
- 'pkg_svc1' => '0',
- 'pkg_svc2' => '0',
- 'pkg_svc3' => '1',
- 'pkg_svc4' => '0',
- 'pkg_svc5' => '1',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'UNIX shell',
- 'comment' => '$20/setup, $9.99/month',
- 'setup' => '20',
- 'recur' => '9.99',
- 'freq' => '1',
- 'pkg_svc1' => '1',
- 'pkg_svc2' => '0',
- 'pkg_svc3' => '0',
- 'pkg_svc4' => '0',
- 'pkg_svc5' => '0',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'Point-to-point T1',
- 'comment' => '$1000/setup, $1000/month',
- 'setup' => '1000',
- 'recur' => '1000',
- 'freq' => '1',
- 'pkg_svc1' => '0',
- 'pkg_svc2' => '0',
- 'pkg_svc3' => '5',
- 'pkg_svc4' => '1',
- 'pkg_svc5' => '5',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
- { 'url' => 'edit/process/part_pkg.cgi',
- 'params' => {
- 'pkgpart' => '',
- 'pkg' => 'Cisco 2501 Router',
- 'comment' => '$2500',
- 'setup' => '2500',
- 'recur' => '0',
- 'freq' => '0',
- 'pkg_svc1' => '0',
- 'pkg_svc2' => '0',
- 'pkg_svc3' => '0',
- 'pkg_svc4' => '0',
- 'pkg_svc5' => '0',
- },
- 'location' => 'browse/part_pkg.cgi',
- },
-
- { 'url' => 'edit/process/agent_type.cgi',
- 'params' => {
- 'typenum' => '',
- 'atype' => 'Internal Sales',
- 'pkgpart1' => 'ON',
- 'pkgpart2' => 'ON',
- 'pkgpart3' => 'ON',
- 'pkgpart4' => 'ON',
- 'pkgpart5' => 'ON',
- 'pkgpart6' => 'ON',
- 'pkgpart7' => 'ON',
- 'pkgpart8' => 'ON',
- 'pkgpart9' => 'ON',
- },
- 'location' => 'browse/agent_type.cgi',
- },
-
- { 'url' => 'edit/process/agent.cgi',
- 'params' => {
- 'agentnum' => '',
- 'agent' => 'Internal Sales',
- 'typenum' => '1',
- 'freq' => '',
- 'prog' => '',
- },
- 'location' => 'browse/agent.cgi',
- },
-
- { 'url' => 'edit/process/part_referral.cgi',
- 'params' => {
- 'refnum' => '',
- 'referral' => 'Another customer',
- },
- 'location' => 'browse/part_referral.cgi',
- },
- { 'url' => 'edit/process/part_referral.cgi',
- 'params' => {
- 'refnum' => '',
- 'referral' => 'Newspaper ad',
- },
- 'location' => 'browse/part_referral.cgi',
- },
-
- { 'url' => 'edit/process/svc_acct_pop.cgi',
- 'params' => {
- 'popnum' => '',
- 'city' => 'Line Lexington',
- 'state' => 'PA',
- 'ac' => '215',
- 'exch' => '996',
- },
- 'location' => 'browse/svc_acct_pop.cgi',
- },
- { 'url' => 'edit/process/svc_acct_pop.cgi',
- 'params' => {
- 'popnum' => '',
- 'city' => 'Oakland',
- 'state' => 'CA',
- 'ac' => '510',
- 'exch' => '208',
- },
- 'location' => 'browse/svc_acct_pop.cgi',
- },
-
- { 'url' => 'edit/process/cust_main.cgi',
- 'params' => {
- 'custnum' => '',
- 'agentnum' => '1',
- 'refnum' => '1',
- 'last' => 'Hogan',
- 'first' => 'Shawn D.',
- 'ss' => '',
- 'company' => 'Digital Point Solutions',
- 'address1' => '3570 Tony Drive',
- 'address2' => '',
- 'city' => 'San Diego',
- 'state' => 'CA / US',
- 'zip' => '92122-2307',
- 'daytime' => '',
- 'night' => '',
- 'fax' => '',
- 'tax' => '',
- 'invoicing_list_POST' => '',
- 'invoicing_list' => '',
- 'payby' => 'BILL',
- 'CARD_payinfo' => '',
- 'CARD_month' => '1',
- 'CARD_year' => '1999',
- 'CARD_payname' => '',
- 'BILL_payinfo' => '',
- 'BILL_month' => '12',
- 'BILL_year' => '2037',
- 'BILL_payname' => 'Accounts Payable',
- 'COMP_payinfo' => '',
- 'COMP_month' => '1',
- 'COMP_year' => '1999',
- 'pkgpart_svcpart' => '1_2',
- 'username' => 'cyborg',
- '_password' => '',
- 'popnum' => '1',
- 'otaker' => 'example',
- },
- 'location' => 'view/cust_main.cgi?1',
- },
- { 'url' => 'edit/process/cust_main.cgi',
- 'params' => {
- 'custnum' => '',
- 'agentnum' => '1',
- 'refnum' => '2',
- 'last' => 'Ford',
- 'first' => 'Bill',
- 'ss' => '',
- 'company' => 'Boardtown Corporation',
- 'address1' => '116 East Main Street',
- 'address2' => '',
- 'city' => 'Starkville',
- 'state' => 'MS / US',
- 'zip' => '39759',
- 'daytime' => '',
- 'night' => '',
- 'fax' => '',
- 'tax' => '',
- 'invoicing_list_POST' => '',
- 'invoicing_list' => '',
- 'payby' => 'BILL',
- 'CARD_payinfo' => '',
- 'CARD_month' => '1',
- 'CARD_year' => '1999',
- 'CARD_payname' => '',
- 'BILL_payinfo' => '',
- 'BILL_month' => '12',
- 'BILL_year' => '2037',
- 'BILL_payname' => 'Accounts Payable',
- 'COMP_payinfo' => '',
- 'COMP_month' => '1',
- 'COMP_year' => '1999',
- 'pkgpart_svcpart' => '3_3',
- 'username' => 'billf',
- '_password' => '',
- 'popnum' => '',
- 'otaker' => 'example',
- },
- 'location' => 'view/cust_main.cgi?2',
- },
-
-
- );
-}
-