1 <% $conf->config_binary("logo$templatename.png", $agentnum) %>
5 unless $FS::CurrentUser::CurrentUser->access_right('View invoices')
6 or $FS::CurrentUser::CurrentUser->access_right('View quotations')
7 or $FS::CurrentUser::CurrentUser->access_right('Configuration');
13 if ( $cgi->param('invnum') =~ /^(\d+)$/ ) {
15 $templatename = $cgi->param('template') || $cgi->param('templatename');
16 my $cust_bill = FS::cust_bill->by_key($invnum)
17 || FS::cust_bill_void->by_key($invnum)
18 || die 'unknown invnum';
19 $conf = $cust_bill->conf;
20 $agentnum = $cust_bill->cust_main->agentnum;
21 } elsif ( $cgi->param('quotationnum') =~ /^(\d+)$/ ) {
22 my $quotationnum = $1;
23 my $quotation = FS::quotation->by_key($quotationnum)
24 or die 'unknown quotationnum';
25 $conf = $quotation->conf;
26 $agentnum = $quotation->agentnum;
28 # assume the default config
29 $conf = FS::Conf->new;
30 my($query) = $cgi->keywords;
31 $query =~ /^([^\.\/]*)$/ or die 'illegal query';
35 if ( $templatename && $conf->exists("logo_$templatename.png") ) {
36 $templatename = "_$templatename";
41 http_header('Content-Type' => 'image/png' );