[freeside-commits] freeside/httemplate/browse part_pkg.cgi, 1.56, 1.57

Jeff Finucane,420,, jeff at wavetail.420.am
Wed Sep 22 12:16:21 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv19099/httemplate/browse

Modified Files:
	part_pkg.cgi 
Log Message:
prepayment discounts rt#5318

Index: part_pkg.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/part_pkg.cgi,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -w -d -r1.56 -r1.57
--- part_pkg.cgi	17 Jun 2010 02:08:52 -0000	1.56
+++ part_pkg.cgi	22 Sep 2010 19:16:19 -0000	1.57
@@ -195,6 +195,9 @@
   my $part_pkg = shift;
   (my $plan = $plan_labels{$part_pkg->plan} ) =~ s/ / /g;
   my $is_recur = ( $part_pkg->freq ne '0' );
+  my @discounts = sort { $a->months <=> $b->months }
+                  map { $_->discount  }
+                  $part_pkg->part_pkg_discount;
 
   [
     [
@@ -238,6 +241,28 @@
           }
       $part_pkg->bill_part_pkg_link
     ),
+    ( scalar(@discounts)
+        ?  [ 
+              { data => '<b>Discounts</b>',
+                align=>'center', #?
+                colspan=>2,
+              }
+            ]
+        : ()  
+    ),
+    ( scalar(@discounts)
+        ? map { 
+            [ 
+              { data  => $_->months. ':',
+                align => 'right',
+              },
+              { data => $_->amount ? '$'. $_->amount : $_->percent. '%'
+              }
+            ]
+          }
+          @discounts
+        : ()
+    ),
   ];
 
 #  $plan_labels{$part_pkg->plan}.'<BR>'.



More information about the freeside-commits mailing list