]> wagnertech.de Git - mfinanz.git/blob - templates/print/RB/purchase_reclamation.tex
date error in mapping
[mfinanz.git] / templates / print / RB / purchase_reclamation.tex
1 % config: use-template-toolkit=1
2 % config: tag-style=$( )$
3 $( USE KiviLatex )$
4 $( USE L )$
5 $( USE LxERP )$
6
7 \input{inheaders.tex}
8 $( KiviLatex.required_packages_for_html )$
9
10 % Variablen, die in settings verwendet werden
11 \newcommand{\lxlangcode} {$( template_meta.language.template_code )$}
12 \newcommand{\lxmedia} {$( media )$}
13 \newcommand{\lxcurrency} {$( reclamation.currency.name )$}
14 \newcommand{\kivicompany} {$( employee_company )$}
15
16 % settings: Einstellungen, Logo, Briefpapier, Kopfzeile, Fusszeile
17 \input{insettings.tex}
18
19 % laufende Kopfzeile:
20 \ourhead{\kundennummer}{$( KiviLatex.filter(reclamation.customervendor.number) )$}{\ekreklamation}{$( KiviLatex.filter(reclamation.record_number) )$}{$( reclamation.transdate_as_date )$}
21
22 \begin{document}
23
24 \ourfont
25 \begin{minipage}[t]{8cm}
26   \scriptsize
27
28   {\color{gray}\underline{\firma\ $\cdot$ \strasse\ $\cdot$ \ort}}
29   \normalsize
30
31   \vspace*{0.3cm}
32
33   $( KiviLatex.filter(reclamation.customervendor.name ) )$
34
35   $( IF (reclamation.customervendor.department_1) )$$( KiviLatex.filter(reclamation.customervendor.department_1) )$\\$( END )$%
36
37   $( IF (reclamation.customervendor.department_2) )$$( KiviLatex.filter(reclamation.customervendor.department_2) )$\\$( END )$%
38
39   $( KiviLatex.filter(reclamation.contact.cp_givenname) )$ $( KiviLatex.filter(reclamation.contact.cp_name) )$
40
41   $( KiviLatex.filter(reclamation.customervendor.street) )$
42
43   ~
44   
45   $( KiviLatex.filter(reclamation.customervendor.zipcode) )$ $( KiviLatex.filter(reclamation.customervendor.city) )$
46
47   $( KiviLatex.filter(reclamation.customervendor.country) )$
48 \end{minipage}
49 \hfill
50 \begin{minipage}[t]{6cm}
51   \hfill{\LARGE\textbf{\ekreklamation}}
52
53   \vspace*{0.2cm}
54
55   \hfill{\large\textbf{\nr ~$( KiviLatex.filter(reclamation.record_number) )$}}
56
57   \vspace*{0.2cm}
58
59   \datum:\hfill $( reclamation.transdate_as_date )$
60
61   \lieferdatum:\hfill $( reclamation.reqdate_as_date )$
62
63   \kundennummer:\hfill $( KiviLatex.filter(reclamation.customervendor.number) )$
64
65   \ansprechpartner:\hfill $( KiviLatex.filter(employee_name) )$
66
67   \textTelefon \hfill $( KiviLatex.filter(employee_tel) )$
68
69   \textEmail \hfill $( KiviLatex.filter(employee_email) )$
70 \end{minipage}
71
72 $( IF (reclamation.shipto.shiptoname) )$%
73   \vspace{0.8cm}
74   \scriptsize \underline{\abweichendeLieferadresse:}\\
75   \normalsize    $( KiviLatex.filter(reclamation.shipto.shiptoname) )$
76
77                  $( IF reclamation.shipto.shiptocontact )$ $( KiviLatex.filter(reclamation.shipto.shiptocontact) )$$( END )$
78
79                  $( KiviLatex.filter(reclamation.shipto.shiptodepartment_1) )$
80
81                  $( KiviLatex.filter(reclamation.shipto.shiptodepartment_2) )$
82
83                  $( KiviLatex.filter(reclamation.shipto.shiptostreet) )$
84
85                  $( KiviLatex.filter(reclamation.shipto.shiptozipcode) )$ $( KiviLatex.filter(reclamation.shipto.shiptocity) )$
86 $( END )$
87 \vspace*{1.5cm}
88
89 \hfill
90
91 % Bei Kontaktperson Anrede nach Geschlecht unterscheiden.
92 % Bei natürlichen Personen persönliche Anrede, sonst allgemeine Anrede.
93 \ifthenelse{\equal{$( reclamation.contact.cp_name )$}{}}{
94   $( IF reclamation.customervendor.natural_person )$$( KiviLatex.filter(reclamation.customervendor.greeting) )$ $( KiviLatex.filter(reclamation.customervendor.name) )$,$( ELSE )$\anrede$( END )$}{
95   \ifthenelse{\equal{$( reclamation.contact.cp_gender )$}{f}}
96     {\anredefrau}{\anredeherr} $( KiviLatex.filter(reclamation.contact.cp_title) )$ $( KiviLatex.filter(reclamation.contact.cp_name) )$,}\\
97
98 \ekreklamationsformel\\
99
100 \vspace{0.5cm}
101
102 %% Diese Variable kann auf 1 gesetzt werden, wenn Preise angezeigt werden sollen.
103 $( SET show_prices = 0 )$
104
105 %
106 % - longtable kann innerhalb der Tabelle umbrechen
107 % - da der Umbruch nicht von Lx-Office kontrolliert wird, kann man keinen
108 %   Übertrag machen
109 % - Innerhalb des Langtextes $( longdescription )$ wird nicht umgebrochen.
110 %   Falls das gewünscht ist, \\ mit \renewcommand umschreiben (siehe dazu:
111 %   http://www.lx-office.org/uploads/media/Lx-Office_Anwendertreffen_LaTeX-Druckvorlagen-31.01.2011_01.pdf)
112 %
113 \setlength\LTleft\parindent     % Tabelle beginnt am linken Textrand
114 \setlength\LTright{0pt}         % Tabelle endet am rechten Textrand
115 $( IF show_prices -)$
116 \begin{longtable}{@{}rrp{7cm}@{\extracolsep{\fill}}rrr@{}}
117 $( ELSE -)$
118 \begin{longtable}{@{}rrp{10.7cm}@{\extracolsep{\fill}}r@{}}
119 $( END -)$
120
121 % Tabellenkopf
122 \hline
123 $( IF show_prices -)$
124 \textbf{\position} & \textbf{\artikelnummer} & \textbf{\bezeichnung} & \textbf{\menge} & \textbf{\einzelpreis} & \textbf{\gesamtpreis} \\
125 $( ELSE -)$
126 \textbf{\position} & \textbf{\artikelnummer} & \textbf{\bezeichnung} & \textbf{\menge} \\
127 $( END -)$
128 \hline\\
129 \endhead
130
131 % Tabellenkopf erste Seite
132 \hline
133 $( IF show_prices -)$
134 \textbf{\position} & \textbf{\artikelnummer} & \textbf{\bezeichnung} & \textbf{\menge} & \textbf{\einzelpreis} & \textbf{\gesamtpreis} \\
135 $( ELSE -)$
136 \textbf{\position} & \textbf{\artikelnummer} & \textbf{\bezeichnung} & \textbf{\menge} \\
137 $( END -)$
138 \hline\\[-0.5em]
139 \endfirsthead
140
141 $( IF show_prices -)$
142 % Tabellenende
143 \\
144 \multicolumn{6}{@{}r@{}}{\weiteraufnaechsterseite}
145 \endfoot
146
147 % Tabellenende letzte Seite
148 \hline\\
149 \multicolumn{5}{@{}l}{\nettobetrag} & $( reclamation.netamount_as_number )$ \currency\\
150 $( FOREACH tax = reclamation.taxes )$
151 \multicolumn{5}{@{}l}{$( KiviLatex.filter(tax.tax.translated_attribute('taxdescription', reclamation.language_id)) )$} & $( LxERP.format_amount(tax.amount, 2) )$ \currency\\
152 $( END )$
153 \multicolumn{5}{@{}l}{\textbf{\schlussbetrag}} &  \textbf{$( reclamation.amount_as_number )$} \currency\\
154 \hline\hline\\
155 \endlastfoot
156 $( ELSE -)$ %% IF show_prices
157 % Tabellenende
158 \\
159 \multicolumn{4}{@{}r@{}}{\weiteraufnaechsterseite}
160 \endfoot
161
162 % Tabellenende letzte Seite
163 \hline\\
164 \endlastfoot
165 $( END )$ %% IF show_prices
166
167 % eigentliche Tabelle
168 $( FOREACH item = reclamation.items_sorted -)$
169   $( item.position )$ &
170   $( KiviLatex.filter(item.part.partnumber) )$ &
171   \textbf{$( KiviLatex.filter(item.description) )$} &
172   $( item.qty_as_number )$ $( KiviLatex.filter(item.unit_obj.get_translation(reclamation.language_id, item.qty)) )$ $( IF show_prices -)$ &
173   $( item.sellprice_as_number )$ \currency &
174   \ifthenelse{\equal{$( item.discount )$}{0}}{}{\sffamily\scriptsize{(-$( item.discount_as_percent )$ \%)}}
175   \ourfont{$( LxERP.format_amount(item.linetotal, 2) )$ \currency} $( END -)$\\*  % kein Umbruch nach der ersten Zeile, damit Beschreibung und Langtext nicht getrennt werden
176
177   $( IF item.longdescription )$ && \scriptsize $( KiviLatex.filter_html(item.longdescription) )$\\$( END )$
178   $( IF item.reqdate )$         && \scriptsize \lieferdatum: $( item.reqdate_as_date )$\\$( END )$
179   $( IF item.serialnumber )$    && \scriptsize \seriennummer: $( KiviLatex.filter(item.serialnumber) )$\\$( END )$
180   $( IF item.part.ean )$        && \scriptsize \ean: $( KiviLatex.filter(item.part.ean) )$\\$( END )$
181   $( IF item.projectnumber )$   && \scriptsize \projektnummer: $( KiviLatex.filter(item.projectnumber) )$\\$( END )$
182   $( IF item.part.customerprices.size )$
183     $( FOREACH customerprice = item.part.customerprices )$
184       $( IF customerprice.customer_id == reclamation.customervendor.id )$
185         && \kundenartnr: $( KiviLatex.filter(customerprice.customer_partnumber) )$\\
186         $( LAST )$
187       $( END )$
188     $( END )$
189   $( END )$
190
191   $( IF (item.reason.description) )$     && \scriptsize \grund: $( KiviLatex.filter(item.reason.description) )$\\$( END )$
192   $( IF (item.reason_description_ext) )$ && \scriptsize $( KiviLatex.filter(item.reason_description_ext) )$\\$( END )$
193   \\[-0.8em]
194 $( END )$
195
196 \end{longtable}
197
198
199 \vspace{0.2cm}
200
201 $( IF reclamation.notes )$
202   \vspace{5mm}
203   $( KiviLatex.filter_html(reclamation.notes) )$
204 \vspace{5mm}
205 $( END )$
206
207 $( IF reclamation.delivery_term )$
208   \lieferung ~$( KiviLatex.filter(reclamation.delivery_term.translated_attribute('description_long', reclamation.language_id)) )$\\
209 $( END )$
210
211 \gruesse \\ \\ \\
212 $( KiviLatex.filter(employee_name) )$
213
214 \end{document}
215