fix declined signup of prepaid package provisioning to RADIUS anyway, RT#10122
authorivan <ivan>
Fri, 14 Jan 2011 02:51:41 +0000 (02:51 +0000)
committerivan <ivan>
Fri, 14 Jan 2011 02:51:41 +0000 (02:51 +0000)
FS/FS/ClientAPI/Signup.pm
FS/FS/cust_main/Billing.pm
FS/FS/cust_pkg.pm

index 7087b12..2443323 100644 (file)
@@ -738,7 +738,7 @@ sub new_customer {
 
     #warn "$me Billing customer...\n" if $Debug;
 
-    my $bill_error = $cust_main->bill;
+    my $bill_error = $cust_main->bill( 'depend_jobnum'=>$placeholder->jobnum );
     #warn "$me error billing new customer: $bill_error"
     #  if $bill_error;
 
index 7ae3d45..c47e630 100644 (file)
@@ -547,7 +547,7 @@ sub bill {
     #create the new invoice
     my $cust_bill = new FS::cust_bill ( {
       'custnum'             => $self->custnum,
-      '_date'               => ( $invoice_time ),
+      '_date'               => $invoice_time,
       'charged'             => $charged,
       'billing_balance'     => $balance,
       'previous_balance'    => $previous_balance,
@@ -946,6 +946,7 @@ sub _make_lines {
         if $DEBUG >1;
   
       my $error = $cust_pkg->replace( $old_cust_pkg,
+                                      'depend_jobnum'=>$options{depend_jobnum},
                                       'options' => { $cust_pkg->options },
                                     )
         unless $options{no_commit};
index d960445..c3d3cb9 100644 (file)
@@ -493,7 +493,10 @@ sub replace {
   #trigger export of new RADIUS Expiration attribute when cust_pkg.bill changes
   foreach my $old_svc_acct ( @svc_acct ) {
     my $new_svc_acct = new FS::svc_acct { $old_svc_acct->hash };
-    my $s_error = $new_svc_acct->replace($old_svc_acct);
+    my $s_error =
+      $new_svc_acct->replace( $old_svc_acct,
+                              'depend_jobnum' => $options->{depend_jobnum},
+                            );
     if ( $s_error ) {
       $dbh->rollback if $oldAutoCommit;
       return $s_error;