X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=conf%2Finvoice_latex;h=29a901df1e3a78c49ebfbfd807010c519ca29c6e;hp=42a9f93cf584987034cbf27213be929e22328792;hb=74e058c8a010ef6feb539248a550d0bb169c1e94;hpb=06187016fd78ba41fb82846b9e8d461405f316b6 diff --git a/conf/invoice_latex b/conf/invoice_latex index 42a9f93cf..29a901df1 100644 --- a/conf/invoice_latex +++ b/conf/invoice_latex @@ -24,14 +24,14 @@ \addtolength{\voffset}{-0.0cm} % top margin to top of header \addtolength{\hoffset}{-0.6cm} % left margin on page -\addtolength{\topmargin}{-1.25cm} % top margin to top of header +\addtolength{\topmargin}{[@-- defined($topmargin) ? $topmargin : '-1.25cm' --@]} \setlength{\headheight}{2.0cm} % height of header -\setlength{\headsep}{1.0cm} % between header and text +\setlength{\headsep}{[@-- defined($headsep) ? $headsep : '1.0cm' --@]} \setlength{\footskip}{1.0cm} % bottom of footer from bottom of text %\addtolength{\textwidth}{2.1in} % width of text \setlength{\textwidth}{19.5cm} -\setlength{\textheight}{19.5cm} +\setlength{\textheight}{[@-- defined($textheight) ? $textheight : '19.5cm' --@]} \setlength{\oddsidemargin}{-0.9cm} % odd page left margin \setlength{\evensidemargin}{-0.9cm} % even page left margin @@ -51,7 +51,7 @@ } } -\newcommand{\extracouponspace}{3.6cm} +\newcommand{\extracouponspace}{[@-- defined($extracouponspace) ? $extracouponspace : '3.6cm' --@]} % Adjust the inset of the mailing address \newcommand{\addressinset}[1][]{\hspace{1.0cm}} @@ -80,14 +80,15 @@ $OUT .= '\vspace{-\extracouponspace}'; $OUT .= '\rule[0.5em]{\textwidth}{\footrulewidth}\\\\'; $OUT .= $coupon; + $OUT .= '\vspace{'. $couponfootsep. '}' if defined($couponfootsep); } ''; ---@] \small{ +--@] [@-- $smallerfooter ? '\scriptsize{' : '\small{' --@] [@-- $footer --@] }[@-- $coupon ? '\vspace{\extracouponspace}' : '' --@] } { % ... pages - \small{ + [@-- $smallerfooter ? '\scriptsize{' : '\small{' --@] [@-- $smallfooter --@] } } @@ -108,10 +109,10 @@ \returninset \makebox{ \begin{tabular}{ll} - \includegraphics{[@-- $logo_file --@]} & + \includegraphics{[@-- $logo_file --@]} & [@-- $verticalreturnaddress ? '\\\\' : '' --@] \begin{minipage}[b]{5.5cm} [@-- $returnaddress --@] - \end{minipage} + \end{minipage}\\ \end{tabular} } } @@ -201,7 +202,7 @@ \addressinset \rule{0.5cm}{0cm} \makebox{ \begin{minipage}[t]{7.0cm} -\vspace{0.25cm} +\vspace{[@-- defined($addresssep) ? $addresssep : '0.25cm' --@]} \textbf{[@-- $payname --@]}\\ \addressline{[@-- $company --@]} \addressline{[@-- $address1 --@]} @@ -242,7 +243,7 @@ Terms: [@-- $terms --@]\\ $OUT .= '\large\textsc{'. $section->{'pretotal'}. '}\\\\'; $OUT .= '\\end{flushright}'; } - $OUT .= '\pagebreak' if $section{'post_total'}; + $OUT .= '\pagebreak' if $section->{'post_total'}; unless ($section->{'summarized'} ) { $OUT .= '\captionsetup{singlelinecheck=false,justification=raggedright,font={Large,sc,bf}}'; $OUT .= '\ifthenelse{\equal{\thepage}{1}}{\setlength{\LTextracouponspace}{\extracouponspace}}{\setlength{\LTextracouponspace}{0pt}}' @@ -251,24 +252,40 @@ Terms: [@-- $terms --@]\\ $OUT .= '\caption*{ '; $OUT .= ($section->{'description'}) ? $section->{'description'}: 'Charges'; $OUT .= '}\\\\'; - $OUT .= '\FShead'; + if ($section->{header_generator}) { + $OUT .= &{$section->{header_generator}}(); + } else { + $OUT .= '\FShead'; + } $OUT .= '\endfirsthead'; $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}Continued from previous page}\\\\'; - $OUT .= '\FShead'; + if ($section->{header_generator}) { + $OUT .= &{$section->{header_generator}}(); + } else { + $OUT .= '\FShead'; + } $OUT .= '\endhead'; $OUT .= '\multicolumn{7}{r}{\rule{0pt}{2.5ex}Continued on next page...}\\\\'; $OUT .= '\endfoot'; $OUT .= '\hline'; if (scalar(@sections) > 1) { - $OUT .= '\FStotaldesc{' . $section->{'description'} . ' Total}' . - '{' . $section->{'subtotal'} . '}' . "\n"; + if ($section->{total_generator}) { + $OUT .= &{$section->{total_generator}}($section); + } else { + $OUT .= '\FStotaldesc{' . $section->{'description'} . ' Total}' . + '{' . $section->{'subtotal'} . '}' . "\n"; + } } #if ($section == $sections[$#sections]) { foreach my $line (grep {$_->{section}->{description} eq $section->{description}} @total_items) { - $OUT .= '\FStotaldesc{' . $line->{'total_item'} . '}' . - '{' . $line->{'total_amount'} . '}' . "\n"; + if ($section->{total_line_generator}) { + $OUT .= &{$section->{total_line_generator}}($line); + } else { + $OUT .= '\FStotaldesc{' . $line->{'total_item'} . '}' . + '{' . $line->{'total_amount'} . '}' . "\n"; + } } #} @@ -289,23 +306,31 @@ Terms: [@-- $terms --@]\\ my $rowbreak = @$ext_description < 5 ? '*' : ''; $OUT .= "\\hline\n" if ($line->{'ref'} && $line->{'ref'} ne $lastref); - $OUT .= '\FSdesc'. - '{' . ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ) . '}'. - '{' . $line->{'description'} . '}' . - '{' . ( $unitprices ? $line->{'unit_amount'} : '' ) . '}'. - '{' . ( $unitprices ? $line->{'quantity'} : '' ) . '}' . - '{' . $line->{'amount'} . "}${rowbreak}\n"; + if ($section->{description_generator}) { + $OUT .= &{$section->{description_generator}}($line); + } else { + $OUT .= '\FSdesc'. + '{' . ( $line->{'ref'} ne $lastref ? $line->{'ref'} : '' ) . '}'. + '{' . $line->{'description'} . '}' . + '{' . ( $unitprices ? $line->{'unit_amount'} : '' ) . '}'. + '{' . ( $unitprices ? $line->{'quantity'} : '' ) . '}' . + '{' . $line->{'amount'} . "}${rowbreak}\n"; + } $lastref = $line->{'ref'}; foreach my $ext_desc (@$ext_description) { - if ( $ext_desc !~ /[^\\]&/ ) { - $ext_desc = substr($ext_desc, 0, 80) . '...' - if (length($ext_desc) > 80); - $ext_desc = '\multicolumn{6}{l}{\small{~~~'. $ext_desc. '}}'; - }else{ - $ext_desc = "~~~$ext_desc"; + if ($section->{extended_description_generator}) { + $OUT .= &{$section->{extended_description_generator}}($ext_desc); + } else { + if ( $ext_desc !~ /[^\\]&/ ) { + $ext_desc = substr($ext_desc, 0, 80) . '...' + if (length($ext_desc) > 80); + $ext_desc = '\multicolumn{6}{l}{\small{~~~'. $ext_desc. '}}'; + }else{ + $ext_desc = "~~~$ext_desc"; + } + $OUT .= '\FSextdesc{' . $ext_desc . '}' . "${rowbreak}\n"; } - $OUT .= '\FSextdesc{' . $ext_desc . '}' . "${rowbreak}\n"; } } @@ -322,7 +347,13 @@ Terms: [@-- $terms --@]\\ --@] \vfill \begin{minipage}[t]{\textwidth} - [@-- length($summary) ? '' : $notes --@] + [@-- length($summary) + ? '' + : ( $smallernotes + ? '\scriptsize{ '.$notes.' }' + : $notes + ) + --@] [@-- $coupon ? '\ifthenelse{\equal{\thepage}{1}}{\rule{0pt}{\extracouponspace}}{}' : '' --@] \end{minipage} \end{document}