All pastes #898954 Raw Edit

Something

public text v1 · immutable
·published 2008-02-10 19:28 UTC
rendered paste body
\documentclass[11pt,twoside,a4paper]{article}
\usepackage{a4wide,amsmath,amssymb}
\usepackage{invoice}

\usepackage{ifthen}
\usepackage{calc}

\newcounter{bh}
\newcounter{bm}
\newcounter{eh}
\newcounter{em}
\newcounter{dh}
\newcounter{dm}
\newcounter{hrdec}


\def\timediff#1:#2-#3:#4 {%
	\setcounter{bh}{#1}
	\setcounter{bm}{#2}
	\setcounter{eh}{#3}
	\setcounter{em}{#4}
	\ifthenelse{\value{eh}>\value{bh}\and\value{em}>\value{bm}}
		{\setcounter{dh}{\value{eh}-\value{bh}}
		 \setcounter{dm}{\value{em}-\value{bm}}}
			{\ifthenelse{\value{eh}>\value{bh}\and\value{em}<\value{bm}}
				{\setcounter{dh}{\value{eh}-\value{bh}-1}
				 \setcounter{dm}{60+\value{em}-\value{bm}}}
				{\ifthenelse{\value{eh}<\value{bh}\and\value{em}>\value{bm}}
				 {\setcounter{dh}{24+\value{eh}-\value{bh}}
				  \setcounter{dm}{\value{em}-\value{bm}}}
				{\ifthenelse{\value{eh}<\value{bh}\and\value{em}<\value{bm}}
					{\setcounter{dh}{23+\value{eh}-\value{bh}}
					 \setcounter{dm}{60+\value{em}-\value{bm}}}}}{}}
		\setcounter{hrdec}{\value{dm}*5/3}
		\thedh.\thehrdec}

\begin{document}

\newcounter{X}
\setcounter{X}{\timediff10:15-16:00}

\timediff10:15-16:00\\
\theX{X}\\
\begin{invoice}{EUR}{0}
	\ProjectTitle{Rechnung }%
		%    Contents                    Rate/Unit Count
		\Fee{ab.cd.de}     {12.5}   {\timediff10:15-16:00}
%		\Fee{ab.cd.de}     {12.5}   {\theX}
		\Fee{ab.cd.de}     {12.5}   {10}
	\ProjectTitle{Sales Restructuring}%
		%    Contents                    Rate/Unit Count
		\Fee{Sales Structure Analysis}   {2750.00} { 6}
		\Fee{Negotiation with Agents}    {2750.00} { 3}
\end{ivoice}

\end{document}