%
my $conf = new FS::Conf;
my %uiview = ();
my %uiadd = ();
foreach my $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";
}
print header("Customer View", menubar(
'Main Menu' => popurl(2)
));
%>
<%
die "No customer specified (bad URL)!" unless $cgi->keywords;
my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
$query =~ /^(\d+)$/;
my $custnum = $1;
my $cust_main = qsearchs('cust_main',{'custnum'=>$custnum});
die "Customer not found!" unless $cust_main;
print qq!Edit this customer!;
%>
<%
print qq! | !.
'Cancel this customer'
if $cust_main->ncancelled_pkgs;
print qq! | !.
'Delete this customer'
if $conf->exists('deletecustomers');
unless ( $conf->exists('disable_customer_referrals') ) {
print qq! | !,
qq!Refer a new customer!;
print qq! | !,
qq!View this customer's referrals!;
}
print '
';
my $signupurl = $conf->config('signupurl');
if ( $signupurl ) {
print "This customer's signup URL: ".
"$signupurl?ref=$custnum
";
}
%>
<%= &itable() %>
<%= encode_entities($cust_main->comments) %>
Package | Status | Services | |
---|---|---|---|
>
<%=$pkg->{pkgnum}%>:
<%=$pkg->{pkg}%> - <%=$pkg->{comment}%> <% unless ($pkg->{cancel}) { %> ( <%=pkg_change_link($pkg)%> ) ( <%=pkg_dates_link($pkg)%> | <%=pkg_customize_link($pkg,$custnum)%> ) <% } %> |
<%
#foreach (qw(setup last_bill next_bill susp expire cancel)) {
# print qq! ! . pkg_datestr($pkg,$_,$conf) . qq! | \n!; #} print "". &itable(''); sub myfreq { my $part_pkg = shift; my $freq = $part_pkg->freq_pretty; $freq =~ s/ / /g; $freq; } if ( $pkg->{cancel} ) { #status: cancelled print ' | |
Cancelled | '. ''. pkg_datestr($pkg,'cancel',$conf). ' | ||
Never billed | |||
Setup | ". pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Suspended | ". pkg_datestr($pkg, 'susp',$conf). ' | ||
Suspended | '. ''. pkg_datestr($pkg,'susp',$conf). ' | ||
Never billed | |||
Setup | ". pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Expires | ". pkg_datestr($pkg, 'expire',$conf). ' | ||
( '. pkg_unsuspend_link($pkg). ' | '. pkg_cancel_link($pkg). ' ) | |||
Not yet billed ('; unless ( $pkg->{freq} ) { print 'one-time charge) | |||
( '. pkg_cancel_link($pkg). ' ) | '; } else { print 'billed '. myfreq($pkg->{part_pkg}). ')|||
One-time charge | |||
Billed | '. pkg_datestr($pkg,'setup',$conf). ' | ||
Active'. ', billed '. myfreq($pkg->{part_pkg}). ' | |||
Setup | '. pkg_datestr($pkg, 'setup',$conf). ' | ||
Last bill | ". pkg_datestr($pkg, 'last_bill',$conf). ' | ||
Next bill | ". pkg_datestr($pkg, 'next_bill',$conf). ' | ||
Expires | ". pkg_datestr($pkg, 'expire',$conf). ' | ||
( '. pkg_suspend_link($pkg). ' | '. pkg_cancel_link($pkg). ' ) |