#}
print "<TD ROWSPAN=$rowspan>". &itable('');
- sub freq {
-
- #false laziness w/edit/part_pkg.cgi
- my %freq = ( #move this
- '1d' => 'daily',
- '1w' => 'weekly',
- '2w' => 'biweekly (every 2 weeks)',
- '1' => 'monthly',
- '2' => 'bimonthly (every 2 months)',
- '3' => 'quarterly (every 3 months)',
- '6' => 'semiannually (every 6 months)',
- '12' => 'annually',
- '24' => 'biannually (every 2 years)',
- );
-
- my $freq = shift;
- exists $freq{$freq} ? $freq{$freq} : "every $freq months";
+ sub myfreq {
+ my $part_pkg = shift;
+ my $freq = $part_pkg->freq_pretty;
+ $freq =~ s/ / /g;
+ $freq;
}
- #eomove
-
if ( $pkg->{cancel} ) { #status: cancelled
print '<TR><TD><FONT COLOR="#ff0000"><B>Cancelled </B></FONT></TD>'.
print '<TR><TD COLSPAN=2>( '. pkg_cancel_link($pkg).
' )</TD</TR>';
} else {
- print 'billed '. freq($pkg->{freq}). ')</TD></TR>';
+ print 'billed '. myfreq($pkg->{part_pkg}). ')</TD></TR>';
}
} else { #setup
pkg_datestr($pkg,'setup',$conf). '</TD></TR>';
} else {
print '<TR><TD COLSPAN=2><FONT COLOR="#00CC00"><B>Active</B></FONT>'.
- ', billed '. freq($pkg->{freq}). '</TD></TR>'.
+ ', billed '. myfreq($pkg->{part_pkg}). '</TD></TR>'.
'<TR><TD>Setup </TD><TD>'.
pkg_datestr($pkg, 'setup',$conf). '</TD></TR>';
}
) {
my $part_pkg = $cust_pkg->part_pkg;
-
+
my %pkg = ();
+
+ #to get back to the original object... should use it in the first place!!
+ $pkg{cust_pkg} = $cust_pkg;
+ $pkg{part_pkg} = $part_pkg;
+
$pkg{pkgnum} = $cust_pkg->pkgnum;
$pkg{pkg} = $part_pkg->pkg;
$pkg{pkgpart} = $part_pkg->pkgpart;
$pkg{susp} = $cust_pkg->getfield('susp');
$pkg{expire} = $cust_pkg->getfield('expire');
$pkg{cancel} = $cust_pkg->getfield('cancel');
+
my %svcparts = map {
$_->svcpart => {