bundled package presentation improvements
[freeside.git] / conf / invoice_latex
index 6bfc41d..ddd068e 100644 (file)
@@ -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