Option to disable the charging of the setup fee while a package is suspended.
authorkhoff <khoff>
Wed, 7 Mar 2007 19:48:32 +0000 (19:48 +0000)
committerkhoff <khoff>
Wed, 7 Mar 2007 19:48:32 +0000 (19:48 +0000)
FS/FS/Conf.pm
FS/FS/cust_main.pm

index f2b1bea..d9f7d19 100644 (file)
@@ -2076,6 +2076,13 @@ httemplate/docs/config.html
     'type'        => 'checkbox',
   },
 
+  {
+    'key'         => 'disable_setup_suspended_pkgs',
+    'section'     => 'billing',
+    'description' => 'Disables charging of setup fees for suspended packages.',
+    'type'       => 'checkbox',
+  },
+
 );
 
 1;
index c621275..9c4b8be 100644 (file)
@@ -1902,7 +1902,14 @@ sub bill {
     ###
 
     my $setup = 0;
-    if ( !$cust_pkg->setup || $options{'resetup'} ) {
+    if ( ! $cust_pkg->setup &&
+         (
+           ( $conf->exists('disable_setup_suspended_pkgs') &&
+            ! $cust_pkg->getfield('susp')
+          ) || ! $conf->exists('disable_setup_suspended_pkgs')
+         )
+      || $options{'resetup'}
+    ) {
     
       warn "    bill setup\n" if $DEBUG > 1;