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.
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 '';
}
=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
return "Can't change custnum!" unless $old->custnum == $new->custnum;
- $new->SUPER::replace;
+ $new->SUPER::replace($old);
}
=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
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;
=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
<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 `.'
</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>)
<%
-#<!-- $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 );
$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',{});
$sortby=\*company_sort;
@cust_main=qsearch('cust_main',{});
} else {
- die "unknown query string $query";
+ die "unknown browse field $query";
}
} else {
@cust_main=();
}
@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 {
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";
<%
-#<!-- $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;
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>';