X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=conf%2Finvoice_latex;h=40ec7031337ab516732ffcc4a0885f6cba80099e;hb=425a87cceee1042973ef0b58755496eadb8caab1;hp=70b36b13dfdbf0c0a9ec2da57e4d8b6d36c883fc;hpb=9d25ecf983c1ca92d9ca0137b678ded22455691d;p=freeside.git diff --git a/conf/invoice_latex b/conf/invoice_latex index 70b36b13d..40ec70313 100644 --- a/conf/invoice_latex +++ b/conf/invoice_latex @@ -176,7 +176,7 @@ \newcommand{\FShead}{ \hline \rule{0pt}{2.5ex} - \makebox[1.4cm]{\textbf{Ref}} & + \makebox[1.4cm]{} & \multicolumn{\FSdescriptioncolumncount}{l}{\makebox[\FSdescriptionlength][l]{\textbf{[@-- emt('Description') --@]}}}& \FSunitcolumns \makebox[1.6cm][r]{\textbf{[@-- emt('Amount') --@]}} \\ @@ -187,11 +187,11 @@ \newcommand{\FSdesc}[5]{ \multicolumn{1}{c}{\rule{0pt}{2.5ex}\textbf{#1}} & \multicolumn{[@-- $unitprices ? '4' : '6' --@]}{l}{\textbf{#2}} & -[@-- $unitprices ? ' \multicolumn{1}{r}{\textbf{\dollar #3}} &'."\n". +[@-- $unitprices ? ' \multicolumn{1}{r}{\textbf{#3}} &'."\n". ' \multicolumn{1}{r}{\textbf{#4}} &'."\n" : '' --@] - \multicolumn{1}{r}{\textbf{\dollar #5}}\\ + \multicolumn{1}{r}{\textbf{#5}}\\ } % ...extended description... \newcommand{\FSextdesc}[1]{ @@ -259,6 +259,8 @@ $OUT .= '\begin{longtable}{cllllllr}'; $OUT .= '\caption*{ '; if ($section->{'location'}) { + $OUT .= $section->{'location'}{'label_prefix'}. ': ' + if length($section->{'location'}{'label_prefix'}); $OUT .= $section->{'location'}{'address1'}; $OUT .= ', ' . $section->{'location'}{'address2'} if length($section->{'location'}{'address2'}); @@ -325,18 +327,25 @@ # Don't break-up small packages. my $rowbreak = @$ext_description < 5 ? '*' : ''; - $OUT .= "\\hline\n" if ($line->{'ref'} && $line->{'ref'} ne $lastref); + $OUT .= "\\hline\n" if (($line->{'ref'} || 0) ne $lastref); 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"; + '{}'. + '{' . $line->{'description'} . '}' ; + if ( $unitprices and length($line->{'unit_amount'}) ) { + # then show the unit amount and quantity + $OUT .= + '{\\dollar' . $line->{'unit_amount'} . '}'. + '{' . $line->{'quantity'} . '}'; + } else { + # leave those columns blank + $OUT .= '{}{}'; + } + $OUT .= '{\\dollar' . $line->{'amount'} . "}${rowbreak}\n"; } - $lastref = $line->{'ref'}; + $lastref = $line->{'ref'} || 0; foreach my $ext_desc (@$ext_description) { if ($section->{extended_description_generator}) {