[freeside-commits] branch master updated. ec1c141729f9c3004cd0c633f2e4c7ed8bdaa418

Ivan ivan at 420.am
Thu Aug 16 11:10:11 PDT 2012


The branch, master has been updated
       via  ec1c141729f9c3004cd0c633f2e4c7ed8bdaa418 (commit)
       via  fb40033fc45f6edce5088e7b29840b58df7b0690 (commit)
      from  582189e6a07bf401385e220bb554ddbf0441b9fb (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 ec1c141729f9c3004cd0c633f2e4c7ed8bdaa418
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Aug 16 11:10:02 2012 -0700

    fix unit_recur 0.0 on existing line items, RT#13136

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 61cfccb..8277c00 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2411,6 +2411,10 @@ sub _items_cust_bill_pkg {
             $amount = $cust_bill_pkg->usage;
           }
   
+          my $unit_amount =
+            ( $cust_bill_pkg->unitrecur > 0 ) ? $cust_bill_pkg->unitrecur
+                                              : $amount;
+
           if ( !$type || $type eq 'R' ) {
 
             warn "$me _items_cust_bill_pkg adding recur\n"
@@ -2418,7 +2422,7 @@ sub _items_cust_bill_pkg {
 
             if ( $cust_bill_pkg->hidden ) {
               $r->{amount}      += $amount;
-              $r->{unit_amount} += $cust_bill_pkg->unitrecur;
+              $r->{unit_amount} += $unit_amount;
               push @{ $r->{ext_description} }, @d;
             } else {
               $r = {
@@ -2427,7 +2431,7 @@ sub _items_cust_bill_pkg {
                 pkgnum          => $cust_bill_pkg->pkgnum,
                 amount          => $amount,
                 recur_show_zero => $cust_bill_pkg->recur_show_zero,
-                unit_amount     => $cust_bill_pkg->unitrecur,
+                unit_amount     => $unit_amount,
                 quantity        => $cust_bill_pkg->quantity,
                 %item_dates,
                 ext_description => \@d,
@@ -2442,7 +2446,7 @@ sub _items_cust_bill_pkg {
 
             if ( $cust_bill_pkg->hidden ) {
               $u->{amount}      += $amount;
-              $u->{unit_amount} += $cust_bill_pkg->unitrecur;
+              $u->{unit_amount} += $unit_amount,
               push @{ $u->{ext_description} }, @d;
             } else {
               $u = {
@@ -2451,7 +2455,7 @@ sub _items_cust_bill_pkg {
                 pkgnum          => $cust_bill_pkg->pkgnum,
                 amount          => $amount,
                 recur_show_zero => $cust_bill_pkg->recur_show_zero,
-                unit_amount     => $cust_bill_pkg->unitrecur,
+                unit_amount     => $unit_amount,
                 quantity        => $cust_bill_pkg->quantity,
                 %item_dates,
                 ext_description => \@d,

commit fb40033fc45f6edce5088e7b29840b58df7b0690
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Aug 16 10:59:48 2012 -0700

    slightly better description

diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 43d5611..d152a01 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -3438,7 +3438,7 @@ and customer address. Include units.',
   {
     'key'         => 'invoice-unitprice',
     'section'     => 'invoicing',
-    'description' => 'Enable unit pricing on invoices.',
+    'description' => 'Enable unit pricing on invoices and quantities on packages.',
     'type'        => 'checkbox',
   },
 

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

Summary of changes:
 FS/FS/Conf.pm           |    2 +-
 FS/FS/Template_Mixin.pm |   12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list