X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_bill_event.pm;fp=FS%2FFS%2Fpart_bill_event.pm;h=0d03ebf29df1793ce03a19f96f9b73cd1349b60f;hp=b7c8b6a2d42c8f201da32a119be41a93fa809ab6;hb=684a478c0f88e5bf6d1d3f32f4618089146b5709;hpb=14cc10e34e277f4761be76d67d621b5a5d10a87f diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm index b7c8b6a2d..0d03ebf29 100644 --- a/FS/FS/part_bill_event.pm +++ b/FS/FS/part_bill_event.pm @@ -171,11 +171,32 @@ sub check { $self->SUPER::check; } +=item templatename + +Returns the alternate invoice template name, if any, or false if there is +no alternate template for this invoice event. + +=cut + +sub templatename { + my $self = shift; + if ( $self->plan =~ /^send_(alternate|agent)$/ + && $self->plandata =~ /^(agent_)?templatename (.*)$/m + ) + { + $2; + } else { + ''; + } +} + + =back =head1 BUGS -Alas. +The whole "eventcode" idea is bunk. This should be refactored with subclasses +like part_pkg/ and part_export/ =head1 SEE ALSO