X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main.cgi;h=9aa00896988f46d24652610535b6be0eb19a91cb;hp=0b51a875c4e1d0fece30109384818dbad6da6625;hb=6fe8172b11d0369d0b1274d6825ec0c57afe8001;hpb=717d562bcfb691d971a01b738d0b55cdda480cf0 diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 0b51a875c..9aa008969 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -411,27 +411,13 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { #} print "". &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 'Cancelled '. @@ -480,7 +466,7 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { print '( '. pkg_cancel_link($pkg). ' )'; } else { - print 'billed '. freq($pkg->{freq}). ')'; + print 'billed '. myfreq($pkg->{part_pkg}). ')'; } } else { #setup @@ -491,7 +477,7 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { pkg_datestr($pkg,'setup',$conf). ''; } else { print 'Active'. - ', billed '. freq($pkg->{freq}). ''. + ', billed '. myfreq($pkg->{part_pkg}). ''. 'Setup '. pkg_datestr($pkg, 'setup',$conf). ''; } @@ -900,8 +886,13 @@ sub get_packages { ) { 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; @@ -913,6 +904,7 @@ sub get_packages { $pkg{susp} = $cust_pkg->getfield('susp'); $pkg{expire} = $cust_pkg->getfield('expire'); $pkg{cancel} = $cust_pkg->getfield('cancel'); + my %svcparts = map { $_->svcpart => {