\r
\documentclass[letterpaper]{article}\r
\r
-\usepackage{fancyhdr,lastpage,ifthen,fslongtable,afterpage,caption,multirow,bigstrut}\r
+\usepackage{fancyhdr,lastpage,ifthen,array,fslongtable,afterpage,caption,multirow,bigstrut}\r
\usepackage{graphicx} % required for logo graphic\r
\r
\addtolength{\voffset}{-0.0cm} % top margin to top of header\r
$OUT .= $coupon;\r
}\r
'';\r
---@] \small{\r
+--@] [@-- $smallerfooter ? '\scriptsize{' : '\small{' --@]\r
[@-- $footer --@]\r
}[@-- $coupon ? '\vspace{\extracouponspace}' : '' --@]\r
}\r
{ % ... pages\r
- \small{\r
+ [@-- $smallerfooter ? '\scriptsize{' : '\small{' --@]\r
[@-- $smallfooter --@]\r
}\r
}\r
Invoice date & Invoice \#& Customer\#\\\r
\vspace{0.2cm}\r
\textbf{[@-- $date --@]} & \textbf{[@-- $invnum --@]} & \textbf{[@-- $custnum --@]} \\\hline\r
- \rule{0pt}{5ex} &~~ \huge{\textsc{Invoice}} & \\\r
+ \rule{0pt}{5ex} &~~ \huge{\textsc{[@-- $notice_name || 'Invoice' --@]}} & \\\r
\vspace{-0.2cm}\r
& & \\\hline\r
\end{tabular}\r
\r
\r
\begin{document}\r
-%\r
-%% Headers and footers defined for the first page\r
-%\r
-%% The LH Heading comprising logo\r
-%% UNCOMMENT the following FOUR lines and change the path if necssary to provide a logo\r
-%\r
-%% The Heading comprising isue date, customer ref & INVOICE name\r
-%\r
-%% Header & footer changes for subsequent pages\r
-%\r
-%\r
-%\r
+% Headers and footers defined for the first page\r
\addressinset \rule{0.5cm}{0cm} \r
\makebox{\r
\begin{minipage}[t]{7.0cm}\r
\end{minipage}}\r
\vspace{1.5cm}\r
%\r
+[@-- $summary --@]\r
+%\r
\section*{}\r
[@--\r
- foreach my $section ( @sections ) {\r
- if ($section->{'pretotal'}) {\r
+ foreach my $section ( grep { !$summary || $_->{description} ne $finance_section } @sections ) {\r
+ if ($section->{'pretotal'} && !$summary) {\r
$OUT .= '\begin{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 .= '\ifthenelse{\equal{\thepage}{1}}{\setlength{\LTextracouponspace}{\extracouponspace}}{\setlength{\LTextracouponspace}{0pt}}'\r
- if $coupon;\r
- $OUT .= '\begin{longtable}{cllllllr}';\r
- $OUT .= '\caption*{ ';\r
- $OUT .= ($section->{'description'}) ? $section->{'description'}: 'Charges';\r
- $OUT .= '}\\\\';\r
- $OUT .= '\FShead';\r
- $OUT .= '\endfirsthead';\r
- $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}Continued from previous page}\\\\';\r
- $OUT .= '\FShead';\r
- $OUT .= '\endhead';\r
- $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}Continued on next page...}\\\\';\r
- $OUT .= '\endfoot';\r
- $OUT .= '\hline';\r
-\r
- if (scalar(@sections) > 1) {\r
- $OUT .= '\FStotaldesc{' . $section->{'description'} . ' Total}' .\r
- '{' . $section->{'subtotal'} . '}' . "\n";\r
- }\r
-\r
- #if ($section == $sections[$#sections]) {\r
- foreach my $line (grep {$_->{section}->{description} eq $section->{description}} @total_items) {\r
- $OUT .= '\FStotaldesc{' . $line->{'total_item'} . '}' .\r
- '{' . $line->{'total_amount'} . '}' . "\n";\r
+ unless ($section->{'summarized'} ) {\r
+ $OUT .= '\captionsetup{singlelinecheck=false,justification=raggedright,font={Large,sc,bf}}';\r
+ $OUT .= '\ifthenelse{\equal{\thepage}{1}}{\setlength{\LTextracouponspace}{\extracouponspace}}{\setlength{\LTextracouponspace}{0pt}}'\r
+ if $coupon;\r
+ $OUT .= '\begin{longtable}{cllllllr}';\r
+ $OUT .= '\caption*{ ';\r
+ $OUT .= ($section->{'description'}) ? $section->{'description'}: 'Charges';\r
+ $OUT .= '}\\\\';\r
+ $OUT .= '\FShead';\r
+ $OUT .= '\endfirsthead';\r
+ $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}Continued from previous page}\\\\';\r
+ $OUT .= '\FShead';\r
+ $OUT .= '\endhead';\r
+ $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}Continued on next page...}\\\\';\r
+ $OUT .= '\endfoot';\r
+ $OUT .= '\hline';\r
+\r
+ if (scalar(@sections) > 1) {\r
+ $OUT .= '\FStotaldesc{' . $section->{'description'} . ' Total}' .\r
+ '{' . $section->{'subtotal'} . '}' . "\n";\r
}\r
- #}\r
-\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
- : 1\r
- ) }\r
- @detail_items )\r
- {\r
- my $ext_description = $line->{'ext_description'};\r
+\r
+ #if ($section == $sections[$#sections]) {\r
+ foreach my $line (grep {$_->{section}->{description} eq $section->{description}} @total_items) {\r
+ $OUT .= '\FStotaldesc{' . $line->{'total_item'} . '}' .\r
+ '{' . $line->{'total_amount'} . '}' . "\n";\r
+ }\r
+ #}\r
+\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
+ : 1\r
+ ) }\r
+ @detail_items )\r
+ {\r
+ my $ext_description = $line->{'ext_description'};\r
\r
- # Don't break-up small packages.\r
- my $rowbreak = @$ext_description < 5 ? '*' : '';\r
+ # Don't break-up small packages.\r
+ my $rowbreak = @$ext_description < 5 ? '*' : '';\r
\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 = '\multicolumn{6}{l}{\small{~~~'. $ext_desc. '}}';\r
- }else{\r
- $ext_desc = "~~~$ext_desc";\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 = '\multicolumn{6}{l}{\small{~~~'. $ext_desc. '}}';\r
+ }else{\r
+ $ext_desc = "~~~$ext_desc";\r
+ }\r
+ $OUT .= '\FSextdesc{' . $ext_desc . '}' . "${rowbreak}\n";\r
}\r
- $OUT .= '\FSextdesc{' . $ext_desc . '}' . "${rowbreak}\n";\r
+\r
}\r
\r
+ $OUT .= '\end{longtable}';\r
}\r
-\r
- $OUT .= '\end{longtable}';\r
-\r
if ($section->{'posttotal'}) {\r
$OUT .= '\begin{flushright}';\r
$OUT .= '\normalfont\large\bfseries\textsc{'. $section->{'posttotal'}. '}\\\\';\r
\r
--@]\r
\vfill\r
-[@-- $notes --@]\r
+\begin{minipage}[t]{\textwidth}\r
+ [@-- length($summary)\r
+ ? ''\r
+ : ( $smallernotes\r
+ ? '\scriptsize{ '.$notes.' }'\r
+ : $notes\r
+ )\r
+ --@]\r
+ [@-- $coupon ? '\ifthenelse{\equal{\thepage}{1}}{\rule{0pt}{\extracouponspace}}{}' : '' --@]\r
+\end{minipage}\r
\end{document}\r