\newcommand{\FSextdesc}[1]{\r
\multicolumn{1}{l}{\rule{0pt}{1.0ex}} &\r
%% \multicolumn{2}{l}{\small{~-~#1}}\\\r
- ~~~#1\\\r
+#1\\\r
}\r
% ...and total line items.\r
\newcommand{\FStotaldesc}[2]{\r
\hfill\r
\makebox{\r
\begin{minipage}[t]{6.4cm}\r
-\begin{flushright}\r
[@--\r
if ($ship_enable) {\r
$OUT .= '\textbf{Service Address}\\\\';\r
$OUT .= "\\addressline{$ship_city, $ship_state~~$ship_zip}";\r
$OUT .= "\\addressline{$ship_country}";\r
$OUT .= '~\\\\';\r
+ $OUT .= "\\textbf{ID:}~~$agent_custid\\\\" if $agent_custid;\r
+ $OUT .= "\\textbf{Fax:}~~$ship_fax\\\\" if $ship_fax;\r
+ $OUT .= '~\\\\' if ($ship_fax or $agent_custid);\r
}else{\r
$OUT .= '';\r
}\r
--@]\r
+\begin{flushright}\r
Terms: [@-- $terms --@]\\\r
[@-- $po_line --@]\\\r
\end{flushright}\r
$OUT .= '\large\textsc{'. $section->{'pretotal'}. '}\\\\';\r
$OUT .= '\\end{flushright}';\r
}\r
+ $OUT .= '\pagebreak' if $section{'post_total'};\r
$OUT .= '\captionsetup{singlelinecheck=false,justification=raggedright,font={Large,sc,bf}}';\r
$OUT .= '\begin{longtable}{cllllllr}';\r
$OUT .= '\caption*{ ';\r
$OUT .= '\makebox[2.0cm][l]{}& ';\r
$OUT .= '\makebox[2.0cm][l]{}& ';\r
$OUT .= '\makebox[2.0cm][l]{}& ';\r
- $OUT .= '\makebox[2.0cm][l]{\textbf{'. ($unitprices ? '~~Unit Price' : ''). '}&';\r
- $OUT .= '\makebox[2.0cm]{\textbf{'. ($unitprices ? '~Quantity' : ''). '}&';\r
+ $OUT .= '\makebox[2.0cm][l]{\textbf{'. ($unitprices ? '~~Unit Price' : ''). '}}&';\r
+ $OUT .= '\makebox[2.0cm]{\textbf{'. ($unitprices ? '~Quantity' : ''). '}}&';\r
$OUT .= '\makebox[2.0cm][r]{\textbf{Amount}} \\\\';\r
$OUT .= '\hline';\r
$OUT .= '\endfirsthead';\r
$OUT .= '\makebox[2.0cm][l]{}& ';\r
$OUT .= '\makebox[2.0cm][l]{}& ';\r
$OUT .= '\makebox[2.0cm][l]{}& ';\r
- $OUT .= '\makebox[2.0cm][l]{\textbf{'. ($unitprices ? '~~Unit Price' : ''). '}&';\r
- $OUT .= '\makebox[2.0cm]{\textbf{'. ($unitprices ? '~Quantity' : ''). '}&';\r
+ $OUT .= '\makebox[2.0cm][l]{\textbf{'. ($unitprices ? '~~Unit Price' : ''). '}}&';\r
+ $OUT .= '\makebox[2.0cm]{\textbf{'. ($unitprices ? '~Quantity' : ''). '}}&';\r
$OUT .= '\makebox[2.0cm][r]{\textbf{Amount}} \\\\';\r
$OUT .= '\hline';\r
$OUT .= '\endhead';\r
$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
# 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
$ext_desc = substr($ext_desc, 0, 80) . '...'\r
if (length($ext_desc) > 80);\r
- $ext_desc = '\small{'. $ext_desc. '}';\r
+ $ext_desc = '\multicolumn{6}{l}{\small{~~~'. $ext_desc. '}}';\r
+ }else{\r
+ $ext_desc = "~~~$ext_desc";\r
}\r
$OUT .= '\FSextdesc{' . $ext_desc . '}' . "${rowbreak}\n";\r
}\r