summaryrefslogtreecommitdiff
path: root/httemplate/browse
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-08-09 16:00:32 -0700
committerIvan Kohler <ivan@freeside.biz>2014-08-09 16:00:32 -0700
commit61a098f3c2902a046a585d2b02f7e2c8494e7a83 (patch)
tree07e80b21c87149d605a259f094a7c8a2b5be3710 /httemplate/browse
parent3599ab3e7c66883d152cc95cebc5d2655f2c91f8 (diff)
show costs in package list, RT#28856
Diffstat (limited to 'httemplate/browse')
-rwxr-xr-xhttemplate/browse/part_pkg.cgi47
1 files changed, 46 insertions, 1 deletions
diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index d0c14da4c..63822c7c9 100755
--- a/httemplate/browse/part_pkg.cgi
+++ b/httemplate/browse/part_pkg.cgi
@@ -10,7 +10,7 @@
'agent_virt' => 1,
'agent_null_right' => [ $edit, $edit_global ],
'agent_null_right_link' => $edit_global,
- 'agent_pos' => 6,
+ 'agent_pos' => 7, #5?
'query' => { 'select' => $select,
'table' => 'part_pkg',
'hashref' => \%hash,
@@ -354,6 +354,51 @@ push @fields, sub {
# $part_pkg->freq_pretty; #.'<BR>'
};
+push @header, 'Cost&nbsp;tracking';
+$align .= 'r'; #?
+push @fields, sub {
+ my $part_pkg = shift;
+ #(my $plan = $plan_labels{$part_pkg->plan} ) =~ s/ /&nbsp;/g;
+ my $is_recur = ( $part_pkg->freq ne '0' );
+
+ [
+ [
+ { data => '&nbsp;', # $plan,
+ align=>'center',
+ colspan=>2,
+ },
+ ],
+ [
+ { data =>$money_char.
+ sprintf('%.2f ', $part_pkg->setup_cost ),
+ align=>'right'
+ },
+ { data => ( $is_recur ? '&nbsp;setup' : '&nbsp;one-time' ),
+ align=>'left',
+ },
+ ],
+ [
+ { data=>(
+ $is_recur
+ ? $money_char. sprintf('%.2f', $part_pkg->recur_cost)
+ : '(no&nbsp;recurring)' #$part_pkg->freq_pretty
+ ),
+ align=> ( $is_recur ? 'right' : 'center' ),
+ colspan=> ( $is_recur ? 1 : 2 ),
+ },
+ ( $is_recur
+ ? { data => ( $is_recur
+ ? '&nbsp;'. $part_pkg->freq_pretty
+ : ''
+ ),
+ align=>'left',
+ }
+ : ()
+ ),
+ ],
+ ];
+};
+
###
# Agent goes here if displayed
###