<%
groups = []
groups.push(
  { title: 'Labor', lines: @invoice.lines.time_entry,
    footer: 'inv_lines_labor_group_footer.tex' }
) if @invoice.lines.time_entry.any?
groups.push(
  { title: 'Non Labor', lines: @invoice.lines.product }
) if @invoice.lines.product.any?
-%>
\begin{document}
<%= partial( 'lhead.tex', { :location => @invoice.location } ) %>
<%=partial 'inv_rhead.tex', invoice: @invoice %>
\textbf{Invoice To:}
\medskip
\hspace*{3ex}{
  <%=partial 'address.tex', :address=>@invoice.billing_address %>
}
\medskip
<%=partial 'inv_info_line.tex', invoice: @invoice -%>
\\[-5ex]
<%=partial 'inv_lines.tex', invoice: @invoice, lines: @invoice.lines.regular,
    footer: groups.many? ? false : 'labor_lines_footer.tex',
    groups: groups.many? ? groups : false %>
\end{document}

<%
groups = []
groups.push(
  { title: 'Labor', lines: @invoice.lines.time_entry,
    footer: 'inv_lines_labor_group_footer.tex' }
) if @invoice.lines.time_entry.any?
groups.push(
  { title: 'Non Labor', lines: @invoice.lines.product }
) if @invoice.lines.product.any?
-%>
\setlength{\LTpre}{0pt}
\begin{document}
<%= partial( 'lhead.tex', { :location => @invoice.location } ) %>
<%=partial 'inv_rhead.tex', invoice: @invoice %>
\textbf{Invoice To:}
\medskip
\hspace*{3ex}{
  <%=partial 'address.tex', :address=>@invoice.billing_address %>
}
\medskip
<%=partial 'inv_info_line.tex', invoice: @invoice -%>
<%=partial 'inv_lines.tex', invoice: @invoice, lines: @invoice.lines.regular,
    footer: groups.many? ? false : 'labor_lines_footer.tex',
    groups: groups.many? ? groups : false %>
\end{document}

Adjust LTpre vs negative adjustment
Adjust LTpre vs negative adjustment
