apply variable substitutions in latex notes also
authorivan <ivan>
Fri, 16 Jan 2004 21:45:37 +0000 (21:45 +0000)
committerivan <ivan>
Fri, 16 Jan 2004 21:45:37 +0000 (21:45 +0000)
FS/FS/cust_bill.pm

index a5602a7..3c941ca 100644 (file)
@@ -943,15 +943,22 @@ sub print_latex {
     'footer'       => join("\n", $conf->config('invoice_latexfooter') ),
     'quantity'     => 1,
     'terms'        => $conf->config('invoice_default_terms') || 'Payable upon receipt',
-    'notes'        => join("\n", $conf->config('invoice_latexnotes') ),
+    #'notes'        => join("\n", $conf->config('invoice_latexnotes') ),
   );
 
-  $invoice_data{'footer'} =~ s/\n+$//;
-  $invoice_data{'notes'} =~ s/\n+$//;
-
   my $countrydefault = $conf->config('countrydefault') || 'US';
   $invoice_data{'country'} = '' if $invoice_data{'country'} eq $countrydefault;
 
+  #do variable substitutions in notes
+  $invoice_data{'notes'} =
+    join("\n",
+      map { my $b=$_; $b =~ s/\$(\w+)/$invoice_data{$1}/eg; $b }
+        $conf->config('invoice_latexnotes')
+    );
+
+  $invoice_data{'footer'} =~ s/\n+$//;
+  $invoice_data{'notes'} =~ s/\n+$//;
+
   $invoice_data{'po_line'} =
     (  $cust_main->payby eq 'BILL' && $cust_main->payinfo )
       ? _latex_escape("Purchase Order #". $cust_main->payinfo)