[freeside-commits] branch master updated. 1db161f21c577aeded3240c0783a10da77d639de

Mark Wells mark at 420.am
Wed Jul 13 16:20:10 PDT 2016


The branch, master has been updated
       via  1db161f21c577aeded3240c0783a10da77d639de (commit)
      from  e905c937e83ae9a6bd4361fd9ec9538060c8ec30 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1db161f21c577aeded3240c0783a10da77d639de
Author: Mark Wells <mark at freeside.biz>
Date:   Wed Jul 13 16:18:33 2016 -0700

    limit column width of line item descriptions and details, #38130

diff --git a/conf/invoice_latex b/conf/invoice_latex
index fd0f952..c1d04d6 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}
@@ -192,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
@@ -203,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') --@]} &
@@ -214,7 +217,9 @@
 % ...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"
                  : ''
@@ -224,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
@@ -399,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";
           }
         }
 

-----------------------------------------------------------------------

Summary of changes:
 conf/invoice_latex |   43 +++++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 16 deletions(-)




More information about the freeside-commits mailing list