[freeside-commits] freeside/FS/FS Conf.pm, 1.339, 1.340 cust_pkg.pm, 1.142, 1.143

Ivan,,, ivan at wavetail.420.am
Sun Nov 29 15:18:09 PST 2009


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

Modified Files:
	Conf.pm cust_pkg.pm 
Log Message:
add cust_pkg-change_pkgpart-bill_now option to bill the new package immediately on package changes.  Useful for prepaid situations with RADIUS where an Expiration attribute base don the package must be present at all times.  RT#6692

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.339
retrieving revision 1.340
diff -u -d -r1.339 -r1.340
--- Conf.pm	20 Nov 2009 17:33:38 -0000	1.339
+++ Conf.pm	29 Nov 2009 23:18:07 -0000	1.340
@@ -1911,6 +1911,13 @@
   },
 
   {
+    'key'         => 'cust_pkg-change_pkgpart-bill_now',
+    'section'     => '',
+    'description' => "When changing packages, bill the new package immediately.  Useful for prepaid situations with RADIUS where an Expiration attribute base don the package must be present at all times.",
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'disable_autoreverse',
     'section'     => 'BIND',
     'description' => 'Disable automatic synchronization of reverse-ARPA entries.',

Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.142
retrieving revision 1.143
diff -u -d -r1.142 -r1.143
--- cust_pkg.pm	13 Nov 2009 07:12:35 -0000	1.142
+++ cust_pkg.pm	29 Nov 2009 23:18:07 -0000	1.143
@@ -1207,11 +1207,21 @@
   #Good to go, cancel old package.
   $error = $self->cancel( quiet=>1 );
   if ($error) {
-    $dbh->rollback;
+    $dbh->rollback if $oldAutoCommit;
     return $error;
   }
 
+  if ( $conf->exists('cust_pkg-change_pkgpart-bill_now') ) {
+    #$self->cust_main
+    my $error = $cust_pkg->cust_main->bill( 'pkg_list' => [ $cust_pkg ] );
+    if ( $error ) {
+      $dbh->rollback if $oldAutoCommit;
+      return $error;
+    }
+  }
+
   $dbh->commit or die $dbh->errstr if $oldAutoCommit;
+
   $cust_pkg;
 
 }



More information about the freeside-commits mailing list