[freeside-commits] branch master updated. 55a6fb35edc9daa28198e053c35549230381b49a

Ivan ivan at 420.am
Thu Jul 5 13:35:42 PDT 2012


The branch, master has been updated
       via  55a6fb35edc9daa28198e053c35549230381b49a (commit)
       via  391a92928c191127a1dabba0caa92b839c06d102 (commit)
       via  cfaa68d87335cca3d998717b8653fdba60f4e6bc (commit)
      from  36f114fa4084bfcfb52ed4673d54d1a0a7e33d15 (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 55a6fb35edc9daa28198e053c35549230381b49a
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Jul 5 13:35:41 2012 -0700

    less busywork for freeside-prepaidd

diff --git a/FS/bin/freeside-prepaidd b/FS/bin/freeside-prepaidd
index 05b068b..c095cee 100644
--- a/FS/bin/freeside-prepaidd
+++ b/FS/bin/freeside-prepaidd
@@ -85,7 +85,7 @@ while (1) {
   }
 
   die "exiting" if sigterm() || sigint();
-  sleep 5;
+  sleep 60;
 
 }
 

commit 391a92928c191127a1dabba0caa92b839c06d102
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jul 4 19:09:26 2012 -0700

    quotations, RT#16996

diff --git a/FS/FS/quotation_pkg.pm b/FS/FS/quotation_pkg.pm
index 48d5906..3d40bb0 100644
--- a/FS/FS/quotation_pkg.pm
+++ b/FS/FS/quotation_pkg.pm
@@ -2,7 +2,7 @@ package FS::quotation_pkg;
 
 use strict;
 use base qw( FS::Record );
-use FS::Record; # qw( qsearch qsearchs );
+use FS::Record qw( qsearchs ); #qsearch
 use FS::part_pkg;
 use FS::cust_location;
 
@@ -119,6 +119,39 @@ sub check {
   $self->SUPER::check;
 }
 
+sub part_pkg {
+  my $self = shift;
+  qsearchs('part_pkg', { 'pkgpart' => $self->pkgpart } );
+}
+
+sub desc {
+  my $self = shift;
+  $self->part_pkg->pkg;
+}
+
+sub setup {
+  my $self = shift;
+  return '0.00' if $self->waive_setup eq 'Y';
+  my $part_pkg = $self->part_pkg;
+  #my $setup = $part_pkg->can('base_setup') ? $part_pkg->base_setup
+  #                                         : $part_pkg->option('setup_fee');
+  my $setup = $part_pkg->option('setup_fee');
+  #XXX discounts
+  $setup *= $self->quantity if $self->quantity;
+  sprintf('%.2f', $setup);
+
+}
+
+sub recur {
+  my $self = shift;
+  my $part_pkg = $self->part_pkg;
+  my $recur = $part_pkg->can('base_recur') ? $part_pkg->base_recur
+                                           : $part_pkg->option('recur_fee');
+  #XXX discounts
+  $recur *= $self->quantity if $self->quantity;
+  sprintf('%.2f', $recur);
+}
+
 =back
 
 =head1 BUGS

commit cfaa68d87335cca3d998717b8653fdba60f4e6bc
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Jul 4 19:07:56 2012 -0700

    quotations, RT#16996

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 64b9db5..d1bcec5 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2186,7 +2186,30 @@ sub _items_cust_bill_pkg {
                           'no_usage'        => $opt{'no_usage'},
                         );
 
-      if ( $cust_bill_pkg->pkgnum > 0 ) {
+      if ( ref($cust_bill_pkg) eq 'FS::quotation_pkg' ) {
+
+        warn "$me _items_cust_bill_pkg cust_bill_pkg is quotation_pkg\n"
+          if $DEBUG > 1;
+
+        if ( $cust_bill_pkg->setup != 0 ) {
+          my $description = $desc;
+          $description .= ' Setup'
+            if $cust_bill_pkg->recur != 0
+            || $discount_show_always
+            || $cust_bill_pkg->recur_show_zero;
+          push @b, {
+            'description' => $description,
+            'amount'      => sprintf("%.2f", $cust_bill_pkg->setup),
+          };
+        }
+        if ( $cust_bill_pkg->recur != 0 ) {
+          push @b, {
+            'description' => "$desc (". $cust_bill_pkg->part_pkg->freq_pretty.")",
+            'amount'      => sprintf("%.2f", $cust_bill_pkg->recur),
+          };
+        }
+
+      } elsif ( $cust_bill_pkg->pkgnum > 0 ) {
 
         warn "$me _items_cust_bill_pkg cust_bill_pkg is non-tax\n"
           if $DEBUG > 1;

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

Summary of changes:
 FS/FS/Template_Mixin.pm  |   25 ++++++++++++++++++++++++-
 FS/FS/quotation_pkg.pm   |   35 ++++++++++++++++++++++++++++++++++-
 FS/bin/freeside-prepaidd |    2 +-
 3 files changed, 59 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list