From bd37cef4d8a2930a7550efe857d354a790ffc65f Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 9 Jun 2005 05:59:57 +0000 Subject: [PATCH] make sure invoice_(latex|html)returnaddress is configurable per-agent --- FS/FS/cust_bill.pm | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index a9bb7452b..ed08ae79a 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -1336,11 +1336,10 @@ sub print_latex { } my $returnaddress; - if ( $conf->exists('invoice_latexreturnaddress') - && length($conf->exists('invoice_latexreturnaddress')) - ) - { - $returnaddress = join("\n", $conf->config('invoice_latexreturnaddress') ); + if ( length($conf->config_orbase('invoice_latexreturnaddress', $template) ) { + $returnaddress = join("\n", + $conf->config_orbase('invoice_latexreturnaddress', $template) + ); } else { $returnaddress = '~'; } @@ -1762,16 +1761,17 @@ sub print_html { # 'conf_dir' => "$FS::UID::conf_dir/conf.$FS::UID::datasrc", ); - $invoice_data{'returnaddress'} = $conf->exists('invoice_htmlreturnaddress') - ? join("\n", $conf->config('invoice_htmlreturnaddress') ) - : join("\n", map { - s/~/ /g; - s/\\\\\*?\s*$/
/; - s/\\hyphenation\{[\w\s\-]+\}//; - $_; - } - $conf->config('invoice_latexreturnaddress') - ); + $invoice_data{'returnaddress'} = + length( $conf->config_orbase('invoice_htmlreturnaddress', $template) ) + ? join("\n", $conf->config('invoice_htmlreturnaddress', $template) ) + : join("\n", map { + s/~/ /g; + s/\\\\\*?\s*$/
/; + s/\\hyphenation\{[\w\s\-]+\}//; + $_; + } + $conf->config_orbase('invoice_latexreturnaddress', $template) + ); my $countrydefault = $conf->config('countrydefault') || 'US'; if ( $cust_main->country eq $countrydefault ) { -- 2.11.0