show a better message when no results are found
[freeside.git] / httemplate / misc / print-invoice.cgi
index a5500bf..144f615 100755 (executable)
@@ -11,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");
 
 %>