X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=conf%2Finvoice_latex;h=c1d04d65136f51c32e0c65faea602ba3ae38ba5a;hp=ceff84bd228d3972fdcddaaa04bf6c226273b6d2;hb=88e9a56677d343392416c262f976f069157b06cb;hpb=ffa5a5ba5f1e75ad5e7545f5c8e303e079014f2f diff --git a/conf/invoice_latex b/conf/invoice_latex index ceff84bd2..c1d04d651 100644 --- a/conf/invoice_latex +++ b/conf/invoice_latex @@ -20,6 +20,7 @@ \documentclass[letterpaper]{article} \usepackage{fancyhdr,lastpage,ifthen,array,longtable,afterpage,caption,multirow,bigstrut} +\usepackage[breakwords]{truncate} % to avoid overflowing boxes \usepackage{graphicx} % required for logo graphic \usepackage[utf8]{inputenc} % multilanguage support \usepackage[T1]{fontenc} @@ -39,7 +40,7 @@ \addtolength{\voffset}{-0.0cm} % top margin to top of header \addtolength{\hoffset}{-0.6cm} % left margin on page -\addtolength{\topmargin}{[@-- defined($topmargin) ? $topmargin : '-1.25cm' --@]} +\addtolength{\topmargin}{[@-- defined($topmargin) ? $topmargin : '-1.00cm' --@]} \setlength{\headheight}{2.0cm} % height of header \setlength{\headsep}{[@-- defined($headsep) ? $headsep : '1.0cm' --@]} \setlength{\footskip}{1.0cm} % bottom of footer from bottom of text @@ -66,7 +67,7 @@ } } -\newcommand{\extracouponspace}{[@-- defined($extracouponspace) ? $extracouponspace : '3.6cm' --@]} +\newcommand{\extracouponspace}{[@-- defined($extracouponspace) ? $extracouponspace : '2.7in' --@]} % Adjust the inset of the mailing address \newcommand{\addressinset}[1][]{\hspace{1.0cm}} @@ -95,7 +96,9 @@ $OUT .= '\vspace{-\extracouponspace}'; $OUT .= '\rule[0.5em]{\textwidth}{\footrulewidth}\\\\'; $OUT .= $coupon; - $OUT .= '\vspace{'. $couponfootsep. '}' if defined($couponfootsep); + $OUT .= '\vspace{'. + (defined($couponfootsep) ? $couponfootsep : '0.2in') . + '}'; } ''; --@] [@-- $smallerfooter ? '\scriptsize{' : '\small{' --@] @@ -124,10 +127,10 @@ \returninset \makebox{ \begin{tabular}{ll} - \includegraphics{[@-- $logo_file --@]} & [@-- $verticalreturnaddress ? '\\\\' : '' --@] \begin{minipage}[b]{5.5cm} [@-- $returnaddress --@] - \end{minipage}\\ + \end{minipage} & + \includegraphics{[@-- $logo_file --@]}\\ \end{tabular} } } @@ -190,7 +193,9 @@ \hline \rule{0pt}{2.5ex} \makebox[1.4cm]{} & - \multicolumn{\FSdescriptioncolumncount}{l}{\makebox[\FSdescriptionlength][l]{\textbf{[@-- emt('Description') --@]}}}& + \multicolumn{\FSdescriptioncolumncount}{l}{ + \truncate{\FSdescriptionlength}{\textbf{[@-- emt('Description') --@]}} + } & \FSunitcolumns \makebox[1.6cm][r]{\textbf{[@-- emt('Amount') --@]}} \\ \hline @@ -201,7 +206,7 @@ \rule{0pt}{2.5ex} \makebox[1.4cm]{} & \multicolumn{4}{l}{ - \makebox[\FSdescriptionlength][l]{\textbf{[@-- emt('Description') --@]}} + \truncate{\FSdescriptionlength}{\textbf{[@-- emt('Description') --@]}} } & \textbf{~~[@-- emt('Calls') --@]} & \textbf{~~[@-- emt('Duration') --@]} & @@ -209,10 +214,12 @@ \hline } -}% ...description... +% ...description... \newcommand{\FSdesc}[5]{ \multicolumn{1}{c}{\rule{0pt}{2.5ex}\textbf{#1}} & - \multicolumn{[@-- $unitprices ? '4' : '6' --@]}{l}{\textbf{#2}} & + \multicolumn{[@-- $unitprices ? '4' : '6' --@]}{l}{ + \truncate{\FSdescriptionlength}{\textbf{#2}} + } & [@-- $unitprices ? ' \multicolumn{1}{r}{\textbf{#3}} &'."\n". ' \multicolumn{1}{r}{\textbf{#4}} &'."\n" : '' @@ -222,12 +229,23 @@ % ...extended description... \newcommand{\FSextdesc}[1]{ \multicolumn{1}{l}{\rule{0pt}{1.0ex}} & -%% \multicolumn{2}{l}{\small{~-~#1}}\\ -#1\\ + \multicolumn{6}{l}{ + \truncate{12.8cm}{\small{~~~#1}} + } \\ } -% ...and total line items. +% ...call detail (multiple columns already)... +\newcommand{\FScalldetail}[1]{ + \multicolumn{1}{l}{\rule{0pt}{1.0ex}} & + ~~~#1 + \\ +} +} +% ...and total line items (which use the full 12.8cm length, ignoring +% unitprice/quantity \newcommand{\FStotaldesc}[2]{ - & \multicolumn{6}{l}{#1} & #2\\ + & \multicolumn{6}{l}{ + \truncate{12.8cm}{#1} + } & #2\\ } % ...usage class summary @@ -270,7 +288,7 @@ } --@] \begin{flushright} -[@-- $terms ? emt('Terms') .": $terms" : '' --@]\\ +[@-- $terms ? emt('Terms') . ': ' . emt($terms) : '' --@]\\ [@-- $po_line --@]\\ \end{flushright} \end{minipage}} @@ -397,15 +415,10 @@ foreach my $ext_desc (@$ext_description) { 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"; + } elsif ( $ext_desc !~ /[^\\]&/ ) { + $OUT .= '\FSextdesc{' . $ext_desc . "}$rowbreak\n"; + } else { # call detail + $OUT .= '\FScalldetail{' . $ext_desc . "}$rowbreak\n"; } }