invoice cosmetic improvements
[freeside.git] / conf / invoice_html
index 9d97243..ae6910d 100644 (file)
 
   <%=
       foreach my $section ( @sections ) {
+        if ($section->{'pretotal'}) {
+          $OUT .=
+            '<table width="100%"><tr><td>'.
+            '<p align="right"><b><font size="+1">'.
+            uc(substr($section->{'pretotal'},0,1)).
+            '</font><font size="+0">'. uc(substr($section->{'pretotal'},1)).
+            '</font></b>'.
+            '<p>'.
+            '</td></tr></table>';
+        }
         $OUT .= '<table><tr><td>';
         if ($section->{'description'}) {
           $OUT .=
               '<td align="right">'. $line->{'amount'}. '</td>'.
             '</tr>'
           ;
-          foreach my $ext_desc ( @{$line->{'ext_description'} } ) {
-            $OUT .=
-              '<tr class="invoice_extdesc">'.
-                '<td></td>'.
-                '<td align="left">-&nbsp;'. $ext_desc. '</td>'.
-                '<td></td>'.
-              '</tr>'
+          if ( @{$line->{'ext_description'} } ) {
+            $OUT .= '<tr class="invoice_extdesc"><td></td><td><table>';
+            foreach my $ext_desc ( @{$line->{'ext_description'} } ) {
+              $OUT .=
+                '<tr class="invoice_extdesc">'.
+                  '<td align="left">-&nbsp;'. $ext_desc. '</td>'.
+                '</tr>'
+            }
+            $OUT .= '</table></td><td></td></tr>';
           }
         }
 
             '</tr>'
         ;
         }
+
+        if ($section->{'posttotal'}) {
+          $OUT .= '<tr><td align="right" colspan=3>';
+          $OUT .=
+            '<p><font size="+1">'. $section->{'posttotal'}.
+            '</font>'.
+            '<p>';
+          $OUT .= '</td></tr>';
+        }
+
       }
 
       my $style = 'border-top: 3px solid #000000;';