%{#
    Copyright (c) 2015 Chintalagiri Shashank
    Released under the MIT license
%#}
\documentclass[fontsize = 9pt, DIV=10, oneside, titlepage = false]{scrartcl}
%\usepackage[top=1.5in, bottom=1in, right=1in, left=1in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{}
%\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{array}
\usepackage{multicol}
\usepackage{colortbl}
\usepackage{tfrupee}
\pdfmapfile{=tfrupee.map}
\usepackage{lastpage}

\newcommand{\sno}{%{{stage.sno%}}}

\usepackage[%
  automark,
  headsepline,                %% Separation line below the header
  footsepline,               %% Separation line above the footer
  markuppercase
]{scrpage2}

\lehead{\includegraphics[width=0.12in]{%{{stage.logo%}}}\hspace{0.01in} \tt %{{stage.company%}}}    %% Top left on odd pages
\rohead{\tt %{{stage.company%}}\hspace{0.1in}\includegraphics[width=0.12in]{%{{stage.logo%}}}}      %% Top right on even pages
\lohead{{\small Stock Separation Indent } \sno}    %% Top left on odd pages
\rehead{{\small Stock Separation Indent } \sno}    %% Top right on even pages
\chead{}                       %% Top center
\cfoot{Page \thepage\ of \pageref{LastPage}}

\title{Indent}
\subtitle{%{{stage.title%}}}
\author{}
\date{}

\makeatletter
\renewcommand{\@maketitle}{
\begin{center}
  \ifx\@subject\@empty \else
    {\subject@font \@subject \par}
  \fi
  \titlefont\huge \@title\par
  \ifx\@subtitle\@empty \else
    {\normalsize \@subtitle \par}
  \fi
\end{center}
}
\makeatother

%opening
\begin{document}
\pagestyle{scrheadings}
\maketitle
\thispagestyle{scrheadings}
\begin{center}

\keepXColumns
\renewcommand{\arraystretch}{1.35}
\small
\begin{tabularx}{1.0\textwidth}{>{\raggedleft\arraybackslash}p{0.15\textwidth}>{\raggedright\arraybackslash}p{0.25\textwidth}>{\raggedleft\arraybackslash}p{0.20\textwidth}>{\raggedright\arraybackslash}p{0.25\textwidth}}
\small{Document No:} & {\tt\sno} & Date:& {\tt \today} \\
\small{Indent for:} & \multicolumn{3}{l}{\ttfamily \parbox{0.7\textwidth}{%{{stage.cards%}}}} \\
\end{tabularx}
\renewcommand{\arraystretch}{1.25}
\begin{tabularx}{1.0\textwidth}{|c|>{\raggedright\arraybackslash}p{0.45\textwidth}|>{\centering\arraybackslash}p{0.1\textwidth}|>{\centering\arraybackslash}p{0.1\textwidth}|>{\centering\arraybackslash}p{0.1\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\centering\textbf{S.No.} & \centering\textbf{Item} & \centering\textbf{Qty Required} &\centering\textbf{Recieved} & \centering\textbf{Shortage}\tabularnewline\hline
  %{ for line in stage.lines %}
  \small{%{{loop.index%}}.} & \small{%{{line.ident|escape_latex%}}} & {%{{line.qty%}}} &  &  \tabularnewline\hline 
  %{ endfor %} 
  
\end{tabularx}

\end{center}

\begin{tabularx}{1.0\textwidth}{|>{\centering\arraybackslash}p{0.22\textwidth}|>{\centering\arraybackslash}p{0.22\textwidth}|>{\centering\arraybackslash}p{0.22\textwidth}|>{\centering\arraybackslash}p{0.22\textwidth}|}
\hline
  \small Stock Requested & \small Stock Released & \small Stock Recieved & \small Shortage Acknowledged\\
  & & &\\
  \hline
  \small Date & \small Date & \small Date & \small Date \\
  & & &\\
\hline
\end{tabularx}

\end{document}


