X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=conf%2Finvoice_latex;h=478405ebd82eb8a78f594708e2b3a22672fc852f;hb=3e6b291920daf5546efa5355e3ea6199e875d9db;hp=b64cc690b31798a6360bcf34b130a25c195afbf2;hpb=4d2467d2b8c2134f8cab6907c675a9c4f56472ed;p=freeside.git diff --git a/conf/invoice_latex b/conf/invoice_latex index b64cc690b..478405ebd 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} @@ -37,6 +38,16 @@ ''; --@] +\catcode`\{=1 +\catcode`\}=2 +\special{ps:% + SDict begin [ + /Title (Invoice \#[@-- $invnum --@]) + /DOCINFO pdfmark + end +} +\end + \addtolength{\voffset}{-0.0cm} % top margin to top of header \addtolength{\hoffset}{-0.6cm} % left margin on page \addtolength{\topmargin}{[@-- defined($topmargin) ? $topmargin : '-1.00cm' --@]} @@ -52,6 +63,10 @@ \LTchunksize=40 + +\begin{document} + + \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{1pt} @@ -66,7 +81,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 +110,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{' --@] @@ -114,7 +131,7 @@ { % First page } { % ... pages - \small{\thepage\ of \pageref{LastPage}} + \small{\thepage~[@-- emt('of') --@]~\pageref{LastPage}} } } @@ -190,7 +207,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 +220,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 +228,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 +243,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}} + } \\ +} +% ...call detail (multiple columns already)... +\newcommand{\FScalldetail}[1]{ + \multicolumn{1}{l}{\rule{0pt}{1.0ex}} & + ~~~#1 + \\ } -% ...and total line items. +} +% ...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 @@ -240,7 +272,6 @@ \\ } -\begin{document} % Headers and footers defined for the first page \addressinset \rule{0.5cm}{0cm} \makebox{ @@ -270,7 +301,7 @@ } --@] \begin{flushright} -[@-- $terms ? emt('Terms') .": $terms" : '' --@]\\ +[@-- $terms ? emt('Terms') . ': ' . emt($terms) : '' --@]\\ [@-- $po_line --@]\\ \end{flushright} \end{minipage}} @@ -397,15 +428,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"; } } @@ -421,6 +447,64 @@ } --@] +[@-- + + my @location_summary_sections = + grep { + ref $_->{location} + && $_->{locationnum} + && $_->{description} + && $_->{description} ne $finance_section + } @sections; + if ( $multisection eq 'location' && scalar(@location_summary_sections) > 1 ) { + +$OUT .= ' + \hline + \section*{} + \captionsetup{singlelinecheck=false,justification=raggedright,font={Large,sc,bf}} + \ifthenelse{\equal{\thepage}{1}}{\setlength{\LTextracouponspace}{\extracouponspace}}{\setlength{\LTextracouponspace}{0pt}} + + \begin{longtable}{cllllllr} + \caption*{ '. emt('Summary of New Charges by Location') .' } + \\\\ + + \hline + \rule{0pt}{2.5ex} + \makebox[1.4cm]{} & + \multicolumn{6}{l}{ + \truncate{13.0cm}{\textbf{'. emt('Location') .'}} + } & + \makebox[1.6cm][r]{\textbf{'. emt('Amount') .'}} \\\\ + \hline + + \endfirsthead + \multicolumn{7}{r}{\rule{0pt}{2.5ex}'. emt('Continued from previous page') .'} + \\ + \FShead + \endhead + \multicolumn{7}{r}{\rule{0pt}{2.5ex}'. emt('Continued on next page...') .'} + \\ + \endfoot + \hline + \endlastfoot + \hline + '; + + for my $section (@location_summary_sections) { + $OUT.= ' + \rule{0pt}{2.5ex} + \makebox[1.4cm]{} & + \multicolumn{6}{l}{ + \truncate{12.0cm}{\textbf{'. $section->{description} .'}} + } & + \makebox[1.6cm][r]{\textbf{'. $section->{subtotal} .'}} \\\\ + '; + } + + $OUT .= '\end{longtable}'; + } +--@] + \vfill \begin{minipage}[t]{\textwidth} [@-- length($summary)