'type' => 'checkbox',
},
+ {
+ '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',
#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;
}