<?lsmb BLOCK check_single ?>
\parbox[t]{12cm}{
  <?lsmb company ?>

  <?lsmb address ?>}
\hfill
\parbox[t]{6cm}{\hfill <?lsmb source ?>}

\vspace*{0.6cm}

<?lsmb text_amount ?> \dotfill <?lsmb decimal ?>/100 \makebox[0.5cm]{\hfill}

\vspace{0.5cm}

\hfill <?lsmb datepaid ?> \makebox[2cm]{\hfill} <?lsmb amount ?>

% different date format for datepaid
% <?lsmb DD ?><?lsmb MM ?><?lsmb YYYY ?>

\vspace{0.5cm}

<?lsmb legal_name ?>

<?lsmb street1 ?>

<?lsmb street2 ?>

<?lsmb city ?>
<?lsmb IF state ?>
\hspace{-0.1cm}, <?lsmb state ?>
<?lsmb END # state ?>

<?lsmb mail_code ?>

<?lsmb country ?>

\vspace{1.8cm}

<?lsmb memo ?>

\vspace{0.8cm}

<?lsmb company ?>

\vspace{0.5cm}

<?lsmb name ?> \hfill <?lsmb datepaid ?> \hfill <?lsmb source ?>

\vspace{0.5cm}
\begin{tabularx}{\textwidth}{lXrr@{}}
\textbf{Invoice \#} & \textbf{Invoice Date}
  & \textbf{Amount Due} & \textbf{Applied} \\
<?lsmb FOR inv = invoices ?>
<?lsmb inv.invnumber ?> & <?lsmb inv.invdate ?> \dotfill
  & <?lsmb inv.due ?> & <?lsmb inv.paid ?> \\
<?lsmb END # FOREACH inv ?>
\end{tabularx}

\vspace{1cm}

<?lsmb memo ?>

\vfill
<?lsmb message ?>
<?lsmb END # BLOCK ?>
