diff options
author | ivan <ivan> | 2001-09-16 12:45:35 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-09-16 12:45:35 +0000 |
commit | 87661d51ce44b78c5b156f4ee7c52e75a9d38746 (patch) | |
tree | 7aab13ab158ef8feae0d64a97f00140313bb4e40 | |
parent | 5477d23b51bd3135893c4d79091a9e272a17f4f8 (diff) |
fix oops in FS::cust_main_invoice::replace preventing package cancellation
add toggle switch to cust_main searching to show/hide cancelled customers.
hidecancelledcustomers config file is just which state it starts in.
add signupurl config file to enable showing of the customer's signup URL
on the view page.
-rw-r--r-- | FS/FS/Record.pm | 5 | ||||
-rw-r--r-- | FS/FS/cust_main_invoice.pm | 4 | ||||
-rw-r--r-- | FS/FS/svc_acct.pm | 5 | ||||
-rw-r--r-- | httemplate/docs/config.html | 1 | ||||
-rw-r--r-- | httemplate/index.html | 2 | ||||
-rwxr-xr-x | httemplate/search/cust_main.cgi | 25 | ||||
-rwxr-xr-x | httemplate/view/cust_main.cgi | 14 |
7 files changed, 41 insertions, 15 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 578904ed3..333602c07 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -472,10 +472,11 @@ returns the error, otherwise returns false. sub replace { my ( $new, $old ) = ( shift, shift ); + warn "[debug][FS::Record] $new ->replace $old\n" if $DEBUG; my @diff = grep $new->getfield($_) ne $old->getfield($_), $old->fields; unless ( @diff ) { - carp "warning: records identical"; + carp "[warning][FS::Record] $new -> replace $old: records identical"; return ''; } @@ -993,7 +994,7 @@ sub DESTROY { return; } =head1 VERSION -$Id: Record.pm,v 1.28 2001-09-14 18:05:16 ivan Exp $ +$Id: Record.pm,v 1.29 2001-09-16 12:45:35 ivan Exp $ =head1 BUGS diff --git a/FS/FS/cust_main_invoice.pm b/FS/FS/cust_main_invoice.pm index 61a8f7534..d6b4cd933 100644 --- a/FS/FS/cust_main_invoice.pm +++ b/FS/FS/cust_main_invoice.pm @@ -88,7 +88,7 @@ sub replace { return "Can't change custnum!" unless $old->custnum == $new->custnum; - $new->SUPER::replace; + $new->SUPER::replace($old); } @@ -172,7 +172,7 @@ sub address { =head1 VERSION -$Id: cust_main_invoice.pm,v 1.6 2001-08-12 00:06:33 ivan Exp $ +$Id: cust_main_invoice.pm,v 1.7 2001-09-16 12:45:35 ivan Exp $ =head1 BUGS diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index e52cebf15..c6b65936a 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -397,6 +397,9 @@ sub delete { foreach my $cust_main_invoice ( qsearch( 'cust_main_invoice', { 'dest' => $self->svcnum } ) ) { + #next unless defined; #wtf is up with qsearch? + warn $cust_main_invoice; + next unless defined $cust_main_invoice; my %hash = $cust_main_invoice->hash; $hash{'dest'} = $self->email; my $new = new FS::cust_main_invoice \%hash; @@ -841,7 +844,7 @@ sub email { =head1 VERSION -$Id: svc_acct.pm,v 1.39 2001-09-14 19:54:22 ivan Exp $ +$Id: svc_acct.pm,v 1.40 2001-09-16 12:45:35 ivan Exp $ =head1 BUGS diff --git a/httemplate/docs/config.html b/httemplate/docs/config.html index 84e9538f7..b985ebee9 100644 --- a/httemplate/docs/config.html +++ b/httemplate/docs/config.html @@ -89,6 +89,7 @@ All further configuration files and directories are located in <li><a name="shellmachines">shellmachines</a> - Your Linux and System V flavored shell (and mail) machines, one per line. This enables export of `/etc/passwd' and `/etc/shadow' files. <li><a name="shells"><font color="#ff0000">shells</font></a> - 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><a name="showpasswords">showpasswords</a> - The existance of this file will allow unencrypted user passwords to be displayed. + <li><a name="signupurl">signupurl</a> - if you are using customer-to-customer referrals, and you enter the URL of your <a href="signup.html">signup server CGI</a>, the customer view screen will display a customized link to the signup server with the appropriate customer as referral. <li><a name="smtpmachine"><font color="#ff0000">smtpmachine</font></a> - SMTP relay for Freeside's outgoing mail. <li><a name="soadefaultttl">soadefaultttl</a> - SOA default TTL for new domains. <li><a name="soaemail">soaemail</a> - SOA email for new domains, in BIND form (`.' instead of `@'), with trailing `.' diff --git a/httemplate/index.html b/httemplate/index.html index 2fbc06221..c45997608 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -34,7 +34,7 @@ </ul> <li><A NAME="browse">Browse</A> <ul> - <LI>customers (<A HREF="search/cust_main.cgi?custnum">by customer number</A>) (<A HREF="search/cust_main.cgi?last">by last name</A>) (<A HREF="search/cust_main.cgi?company">by company</A>) + <LI>customers (<A HREF="search/cust_main.cgi?browse=custnum">by customer number</A>) (<A HREF="search/cust_main.cgi?browse=last">by last name</A>) (<A HREF="search/cust_main.cgi?browse=company">by company</A>) <LI>invoices <UL> <LI>open invoices (<A HREF="search/cust_bill.cgi?OPEN_invnum">by invoice number</A>) (<A HREF="search/cust_bill.cgi?OPEN_date">by date</A>) (<A HREF="search/cust_bill.cgi?OPEN_custnum">by customer number</A>) diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 9dcada7c2..25dbe6964 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -1,5 +1,5 @@ <% -#<!-- $Id: cust_main.cgi,v 1.5 2001-09-11 00:08:18 ivan Exp $ --> +#<!-- $Id: cust_main.cgi,v 1.6 2001-09-16 12:45:35 ivan Exp $ --> use strict; #use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby ); @@ -19,8 +19,8 @@ cgisuidsetup($cgi); $conf = new FS::Conf; -if ( $cgi->keywords ) { - my($query)=$cgi->keywords; +if ( $cgi->param('browse') ) { + my $query = $cgi->param('browse'); if ( $query eq 'custnum' ) { $sortby=\*custnum_sort; @cust_main=qsearch('cust_main',{}); @@ -31,7 +31,7 @@ if ( $cgi->keywords ) { $sortby=\*company_sort; @cust_main=qsearch('cust_main',{}); } else { - die "unknown query string $query"; + die "unknown browse field $query"; } } else { @cust_main=(); @@ -42,7 +42,9 @@ if ( $cgi->keywords ) { } @cust_main = grep { $_->ncancelled_pkgs || ! $_->all_pkgs } @cust_main - if $conf->exists('hidecancelledcustomers'); + if $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me + || ( $conf->exists('hidecancelledcustomers') + && ! $cgi->param('showcancelledcustomers') ); if ( $conf->exists('hidecancelledpackages' ) ) { %all_pkgs = map { $_->custnum => [ $_->ncancelled_pkgs ] } @cust_main; } else { @@ -59,7 +61,18 @@ if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) { my($total)=scalar(@cust_main); print $cgi->header( '-expires' => 'now' ), header("Customer Search Results",menubar( 'Main Menu', popurl(2) - )), "$total matching customers found"; + )), "$total matching customers found "; + if ( $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me + || ( $conf->exists('hidecancelledcustomers') + && ! $cgi->param('showcancelledcustomers') + ) + ) { + $cgi->param('showcancelledcustomers', 1); + print qq!( <a href="!. $cgi->self_url. qq!">show cancelled customers</a> )!; + } else { + $cgi->param('showcancelledcustomers', 0); + print qq!( <a href="!. $cgi->self_url. qq!">hide cancelled customers</a> )!; + } if ( $cgi->param('referral_custnum') ) { $cgi->param('referral_custnum') =~ /^(\d+)$/ or eidiot "Illegal referral_custnum\n"; diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 174c08760..6df28c844 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -1,10 +1,11 @@ <% -#<!-- $Id: cust_main.cgi,v 1.10 2001-09-11 09:56:27 ivan Exp $ --> +#<!-- $Id: cust_main.cgi,v 1.11 2001-09-16 12:45:35 ivan Exp $ --> 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 ); + $balance $item @agents @referrals @invoicing_list $n1 $conf + $signupurl ); use CGI; use CGI::Carp qw(fatalsToBrowser); use Date::Format; @@ -53,10 +54,17 @@ unless ( $conf->exists('disable_customer_referrals') ) { print qq! | <A HREF="!, popurl(2), qq!search/cust_main.cgi?referral_custnum=$custnum">!, - qq!View this customer's referrals<A>!; + qq!View this customer's referrals</A>!; } print '<BR><BR>'; + +my $signupurl = $conf->config('signupurl'); +if ( $signupurl ) { +print "This customer's signup URL: ". + "<a href=\"$signupurl?ref=$custnum\">$signupurl?ref=$custnum</a><BR><BR>"; +} + print '<A NAME="cust_main"></A>'; print &itable(), '<TR>'; |