summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_bill-logo.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view/cust_bill-logo.cgi')
-rwxr-xr-xhttemplate/view/cust_bill-logo.cgi18
1 files changed, 14 insertions, 4 deletions
diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi
index 9c1c1d71d..09ac9a717 100755
--- a/httemplate/view/cust_bill-logo.cgi
+++ b/httemplate/view/cust_bill-logo.cgi
@@ -1,4 +1,4 @@
-<% $conf->config_binary("logo$templatename.png") %>
+<% $conf->config_binary("logo$templatename.png", $agentnum) %>
<%init>
die "access denied"
@@ -7,9 +7,19 @@ die "access denied"
my $conf = new FS::Conf;
-my($query) = $cgi->keywords;
-$query =~ /^([^\.\/]*)$/;
-my $templatename = $1;
+my $templatename;
+my $agentnum = '';
+if ( $cgi->param('invnum') ) {
+ $templatename = $cgi->param('templatename');
+ my $cust_bill = qsearchs('cust_bill', { 'invnum' => $cgi->param('invnum') } )
+ or die 'unknown invnum';
+ $agentnum = $cust_bill->cust_main->agentnum;
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^([^\.\/]*)$/ or die 'illegal query';
+ $templatename = $1;
+}
+
if ( $templatename && $conf->exists("logo_$templatename.png") ) {
$templatename = "_$templatename";
} else {