\r
\documentclass[letterpaper]{article}\r
\r
-\usepackage{fancyhdr,lastpage,ifthen,array,fslongtable,afterpage,caption,multirow,bigstrut}\r
+\usepackage{fancyhdr,lastpage,ifthen,array,longtable,afterpage,caption,multirow,bigstrut}\r
\usepackage{graphicx} % required for logo graphic\r
\usepackage[utf8]{inputenc} % multilanguage support\r
\usepackage[T1]{fontenc}\r
+[@-- if ( length($watermark) ) {\r
+ $OUT .= '\r
+\usepackage{background}\r
+\backgroundsetup{\r
+ placement=center,\r
+ opacity=0.25,\r
+ color=black,\r
+ angle=0,\r
+ contents=' . $watermark . '\r
+}';\r
+}\r
+'';\r
+--@]\r
\r
\addtolength{\voffset}{-0.0cm} % top margin to top of header\r
\addtolength{\hoffset}{-0.6cm} % left margin on page\r
\ifthenelse{\equal{\thepage}{1}}\r
{ % First page\r
\begin{tabular}{ccc}\r
- [@-- join(' & ', emt('Invoice date'), emt('Invoice #'), emt('Customer #') ) --@]\\\r
+ [@-- join(' & ', ( $no_date ? '' : emt('Invoice date') ),\r
+ ( $no_number ? '' : emt('Invoice #') ),\r
+ emt('Customer #')\r
+ )\r
+ --@]\\\r
\vspace{0.2cm}\r
\textbf{[@-- $date --@]} & \textbf{[@-- $invnum --@]} & \textbf{[@-- $custnum --@]} \\\hline\r
\rule{0pt}{5ex} &~~ \huge{\textsc{[@-- emt($notice_name) --@]}} & \\\r
\newcommand{\FSdescriptionlength} { [@-- $unitprices ? '8.2cm' : '12.8cm' --@] }\r
\newcommand{\FSdescriptioncolumncount} { [@-- $unitprices ? '4' : '6' --@] }\r
\newcommand{\FSunitcolumns}{ [@-- \r
- $unitprices \r
- ? '\makebox[2.5cm][l]{\textbf{~~'.emt('Unit Price').'}}&\makebox[1.4cm]{\textbf{~'.emt('Quantity').'}}&' \r
+ $unitprices\r
+ ? '\makebox[2.5cm][r]{\textbf{~~' . emt('Unit Price') . '}} &' .\r
+ '\makebox[1.4cm]{\textbf{~' . emt('Quantity') . '}} & ' \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
\newcommand{\FSdesc}[5]{\r
\multicolumn{1}{c}{\rule{0pt}{2.5ex}\textbf{#1}} &\r
\multicolumn{[@-- $unitprices ? '4' : '6' --@]}{l}{\textbf{#2}} &\r
-[@-- $unitprices ? ' \multicolumn{1}{l}{\textbf{#3}} &'."\n".\r
+[@-- $unitprices ? ' \multicolumn{1}{r}{\textbf{#3}} &'."\n".\r
' \multicolumn{1}{r}{\textbf{#4}} &'."\n"\r
: ''\r
--@]\r
- \multicolumn{1}{r}{\textbf{\dollar #5}}\\\r
+ \multicolumn{1}{r}{\textbf{#5}}\\\r
}\r
% ...extended description...\r
\newcommand{\FSextdesc}[1]{\r
if $coupon;\r
$OUT .= '\begin{longtable}{cllllllr}';\r
$OUT .= '\caption*{ ';\r
- $OUT .= ($section->{'description'}) ? $section->{'description'}: emt('Charges');\r
+ if ($section->{'location'}) {\r
+ $OUT .= $section->{'location'}{'label_prefix'}. ': '\r
+ if length($section->{'location'}{'label_prefix'});\r
+ $OUT .= $section->{'location'}{'address1'};\r
+ $OUT .= ', ' . $section->{'location'}{'address2'}\r
+ if length($section->{'location'}{'address2'});\r
+ $OUT .= ', ' .\r
+ $section->{'location'}{'city'} . ', ' .\r
+ $section->{'location'}{'state'} . '~' .\r
+ $section->{'location'}{'zip'};\r
+ } elsif ( $section->{'description'} ) {\r
+ $OUT .= ($section->{'description'});\r
+ } else {\r
+ $OUT .= emt('Charges');\r
+ }\r
$OUT .= '}\\\\';\r
if ($section->{header_generator}) {\r
$OUT .= &{$section->{header_generator}}();\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 .= "\\hline\n" if (($line->{'ref'} || 0) ne $lastref);\r
if ($section->{description_generator}) {\r
$OUT .= &{$section->{description_generator}}($line);\r
} else {\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
+ '{}'.\r
+ '{' . $line->{'description'} . '}' ;\r
+ if ( $unitprices and length($line->{'unit_amount'}) ) {\r
+ # then show the unit amount and quantity\r
+ $OUT .= \r
+ '{\\dollar' . $line->{'unit_amount'} . '}'.\r
+ '{' . $line->{'quantity'} . '}';\r
+ } else {\r
+ # leave those columns blank\r
+ $OUT .= '{}{}';\r
+ }\r
+ $OUT .= '{\\dollar' . $line->{'amount'} . "}${rowbreak}\n";\r
}\r
- $lastref = $line->{'ref'};\r
+ $lastref = $line->{'ref'} || 0;\r
\r
foreach my $ext_desc (@$ext_description) {\r
if ($section->{extended_description_generator}) {\r