[freeside-commits] branch FREESIDE_3_BRANCH updated. 6c3e25436461c3fa83d8dc8b7c683857c98d6a5d

Ivan ivan at 420.am
Wed Nov 5 16:46:37 PST 2014


The branch, FREESIDE_3_BRANCH has been updated
       via  6c3e25436461c3fa83d8dc8b7c683857c98d6a5d (commit)
      from  5b420b40e5c62e0d61b12e206b931cb2af3eff96 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6c3e25436461c3fa83d8dc8b7c683857c98d6a5d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Nov 5 16:46:36 2014 -0800

    agent-virtualize quotation logos, RT#31135

diff --git a/conf/quotation_html b/conf/quotation_html
index 1dfb944..68d373f 100644
--- a/conf/quotation_html
+++ b/conf/quotation_html
@@ -18,7 +18,7 @@
 
   <table class="invoice_header" width="100%">
     <tr>
-     <td><img src="<%= $cid ? "cid:$cid" : "cust_bill-logo.cgi?invnum=$invnum;template=$template" %>"></td>
+     <td><img src="<%= $cid ? "cid:$cid" : "cust_bill-logo.cgi?quotationnum=$quotationnum;template=$template" %>"></td>
      <td align="left"><%= $returnaddress %></td>
       <td align="right">
         <table CLASS="invoice_headerright" cellspacing=0>
diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi
index dc8b674..85b5d72 100755
--- a/httemplate/view/cust_bill-logo.cgi
+++ b/httemplate/view/cust_bill-logo.cgi
@@ -3,6 +3,7 @@
 
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('View invoices')
+      or $FS::CurrentUser::CurrentUser->access_right('View quotations')
       or $FS::CurrentUser::CurrentUser->access_right('Configuration');
 
 my $conf;
@@ -13,10 +14,16 @@ if ( $cgi->param('invnum') =~ /^(\d+)$/ ) {
   my $invnum = $1; 
   $templatename = $cgi->param('template') || $cgi->param('templatename');
   my $cust_bill = FS::cust_bill->by_key($invnum)
-               || FS::cust_bill_void->by_key($invnum);
-  die 'unknown invnum' unless $cust_bill;
+               || FS::cust_bill_void->by_key($invnum)
+               || die 'unknown invnum';
   $conf = $cust_bill->conf;
   $agentnum = $cust_bill->cust_main->agentnum;
+} elsif ( $cgi->param('quotationnum') =~ /^(\d+)$/ ) {
+  my $quotationnum = $1; 
+  my $quotation = FS::quotation->by_key($quotationnum)
+    or die 'unknown quotationnum';
+  $conf = $quotation->conf;
+  $agentnum = $quotation->agentnum;
 } else {
   # assume the default config
   $conf = FS::Conf->new;

-----------------------------------------------------------------------

Summary of changes:
 conf/quotation_html                |    2 +-
 httemplate/view/cust_bill-logo.cgi |   11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list