X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_pkg.pm;h=13a3b6eb758ead808756593660d8063c5b986c87;hb=5520f6ba588977ad69083a8d34309e9e97e6ec88;hp=c31b7e5d540a19e1880a2a2e79814737af54e235;hpb=9e6bf0f56f0bd9ceef7cbc22975583968e9f4fb2;p=freeside.git diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index c31b7e5d5..13a3b6eb7 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -598,6 +598,9 @@ sub check { ; return $error if $error; + return "A package with both start date (future start) and setup date (already started) will never bill" + if $self->start_date && $self->setup; + $self->usernum($FS::CurrentUser::CurrentUser->usernum) unless $self->usernum; if ( $self->dbdef_table->column('manual_flag') ) { @@ -758,6 +761,8 @@ sub cancel { map { [ $_, $_->svc_x->table_info->{'cancel_weight'} ]; } qsearch( 'cust_svc', { 'pkgnum' => $self->pkgnum } ) ) { + my $part_svc = $cust_svc->part_svc; + next if ( defined($part_svc) and $part_svc->preserve ); my $error = $cust_svc->cancel( %svc_cancel_opt ); if ( $error ) {