/*
** MUI-Rechnung.h - alle Teile für die Rechnungsliste und die Rechnung in MUI
**
** 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 MUI_RECHNUNG_H
#define MUI_RECHNUNG_H

/* globale Definitionen */

extern APTR TX_I_invnum, TX_I_invdate, TX_I_summe, REG_I_pages, BT_I_cash;
extern APTR BT_I_payall;
extern APTR BT_I_customer, ST_I_adr1, ST_I_adr2, ST_I_adr3, ST_I_adr4;
extern APTR ST_I_adr5, ST_I_kundennr, ST_I_zeichen;
extern APTR LV_I_list, BT_I_insert, BT_I_change, BT_I_delete;
extern APTR ST_I_artnum, BT_I_choose, BT_I_clear;
extern APTR ST_I_article, ST_I_einzel, ST_I_menge, CY_I_mwst, CY_I_mode;
extern APTR TX_I_orddate, TX_I_ordnum;
extern APTR CY_I_pay, ST_I_pay, ST_I_paydate, BT_I_today;
extern APTR BT_I_ok, BT_I_cancel;

extern APTR CY_IL_year, CY_IL_mode;
extern APTR LV_IL_list;
extern APTR BT_IL_new, BT_IL_del, BT_IL_edit, BT_IL_lookord;
extern APTR BT_IL_pay, BT_IL_prtinv, BT_IL_prtlist;

/* von wo aus wurde das Fenster geöffnet, d.h.
** was passiert, wenn die Rechnung geschlossen wird
*/

extern UWORD closeInvoiceAction;
enum
  {
    CIA_MAIN_EDIT,	/* Rechnung wurde vom Hauptfenster geöffnet */
    CIA_MAIN_NEW,	/* neue Rechnung wurde vom Hauptfenster geöffnet */
    CIA_MAIN_ORDINV,	/* neue Rechnung wurde vom Hauptfenster geöffnet und
			   soll aus dem Auftrag erstellt werden */
  };


/* Prototypen */

void Build_IL_years (void);
void Redraw_IL_List (void);
APTR MUI_BuildInvoiceList (void);
void Clear_I_Inputs (void);
BOOL I_CheckAbort (BOOL);
void I_DisplayArticle (void);
void Redraw_I_List (void);
void InitInvoiceWin (void);
APTR MUI_BuildInvoice (void);
void DoInvoiceMethods (void);
void HandleInvoiceEvents (ULONG event);


#endif /* MUI_RECHNUNG_H */
