[freeside-commits] branch master updated. 61a098f3c2902a046a585d2b02f7e2c8494e7a83

Ivan ivan at 420.am
Sat Aug 9 16:00:33 PDT 2014


The branch, master has been updated
       via  61a098f3c2902a046a585d2b02f7e2c8494e7a83 (commit)
      from  3599ab3e7c66883d152cc95cebc5d2655f2c91f8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 61a098f3c2902a046a585d2b02f7e2c8494e7a83
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Sat Aug 9 16:00:32 2014 -0700

    show costs in package list, RT#28856

diff --git a/httemplate/browse/part_pkg.cgi b/httemplate/browse/part_pkg.cgi
index d0c14da..63822c7 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 tracking';
+$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,
+        align=>'center',
+        colspan=>2,
+      },
+    ],
+    [
+      { data =>$money_char.
+               sprintf('%.2f ', $part_pkg->setup_cost ),
+        align=>'right'
+      },
+      { data => ( $is_recur ? ' setup' : ' one-time' ),
+        align=>'left',
+      },
+    ],
+    [
+      { data=>(
+          $is_recur
+            ? $money_char. sprintf('%.2f', $part_pkg->recur_cost)
+            : '(no recurring)' #$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',
+           }
+        : ()
+      ),
+    ],
+  ];
+};
+
 ###
 # Agent goes here if displayed
 ###

-----------------------------------------------------------------------

Summary of changes:
 httemplate/browse/part_pkg.cgi |   47 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 46 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list