[freeside-commits] freeside/FS/FS/part_pkg flat.pm,1.37,1.38

Ivan,,, ivan at wavetail.420.am
Thu Feb 4 18:39:33 PST 2010


Update of /home/cvs/cvsroot/freeside/FS/FS/part_pkg
In directory wavetail.420.am:/tmp/cvs-serv16400/FS/FS/part_pkg

Modified Files:
	flat.pm 
Log Message:
discounts, RT#6679

Index: flat.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg/flat.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- flat.pm	31 Jan 2010 02:57:14 -0000	1.37
+++ flat.pm	5 Feb 2010 02:39:31 -0000	1.38
@@ -188,15 +188,17 @@
      die "error discounting: $error" if $error;
 
      $amount *= $months;
+     $amount = sprintf('%.2f', $amount);
 
      #add details on discount to invoice
      my $conf = new FS::Conf;
      my $money_char = $conf->config('money_char') || '$';  
+     $months = sprintf('%.2f', $months) if $months =~ /\./;
 
      my $d = 'Includes ';
      $d .= $discount->name. ' ' if $discount->name;
      $d .= 'discount of '. $discount->description_short;
-     $d .= " for $months month". ( $months>1 ? 's' : '' );
+     $d .= " for $months month". ( $months!=1 ? 's' : '' );
      $d .= ": $money_char$amount" if $months != 1 || $discount->percent;
      push @$details, $d;
 



More information about the freeside-commits mailing list