planet telecom rate import, RT#83146
[freeside.git] / conf / quotation_latex
index d56a7fb..13fc429 100644 (file)
 \r
 \LTchunksize=40\r
 \r
+\r
+\begin{document}\r
+\r
+\r
 \renewcommand{\headrulewidth}{0pt}\r
 \renewcommand{\footrulewidth}{1pt}\r
 \r
   \ifthenelse{\equal{\thepage}{1}}\r
   { % First page\r
     \begin{tabular}{ccc}\r
-    [@-- join(' & ', emt('Invoice date'), emt('Invoice #'), emt('Customer #') ) --@]\\\r
+    [@-- join(' & ', emt('Quotation date'), emt('Quotation #'), $custnum ? emt('Customer #') : emt('Prospect #') ) --@]\\\r
     \vspace{0.2cm}\r
-    \textbf{[@-- $date --@]} & \textbf{[@-- $invnum --@]} & \textbf{[@-- $custnum --@]} \\\hline\r
+    \textbf{[@-- $date --@]} & \textbf{[@-- $quotationnum --@]} & \textbf{[@-- $custnum || $prospectnum --@]} \\\hline\r
     \rule{0pt}{5ex} &~~ \huge{\textsc{[@-- emt($notice_name) --@]}} & \\\r
     \vspace{-0.2cm}\r
      & & \\\hline\r
   { % ... pages\r
     \small{\r
       \begin{tabular}{lll}\r
-      [@-- join(' & ', emt('Invoice date'), emt('Invoice #'), emt('Customer #') ) --@]\\\r
-      \textbf{[@-- $date --@]} & \textbf{[@-- $invnum --@]} & \textbf{[@-- $custnum --@]}\\\r
+      [@-- join(' & ', emt('Quotation date'), emt('Quotation #'), $custnum ? emt('Customer #') : emt('Prospect #') ) --@]\\\r
+      \textbf{[@-- $date --@]} & \textbf{[@-- $quotationnum --@]} & \textbf{[@-- $custnum || $prospectnum --@]}\\\r
       \end{tabular}\r
     }\r
   }\r
 \newcommand{\FShead}{\r
   \hline\r
   \rule{0pt}{2.5ex}\r
-  \makebox[1.4cm]{\textbf{Ref}} &\r
+  \makebox[1.4cm]{} &\r
   \multicolumn{\FSdescriptioncolumncount}{l}{\makebox[\FSdescriptionlength][l]{\textbf{[@-- emt('Description') --@]}}}&\r
   \FSunitcolumns\r
   \makebox[1.6cm][r]{\textbf{[@-- emt('Amount') --@]}} \\\r
 }\r
 \r
 \r
-\begin{document}\r
 %      Headers and footers defined for the first page\r
 \addressinset \rule{0.5cm}{0cm} \r
 \makebox{\r
         }\r
       }\r
 \r
-      #if ($section == $sections[$#sections]) {\r
-        foreach my $line (grep {$_->{section}->{description} eq $section->{description}} @total_items) {\r
-          if ($section->{total_line_generator}) {\r
-            $OUT .= &{$section->{total_line_generator}}($line);\r
-          } else {\r
-            $OUT .= '\FStotaldesc{' . $line->{'total_item'} . '}' .\r
-                    '{' . $line->{'total_amount'} . '}' . "\n";\r
-          }\r
+      foreach my $line (grep {$_->{section}->{description} eq $section->{description}} @total_items) {\r
+        if ($section->{total_line_generator}) {\r
+          $OUT .= &{$section->{total_line_generator}}($line);\r
+        } else {\r
+          $OUT .= '\FStotaldesc{' . $line->{'total_item'} . '}' .\r
+                  '{' . $line->{'total_amount'} . '}' . "\n";\r
+          $OUT .= '\hline' . "\n" if $line->{'break_after'};\r
         }\r
-      #}\r
+      }\r
 \r
-      $OUT .= '\hline';\r
       $OUT .= '\endlastfoot';\r
 \r
       my $lastref = 0;\r
           $OUT .= &{$section->{description_generator}}($line);\r
         } else {\r
           $OUT .= '\FSdesc'.\r
-                  '{' . ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ) . '}'.\r
+                  '{}'. #'{' . ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ) . '}'.\r
                   '{' . $line->{'description'} . '}' .\r
                   '{' . ( $unitprices ? $line->{'unit_amount'} : '' ) . '}'.\r
                   '{' . ( $unitprices ? $line->{'quantity'} : ''  ) . '}' .\r