\documentclass{scrartcl}
\usepackage[latin1]{inputenc}
\usepackage{tabularx}
\usepackage[top=2cm,bottom=1.5cm,left=2cm,right=1cm]{geometry}
\usepackage{graphicx}
\setlength{\parindent}{0pt}

\begin{document}

\pagestyle{myheadings}
\thispagestyle{empty}

\fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont

\vspace*{-1.3cm}

\parbox{\textwidth}{%
  \parbox[b]{.42\textwidth}{%
    <?lsmb company ?>
   
    <?lsmb address ?>
  }
  \parbox[b]{.2\textwidth}{
    \includegraphics[scale=0.3]{ledger-smb}
  }\hfill
  \begin{tabular}[b]{rr@{}}
  Telephone & <?lsmb tel ?>\\
  Facsimile & <?lsmb fax ?>
  \end{tabular}

  \rule[1.5em]{\textwidth}{0.5pt}
}

\centerline{\textbf{A P} \hspace{0.3cm} \textbf{T R A N S A C T I O N}}

\vspace*{0.5cm}

\parbox[t]{.5\textwidth}{
<?lsmb name ?>

<?lsmb address1 ?>

<?lsmb address2 ?>

<?lsmb city ?> <?lsmb state ?> <?lsmb zipcode ?>

<?lsmb country ?>

\vspace{0.3cm}

<?lsmb if contact ?>
<?lsmb contact ?>
<?lsmb end contact ?>

\vspace{0.2cm}

<?lsmb if customerphone ?>
Tel: <?lsmb customerphone ?>
<?lsmb end customerphone ?>

<?lsmb if customerfax ?>
Fax: <?lsmb customerfax ?>
<?lsmb end customerfax ?>

<?lsmb email ?>
}
\hfill
\begin{tabular}[t]{ll}
  \textbf{Invoice \#} & <?lsmb invnumber ?> \\
  \textbf{Date} & <?lsmb invdate ?> \\
  \textbf{Due} & <?lsmb duedate ?> \\
  \textbf{Order \#} & <?lsmb ordnumber ?> \\
  \textbf{Employee} & <?lsmb employee ?> \\
\end{tabular}

\vspace{1cm}

\begin{tabularx}{.5\textwidth}[t]{@{}llrl@{}}
<?lsmb foreach amount ?>
  <?lsmb accno ?> & <?lsmb account ?> & <?lsmb amount ?> & <?lsmb projectnumber ?> \\
<?lsmb end amount ?>

  \multicolumn{2}{r}{\textbf{Subtotal}} & <?lsmb subtotal ?> & \\
<?lsmb foreach tax ?>
  \multicolumn{2}{r}{\textbf{<?lsmb taxdescription ?> @ <?lsmb taxrate ?> \%}} & <?lsmb tax ?> & \\
<?lsmb end tax ?>

  \multicolumn{2}{r}{\textbf{Total}} & <?lsmb invtotal ?> & \\
  
\end{tabularx}
<?lsmb notes ?>

\vspace{0.3cm}

<?lsmb text_amount ?> ***** <?lsmb decimal ?>/100 <?lsmb currency ?>

\vspace{0.3cm}

<?lsmb if paid ?>
\begin{tabular}{@{}llllr@{}}
  \multicolumn{5}{c}{\textbf{Payments}} \\
  \hline
  \textbf{Date} & & \textbf{Source} & \textbf{Memo} & \textbf{Amount} \\
<?lsmb end paid ?>
<?lsmb foreach payment ?>
  <?lsmb paymentdate ?> & <?lsmb paymentaccount ?> & <?lsmb paymentsource ?> & <?lsmb paymentmemo ?> & <?lsmb payment ?> \\
<?lsmb end payment ?>
<?lsmb if paid ?>
\end{tabular}
<?lsmb end paid ?>

\end{document}

