and make (html|latex)(small)?footer optionall per-agent too
authorivan <ivan>
Thu, 9 Jun 2005 06:36:37 +0000 (06:36 +0000)
committerivan <ivan>
Thu, 9 Jun 2005 06:36:37 +0000 (06:36 +0000)
FS/FS/cust_bill.pm
FS/FS/part_bill_event.pm

index 2a7d506..a603310 100644 (file)
@@ -1358,8 +1358,8 @@ sub print_latex {
     'city'         => _latex_escape($cust_main->city),
     'state'        => _latex_escape($cust_main->state),
     'zip'          => _latex_escape($cust_main->zip),
-    'footer'       => join("\n", $conf->config('invoice_latexfooter') ),
-    'smallfooter'  => join("\n", $conf->config('invoice_latexsmallfooter') ),
+    'footer'       => join("\n", $conf->config_orbase('invoice_latexfooter', $template) ),
+    'smallfooter'  => join("\n", $conf->config_orbase('invoice_latexsmallfooter', $template) ),
     'returnaddress' => $returnaddress,
     'quantity'     => 1,
     'terms'        => $conf->config('invoice_default_terms') || 'Payable upon receipt',
@@ -1805,11 +1805,12 @@ sub print_html {
 #        $conf->config_orbase('invoice_latexnotes', $suffix)
 #    );
 
-   $invoice_data{'footer'} = $conf->exists('invoice_htmlfooter')
-     ? join("\n", $conf->config('invoice_htmlfooter') )
-     : join("\n", map { s/~/&nbsp;/g; s/\\\\\*?\s*$/<BR>/; $_; }
-                      $conf->config('invoice_latexfooter')
-           );
+   $invoice_data{'footer'} =
+     length($conf->config_orbase('invoice_htmlfooter', $template))
+       ? join("\n", $conf->config_orbase('invoice_htmlfooter', $template) )
+       : join("\n", map { s/~/&nbsp;/g; s/\\\\\*?\s*$/<BR>/; $_; }
+                        $conf->config_orbase('invoice_latexfooter', $template)
+             );
 
   $invoice_data{'po_line'} =
     (  $cust_main->payby eq 'BILL' && $cust_main->payinfo )
index 5731f78..573b21b 100644 (file)
@@ -158,7 +158,12 @@ sub check {
   if ( $self->plandata =~ /^(agent_)?templatename\s+(.*)$/m ) {
     my $name= $2;
 
-    foreach my $file (qw( template latex latexnotes html htmlnotes )) {
+    foreach my $file (qw( template
+                          latex latexnotes latexreturnaddress latexfooter
+                            latexsmallfooter
+                          html htmlnotes htmlreturnaddress htmlfooter
+                     ))
+    {
       unless ( $conf->exists("invoice_${file}_$name") ) {
         $conf->set(
           "invoice_${file}_$name" =>