X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill.cgi;h=34f533196d57dbea008dbd761e83453ceac6683a;hb=6a953c149c5f4423cafc510e34c60b41bd7d0ef9;hp=50ee8b36c075ac92528f530260cd7dcfbf38ca80;hpb=eb9668a6f3181ee02cb335272c5ee4616e61fd09;p=freeside.git
diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi
index 50ee8b36c..34f533196 100755
--- a/httemplate/view/cust_bill.cgi
+++ b/httemplate/view/cust_bill.cgi
@@ -3,8 +3,9 @@
#untaint invnum
my($query) = $cgi->keywords;
-$query =~ /^(\d+)$/;
-my $invnum = $1;
+$query =~ /^((.+)-)?(\d+)$/;
+my $templatename = $2;
+my $invnum = $3;
my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
die "Invoice #$invnum not found!" unless $cust_bill;
@@ -30,26 +31,46 @@ print '
';
my $conf = new FS::Conf;
if ( $conf->exists('invoice_latex') ) {
+ my $link = "${p}view/cust_bill-pdf.cgi?";
+ $link .= "$templatename-" if $templatename;
+ $link .= "$invnum.pdf";
print menubar(
- 'View typeset invoice' => "${p}view/cust_bill-pdf.cgi?$invnum",
+ 'View typeset invoice' => $link,
), '
';
}
#false laziness with search/cust_bill_event.cgi
-print table(). '
'; -print $cust_bill->print_text; +print '', $cust_bill->print_text('', $templatename); #formatting print <