2 latex.c - Belegloser Datenträgeraustausch mit einer Bank
3 Copyright (c) 2004 Martin Schulze <joey@infodrom.org>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
25 #define LATEX_HEADER "%% Automatically generated by dtaus, requires dtaus.cls from the\n\
26 %% source distribution or derivative class.\n\
28 \\documentclass{dtaus}\n\
34 \\headline{Begleitzettel}\n\
36 \\subheadline{Belegloser Datenträgeraustausch}\n\
39 #define LATEX_FOOTER "\\vfill\n\
48 #define LATEX_TYPE "\\subheadline{%s}\n\n"
50 #define LATEX_TAB_BEGIN "\\begin{tabular}{l@{ : }l}\n"
51 #define LATEX_TAB_END "\\end{tabular}\n\n"
52 #define LATEX_TAB_ROW "\\tabline{%s}{%s}\n"
54 void generate_latex_receipt (
71 if (!(f = fopen(fname, "w"))) {
72 fprintf (stderr, "Cannot open LaTeX output file %s, ignoring.\n", fname);
77 fprintf (f, LATEX_HEADER);
78 fprintf (f, LATEX_TYPE, type);
80 fprintf (f, LATEX_TAB_BEGIN);
81 fprintf (f, LATEX_TAB_ROW, "VOL", "");
82 fprintf (f, LATEX_TAB_ROW, "Erstellungsdatum", created);
84 fprintf (f, LATEX_TAB_ROW, "Ausführugsdatum", todo);
85 fprintf (f, LATEX_TAB_ROW, "Währung", currency);
86 snprintf (tmp, sizeof (tmp), "%d", quantity);
87 fprintf (f, LATEX_TAB_ROW, "Anzahl", tmp);
88 fprintf (f, LATEX_TAB_ROW, "Summe", sum_val);
89 fprintf (f, LATEX_TAB_ROW, "Kontrollsumme Kontonummern", sum_kto);
90 fprintf (f, LATEX_TAB_ROW, "Kontrollsumme Bankleitzahlen", sum_blz);
91 fprintf (f, LATEX_TAB_ROW, "Unsere Kontonummer", kto);
92 fprintf (f, LATEX_TAB_ROW, "Unsere Bankleitzahl", blz);
93 fprintf (f, LATEX_TAB_END);
95 fprintf (f, LATEX_FOOTER);
100 /* --------------------
101 \subheadline{Sammeleinziehungsauftrag}
103 \begin{tabular}{l@{ : }l}
105 \tabline{Erstellungsdatum}{05.08.04}
106 \tabline{Ausführugsdatum}{24.12.2001}
107 \tabline{Währung}{Euro}
109 \tabline{Summe}{50.00}
110 \tabline{Kontrollsumme Kontonummern}{2469134}
111 \tabline{Kontrollsumme Bankleitzahlen}{94221630}
112 \tabline{Unsere Kontonummer}{0000123545}
113 \tabline{Unsere Bankleitzahl}{02004002}
115 -------------------- */