/*
** Druckerausgaben
**
** Copyright (C) 1996 by Stefan Scherer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for non-commerical use and without fee is hereby granted,
** provided that the above copyright notice appear in all copies and that
** both that copyright notice and this permission notice appear in
** supporting documentation.  This software is provided "as is" without
** express or implied warranty.
*/

#ifndef PRINT_H
#define PRINT_H

#include "Config.h"

#define MAX_PRINT_LEN 100

/* Druckmodi für das Formular */

enum
  {
    PRT_MODE_INVOICE,		/* Rechnung              R */
    PRT_MODE_DELIVERY,		/* Lieferschein          L */
    PRT_MODE_ORDER,		/* Bestellung            B */
    PRT_MODE_CONFIRMATION,	/* Auftragsbestätigung   A */
    PRT_MODE_OFFER		/* Angebot               O */
  };


/* Fehlercodes */

enum
  {
    ERR_PRINT_OK,		/* kein Fehler aufgetreten */
    ERR_PRINT_TEX,		/* Fehler beim TeX-Lauf */
    ERR_PRINT_PATH,		/* Fehler beim Suchen des Pfades "TeX:" */
    ERR_PRINT_CON,		/* Fehler beim Öffnen der Console */
    ERR_PRINT_INTERNAL,		/* Fehler innerhalb des TeX-Moduls */
    ERR_PRINT_PRINTING,		/* Fehler beim Ausdruck */
    ERR_PRINT_SAVE,		/* Fehler beim Schreiben "TeX:invoice.tex" */
  };


/* o-functions */

int P_Print (UWORD mode, STRPTR pubname,
	     int (*getfunc) (UWORD, void *),
	     struct MinCustomer *cust, UWORD count, STRPTR number,
	     STRPTR invdate, STRPTR orddate, double mwst1, double mwst2,
	     BOOL justshow);
int P_PrintLetter (STRPTR pubname, struct MinCustomer *cust, STRPTR number,
		STRPTR letdate, STRPTR refdate, STRPTR text, BOOL justshow);
int P_SaveConfig (void);
int P_PrintTest (STRPTR pubname);
int P_PrintLabel (STRPTR pubname, UWORD col, UWORD line, STRPTR s1,
		  STRPTR s2, STRPTR s3, STRPTR s4, STRPTR s5);
int P_PrintVisit (STRPTR pubname, UWORD col, UWORD line);
STRPTR P_GetErrorMsg (void);

int P_PrintCust (ULONG mode, ULONG list, STRPTR str, STRPTR pubname);
int P_PrintArticle (ULONG mode, STRPTR str, STRPTR pubname);

int P_PrintList (ULONG mode, STRPTR pubname);

#endif /* PRINT_H */
