show a better message when no results are found
[freeside.git] / httemplate / misc / print-invoice.cgi
index aec7cb3..144f615 100755 (executable)
@@ -1,4 +1,3 @@
-<!-- $Id: print-invoice.cgi,v 1.3 2002-01-30 14:18:09 ivan Exp $ -->
 <%
 
 my $conf = new FS::Conf;
@@ -12,13 +11,19 @@ my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum});
 die "Can't find invoice!\n" unless $cust_bill;
 
         open(LPR,"|$lpr") or die "Can't open $lpr: $!";
-        print LPR $cust_bill->print_text; #( date )
+
+        if ( $conf->exists('invoice_latex') ) {
+          print LPR $cust_bill->print_ps; #( date )
+        } else {
+          print LPR $cust_bill->print_text; #( date )
+        }
+
         close LPR
           or die $! ? "Error closing $lpr: $!"
                        : "Exit status $? from $lpr";
 
 my $custnum = $cust_bill->getfield('custnum');
 
-print $cgi->redirect(popurl(2). "view/cust_main.cgi?$custnum#history");
+print $cgi->redirect("${p}view/cust_main.cgi?$custnum");
 
 %>