summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-07-13 09:19:03 +0000
committerivan <ivan>2009-07-13 09:19:03 +0000
commit1b1f1cad5549a587ca45df9770e316158872cbf0 (patch)
tree059ef96b290e4f9aae95ee76c642ca000f445f3d /FS
parentef5ca981340ba4d9077be3eebdcf527824868dfe (diff)
fix self-service agent-specific logos
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm11
1 files changed, 9 insertions, 2 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index d297cf9f5..c643b3683 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -555,7 +555,14 @@ sub invoice_logo {
#sessioning for this? how do we get the session id to the backend invoice
# template so it can add it to the link, blah
- my $templatename = $p->{'templatename'};
+ my $agentnum = '';
+ if ( $p->{'invnum'} ) {
+ my $cust_bill = qsearchs('cust_bill', { 'invnum' => $p->{'invnum'} } )
+ or return { 'error' => 'unknown invnum' };
+ $agentnum = $cust_bill->cust_main->agentnum;
+ }
+
+ my $templatename = $p->{'template'} || $p->{'templatename'};
#false laziness-ish w/view/cust_bill-logo.cgi
@@ -569,7 +576,7 @@ sub invoice_logo {
my $filename = "logo$templatename.png";
return { 'error' => '',
- 'logo' => $conf->config_binary($filename),
+ 'logo' => $conf->config_binary($filename, $agentnum),
'content_type' => 'image/png', #should allow gif, jpg too
};
}