X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill-logo.cgi;h=75321ef82b772b947178ceccc8b50edf29cccef4;hb=e41880cfb8d9835bca858ec13c96724b08fa0af7;hp=9c1c1d71d2289e83cfbccbd9129612b182b7d31b;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi index 9c1c1d71d..75321ef82 100755 --- a/httemplate/view/cust_bill-logo.cgi +++ b/httemplate/view/cust_bill-logo.cgi @@ -1,15 +1,26 @@ -<% $conf->config_binary("logo$templatename.png") %> +<% $conf->config_binary("logo$templatename.png", $agentnum) %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('View invoices') or $FS::CurrentUser::CurrentUser->access_right('Configuration'); -my $conf = new FS::Conf; +my $conf; + +my $templatename; +my $agentnum = ''; +if ( $cgi->param('invnum') ) { + $templatename = $cgi->param('template') || $cgi->param('templatename'); + my $cust_bill = qsearchs('cust_bill', { 'invnum' => $cgi->param('invnum') } ) + or die 'unknown invnum'; + $conf = $cust_bill->conf; + $agentnum = $cust_bill->cust_main->agentnum; +} else { + my($query) = $cgi->keywords; + $query =~ /^([^\.\/]*)$/ or die 'illegal query'; + $templatename = $1; +} -my($query) = $cgi->keywords; -$query =~ /^([^\.\/]*)$/; -my $templatename = $1; if ( $templatename && $conf->exists("logo_$templatename.png") ) { $templatename = "_$templatename"; } else {