X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=7d104117f209a743f3ddf94cd1085aa4237dd2cd;hb=0452430dac4d639796581be77e8674207653f42b;hp=c3ad158dbc77f7ea98a63a2c665388181af1f1ad;hpb=bbff687b94d49c5348ce51005433840ec7d51bea;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index c3ad158db..7d104117f 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -414,10 +414,18 @@ sub generate_email { $args{'from'} =~ /\@([\w\.\-]+)/ or $1 = 'example.com'; my $content_id = join('.', rand()*(2**32), $$, time). "\@$1"; + my $path = "$FS::UID::conf_dir/conf.$FS::UID::datasrc"; + my $file; + if ( [ -e "$path/logo_". $args{'_template'}. ".png" ] ) { + $file = "$path/logo_". $args{'_template'}. ".png"; + } else { + $file = "$path/logo.png"; + } + my $image = build MIME::Entity 'Type' => 'image/png', 'Encoding' => 'base64', - 'Path' => "$FS::UID::conf_dir/conf.$FS::UID::datasrc/logo.png", + 'Path' => $file, 'Filename' => 'logo.png', 'Content-ID' => "<$content_id>", ; @@ -1017,9 +1025,9 @@ sub _agent_plandata { 'plan' => 'send_agent', 'plandata' => { 'op' => '~', 'value' => "(^|\n)agentnum ". - '\[?[0-9 ,]*'. - '[ ,]'. $self->cust_main->agentnum. '[ ,]' - '[0-9 ,]*\]?'. + '([0-9]*, )*'. + $self->cust_main->agentnum. + '(, [0-9]*)*'. "(\n|\$)", }, }, @@ -1358,8 +1366,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', @@ -1760,6 +1768,7 @@ sub print_html { 'terms' => $conf->config('invoice_default_terms') || 'Payable upon receipt', 'cid' => $cid, + 'template' => $template, # 'conf_dir' => "$FS::UID::conf_dir/conf.$FS::UID::datasrc", ); @@ -1805,11 +1814,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/~/ /g; s/\\\\\*?\s*$/
/; $_; } - $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/~/ /g; s/\\\\\*?\s*$/
/; $_; } + $conf->config_orbase('invoice_latexfooter', $template) + ); $invoice_data{'po_line'} = ( $cust_main->payby eq 'BILL' && $cust_main->payinfo )