Anzahlungsrechnung: Bei Schlussrechnung das Transferkonto ausgleichen
[kivitendo-erp.git] / templates / print / marei / kivitendo.sty
1 \ProvidesFile{kivitendo.sty}
2 \usepackage{colortbl}
3 \usepackage{eurosym}
4 \usepackage{german}
5 \usepackage{graphicx}
6 \usepackage{ifthen}
7 \usepackage{iftex}
8 %Compilerunabhängigkeit
9 \ifPDFTeX
10   \usepackage[utf8]{inputenc}
11   \usepackage[T1]{fontenc}
12 \fi
13 \usepackage{latexsym}
14 \usepackage{longtable}
15 \usepackage{textcomp}
16
17 %% Paketoptionen
18 \newboolean{defaultbg}\setboolean{defaultbg}{true}
19 \newboolean{draftbg}
20 \newboolean{reqspeclogo}
21 \newboolean{secondpagelogo}
22 \DeclareOption{nologo}{\setboolean{defaultbg}{false}}
23 \DeclareOption{draftlogo}{\setboolean{defaultbg}{false}\setboolean{draftbg}{true}}
24 \DeclareOption{reqspeclogo}{\setboolean{reqspeclogo}{true}}
25 \DeclareOption{secondpagelogo}{\setboolean{defaultbg}{false}\setboolean{secondpagelogo}{true}}
26 \ProcessOptions
27
28 %% Seitenlayout
29 \setlength{\voffset}{-1.5cm}
30 \setlength{\hoffset}{-2.5cm}
31 \setlength{\topmargin}{0cm}
32 \setlength{\headheight}{0.5cm}
33 \setlength{\headsep}{1cm}
34 \setlength{\topskip}{0pt}
35 \setlength{\oddsidemargin}{2cm}
36 \setlength{\textwidth}{16.4cm}
37 \setlength{\textheight}{25cm}
38 \setlength{\footskip}{1cm}
39 \setlength{\parindent}{0pt}
40 \setlength{\tabcolsep}{0.2cm}
41
42 \setlength{\unitlength}{1cm}
43
44 \newcommand{\kivitendobgsettings}{%
45   \setlength{\headsep}{2.5cm}
46   \setlength{\textheight}{22.5cm}
47   \setlength{\footskip}{0.9cm}
48 }
49
50 %% Standardschrift Compilerunabhängig
51 \newcommand*{\defaultfont}{\normalfont}
52 \renewcommand*{\familydefault}{\sfdefault}
53 \ifPDFTeX
54 \else
55   \usepackage{fontspec}
56 \fi
57
58 %% Checkboxen
59 \newsavebox{\checkedbox}
60 \savebox{\checkedbox}(0.2,0.4){
61   \put(-0.15,-0.425){$\times$}
62   \put(-0.15,-0.45){$\Box$}
63 }
64 \newsavebox{\uncheckedbox}
65 \savebox{\uncheckedbox}(0.2,0.4){
66   \put(-0.15,-0.45){$\Box$}
67 }
68
69 %% Farben
70 \definecolor{kivitendoorange}{rgb}{1,0.4,0.2}
71 \definecolor{kivitendodarkred}{rgb}{0.49,0,0}
72 \definecolor{kivitendoyellow}{rgb}{1,1,0.4}
73 \definecolor{kivitendobggray}{gray}{0.9}
74 \definecolor{kivitendowhite}{gray}{1}
75
76 %% Kopf- und Fußzeilen
77 \newcommand{\kivitendofirsthead}{}
78 \newcommand{\kivitendofirstfoot}{}
79 \newcommand{\kivitendosecondhead}{}
80 \newcommand{\kivitendosecondfoot}{\centerline{\defaultfont\small Seite \thepage}}
81
82 \newcommand{\myhead}{%
83   \ifthenelse{\boolean{defaultbg}}{%
84     \begin{picture}(0,0)
85       \put(-2.025,-28.1){\includegraphics*[width=\paperwidth,keepaspectratio=true]{images/hintergrund_seite1.png}}
86     \end{picture}%
87   }{}%
88   \ifthenelse{\boolean{secondpagelogo}}{%
89     \begin{picture}(0,0)
90       \put(-2.025,-28.1){\includegraphics*[width=\paperwidth,keepaspectratio=true]{images/hintergrund_seite2.png}}
91     \end{picture}%
92   }{}%
93   \ifthenelse{\boolean{draftbg}}{%
94     \begin{picture}(0,0)
95       \put(-2.025,-26.9){\includegraphics*[width=\paperwidth,keepaspectratio=true]{images/draft.png}}
96     \end{picture}%
97   }{}%
98   \ifthenelse{\boolean{reqspeclogo}}{%
99     \begin{picture}(0,0)
100       \put(3,-22){\includegraphics*[width=13cm,keepaspectratio=true]{images/schachfiguren.jpg}}
101       \put(0.275,-4.1){\colorbox{kivitendoorange}{\begin{minipage}[t][4.5cm]{2.5cm}\hspace*{2.5cm}\end{minipage}}}
102       \put(0.275,-8.8){\colorbox{kivitendodarkred}{\begin{minipage}[t][4.5cm]{2.5cm}\hspace*{2.5cm}\end{minipage}}}
103       \put(0.275,-13.5){\colorbox{kivitendoyellow}{\begin{minipage}[t][4.5cm]{2.5cm}\hspace*{2.5cm}\end{minipage}}}
104     \end{picture}%
105   }{}%
106   \kivitendofirsthead
107 }
108
109 \newcommand{\mysecondhead}{%
110   \ifthenelse{\boolean{defaultbg} \or \boolean{secondpagelogo}}{%
111     \begin{picture}(0,0)
112       \put(-2.025,-28.1){\includegraphics*[width=\paperwidth,keepaspectratio=true]{images/hintergrund_seite2.png}}
113     \end{picture}%
114   }{}%
115   \ifthenelse{\boolean{draftbg}}{%
116     \begin{picture}(0,0)
117       \put(-2.025,-26.9){\includegraphics*[width=\paperwidth,keepaspectratio=true]{images/draft.png}}
118     \end{picture}%
119   }{}%
120   \kivitendosecondhead
121 }
122
123 \newcommand{\myfoot}{\kivitendofirstfoot}
124 \newcommand{\mysecondfoot}{\kivitendosecondfoot}
125
126 \renewcommand{\ps@headings}{%
127   \renewcommand{\@oddhead}{\myhead}
128   \renewcommand{\@evenhead}{\@oddhead}%
129   \renewcommand{\@oddfoot}{\myfoot}
130   \renewcommand{\@evenfoot}{\@oddfoot}%
131 }
132
133 \renewcommand{\ps@plain}{%
134   \renewcommand{\@oddhead}{\mysecondhead}
135   \renewcommand{\@evenhead}{\@oddhead}%
136   \renewcommand{\@oddfoot}{\mysecondfoot}
137   \renewcommand{\@evenfoot}{\@oddfoot}%
138 }
139
140 \pagestyle{plain}
141 \thispagestyle{headings}
142
143 % Abschnitte mit Kasten hinterlegt
144
145 \newcommand{\reqspecsectionstyle}{%
146   \renewcommand{\thesection}{\alph{section}}
147   \makeatletter
148   \def\section{\@ifstar\unnumberedsection\numberedsection}
149   \makeatother
150 }
151
152 \makeatletter
153 \def\numberedsection{\@ifnextchar[%]
154 \numberedsectionwithtwoarguments\numberedsectionwithoneargument}
155 \def\unnumberedsection{\@ifnextchar[%]
156 \unnumberedsectionwithtwoarguments\unnumberedsectionwithoneargument}
157 \def\numberedsectionwithoneargument#1{\numberedsectionwithtwoarguments[#1]{#1}}
158 \def\unnumberedsectionwithoneargument#1{\unnumberedsectionwithtwoarguments[#1]{#1}}
159 \def\numberedsectionwithtwoarguments[#1]#2{%
160   \ifhmode\par\fi
161   \removelastskip
162   \vskip 3ex\goodbreak
163   \refstepcounter{section}%
164   \noindent
165   \begingroup
166   \leavevmode\Large\bfseries\raggedright
167   \begin{picture}(0,0)
168     \put(0,0){\colorbox{kivitendoorange}{\parbox{0.7cm}{\hspace*{0.7cm}\\\vspace*{0.2cm}}}}
169   \end{picture}%
170   \hspace*{0.3cm}\textcolor{white}{\thesection{}.}%
171   \quad%
172   #2
173   \par
174   \endgroup
175   \vskip 2ex\nobreak
176   \addcontentsline{toc}{section}{\protect\numberline{\thesection{}.}#1}%
177 }
178 \def\unnumberedsectionwithtwoarguments[#1]#2{%
179   \ifhmode\par\fi
180   \removelastskip
181   \vskip 3ex\goodbreak
182   \noindent
183   \begingroup
184   \leavevmode\Large\bfseries\raggedright
185   \leavevmode\Large\bfseries\raggedright
186   #2
187   \par
188   \endgroup
189   \vskip 2ex\nobreak%
190 }
191 \makeatother