[freeside-commits] freeside/FS/FS/ClientAPI MyAccount.pm,1.38,1.39

Ivan,,, ivan at wavetail.420.am
Tue Aug 8 23:34:27 PDT 2006


Update of /home/cvs/cvsroot/freeside/FS/FS/ClientAPI
In directory wavetail:/tmp/cvs-serv26795/FS/FS/ClientAPI

Modified Files:
	MyAccount.pm 
Log Message:
self-service interface: move from text to html invoices

Index: MyAccount.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/ClientAPI/MyAccount.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- MyAccount.pm	24 Aug 2005 13:22:27 -0000	1.38
+++ MyAccount.pm	9 Aug 2006 06:34:25 -0000	1.39
@@ -414,10 +414,37 @@
   return { 'error'        => '',
            'invnum'       => $invnum,
            'invoice_text' => join('', $cust_bill->print_text ),
+           'invoice_html' => $cust_bill->print_html,
          };
 
 }
 
+sub invoice_logo {
+  my $p = shift;
+
+  #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'};
+
+  #false laziness-ish w/view/cust_bill-logo.cgi
+
+  my $conf = new FS::Conf;
+  if ( $templatename =~ /^([^\.\/]*)$/ && $conf->exists("logo_$1.png") ) {
+    $templatename = "_$1";
+  } else {
+    $templatename = '';
+  }
+
+  my $filename = "logo$templatename.png";
+
+  return { 'error'        => '',
+           'logo'         => $conf->config_binary($filename),
+           'content_type' => 'image/png', #should allow gif, jpg too
+         };
+}
+
+
 sub list_invoices {
   my $p = shift;
   my $session = _cache->get($p->{'session_id'})



More information about the freeside-commits mailing list