invoice_latexfooter
invoice_latexsmallfooter
invoice_latexnotes
- invoice_html
- invoice_htmlreturnaddress
- invoice_htmlfooter
- invoice_htmlnotes
- logo.png
- logo.eps
- );
-
-@base_items = qw (
- invoice_template
- invoice_latex
- invoice_latexreturnaddress
- invoice_latexfooter
- invoice_latexsmallfooter
- invoice_latexnotes
+ invoice_latexcoupon
invoice_html
invoice_htmlreturnaddress
invoice_htmlfooter
},
{
+ 'key' => 'invoice_latexcoupon',
+ 'section' => 'billing',
+ 'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
+ 'type' => 'textarea',
+ },
+
+ {
'key' => 'invoice_latexreturnaddress',
'section' => 'billing',
'description' => 'Return address for LaTeX typeset PostScript invoices.',
},
{
+ 'key' => 'invoice_latexcoupon',
+ 'section' => 'billing',
+ 'description' => 'Remittance coupon for LaTeX typeset PostScript invoices.',
+ 'type' => 'textarea',
+ },
+
+ {
'key' => 'invoice_latexreturnaddress',
'section' => 'billing',
'description' => 'Return address for LaTeX typeset PostScript invoices.',
'footer' => sub { map "$_", @_ },
'smallfooter' => sub { map "$_", @_ },
'returnaddress' => sub { map "$_", @_ },
+ 'coupon' => sub { map "$_", @_ },
},
'html' => {
'notes' =>
$_;
} @_
},
+ 'coupon' => sub { "" },
},
'template' => {
'notes' =>
$_;
} @_
},
+ 'coupon' => sub { "" },
},
);
push @address, ''
while (scalar(@address) < 5);
+ $invoice_data{'logo_file'} = $params{'logo_file'}
+ if $params{'logo_file'};
+
+ my( $pr_total, @pr_cust_bill ) = $self->previous; #previous balance
+# my( $cr_total, @cr_cust_credit ) = $self->cust_credit; #credits
+ #my $balance_due = $self->owed + $pr_total - $cr_total;
+ my $balance_due = $self->owed + $pr_total;
+ $invoice_data{'balance'} = $balance_due;
+
#do variable substitution in notes, footer, smallfooter
- foreach my $include (qw( notes footer smallfooter )) {
+ foreach my $include (qw( notes footer smallfooter coupon )) {
my $inc_file = $conf->key_orbase("invoice_${format}$include", $template);
my @inc_src;
? &$escape_function("Purchase Order #". $cust_main->payinfo)
: $nbsp;
- my( $pr_total, @pr_cust_bill ) = $self->previous; #previous balance
-# my( $cr_total, @cr_cust_credit ) = $self->cust_credit; #credits
- #my $balance_due = $self->owed + $pr_total - $cr_total;
- my $balance_due = $self->owed + $pr_total;
-
my %money_chars = ( 'latex' => '',
'html' => $conf->config('money_char') || '$',
'template' => '',
}
}
- $invoice_data{'logo_file'} = $params{'logo_file'}
- if $params{'logo_file'};
-
$invoice_lines = 0;
my $wasfunc = 0;
foreach ( grep /invoice_lines\(\d*\)/, @invoice_template ) { #kludgy
\r
\documentclass[letterpaper]{article}\r
\r
-\usepackage{fancyhdr,lastpage,ifthen,longtable,afterpage,caption}\r
+\usepackage{fancyhdr,lastpage,ifthen,longtable,afterpage,caption,multirow,bigstrut}\r
\usepackage{graphicx} % required for logo graphic\r
\r
\addtolength{\voffset}{-0.0cm} % top margin to top of header\r
\renewcommand{\headrulewidth}{0pt}\r
\renewcommand{\footrulewidth}{1pt}\r
\r
+\renewcommand{\footrule}{\r
+[@--\r
+ $coupon ? '\ifthenelse{\equal{\thepage}{1}}' : '';\r
+--@]\r
+ {\r
+ }\r
+ {\r
+ \vbox to 0pt{\rule{\headwidth}{\footrulewidth}\vss}\r
+ }\r
+}\r
+\r
+\newcommand{\extracouponspace}{4.8cm}\r
+\r
% Adjust the inset of the mailing address\r
\newcommand{\addressinset}[1][]{\hspace{1.0cm}}\r
\r
\fancyfoot[C]{\r
\ifthenelse{\equal{\thepage}{1}}\r
{ % First page\r
- \small{\r
+[@--\r
+ if ($coupon) {\r
+ $OUT .= '\vspace{-\extracouponspace}';\r
+ $OUT .= '\rule[0.5em]{\textwidth}{\footrulewidth}\\\\';\r
+ $OUT .= $coupon;\r
+ }\r
+ '';\r
+--@] \small{\r
[@-- $footer --@]\r
- }\r
+ }[@-- $coupon ? '\vspace{\extracouponspace}' : '' --@]\r
}\r
{ % ... pages\r
\small{\r
%\r
%\r
%\r
+[@-- $coupon ? '\enlargethispage{-\extracouponspace}' : '' --@]\r
\begin{tabular}{ll}\r
\addressinset \rule{0cm}{0cm} &\r
\makebox{\r
'{' . $section->{'subtotal'} . '}' . "\n";\r
}\r
\r
- if ($section == $sections[$#sections]) {\r
- foreach my $line (@total_items) {\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
\r
$OUT .= '\hline';\r
$OUT .= '\endlastfoot';\r
--- /dev/null
+Detach and return this remittance form with your your payment.\\\r
+\begin{tabular}{ll}\r
+\returninset\r
+\begin{tabular}{ll}\r
+ \makebox{ \includegraphics{[@-- $logo_file --@]}} &\r
+ \begin{minipage}[b]{5.5cm}\r
+[@-- $returnaddress --@]\r
+ \end{minipage}\r
+\end{tabular}&\r
+\begin{tabular}{r@{: }lr}\r
+Invoice date & \textbf{[@-- $date --@]} & \multirow{4}*{\r
+\makebox{\r
+\begin{minipage}[t]{5.0cm}\r
+\textbf{[@-- $payname --@]}\\\r
+\addressline{[@-- $company --@]}\r
+\addressline{[@-- $address1 --@]}\r
+\addressline{[@-- $address2 --@]}\r
+\addressline{[@-- $city --@], [@-- $state --@]~~[@-- $zip --@]}\r
+\addressline{[@-- $country --@]}\r
+\end{minipage}}}\\\r
+Customer\#& \textbf{[@-- $custnum --@]} & \\\r
+Total Due & \textbf{[@-- $balance --@]} & \\\r
+\rule{0pt}{2.25em}Amount Enclosed & \rule{2cm}{1pt}& \\\r
+\end{tabular}\\\r
+\rule{0pt}{1cm} &\\\r
+\begin{tabular}{ll}\r
+\addressinset \rule{0.5cm}{0cm} &\r
+\makebox{\r
+\begin{minipage}[t]{5.0cm}\r
+[@-- $returnaddress --@]\r
+\end{minipage}}\r
+\end{tabular}\\\r
+\end{tabular}\\\r