freeside inc. web services for address normalizaion and printing, RT#33849
authorIvan Kohler <ivan@freeside.biz>
Sun, 27 Mar 2016 08:19:41 +0000 (01:19 -0700)
committerIvan Kohler <ivan@freeside.biz>
Sun, 27 Mar 2016 08:19:41 +0000 (01:19 -0700)
FS/FS/Conf.pm
FS/FS/Template_Mixin.pm
conf/invoice_html
conf/invoice_latex

index c2b558d..248954a 100644 (file)
@@ -1442,8 +1442,8 @@ and customer address. Include units.',
 
   {
     'key'         => 'invoice_latexverticalreturnaddress',
 
   {
     'key'         => 'invoice_latexverticalreturnaddress',
-    'section'     => 'invoicing',
-    'description' => 'Place the return address under the company logo rather than beside it.',
+    'section'     => 'deprecated',
+    'description' => 'Deprecated.  With old invoice_latex template, places the return address under the company logo rather than beside it.',
     'type'        => 'checkbox',
     'per_agent'   => 1,
   },
     'type'        => 'checkbox',
     'per_agent'   => 1,
   },
index f92a564..6974f7d 100644 (file)
@@ -1669,6 +1669,13 @@ sub print_generic {
 
   } else { # this is where we actually create the invoice
 
 
   } else { # this is where we actually create the invoice
 
+    if ( $params{no_addresses} ) {
+      delete $invoice_data{$_} foreach qw(
+        payname company address1 address2 city state zip country
+      );
+      $invoice_data{returnaddress} = '~';
+    }
+
     warn "filling in template for invoice ". $self->invnum. "\n"
       if $DEBUG;
     warn join("\n", map " $_ => ". $invoice_data{$_}, keys %invoice_data). "\n"
     warn "filling in template for invoice ". $self->invnum. "\n"
       if $DEBUG;
     warn join("\n", map " $_ => ". $invoice_data{$_}, keys %invoice_data). "\n"
@@ -2396,7 +2403,7 @@ sub postal_mail_fsinc {
   }
   $company_city =~ s/,$//;
 
   }
   $company_city =~ s/,$//;
 
-  my $file = $self->print_pdf(%opt);
+  my $file = $self->print_pdf(%opt, 'no_addresses' => 1);
   my $pages = CAM::PDF->new($file)->numPages;
 
   my $ua = LWP::UserAgent->new( 'ssl_opts' => { 'verify_hostname'=>0 });
   my $pages = CAM::PDF->new($file)->numPages;
 
   my $ua = LWP::UserAgent->new( 'ssl_opts' => { 'verify_hostname'=>0 });
index e1af707..9d6f528 100644 (file)
@@ -51,8 +51,8 @@
 
   <table class="invoice_header" width="100%">
     <tr>
 
   <table class="invoice_header" width="100%">
     <tr>
-     <td><img src="<%= $cid ? "cid:$cid" : "cust_bill-logo.cgi?invnum=$invnum;template=$template" %>"></td>
      <td align="left"><%= $returnaddress %></td>
      <td align="left"><%= $returnaddress %></td>
+     <td align="left"><img src="<%= $cid ? "cid:$cid" : "cust_bill-logo.cgi?invnum=$invnum;template=$template" %>"></td>
       <td align="right">
         <table CLASS="invoice_headerright" cellspacing=0>
           <tr>
       <td align="right">
         <table CLASS="invoice_headerright" cellspacing=0>
           <tr>
         </table>
       </td>
     </tr>
         </table>
       </td>
     </tr>
+  </table>
 
 
+  <table class="invoice_header" width="100%">
     <tr>
     <tr>
-      <td>
+      <td WIDTH="10%">
       </td>
       <td align="left">
         <b><%= $payname %></b><BR>
       </td>
       <td align="left">
         <b><%= $payname %></b><BR>
index ceff84b..b64cc69 100644 (file)
@@ -39,7 +39,7 @@
 \r
 \addtolength{\voffset}{-0.0cm}         % top margin to top of header\r
 \addtolength{\hoffset}{-0.6cm}         % left margin on page\r
 \r
 \addtolength{\voffset}{-0.0cm}         % top margin to top of header\r
 \addtolength{\hoffset}{-0.6cm}         % left margin on page\r
-\addtolength{\topmargin}{[@-- defined($topmargin) ? $topmargin : '-1.25cm' --@]}\r
+\addtolength{\topmargin}{[@-- defined($topmargin) ? $topmargin : '-1.00cm' --@]}\r
 \setlength{\headheight}{2.0cm}                 % height of header\r
 \setlength{\headsep}{[@-- defined($headsep) ? $headsep : '1.0cm' --@]}\r
 \setlength{\footskip}{1.0cm}           % bottom of footer from bottom of text\r
 \setlength{\headheight}{2.0cm}                 % height of header\r
 \setlength{\headsep}{[@-- defined($headsep) ? $headsep : '1.0cm' --@]}\r
 \setlength{\footskip}{1.0cm}           % bottom of footer from bottom of text\r
     \returninset\r
     \makebox{\r
       \begin{tabular}{ll}\r
     \returninset\r
     \makebox{\r
       \begin{tabular}{ll}\r
-        \includegraphics{[@-- $logo_file --@]} & [@-- $verticalreturnaddress ? '\\\\' : '' --@]\r
         \begin{minipage}[b]{5.5cm}\r
 [@-- $returnaddress --@]\r
         \begin{minipage}[b]{5.5cm}\r
 [@-- $returnaddress --@]\r
-        \end{minipage}\\\r
+        \end{minipage} &\r
+        \includegraphics{[@-- $logo_file --@]}\\\r
       \end{tabular}\r
     }\r
   }\r
       \end{tabular}\r
     }\r
   }\r