2 dtaus.c - Datenträgeraustausch mit einer Bank
3 Copyright (c) 1996,8 Martin Schulze <joey@artis.uni-oldenburg.de>
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.
31 * First: Some control structures
37 unsigned short int pos;
38 unsigned short int len;
50 dtaus_record recA[] = {
52 {"Name", 23, 27, REQ},
53 {"Konto", 60, 10, REQ},
55 {"Referenz", 70, 10, OPT},
56 {"Datum", 50, 6, IGN},
57 {"Euro", 127, 1, OPT},
70 dtaus_record recC[] = {
71 {"Name", 93, 27, REQ},
72 {"Konto", 21, 10, REQ},
74 {"Transaktion", 44, 5, REQ},
75 {"Betrag", 50, 11, REQ},
76 {"Zweck", 155, 27, REQ},
77 {"myName", 128, 27, OPT},
78 {"myKonto", 69, 10, OPT},
79 {"myBLZ", 61, 8, OPT},
80 {"Euro", 182, 1, IGN},
81 {"Text", 187, 29, OPT},
82 {"Extension", 216, 29, OPT},
100 dtaus_record recE[] = {
101 {"Anzahl", 10, 7, IGN},
102 {"Summe", 17, 13, IGN},
103 {"Kontos", 30, 17, IGN},
104 {"BLZs", 47, 17, IGN},
115 * Second: Some low level routines
118 size_t dtaus_nextrec (void **buf, FILE *f)
121 return fread(buf, 128, 1, f);
124 char *upcase(char *s)
130 for (cp=s,xp=x; *cp; cp++,xp++) {
131 if (strchr(" 0123456789.,&-/+*$%ABCDEFGHIJKLMNOPQRSTUVWXYZ",*cp)) {
133 } else if (strchr("abcdefghijklmnopqrstuvwxyz",*cp)) {
135 } else if (strchr ("üÜäÄöÖß", *cp)) {
137 case 'ü': *(xp++) = 'U'; *xp='E'; break;
138 case 'Ü': *(xp++) = 'U'; *xp='E'; break;
139 case 'ä': *(xp++) = 'A'; *xp='E'; break;
140 case 'Ä': *(xp++) = 'A'; *xp='E'; break;
141 case 'ö': *(xp++) = 'O'; *xp='E'; break;
142 case 'Ö': *(xp++) = 'O'; *xp='E'; break;
143 case 'ß': *(xp++) = 'S'; *xp='S'; break;
153 char *downcase(char *s)
166 char *strip_spaces (char *s)
171 for (i=strlen(s);(s[i-1] == ' '||s[i-1] == '\t')&&i>0; i--)
173 for (p=s; *p==' '; p++);
177 char *strip_zeros (char *s)
181 for (p=s; *p=='0'; p++);
185 char dtaus_char(void *buf, unsigned int pos)
191 memcpy(&res, bufp, 1);
195 char *string2real(char *s)
201 strncpy(res, s, strlen(s)-2);
202 res[strlen(s)-2] = '.';
203 res[strlen(s)-1] = s[strlen(s)-2];
204 res[strlen(s)] = s[strlen(s)-1];
208 char *real2string(char *s)
214 for (cp=res; *cp&&!(*cp == ',')&&!(*cp == '.');cp++);
221 char *string2trans (char *s)
226 if (!strcmp(s, "04000"))
227 sprintf (res, "Abbuchung");
228 else if (!strcmp(s, "05000"))
229 sprintf (res, "Einzug");
230 else if (!strcmp(s, "05005"))
231 sprintf (res, "E-Cash");
232 else if (!strcmp(s, "05006"))
233 sprintf (res, "E-Cash-A");
234 else if (!strcmp(s, "51000"))
235 sprintf (res, "Gutschrift");
236 else if (!strcmp(s, "53000"))
237 sprintf (res, "Lohn");
238 else if (!strncmp(s, "5400", 4))
239 sprintf (res, "Vermögen");
240 /* else if (!strcmp(s, "56000"))
241 sprintf (res, ""); / * Überweisung öffentlicher Kassen */
245 char *trans2string (char *s)
250 if (!strcmp(s, "Abbuchung"))
251 sprintf (res, "04000");
252 else if (!strcmp(s, "Einzug"))
253 sprintf (res, "05000");
254 else if (!strcmp(s, "E-Cash"))
255 sprintf (res, "05005");
256 else if (!strcmp(s, "E-Cash-A"))
257 sprintf (res, "05006");
258 else if (!strcmp(s, "Gutschrift"))
259 sprintf (res, "51000");
260 else if (!strcmp(s, "Lohn"))
261 sprintf (res, "53000");
262 else if (!strncmp(s, "Vermögen", 4))
263 sprintf (res, "5400");
264 /* else if (!strcmp(s, ""))
265 sprintf (res, "56000"); / * Überweisung öffentlicher Kassen */
269 char *string2ext (char *s)
274 if (!strcmp(s, "01"))
275 sprintf (res, "Klient");
276 else if (!strcmp(s, "02"))
277 sprintf (res, "Text");
278 else if (!strcmp(s, "03"))
279 sprintf (res, "Auftraggeber");
283 char *ext2string (char *s)
288 if (!strcmp(s, "Klient"))
290 else if (!strcmp(s, "Text"))
292 else if (!strcmp(s, "Auftraggeber"))
297 unsigned long int dtaus_int(void *buf, unsigned int pos, unsigned int len)
301 static unsigned long int res;
304 memcpy(tmp, bufp, len);
306 sscanf(tmp, "%lu", &res);
311 * returns the first word in this line, returns it and shortens the
314 char *extract_ident (char *line)
317 static char word[30];
319 if (strlen(line) > 0) {
320 x = index (line, ' ');
321 y = index (line, '\t');
324 strncpy(word, line, 29);
329 /* Check which index returns the lower value, and check if the
331 if ((c = (x && x<y)?x:(y?y:x))) {
332 strncpy(word, line, c - line);
334 for (;*c == '\t' || *c == ' '; c++);
335 for (x=line; *c; c++,x++)
338 strcpy(word, downcase(word));
347 * Pads a string with zero's on the left side.
349 char *padzeroclip (char *s, int len)
353 if (strlen(s) == len) return s;
354 if (strlen(s) > len) {
362 for (p=s+strlen(s)-1;p>=s;p--)
364 for (;q>=s;) *(q--)='0';
368 int rec_index(char *ident, int type)
371 dtaus_record *rec = NULL;
374 case REC_A: rec = recA; break;
375 case REC_C: rec = recC; break;
376 case REC_E: rec = recE; break;
379 for (i=0; (rec[i].name); i++) {
380 if (!strcmp(ident, downcase(rec[i].name)))
387 size_t control_nextline (void **buf, int len, FILE *f)
394 bzero (line, sizeof(line));
398 while (!strlen(line) && (cp = fgets(line, 100, f))) {
400 if (line[0] != '#') {
401 if (line[strlen(line)-1] != '\n') {
403 while (tmp[strlen(tmp)-1] != '\n' && (cp = fgets(tmp, 100, f)));
405 line[strlen(line)-1] = '\0';
406 if (line[strlen(line)-1] == '
\r')
407 line[strlen(line)-1] = '\0';
408 for (i=strlen(line);(line[i-1] == ' '||line[i-1] == '\t')&&i>0; i--)
416 for (cp=line; *cp==' '; cp++);
419 memcpy(buf, cp, strlen(cp));
431 timer = time ( NULL );
432 loctime = localtime(&timer);
433 sprintf(res, "%02d.%02d.%02d", loctime->tm_mday, loctime->tm_mon+1, loctime->tm_year);
437 void dtaus_prepareA(char *buf)
445 timer = time ( NULL );
446 loctime = localtime(&timer);
453 for (i=15;i<15+8; i++) buf[i] = '0';
454 sprintf(tmp, "%02d%02d%2d", loctime->tm_mday, loctime->tm_mon+1, loctime->tm_year);
455 for (i=0; i<6; i++) buf[50+i] = tmp[i];
456 for (i=56;i<56+4; i++) buf[i] = ' ';
457 for (i=70;i<70+10; i++) buf[i] = '0';
458 for (i=80;i<80+48; i++) buf[i] = ' ';
461 void dtaus_prepareC(char *buf)
471 for (i=31;i<31+13; i++) buf[i] = '0';
473 for (i=79;i<79+11; i++) buf[i] = '0';
474 for (i=90;i<90+3; i++) buf[i] = ' ';
475 for (i=120;i<120+8; i++) buf[i] = ' ';
476 for (i=182;i<182+3; i++) buf[i] = ' ';
477 for (i=185;i<185+2; i++) buf[i] = '0';
478 for (i=187;i<187+(29*2); i++) buf[i] = ' ';
479 for (i=245;i<245+11; i++) buf[i] = ' ';
482 void dtaus_prepareE(char *buf)
492 for (i=5;i<5+5; i++) buf[i] = ' ';
493 for (i=64;i<64+13; i++) buf[i] = '0';
494 for (i=77;i<77+51; i++) buf[i] = ' ';
497 int dtaus_writeA(FILE *f, char **values)
503 for (i=0; (recA[i].name); i++)
504 if ((recA[i].type == REQ) && !values[i]) {
505 fprintf (stderr, "Anfangsdatensatz ist nicht vollständig, kein %s.\n", recA[i].name);
508 if (!(((values[A_TRANS][0] == 'L')||(values[A_TRANS][0] == 'G'))
509 &&((values[A_TRANS][1] == 'B')||(values[A_TRANS][1] == 'K')))) {
510 fprintf (stderr, "Ungueltiger Typ, nur LK, GK, LB oder GB erlaubt.\n");
514 i=A_NAME;if (values[i] && strlen(values[i]) > recA[i].len)
515 values[i][recA[i].len] = '\0';
518 buf[5] = values[A_TRANS][0];
519 buf[6] = values[A_TRANS][1];
520 sprintf (tmp, "%s", padzeroclip(values[A_BLZ],8));
521 for (i=0; i<8; i++) buf[recA[A_BLZ].pos+i] = tmp[i];
522 sprintf (tmp, "%-27s", upcase(values[A_NAME]));
523 for (i=0; i<27; i++) buf[recA[A_NAME].pos+i] = tmp[i];
524 sprintf (tmp, "%s", padzeroclip(values[A_KTO],10));
525 for (i=0; i<10; i++) buf[recA[A_KTO].pos+i] = tmp[i];
531 int dtaus_writeC(FILE *f, char **valuesA, char **values)
538 for (i=0; (recC[i].name); i++)
540 printf ("%s: %s\n", recC[i].name, values[i]);
543 for (i=0; (recC[i].name); i++)
544 if ((recC[i].type == REQ) && !values[i]) {
545 fprintf (stderr, "Datensatz ist nicht vollständig, kein %s.\n", recC[i].name);
548 sprintf (tmp, "%s", trans2string(values[C_TRANS]));
550 fprintf (stderr, "Ungültiger Typ, nur Abbuchung, Einzug, E-Cash, E-Cash-A, Gutschrift und Lohn erlaubt.\n");
554 i=C_TEXT;if (values[i] && strlen(values[i]) > recC[i].len)
555 values[i][recC[i].len] = '\0';
556 i=C_ZWECK;if (values[i] && strlen(values[i]) > recC[i].len)
557 values[i][recC[i].len] = '\0';
558 i=C_MYNAM;if (values[i] && strlen(values[i]) > recC[i].len)
559 values[i][recC[i].len] = '\0';
560 i=C_TEXT;if (values[i] && strlen(values[i]) > recC[i].len)
561 values[i][recC[i].len] = '\0';
562 i=C_EXT;if (values[i] && strlen(values[i]) > recC[i].len)
563 values[i][recC[i].len] = '\0';
566 if (!values[C_TEXT]) {
571 for (i=0; i<5; i++) buf[recC[C_TRANS].pos+i] = tmp[i];
573 sprintf (tmp, "%s", padzeroclip(values[C_MYBLZ],8));
575 sprintf (tmp, "%s", padzeroclip(valuesA[A_BLZ],8));
576 for (i=0; i<recC[C_MYBLZ].len; i++) buf[5+i] = tmp[i];
577 for (i=0; i<recC[C_MYBLZ].len; i++) buf[recC[C_MYBLZ].pos+i] = tmp[i];
578 sprintf (tmp, "%s", padzeroclip(values[C_BLZ],8));
579 for (i=0; i<recC[C_BLZ].len; i++) buf[recC[C_BLZ].pos+i] = tmp[i];
580 sprintf (tmp, "%s", padzeroclip(values[C_KTO],10));
581 for (i=0; i<recC[C_KTO].len; i++) buf[recC[C_KTO].pos+i] = tmp[i];
582 sprintf (tmp, "%s", padzeroclip(real2string(values[C_VAL]),11));
583 for (i=0; i<recC[C_VAL].len; i++) buf[recC[C_VAL].pos+i] = tmp[i];
585 sprintf (tmp, "%s", padzeroclip(values[C_MYKTO],10));
587 sprintf (tmp, "%s", padzeroclip(valuesA[A_KTO],10));
588 for (i=0; i<recC[C_MYKTO].len; i++) buf[recC[C_MYKTO].pos+i] = tmp[i];
589 sprintf (tmp, "%-27s", upcase(values[C_NAME]));
590 for (i=0; i<recC[C_NAME].len; i++) buf[recC[C_NAME].pos+i] = tmp[i];
592 sprintf (tmp, "%-27s", upcase(values[C_MYNAM]));
594 sprintf (tmp, "%-27s", upcase(valuesA[A_NAME]));
595 for (i=0; i<recC[C_MYNAM].len; i++) buf[recC[C_MYNAM].pos+i] = tmp[i];
596 sprintf (tmp, "%-27s", upcase(values[C_ZWECK]));
597 for (i=0; i<recC[C_ZWECK].len; i++) buf[recC[C_ZWECK].pos+i] = tmp[i];
599 if (!values[C_TEXT]) {
600 buf[recC[C_TEXT].pos+0] = ' ';
601 buf[recC[C_TEXT].pos+1] = ' ';
605 buf[recC[C_TEXT].pos+0] = '0';
606 buf[recC[C_TEXT].pos+1] = '2';
607 sprintf (tmp, "%-27s", upcase(values[C_TEXT]));
608 for (i=0; i<recC[C_TEXT].len-2; i++) buf[recC[C_TEXT].pos+2+i] = tmp[i];
614 int dtaus_writeE(FILE *f, int count, bigint sum, bigint blz, bigint kto)
622 sprintf (tmp, "%07d", count);
623 for (i=0; i<recE[E_COUNT].len; i++) buf[recE[E_COUNT].pos+i] = tmp[i];
624 bigint_sprintf (tmp, "%s", sum);
626 for (i=0; i<recE[E_VAL].len; i++) buf[recE[E_VAL].pos+i] = tmp[i];
627 bigint_sprintf (tmp, "%s", sum);
629 for (i=0; i<recE[E_VAL].len; i++) buf[recE[E_VAL].pos+i] = tmp[i];
630 bigint_sprintf (tmp, "%s", kto);
632 for (i=0; i<recE[E_KTO].len; i++) buf[recE[E_KTO].pos+i] = tmp[i];
633 bigint_sprintf (tmp, "%s", blz);
635 for (i=0; i<recE[E_BLZ].len; i++) buf[recE[E_BLZ].pos+i] = tmp[i];
641 void printctln(FILE *f, char *field, char *value)
643 if (strlen(field) && strlen(value))
644 fprintf(f, " %s\t%s\n", field, value);
649 * Third: Some high level routines
652 void dtaus2control (char *cdtaus, char *ccontrol)
654 FILE *fdtaus, *fcontrol;
662 if (!(fdtaus = fopen("DTAUS0.TXT", "r")))
663 if (!(fdtaus = fopen("dtaus0.txt", "r")))
666 if (!(fdtaus = fopen(cdtaus, "r")))
671 if (!(fcontrol = fopen(ccontrol, "w")))
673 if (!(buf = (char *)malloc (512)))
679 if (dtaus_nextrec(buf, fdtaus) == 1) {
680 if (dtaus_char(buf,4) == 'A') {
681 fprintf(fcontrol, "BEGIN {\n");
684 for (index=A_TRANS; index < A_DATE; index++) {
685 bufp = buf + recA[index].pos;
686 memcpy(tmp, bufp, recA[index].len); tmp[recA[index].len] = '\0';
687 printctln(fcontrol, recA[index].name, strip_zeros(strip_spaces(tmp)));
690 index = A_DATE; bufp = buf + recA[index].pos;
691 memcpy(tmp, bufp, recA[index].len); tmp[recA[index].len] = '\0';
692 printctln(fcontrol, recA[index].name, strip_spaces(tmp));
694 index = A_EURO; bufp = buf + recA[index].pos;
695 memcpy(tmp, bufp, recA[index].len); tmp[recA[index].len] = '\0';
696 printctln(fcontrol, recA[index].name, strip_zeros(strip_spaces(tmp)));
698 fprintf(fcontrol, "}\n\n");
700 fprintf (stderr, "Datei fängt nicht mit dem Anfangsdatensatz an.\n");
704 fprintf (stderr, "Der Anfangsdatensatz ist kaputt.\n");
711 if (dtaus_nextrec(buf, fdtaus) == 1) {
712 while (dtaus_char(buf,4) == 'C') {
714 if (dtaus_nextrec(bufp, fdtaus) == 1) {
715 fprintf(fcontrol, "{\n");
717 for (index=C_NAME; index <= C_EURO; index++) {
718 bufp = buf + recC[index].pos;
719 memcpy(tmp, bufp, recC[index].len); tmp[recC[index].len] = '\0';
721 printctln(fcontrol, recC[index].name, strip_zeros(string2real(tmp)));
722 else if (index == C_TRANS)
723 printctln(fcontrol, recC[index].name, strip_zeros(string2trans(tmp)));
725 printctln(fcontrol, recC[index].name, strip_zeros(strip_spaces(tmp)));
728 for (index=C_TEXT; index <= C_EXT; index++) {
729 if (!(dtaus_char(buf,recC[index].pos) == ' ')) {
730 bufp = buf + recC[index].pos;
731 memcpy(x, bufp, 2); tmp[2] = '\0'; bufp+=2;
732 memcpy(tmp, bufp, recC[index].len-2); tmp[recC[index].len-2] = '\0';
733 printctln(fcontrol, string2ext(x), strip_spaces(tmp));
737 countC = dtaus_int(buf, 185, 2);
738 countC = countC<3?0:countC-2/4;
739 countC += countC%4>0?1:0;
740 /* FIXME: Erweiterungsfelder werden ignoriert */
742 fprintf(fcontrol, "}\n");
744 fprintf (stderr, "Der zweite Teil der Transaktion ist kaputt.\n");
747 if (dtaus_nextrec(buf, fdtaus) != 1)
748 bzero (buf, sizeof(buf));
754 * (gelesen ist er eigentlich schon...)
756 if (dtaus_char(buf,4) == 'E') {
757 if (dtaus_char(buf,4) == 'E') {
758 fprintf(fcontrol, "END {\n");
760 for (index=E_COUNT; index <= E_BLZ; index++) {
761 bufp = buf + recE[index].pos;
762 memcpy(tmp, bufp, recE[index].len); tmp[recE[index].len] = '\0';
764 printctln(fcontrol, recE[index].name, strip_zeros(string2real(tmp)));
766 printctln(fcontrol, recE[index].name, strip_zeros(tmp));
769 fprintf(fcontrol, "}\n");
771 fprintf (stderr, "Das ist kein Abschlußdatensatz.\n");
775 fprintf (stderr, "Der Abschlußdatensatz ist leer oder kaputt.\n");
782 int control2dtaus (char *ccontrol, char *cdtaus, char *cbeleg, char *ccheck)
784 FILE *fdtaus, *fcontrol, *fbeleg, *fcheck;
790 char *valA[A_LEN], *valC[C_LEN];
792 bigint sum_val, sum_blz, sum_kto, bi;
795 if (!(fdtaus = fopen("dtaus0.txt", "w")))
798 if (!(fdtaus = fopen(cdtaus, "w")))
801 if (!(fcontrol = fopen("dtaus0.ctl", "r")))
802 if (!(fcontrol = fopen("DTAUS0.CTL", "r")))
805 if (!(fcontrol = fopen(ccontrol, "r")))
808 if (!(fbeleg = fopen("dtaus0.doc", "w")))
811 if (!(fbeleg = fopen(cbeleg, "w")))
816 if (!(fcheck = fopen(ccheck, "w")))
820 if (!(buf = (char *)malloc (512)))
826 bzero(valA, sizeof(valA));
827 control_nextline ((void *)line, 100, fcontrol);
828 ident = extract_ident(line);
829 if (!strcmp(ident, "begin") && (line[0] == '{')) {
830 fprintf(fbeleg, "\n\n");
831 fprintf(fbeleg, "\n Begleitzettel\n\n");
832 fprintf(fbeleg, "\n Belegloser Datentraegeraustausch\n\n");
833 fprintf(fbeleg, "\n Sammeleinziehungsauftrag\n\n");
834 fprintf(fbeleg, "\n VOL ........................:\n");
835 fprintf(fbeleg, "\n Erstellungsdatum ...........: %s\n", get_date());
837 control_nextline ((void *)line, 100, fcontrol);
838 while (strlen(line) && line[0] != '}') {
839 ident = extract_ident(line);
840 if ((recindex = rec_index(ident, REC_A)) != -1)
841 if (recA[recindex].type != IGN)
842 if ((valA[recindex] = (char *)malloc (strlen(line)+1)))
843 strcpy(valA[recindex], line);
844 control_nextline ((void *)line, 100, fcontrol);
846 if (!dtaus_writeA(fdtaus, valA)) {
847 fprintf (stderr, "Konnte den Anfangsdatensatz nicht schreiben.\n");
851 fprintf (fcheck, "\n\n\n");
852 fprintf (fcheck, " Sammeleinzeiehungsauftrag\n\n");
853 fprintf (fcheck, " Erstellungsdatum : %s\n\n\n", get_date());
854 fprintf (fcheck, " %-10s %-8s %-30s %12s\n", "Kontonr.", "BLZ", "Name", "Betrag");
855 fprintf (fcheck, " --------------------------------------------------------------------\n");
857 fprintf (stderr, "Datei fängt nicht mit dem Anfangsdatensatz (BEGIN) an.\n");
865 sum_val = bigint_int(0);
866 sum_blz = bigint_int(0);
867 sum_kto = bigint_int(0);
868 bzero(valC, sizeof(valC));
869 control_nextline ((void *)line, 100, fcontrol);
870 if (line[0] == '{') {
871 while (strlen(line) && line[0] == '{') {
872 control_nextline ((void *)line, 100, fcontrol);
873 while (strlen(line) && line[0] != '}') {
874 ident = extract_ident(line);
875 if ((recindex = rec_index(ident, REC_C)) != -1)
876 if (recC[recindex].type != IGN)
877 if ((valC[recindex] = (char *)malloc (strlen(line)+1)))
878 strcpy(valC[recindex], line);
881 control_nextline ((void *)line, 100, fcontrol);
883 if (!dtaus_writeC(fdtaus, valA, valC)) {
884 fprintf (stderr, "Konnte den regulären Datensatz nicht schreiben.\n");
888 bi = bigint_string(real2string(valC[C_VAL])); sum_val = bigint_add(sum_val, bi);
889 bi = bigint_string(valC[C_BLZ]); sum_blz = bigint_add(sum_blz, bi);
890 bi = bigint_string(valC[C_KTO]); sum_kto = bigint_add(sum_kto, bi);
892 fprintf (fcheck, " %10s %8s %-30s %12s\n", valC[C_KTO], valC[C_BLZ], valC[C_NAME], valC[C_VAL]);
893 for (recindex=0; recindex<C_LEN; recindex++)
895 free(valC[recindex]);
896 bzero(valC, sizeof(valC));
897 control_nextline ((void *)line, 100, fcontrol);
900 fprintf (stderr, "Kein regulärer Datensatz?\n");
907 dtaus_writeE(fdtaus, count, sum_val, sum_blz, sum_kto);
908 fprintf (fcheck, " --------------------------------------------------------------------\n");
909 bigint_sprintf (tmp, "%s", sum_val);
910 fprintf (fbeleg, "\n Anzahl .....................: %d\n", count);
911 recindex=strlen(tmp);
912 tmp[recindex+1] = '\0';
913 tmp[recindex] = tmp[recindex-1];
914 tmp[recindex-1] = tmp[recindex-2];
915 tmp[recindex-2] = '.';
916 fprintf (fcheck, " %-52s %14s\n", "Summe", tmp);
917 fprintf (fbeleg, "\n Summe ......................: %s\n", tmp);
918 bigint_sprintf (tmp, "%s", sum_kto);
919 fprintf (fbeleg, "\n Kontrollsumme Kontonummern .: %s\n", tmp);
920 bigint_sprintf (tmp, "%s", sum_blz);
921 fprintf (fbeleg, "\n Kontrollsumme Bankleitzahlen: %s\n", tmp);
922 fprintf (fbeleg, "\n Unsere Kontonummer .........: %s\n", valA[A_KTO]);
923 fprintf (fbeleg, "\n Unsere Bankleitzahl ........: %s\n", valA[A_BLZ]);
924 fprintf (fbeleg, "\n\n\n\n\n __________________________________________________\n");
925 fprintf (fbeleg, " Ort, Datum Unterschrift\n");
926 for (recindex=0; recindex<A_LEN; recindex++)
928 free(valA[recindex]);