bundled package presentation improvements
[freeside.git] / conf / invoice_latex
index 693d66e..ddd068e 100644 (file)
 \hfill\r
 \makebox{\r
 \begin{minipage}[t]{6.4cm}\r
-\begin{flushright}\r
 [@--\r
   if ($ship_enable) {\r
     $OUT .= '\textbf{Service Address}\\\\';\r
     $OUT .= '';\r
   }\r
 --@]\r
+\begin{flushright}\r
 Terms: [@-- $terms --@]\\\r
 [@-- $po_line --@]\\\r
 \end{flushright}\r
@@ -284,6 +284,7 @@ Terms: [@-- $terms --@]\\
     $OUT .= '\hline';\r
     $OUT .= '\endlastfoot';\r
 \r
+    my $lastref = 0;\r
     foreach my $line (\r
       grep { ( scalar( @sections ) > 1 \r
              ? $section->{'description'} eq $_->{'section'}->{'description'}\r
@@ -296,11 +297,14 @@ Terms: [@-- $terms --@]\\
       # Don't break-up small packages.\r
       my $rowbreak = @$ext_description < 5 ? '*' : '';\r
   \r
-      $OUT .= "\\hline\n";\r
-      $OUT .= '\FSdesc{' . $line->{'ref'} . '}{' . $line->{'description'} . '}' .\r
+      $OUT .= "\\hline\n" if ($line->{'ref'} && $line->{'ref'} ne $lastref);\r
+      $OUT .= '\FSdesc'.\r
+              '{' . ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ) . '}'.\r
+              '{' . $line->{'description'} . '}' .\r
               '{' . ( $unitprices ? $line->{'unit_amount'} : '' ) . '}'.\r
               '{' . ( $unitprices ? $line->{'quantity'} : ''  ) . '}' .\r
               '{' . $line->{'amount'} . "}${rowbreak}\n";\r
+      $lastref = $line->{'ref'};\r
 \r
       foreach my $ext_desc (@$ext_description) {\r
         if ( $ext_desc !~ /[^\\]&/ ) {\r