%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%                                           %%%
%%%      Szamla - LaTeX sablon v. 1.01        %%%
%%%  Kovacs Laszlo -- lakovacs@inf.unideb.hu  %%%
%%%                                           %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
%%% 2003.10.31.
%%%
%%%


\documentclass[twoside]{article}
%\documentclass[twoside]{scrartcl}
% \usepackage[frame]{xy}
\usepackage{tabularx}
%\usepackage{graphicx}
\usepackage[latin2]{inputenc}



\setlength{\voffset}{-0.5cm}
\setlength{\hoffset}{-2.5cm}
\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}


\newcommand{\PAR}[1]{\texttt{\upshape <\%#1\ ?>}\typeout{#1}}


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


\newsavebox{\headright}
\sbox{\headright}{
  \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
  \parbox{\textwidth}{
   \begin{center}
%     \includegraphics[scale=1.0]{/tmp/logo_04.eps} \\[.3cm]
     {\large\bfseries SZ�MLA} \\
   \end{center}

   \mbox{}\hfill <?lsmb copysum ?>  \\
   \mbox{}\hfill <?lsmb copynumber ?>
  }
}

\newsavebox{\headleft}
\sbox{\headleft}{
  \fontfamily{cmss}\fontsize{10pt}{12pt}\selectfont
  \parbox{\textwidth}{
%  \includegraphics[scale=.5]{/tmp/logo_04.eps} 
  \hfill <?lsmb invnumber ?>\\[-3mm]
  \rule{\textwidth}{.5pt}
  }
}



\markboth{}{\usebox{\headright}}

\pagestyle{myheadings}

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


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

\rule{\textwidth}{1.5pt}
  
  \hfill
  \begin{tabularx}{7cm}{X@{ }r@{}}
  \textbf{R�sz�sszeg} & <?lsmb sumcarriedforward ?> \cr
  \end{tabularx}

\newpage

\markboth{\usebox{\headleft}}{\usebox{\headleft}}

\mbox{}\vspace{.5cm}

\rule{\textwidth}{1.5pt}

\vspace{.3cm}

{\scriptsize
\begin{tabularx}{\textwidth}{>{\hsize=0.4cm\centering}X@{\ }
            >{\hsize=0.9cm\raggedleft}X@{\ }
            >{\hsize=1.9cm\raggedleft}X@{\ }
            >{\hsize=2.9cm\raggedleft}X@{\ }
            >{\hsize=1.9cm\centering}X@{\ }
            >{\hsize=0.9cm\centering}X@{\ }
            >{\hsize=0.5cm\centering}X@{\ }
            >{\hsize=2.0cm\raggedleft}X@{\ }
            >{\hsize=2.0cm\raggedleft}X@{\ }
            >{\hsize=0.8cm\raggedleft}X@{\ }
            >{\hsize=2.0cm\raggedleft}X@{\ }
            >{\hsize=2.0cm\raggedleft}X@{}
           }
  \textbf{no} & \textbf{M�rka} & \textbf{�ru} & \centering\textbf{Megnevez�s} &
  \textbf{VTSZ} & \textbf{Menny.} & \textbf{u} & 
  \textbf{Nett� egys�g�r} & \textbf{Nett� �sszeg} & \textbf{�FA\%} & 
  \textbf{�FA �sszeg} & \textbf{Brutt� �sszeg}
  \cr
  & & \textbf{el�z� oldalr�l} &
  & & &
  & & & 
  & & <?lsmb sumcarriedforward ?>
  \cr
<?lsmb end pagebreak ?>

\mbox{}\vspace{3.5cm}

\rule{\textwidth}{1.5pt}

\vspace{3mm}

\hbox to\hsize{
\begin{minipage}[t]{9.5cm}
\textbf{Elad�:} \\
<?lsmb company ?>\\
<?lsmb address ?>\\
Ad�sz�m: <?lsmb businessnumber ?>\\
tel: <?lsmb tel ?>\\
fax: <?lsmb fax ?>
\end{minipage}
\hfill \
\begin{minipage}[t]{9.5cm}
\textbf{Vev�:} \\
<?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 ?>
\end{minipage}
}


\vspace{5mm}

\rule{\textwidth}{1.5pt}

\vspace{3mm}

\hspace{-3mm}
\begin{tabularx}{\textwidth}{>{\hsize=2.1cm\centering}X@{\ }
                             >{\hsize=2.8cm\centering}X@{\ }
                             >{\hsize=2.8cm\centering}X@{\ }
                             >{\hsize=2.8cm\centering}X@{\ }
                             >{\hsize=3.4cm\centering}X@{\ }
                             >{\hsize=2.5cm\centering}X@{\ }
                             >{\hsize=2.0cm\raggedleft}X@{}}
  \textbf{Fizet�si m�d} & \textbf{Telj.~d�tuma} & \textbf{Sz�mla kelte} &
  \textbf{Esed�kess�g} & \textbf{Megrendel�s} & \textbf{Ki�ll�totta} & \textbf{Sorsz�m} 
  \cr
  <?lsmb shippingpoint ?> & <?lsmb invdate ?> & <?lsmb crdate ?> &
  <?lsmb duedate ?> & <?lsmb ordnumber ?> & <?lsmb employee ?> & <?lsmb invnumber ?>
\end{tabularx}


\vspace{5mm}

\rule{\textwidth}{1.5pt}

\vspace{3mm}

\hspace{-3mm}
{\scriptsize
\begin{tabularx}{\textwidth}{>{\hsize=0.4cm\centering}X@{\ }
                             >{\hsize=0.9cm\raggedright}X@{\ }
                             >{\hsize=1.9cm\raggedright}X@{\ }
                             >{\hsize=2.9cm\raggedright}X@{\ }
                             >{\hsize=1.9cm\centering}X@{\ }
                             >{\hsize=0.9cm\raggedleft}X@{\ }
                             >{\hsize=0.5cm\centering}X@{\ }
                             >{\hsize=2.0cm\raggedleft}X@{\ }
                             >{\hsize=2.0cm\raggedleft}X@{\ }
                             >{\hsize=0.8cm\raggedleft}X@{\ }
                             >{\hsize=2.0cm\raggedleft}X@{\ }
                             >{\hsize=2.0cm\raggedleft}X@{}
                             }
  \centering\textbf{sz.} & \raggedright\textbf{M�rka} & \raggedright\textbf{�ru} & \raggedright\textbf{Megnevez�s} &
  \centering\textbf{VTSZ} & \raggedleft\textbf{Menny.} & \centering\textbf{egys.} & 
  \raggedleft\textbf{Nett� egys�g�r} & \raggedleft\textbf{Nett� �sszeg} & \raggedright\textbf{�FA\%} & 
  \raggedleft\textbf{�FA �sszeg} & \raggedleft\textbf{Brutt� �sszeg}
  \cr
<?lsmb foreach number ?>
  <?lsmb runningnumber ?> & <?lsmb partsgroup ?> & <?lsmb number ?> & <?lsmb description ?> &
  <?lsmb bin ?> & <?lsmb qty ?> & <?lsmb unit ?> &
  <?lsmb netprice ?> & <?lsmb linetotal ?> & <?lsmb linetaxrate ?> & 
  <?lsmb taxamount ?> & <?lsmb linetotal2 ?> 
  \cr
<?lsmb end number ?>
\end{tabularx}
}

\rule{\textwidth}{1.5pt}

\hbox to\hsize{
\hspace{8.4cm}
\begin{minipage}[t]{11cm}

\rule{10.6cm}{1.5pt}

\vspace{.2cm}

\begin{tabularx}{10cm}{>{\hsize=7cm\raggedleft}X>{\hsize=3cm\raggedleft}X}
%\textbf{Total} & <?lsmb invtotal ?> \cr
\textbf{Nett� �sszesen} & <?lsmb subtotal ?> \cr
<?lsmb foreach tax ?>
\textbf{Alap:} <?lsmb taxbase ?> \textbf{r�ta:} <?lsmb taxrate ?> & <?lsmb tax ?> \cr
<?lsmb end tax ?>
<?lsmb if paid ?>
\textbf{Fizetve:} & -<?lsmb paid ?>
<?lsmb end paid ?>
\end{tabularx}

\rule{10.6cm}{1.5pt}
\begin{tabularx}{10cm}{>{\hsize=7cm\raggedleft}X>{\hsize=3cm\raggedleft}X}
\textbf{A sz�mla v�g�sszege} & <?lsmb total ?> \textbf{Ft}
\end{tabularx}

\end{minipage}
}


\vfill
\vspace{1cm}
<?lsmb if notes ?>
\textbf{Megjegyz�s:} <?lsmb notes ?>
\vspace{1cm}
<?lsmb end if ?>


<?lsmb if paid ?>
\textbf{Fizet�sek:}

\rule{12cm}{1.5pt}

\vspace{.2cm}

\begin{tabularx}{12cm}{@{}>{\hsize=2.9cm\centering}X@{\ }
                       >{\hsize=2.9cm\centering}X@{\ }
                       >{\hsize=2.9cm\centering}X@{\ }
                       >{\hsize=2.9cm\raggedleft}X@{}}
  \textbf{D�tum} & \textbf{Sz�mla} & \textbf{Bizonylatsz�m} & \textbf{�sszeg} 
  \cr
<?lsmb end paid ?>
<?lsmb foreach payment ?>
  <?lsmb paymentdate ?> & <?lsmb paymentaccount ?> & <?lsmb paymentsource ?> & <?lsmb payment ?> 
  \cr
<?lsmb end payment ?>  
<?lsmb if paid ?>
\end{tabularx}
<?lsmb end paid ?>  

\vspace{1cm}

<?lsmb intnotes ?>

\end{document}