//	****************************************************************************
//	*	$VER: Konten.h 1.08 25.02.2000														*
//	****************************************************************************
//	*	Include für MT-Rechnung III, Enthält die die Klasse(n) für die				*
//	*	Kontenverwaltung, soweit es um reine Datenverarbeitung geht. Für die		*
//	*	Bildschirmdarstellung und ähnliches ist ein anderes Include zuständig.	*
//	****************************************************************************
//	*	Programmiersprache:	C++																*
//	*	Compiler:				Maxon C++ (Version 3.00)									*
//	*	Portierung:				keine AMIGA-spezifischen Teile							*
//	*	Programmierer:			Manfred Tremmel												*
//	****************************************************************************
//    Copyright (C) 1997-2001 Manfred Tremmel
//
//    This program is free software; you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation; either version 2 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program; if not, write to the Free Software
//    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA

// Inventur Daten
class KontenPosDaten
{public:
	UWORD							Status;					// 0	= alles OK
																// 1-0xfffe	= gesperrt
																// 0xffff	= gelöscht
	ULONG							NextKonto;				// Verweis auf das nächste Konto
	TEXT							KontoNr[10];			// Nummer des Kontos
	TEXT							KontoBez[40];			// Bezeichnungen des Kontos
	UBYTE							KontoTyp;				// Art des Kontos
																// 0 = EinnahmeKonto
																// 1 = AusgabeKonto
																// 2 = neutrales Konto
																// 3 = GeldKonto
	UBYTE							KontoMWSt;				// Mehrwertsteuersatz
	UBYTE							KontoGruppe;			// zugeordnete Kontengruppe
};

class MTKonten_Pos
{
 public:
	MTKonten_Pos	*PrevKonto;
	MTKonten_Pos	*NextKonto;

	ULONG				DB_Position;
	KontenPosDaten	ListeKontenDaten;
};

class KontenPos : public DataBase
{
 public:
	KontenPosDaten	*Daten;
	KontenPosDaten	*AltDaten;

	MTKonten_Pos	*FirstKonto;
	MTKonten_Pos	*LastKonto;
	MTKonten_Pos	*AktKonto;

	STRPTR			CycleKonto;
	ULONG				CycleKontoLaenge;
	ULONG				AnzCyclePos;

	KontenPos( STRPTR, STRPTR, UWORD );
	~KontenPos();

	void UpDateElement();

	void LesenKontenListe();
	void AddKonto( ULONG );
	void RemoveKonto();
	void RemoveAllKonten();
	void FindKonto( ULONG );
	void SortinKonto();

	BOOL LoescheKonto( ULONG );
	void NeuesKonto();

	void PrintString( ofstream*, STRPTR );
	void PrintTabelle( ofstream*, UBYTE, ULONG, ULONG, DataBaseSearch*, UWORD*, ULONG );
	void PrintVorbereiten( ofstream*, UBYTE );

	ULONG GetRexx( struct RexxMsg *, ULONG );
	ULONG SetRexx(	struct RexxMsg *, ULONG	);

	UWORD FromCycle( UWORD );
	UWORD ToCycle( UWORD );
	void BuildCycleString();
};

