diff options
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/cust_main.pm | 32 | ||||
-rw-r--r-- | FS/FS/part_bill_event.pm | 24 |
2 files changed, 13 insertions, 43 deletions
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 070a888d4..89fd5be14 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -1012,38 +1012,6 @@ sub suspend { grep { $_->suspend } $self->unsuspended_pkgs; } -=item suspend_if_pkgpart PKGPART [ , PKGPART ... ] - -Suspends all unsuspended packages (see L<FS::cust_pkg>) matching the listed -PKGPARTs (see L<FS::part_pkg>). Always returns a list: an empty list on -success or a list of errors. - -=cut - -sub suspend_if_pkgpart { - my $self = shift; - my @pkgparts = @_; - grep { $_->suspend } - grep { my $pkgpart = $_->pkgpart; grep { $pkgpart eq $_ } @pkgparts } - $self->unsuspended_pkgs; -} - -=item suspend_unless_pkgpart PKGPART [ , PKGPART ... ] - -Suspends all unsuspended packages (see L<FS::cust_pkg>) unless they match the -listed PKGPARTs (see L<FS::part_pkg>). Always returns a list: an empty list -on success or a list of errors. - -=cut - -sub suspend_unless_pkgpart { - my $self = shift; - my @pkgparts = @_; - grep { $_->suspend } - grep { my $pkgpart = $_->pkgpart; ! grep { $pkgpart eq $_ } @pkgparts } - $self->unsuspended_pkgs; -} - =item cancel [ OPTION => VALUE ... ] Cancels all uncancelled packages (see L<FS::cust_pkg>) for this customer. diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm index 28cf62037..2638328ea 100644 --- a/FS/FS/part_bill_event.pm +++ b/FS/FS/part_bill_event.pm @@ -149,20 +149,22 @@ sub check { || $self->ut_textn('plan') || $self->ut_anything('plandata') ; - #|| $self->ut_snumber('seconds') return $error if $error; #quelle kludge - if ( $self->plandata =~ /^(agent_)?templatename\s+(.*)$/m ) { - my $name= $2; - - foreach my $file (qw( template latex latexnotes )) { - unless ( $conf->exists("invoice_${file}_$name") ) { - $conf->set( - "invoice_${file}_$name" => - join("\n", $conf->config("invoice_$file") ) - ); - } + if ( $self->plandata =~ /^templatename\s+(.*)$/ ) { + my $name= $1; + unless ( $conf->exists("invoice_template_$name") ) { + $conf->set( + "invoice_template_$name" => + join("\n", $conf->config('invoice_template') ) + ); + } + unless ( $conf->exists("invoice_latex_$name") ) { + $conf->set( + "invoice_latex_$name" => + join("\n", $conf->config('invoice_latex') ) + ); } } |