\documentclass[twoside]{scrartcl}
\usepackage[frame]{xy}
\usepackage{tabularx}
\usepackage[latin1]{inputenc}
\setlength{\voffset}{0.5cm}
\setlength{\hoffset}{-2.0cm}
\setlength{\topmargin}{0cm}
\setlength{\headheight}{0.5cm}
\setlength{\headsep}{1cm}
\setlength{\topskip}{0pt}
\setlength{\oddsidemargin}{1.0cm}
\setlength{\evensidemargin}{1.0cm}
\setlength{\textwidth}{19.2cm}
\setlength{\textheight}{24.5cm}
\setlength{\footskip}{1cm}
\setlength{\parindent}{0pt}
\renewcommand{\baselinestretch}{1}
\begin{document}

\newlength{\descrwidth}\setlength{\descrwidth}{10cm}

\newsavebox{\hdr}
\sbox{\hdr}{
  \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont

  \parbox{\textwidth}{
    \parbox[b]{12cm}{
      <?lsmb company ?>

      <?lsmb address ?>}\hfill
    \begin{tabular}[b]{rrr@{}}
    Tel & <?lsmb tel ?>\\
    Fax & <?lsmb fax ?>
    \end{tabular}

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

\fontfamily{cmss}\fontshape{n}\selectfont

\markboth{<?lsmb company ?>\hfill <?lsmb statementdate ?>}{\usebox{\hdr}}

\pagestyle{myheadings}
%\thispagestyle{empty}     use this with letterhead paper

<?lsmb pagebreak 65 27 48 ?>
\end{tabular*}

  \rule{\textwidth}{2pt}

  \hfill
  \begin{tabularx}{7cm}{Xr@{}}
  \textbf{Subtotale} & \textbf{<?lsmb sumcarriedforward ?>} \\
  \end{tabularx}

\newpage

\markright{<?lsmb company ?>\hfill <?lsmb statementdate ?>}

\vspace*{-12pt}

\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
  \textbf{Fattura Numero} & \textbf{Data} & \textbf{Dovuto} &
  \textbf{Scaduto} & \textbf{30} & \textbf{60} & \textbf{90+} \\
  carried forward from <?lsmb lastpage ?> & & & & & & <?lsmb sumcarriedforward ?> \\
<?lsmb end pagebreak ?>


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

\vspace*{1.5cm}

\parbox[t]{1cm}{\hfill}
\parbox[t]{10.5cm}{
  
<?lsmb name ?>

<?lsmb address1 ?>

<?lsmb if address2 ?>
<?lsmb address2 ?>
<?lsmb end address2 ?>

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

<?lsmb if country ?>
<?lsmb country ?>
<?lsmb end country ?>

}
\parbox[t]{7.5cm}{
<?lsmb if customerphone ?>
Tel: <?lsmb customerphone ?>
<?lsmb end customerphone ?>

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

<?lsmb email ?>
}
\hfill

\vspace{1cm}

\textbf{E S T R A T T O} \parbox{0.3cm}{\hfill}  \textbf{C O N T O} \hfill

\hfill <?lsmb statementdate ?>

\vspace{2cm}

\begin{tabular*}{\textwidth}{@{}l@{\extracolsep\fill}ccrrrr@{}}
  \textbf{Fattura Numero} & \textbf{Data} & \textbf{Dovuto} &
  \textbf{Corrente} & \textbf{30} & \textbf{60} & \textbf{90+} \\
<?lsmb foreach invnumber ?>
  <?lsmb invnumber ?> & <?lsmb invdate ?> & <?lsmb duedate ?> &
  <?lsmb c0 ?> & <?lsmb c30 ?> & <?lsmb c60 ?> & <?lsmb c90 ?> \\
<?lsmb end invnumber ?>
\textbf{Subtotale} & & & <?lsmb c0total ?> & <?lsmb c30total ?> & <?lsmb c60total ?> & <?lsmb c90total ?>
\end{tabular*}
\rule{\textwidth}{1pt}

\vspace{1cm}

\hfill
\begin{tabularx}{7cm}{Xr@{}}
  \textbf{Totale Dovuto} & <?lsmb total ?>
\end{tabularx}

\vfill

Per favore intestare gli assegni a: <?lsmb company ?>

\renewcommand{\thefootnote}{\fnsymbol{footnote}}

\footnotetext[1]{\tiny
}

\end{document}

