=================================================================== RCS file: /cvs/RT/Invoicing/rt_invoices.pl,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- RT/Invoicing/rt_invoices.pl 2011/03/22 06:27:12 1.19 +++ RT/Invoicing/rt_invoices.pl 2011/03/24 00:05:47 1.20 @@ -1,5 +1,5 @@ #!/usr/bin/perl -# $AFresh1$ +# $AFresh1: rt_invoices.pl,v 1.19 2011/03/22 05:27:12 andrew Exp $ ######################################################################## # Copyright (c) 2011 Andrew Fresh # @@ -210,8 +210,11 @@ File::Path::make_path($invoice_dir); my $file = join '/', $invoice_dir, $invoice->{file}; - my $tt = Template->new; - $tt->process( 'invoice.tex.tt', $invoice, $file ) + my $tt = Template->new( + INCLUDE_PATH => $config->get('template_dir'), + )|| die $Template::ERROR, "\n"; + + $tt->process( $config->get('invoice_template'), $invoice, $file ) or die $tt->error . "\n"; printf "Generated %s for %s: \$%.02f\n", $invoice->{file}, $custid, @@ -630,6 +633,12 @@ } when ('invoice_dir') { $value = dirname( $self->{file} ) . '/invoices'; + } + when ('template_dir') { + $value = dirname( $self->{file} ); + } + when ('invoice_template') { + $value = 'invoice.tex.tt'; } }