[freeside-commits] freeside/httemplate/browse part_pkg.cgi, 1.44, 1.45
Ivan,,,
ivan at wavetail.420.am
Wed Apr 16 13:01:02 PDT 2008
Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv15050/browse
Modified Files:
part_pkg.cgi
Log Message:
show package add-on links in browse
Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/part_pkg.cgi,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- part_pkg.cgi 16 Apr 2008 04:43:00 -0000 1.44
+++ part_pkg.cgi 16 Apr 2008 20:00:59 -0000 1.45
@@ -93,28 +93,51 @@
$align .= 'r'; #?
push @fields, sub {
my $part_pkg = shift;
+ (my $plan = $plan_labels{$part_pkg->plan} ) =~ s/ / /g;
+ my $is_recur = ( $part_pkg->freq ne '0' );
[
[
- { data=>$plan_labels{$part_pkg->plan},
- align=>'center'
+ { data =>$plan,
+ align=>'center',
+ colspan=>2,
},
],
[
- { data=>$money_char.
- sprintf('%.2f setup', $part_pkg->option('setup_fee') ),
+ { data =>$money_char.
+ sprintf('%.2f', $part_pkg->option('setup_fee') ),
align=>'right'
},
+ { data => ( $is_recur ? ' setup' : ' one-time' ),
+ align=>'left',
+ },
],
[
- { data=>( $part_pkg->freq ne '0'
+ { data=>( $is_recur
? $money_char.sprintf('%.2f ', $part_pkg->option('recur_fee') )
- : ''
- ).
- $part_pkg->freq_pretty,
- align=>'right'
+ : $part_pkg->freq_pretty
+ ),
+ align=> ( $is_recur ? 'right' : 'center' ),
+ colspan=> ( $is_recur ? 1 : 2 ),
},
+ ( $is_recur
+ ? { data => ( $is_recur ? $part_pkg->freq_pretty : '' ),
+ align=>'left',
+ }
+ : ()
+ ),
],
+ ( map {
+ my $dst_pkg = $_->dst_pkg;
+ [
+ { data => 'Add-on: '.$dst_pkg->pkg_comment,
+ align=>'center', #?
+ colspan=>2,
+ }
+ ]
+ }
+ $part_pkg->bill_part_pkg_link
+ ),
];
# $plan_labels{$part_pkg->plan}.'<BR>'.
@@ -190,18 +213,21 @@
my $part_pkg = shift;
if ( $part_pkg->plan ) {
+ my %options = $part_pkg->options;
+
[ map {
- /^(\w+)=(.*)$/; #or something;
[
- { 'data' => $1,
+ { 'data' => $_,
'align' => 'right',
},
- { 'data' => $part_pkg->format($1,$2),
+ { 'data' => $part_pkg->format($_,$options{$_}),
'align' => 'left',
},
];
}
- split(/\n/, $part_pkg->plandata)
+ grep { $options{$_} =~ /\S/ }
+ grep { $_ !~ /^(setup|recur)_fee$/ }
+ keys %options
];
} else {
@@ -226,7 +252,8 @@
sub {
my $part_pkg = shift;
- [ map {
+ [
+ (map {
my $pkg_svc = $_;
my $part_svc = $pkg_svc->part_svc;
my $svc = $part_svc->svc;
@@ -252,7 +279,18 @@
<=> $a->primary_svc =~ /^Y/i
}
$part_pkg->pkg_svc
-
+ ),
+ ( map {
+ my $dst_pkg = $_->dst_pkg;
+ [
+ { data => 'Add-on: '.$dst_pkg->pkg_comment,
+ align=>'center', #?
+ colspan=>2,
+ }
+ ]
+ }
+ $part_pkg->svc_part_pkg_link
+ )
];
};
More information about the freeside-commits
mailing list