<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="25" zv="Cache for Windows (x86-64) 2011.1.2 (Build 701U)" ts="2011-12-12 15:27:52">
<Class name="DBCore.AF.AbteilungAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61298,40941.38361</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, 
		Abteilungnr, 
		DBCore.Abteilung_GetBezeichnungClass(%ID, :MandOid, :Lang) As Bezeichnung 
	FROM DBCore.Abteilung 
	WHERE Mandant=:MandOid
	ORDER BY Abteilungnr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Abteilungnr AS Nr,
	DBCore.Abteilung_GetBezeichnungClass(%ID, :MandOid, :Lang) As wert1, "" As wert2
	FROM DBCore.Abteilung 
	WHERE Mandant = :MandOid
	ORDER BY Abteilungnr</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.AppEinstellungAF">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>60926,42545.332741</TimeCreated>

<Query name="GetSetting">
<Type>%SQLQuery</Type>
<FormalSpec>einstellung:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, StringWert, FloatWert, DoubleWert, ShortWert, IntWert, LongWert, BoolWert, DateWert FROM DBCore.AppEinstellung WHERE Einstellung = :einstellung Order By ID</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.BankenstammAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61151,61883.248806</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID,
		Adresse1,
		Adresse2,
		BankInstitut,
		Bankengruppe,
		ClearingNr,
		ClearingNrNeu,
		ClearingTyp,
		EuroSICTeilnahme,
		Fax,
		FilialID,
		Hauptsitznummer,
		Kurzbezeichnung,
		LandISO,
		Landesvorwahl,
		Ort,
		Plz,
		Postkonto,
		RecGueltigAbDatum,
		SICNummer,
		SICTeilnahme,
		SWIFTAdresse,
		Sprachcode,
		Telefon
	 FROM DBCore.Bankenstamm 
	 ORDER BY ClearingNr</SqlQuery>
</Query>

<Query name="ListeNachClearingNr">
<Type>%SQLQuery</Type>
<FormalSpec>ClearingNr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID,
		Adresse1,
		Adresse2,
		BankInstitut,
		Bankengruppe,
		ClearingNr,
		ClearingNrNeu,
		ClearingTyp,
		EuroSICTeilnahme,
		Fax,
		FilialID,
		Hauptsitznummer,
		Kurzbezeichnung,
		LandISO,
		Landesvorwahl,
		Ort,
		Plz,
		Postkonto,
		RecGueltigAbDatum,
		SICNummer,
		SICTeilnahme,
		SWIFTAdresse,
		Sprachcode,
		Telefon
	 FROM DBCore.Bankenstamm 
	 WHERE ClearingNr = :ClearingNr 
	 ORDER BY ClearingNr</SqlQuery>
</Query>

<Query name="ListeNachPlz">
<Type>%SQLQuery</Type>
<FormalSpec>Plz:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID,
		Adresse1,
		Adresse2,
		BankInstitut,
		Bankengruppe,
		ClearingNr,
		ClearingNrNeu,
		ClearingTyp,
		EuroSICTeilnahme,
		Fax,
		FilialID,
		Hauptsitznummer,
		Kurzbezeichnung,
		LandISO,
		Landesvorwahl,
		Ort,
		Plz,
		Postkonto,
		RecGueltigAbDatum,
		SICNummer,
		SICTeilnahme,
		SWIFTAdresse,
		Sprachcode,
		Telefon
	 FROM DBCore.Bankenstamm 
	 WHERE Plz = :Plz 
	 ORDER BY ClearingNr</SqlQuery>
</Query>

<Query name="ListeNachOrt">
<Type>%SQLQuery</Type>
<FormalSpec>Ort:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID,
		Adresse1,
		Adresse2,
		BankInstitut,
		Bankengruppe,
		ClearingNr,
		ClearingNrNeu,
		ClearingTyp,
		EuroSICTeilnahme,
		Fax,
		FilialID,
		Hauptsitznummer,
		Kurzbezeichnung,
		LandISO,
		Landesvorwahl,
		Ort,
		Plz,
		Postkonto,
		RecGueltigAbDatum,
		SICNummer,
		SICTeilnahme,
		SWIFTAdresse,
		Sprachcode,
		Telefon
	 FROM DBCore.Bankenstamm 
	 WHERE Ort = :Ort 
	 ORDER BY ClearingNr</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.BenutzerAF">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>60948,39439.472701</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
/*
* Benutzer AF
*
*/
]]></Content>
</UDLText>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Benutzernr, Name, Vorname, Benutzername, TelefonDirekt FROM DBCore.Benutzer ORDER BY Benutzernr</SqlQuery>
</Query>

<Query name="GetBenutzerIdByWindowsbenutzer">
<Type>%SQLQuery</Type>
<FormalSpec>username:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, AutoLogin FROM DBCore.Benutzer WHERE Windowsbenutzer = :username</SqlQuery>
</Query>

<Query name="GetBenutzerByAgrisBenutzername">
<Type>%SQLQuery</Type>
<FormalSpec>username:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Benutzernr FROM DBCore.Benutzer WHERE Benutzername = :username</SqlQuery>
</Query>

<Query name="GetBenutzerByBenutzernr">
<Type>%SQLQuery</Type>
<FormalSpec>benutzernr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Name, Vorname FROM DBCore.Benutzer WHERE Benutzernr = :benutzernr</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.EinstIndWaageAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61558,34012.564986</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, WaageNr, DBCore.EinstIndWaage_GetBezeichnungClass(%ID, :MandOid, :Lang) As Bezeichnung, 
	Standard, ComAnschluss, Baudrate, DatenBit, Parity, StopBit, Empfangmodus
	FROM DBCore.EinstIndWaage WHERE Mandant = :MandOid ORDER BY WaageNr</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.EinstLadenWaageAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61558,56624.987117</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, WaageNr, DBCore.EinstLadenWaage_GetBezeichnungClass(%ID, :MandOid, :Lang) As Bezeichnung, 
	Standard, ComAnschluss, Baudrate, DatenBit, Parity, StopBit
	FROM DBCore.EinstLadenWaage WHERE Mandant = :MandOid ORDER BY WaageNr</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.FeldhilfeFeldAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61524,57930.628258</TimeCreated>

<Query name="Liste">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT Feld, 
			Feld->Controlname As Controlname, 
			LetzteAenderung As LetzteAenderungDE, 
			(SELECT LetzteAenderung 
				FROM DBCore.FeldhilfeStream i 
				WHERE Sprache='it' AND i.Feld = x.Feld) As LetzteAenderungIT 
		FROM DBCore.FeldhilfeStream x WHERE Sprache='de'
		ORDER BY Controlname]]></SqlQuery>
</Query>

<Query name="ListeBySprache">
<Type>%SQLQuery</Type>
<FormalSpec>Classname:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, ControlName, DBCore.FeldhilfeFeld_GetClassNameClass(ID) as ClassName,
			(SELECT LetzteAenderung 
				FROM DBCore.FeldhilfeStream i 
				WHERE Sprache=:Lang AND i.Feld = x.ID) As LetzteAenderung,
			(SELECT LetzterBenutzer 
				FROM DBCore.FeldhilfeStream i 
				WHERE Sprache=:Lang AND i.Feld = x.ID) As LetzterBenutzer,
			(SELECT Status 
				FROM DBCore.FeldhilfeStream i 
				WHERE Sprache=:Lang AND i.Feld = x.ID) As Status
		FROM DBCore.FeldhilfeFeld x WHERE DBCore.FeldhilfeFeld_GetClassNameClass(ID) = :Classname
		ORDER BY Controlname</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.HelpMenuEntryAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61586,39822.332839</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>Sprache:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID,
		ModulNummer,
		Nummer,
		Parent,
		Pfad,
		Sprache,
		Text,
		ToolTipText
	FROM DBCore.HelpMenuEntry 
	WHERE Sprache = :Sprache 
	ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeMasterEntries">
<Type>%SQLQuery</Type>
<FormalSpec>Sprache:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID,
		ModulNummer,
		Nummer,
		Parent,
		Pfad,
		Sprache,
		Text,
		ToolTipText
	FROM DBCore.HelpMenuEntry 
	WHERE Sprache = :Sprache and Parent is null 
	ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeSubEntries">
<Type>%SQLQuery</Type>
<FormalSpec>ParentId:%String,Sprache:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID,
		ModulNummer,
		Nummer,
		Parent,
		Pfad,
		Sprache,
		Text,
		ToolTipText
	FROM DBCore.HelpMenuEntry 
	WHERE Sprache = :Sprache and Parent = :ParentId 
	ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.MandAHVAF">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61025,28912.002567</TimeCreated>

<Query name="GetLnrByMandantAHV">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,AHVNr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Laufnummer, AHVNr FROM DBCore.MandAHV WHERE Mandant = :MandantOid AND AHVNr = :AHVNr</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.MandantAF">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>60948,39419.991854</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
/*
* Mandantenspezifische AF
*
*/
]]></Content>
</UDLText>

<Query name="PListeGesamt">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT 
	ID as "Mandant.ID", 
	Mandantnr as "Mandant.Mandantnr", 
	Anrede as "Mandant.Anrede", 
	Kurzname as "Mandant.Kurzname", 
	Name as "Mandant.Name", 
	Sprachcode as "Mandant.Sprachcode", 
	Strasse as "Mandant.Strasse", 
	Telefon as "Mandant.Telefon", 
	Telefon2 as "Mandant.Telefon2", 
	Fax as "Mandant.Fax", 
	Mobil as "Mandant.Mobil", 
	EMail as "Mandant.EMail", 
	Web as "Mandant.Web", 
	Bemerkung as "Mandant.Bemerkung", 
	Bezeichnung as "Mandant.Bezeichnung", 
	Branchencode as "Mandant.Branchencode", 
	ZuHanden as "Mandant.ZuHanden", 
	PersAnrede as "Mandant.PersAnrede", 
	Gebiet as "Mandant.Gebiet", 
	MwstNummer as "Mandant.MwstNummer", 
	Ablage as "Mandant.Ablage", 
	Plz as "Mandant.Plz",
	UID as "Mandant.UID" 
	FROM DBCore.Mandant ORDER BY Mandantnr</SqlQuery>
</Query>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Mandantnr, Anrede, Kurzname, Name, Sprachcode, 
	Strasse, Telefon, Telefon2, Fax, Mobil, EMail, Web, 
	Bemerkung, Bezeichnung, Branchencode, ZuHanden, 
	PersAnrede, Gebiet, MwstNummer, Ablage, Plz, UID 
	FROM DBCore.Mandant ORDER BY Mandantnr</SqlQuery>
</Query>

<Query name="ListeDruckWithBearbeiter">
<Type>%SQLQuery</Type>
<FormalSpec>vonMandant:%Integer,bisMandant:%Integer,vonDatum:%Date,bisDatum:%Date,sachbearbeiter:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT m.Name as "Mandant.Name",
m.Bezeichnung as "Mandant.Bezeichnung",
j.GeschaeftsjahrBeginn as "Mandant.GeschaeftsjahrBeginn",
j.GeschaeftsjahrEnde as "Mandant.GeschaeftsjahrEnde",
m.Kurzname as "Mandant.Kurzname",
m.Mandantnr as "Mandant.Mandantnr",
m.Mobil as "Mandant.Mobil",
m.Ort as "Mandant.Ort",
m.Plz as "Mandant.Plz",
m.Strasse as "Mandant.Strasse",
m.Telefon as "Mandant.Telefon",
m.Telefon2 as "Mandant.Telefon2",
m.UID as "Mandant.UID"
 FROM DBCore.Mandant m JOIN DBCore.MandantJahr j ON m.ID = j.Mandant
WHERE m.MandantNr <= :bisMandant and m.Mandantnr >= :vonMandant and 
j.GeschaeftsjahrBeginn >= TO_DATE(:vonDatum,'DD.MM.YYYY') and j.GeschaeftsjahrEnde <= TO_DATE(:bisDatum,'DD.MM.YYYY') and 
j.SachbearbeiterNr1 = :sachbearbeiter ORDER BY m.MandantNr]]></SqlQuery>
</Query>

<Query name="ListeDruckWithOutBearbeiter">
<Type>%SQLQuery</Type>
<FormalSpec>vonMandant:%Integer,bisMandant:%Integer,vonDatum:%Date,bisDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT m.Name as "Mandant.Name",
m.Bezeichnung as "Mandant.Bezeichnung",
j.GeschaeftsjahrBeginn as "Mandant.GeschaeftsjahrBeginn",
j.GeschaeftsjahrEnde as "Mandant.GeschaeftsjahrEnde",
m.Kurzname as "Mandant.Kurzname",
m.Mandantnr as "Mandant.Mandantnr",
m.Mobil as "Mandant.Mobil",
m.Ort as "Mandant.Ort",
m.Plz as "Mandant.Plz",
m.Strasse as "Mandant.Strasse",
m.Telefon as "Mandant.Telefon",
m.Telefon2 as "Mandant.Telefon2",
m.UID as "Mandant.UID"
FROM DBCore.Mandant m JOIN DBCore.MandantJahr j ON m.ID = j.Mandant
WHERE m.MandantNr <= :bisMandant and m.Mandantnr >= :vonMandant and 
j.GeschaeftsjahrBeginn >= TO_DATE(:vonDatum,'DD.MM.YYYY') and j.GeschaeftsjahrEnde <= TO_DATE(:bisDatum,'DD.MM.YYYY')
ORDER BY m.MandantNr]]></SqlQuery>
</Query>

<Query name="ListeNachZiffer">
<Type>%SQLQuery</Type>
<FormalSpec>Ziffer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, Mandantnr, Kurzname FROM DBCore.Mandant 
WHERE {fn CONVERT(Mandantnr / 10000, SQL_INTEGER)} = :Ziffer 
AND ID IN (SELECT Mandant FROM DBCore.MandantJahr WHERE NVL(Status,0) <> DBCore.Konst_MANDANTSTATUSINAKTIV() )
ORDER BY Mandantnr]]></SqlQuery>
</Query>

<Query name="ListeRootZiffern">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT DISTINCT {fn CONVERT(Mandantnr / 10000, SQL_INTEGER)} AS Ziffer FROM DBCore.Mandant
WHERE ID IN (SELECT Mandant FROM DBCore.MandantJahr WHERE NVL(Status,0) <> DBCore.Konst_MANDANTSTATUSINAKTIV())
ORDER BY Ziffer]]></SqlQuery>
</Query>

<Query name="GetFirstMandantId">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT TOP 1 ID FROM DBCore.Mandant ORDER BY Mandantnr</SqlQuery>
</Query>

<Query name="ListeNachMandnr">
<Type>%SQLQuery</Type>
<FormalSpec>Mandnr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID FROM DBCore.Mandant WHERE Mandantnr = :Mandnr ORDER BY Mandantnr</SqlQuery>
</Query>

<Query name="ListeNachKurzname">
<Type>%SQLQuery</Type>
<FormalSpec>Kurzname:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Mandantnr, Kurzname, Strasse, Plz, Ort FROM DBCore.Mandant WHERE { fn LCASE(Kurzname)} LIKE { fn LCASE(:Kurzname)} ORDER BY Kurzname</SqlQuery>
</Query>

<Query name="ListeNachName">
<Type>%SQLQuery</Type>
<FormalSpec>Name:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Mandantnr, Kurzname, Strasse, Plz, Ort FROM DBCore.Mandant WHERE {fn LCASE(Name)} LIKE {fn LCASE(:Name)} ORDER BY Name</SqlQuery>
</Query>

<Query name="ListeNachAblage">
<Type>%SQLQuery</Type>
<FormalSpec>Ablage:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Mandantnr, Kurzname, Strasse, Plz, Ort FROM DBCore.Mandant WHERE {fn LCASE(Ablage)} LIKE {fn LCASE(:Ablage)} ORDER BY Ablage</SqlQuery>
</Query>

<Query name="ListeNachSachbearbeiter">
<Type>%SQLQuery</Type>
<FormalSpec>SachbearbeiterNr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT m.ID FROM DBCore.Mandant m JOIN DBCore.MandantJahr j ON m.ID = j.Mandant
	WHERE j.SachbearbeiterNr1 = :SachbearbeiterNr OR j.SachbearbeiterNr2 = :SachbearbeiterNr</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.MandantEinstellungAF">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>60926,42545.332741</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID FROM DBCore.MandantEinstellung WHERE Mandant = :MandantOid</SqlQuery>
</Query>

<Query name="GetSetting">
<Type>%SQLQuery</Type>
<FormalSpec>einstellung:%Integer,MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, StringWert, FloatWert, DoubleWert, ShortWert, IntWert, LongWert, BoolWert, DateWert, TimeWert FROM DBCore.MandantEinstellung WHERE Einstellung = :einstellung  AND Mandant = :MandantOid Order By ID</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.MandantJahrAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61562,42023.780288</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT 
	ID,
	Mandant,
	DBCore.MandantRel_GetMandantnr(Mandant) As MandantNr,
	DBCore.MandantRel_GetMandKurzname(Mandant) As Kurzname,
	DBCore.MandantRel_GetMandName(Mandant) As Name,
	GeschaeftsjahrBeginn,
	GeschaeftsjahrEnde,
	SachbearbeiterNr1,
	SachbearbeiterBenutzername1,
	SachbearbeiterVorname1,
	SachbearbeiterName1,
	SachbearbeiterNr2,
	SachbearbeiterBenutzername2,
	SachbearbeiterVorname2,
	SachbearbeiterName2
	FROM DBCore.MandantJahr ORDER BY MandantNr, GeschaeftsjahrEnde</SqlQuery>
</Query>

<Query name="ListeNachMandant">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 
	ID,
	Mandant,
	DBCore.MandantRel_GetMandantnr(Mandant) As MandantNr,
	DBCore.MandantRel_GetMandKurzname(Mandant) As Kurzname,
	DBCore.MandantRel_GetMandName(Mandant) As Name,
	GeschaeftsjahrBeginn,
	GeschaeftsjahrEnde,
	SachbearbeiterNr1,
	SachbearbeiterBenutzername1,
	SachbearbeiterVorname1,
	SachbearbeiterName1,
	SachbearbeiterNr2,
	SachbearbeiterBenutzername2,
	SachbearbeiterVorname2,
	SachbearbeiterName2
	FROM DBCore.MandantJahr 
	WHERE Mandant = :MandantOid 
	AND NVL(Status,0) <> DBCore.Konst_MANDANTSTATUSINAKTIV() 
	ORDER BY GeschaeftsjahrEnde]]></SqlQuery>
</Query>

<Query name="ListeInaktiveNachMandant">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT 
	ID,
	Mandant,
	DBCore.MandantRel_GetMandantnr(Mandant) As MandantNr,
	DBCore.MandantRel_GetMandKurzname(Mandant) As Kurzname,
	DBCore.MandantRel_GetMandName(Mandant) As Name,
	GeschaeftsjahrBeginn,
	GeschaeftsjahrEnde,
	SachbearbeiterNr1,
	SachbearbeiterBenutzername1,
	SachbearbeiterVorname1,
	SachbearbeiterName1,
	SachbearbeiterNr2,
	SachbearbeiterBenutzername2,
	SachbearbeiterVorname2,
	SachbearbeiterName2
	FROM DBCore.MandantJahr 
	WHERE Mandant = :MandantOid 
	AND NVL(Status,0) = DBCore.Konst_MANDANTSTATUSINAKTIV() 
	ORDER BY GeschaeftsjahrEnde</SqlQuery>
</Query>

<Query name="ListeNachMandantAlle">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT 
	ID,
	Mandant,
	DBCore.MandantRel_GetMandantnr(Mandant) As MandantNr,
	DBCore.MandantRel_GetMandKurzname(Mandant) As Kurzname,
	DBCore.MandantRel_GetMandName(Mandant) As Name,
	GeschaeftsjahrBeginn,
	GeschaeftsjahrEnde,
	SachbearbeiterNr1,
	SachbearbeiterBenutzername1,
	SachbearbeiterVorname1,
	SachbearbeiterName1,
	SachbearbeiterNr2,
	SachbearbeiterBenutzername2,
	SachbearbeiterVorname2,
	SachbearbeiterName2
	FROM DBCore.MandantJahr 
	WHERE Mandant = :MandantOid 
	ORDER BY GeschaeftsjahrEnde</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.MandantSpracheAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61135,59091.277144</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID,Mandant,Code,Sprachkey,Bezeichnung FROM DBCore.MandantSprache WHERE Mandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT Code,Sprachkey AS wert1,Bezeichnung AS wert2 FROM DBCore.MandantSprache WHERE Mandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.MandantUserEinstellungAF">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>60926,42545.332741</TimeCreated>

<Query name="ListeGesamtMandant">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID FROM DBCore.MandantUserEinstellung WHERE Mandant = :MandantOid</SqlQuery>
</Query>

<Query name="GetSetting">
<Type>%SQLQuery</Type>
<FormalSpec>einstellung:%Integer,MandantOid:%String,BenutzerOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, StringWert, FloatWert, DoubleWert, ShortWert, IntWert, LongWert, BoolWert, DateWert FROM DBCore.MandantUserEinstellung WHERE Einstellung = :einstellung  AND Mandant = :MandantOid AND Benutzer = :BenutzerOid Order By ID</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.MitarbeiterAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61536,37165.785231</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, 
		Nummer, 
		Kurzname,
		Anrede,
		Name, 
		Vorname,
		Zusatz,
		Strasse,
		Plz, 
		Ort,
		PersAnrede,
		ZuHanden,
		Telefon1,
		Telefon2,
		Fax,
		Mobil,
		EMail,
		Web,
		Sprachcode,
		Aktiv,
		Beruf,
		TelIntern,
		Visum
	FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeForDropDrown">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT Nummer, Vorname, Name, ID FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeIdsGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid</SqlQuery>
</Query>

<Query name="ListeNachOid">
<Type>%SQLQuery</Type>
<FormalSpec>Oid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, Name, Vorname, Plz, Ort FROM DBCore.Mitarbeiter WHERE ID = :Oid</SqlQuery>
</Query>

<Query name="GetMitarbeiterByNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid AND Nummer = :Nummer</SqlQuery>
</Query>

<Query name="GetFirstMitarbeiterId">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT TOP 1 ID FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeNachKurzname">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Kurzname:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Name, Vorname, Strasse, Plz, Ort, Telefon1 FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid AND { fn LCASE(Kurzname)} LIKE { fn LCASE(:Kurzname)} ORDER BY Kurzname</SqlQuery>
</Query>

<Query name="ListeNachName">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Name:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, Name, Vorname, Strasse, Plz, Ort, Telefon1 FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid AND { fn LCASE(Name)} LIKE { fn LCASE(:Name)} ORDER BY Name</SqlQuery>
</Query>

<Query name="GetEntryByMitarbeiterNr">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Nr:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, Name, Vorname, Plz, Ort, Kurzname
	FROM DBCore.Mitarbeiter
	WHERE Mandant = :MandantOid
	AND Nummer %STARTSWITH :Nr</SqlQuery>
</Query>

<Query name="GetEntryByKurzname">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Kurzname:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT TOP 1 ID, Nummer, Kurzname, Name, Vorname, Plz, Ort 
	FROM DBCore.Mitarbeiter
	WHERE Mandant = :MandantOid
	AND Kurzname LIKE :Kurzname ORDER BY Kurzname</SqlQuery>
</Query>

<Query name="GetEntryByName">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Name:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT TOP 1 ID, Nummer, Kurzname, Name, Vorname, Plz, Ort 
	FROM DBCore.Mitarbeiter
	WHERE Mandant = :MandantOid
	AND Name LIKE :Name ORDER BY Name</SqlQuery>
</Query>

<Query name="ListeNachMandantVonBisNr">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,vonMitarbeiter:%Integer,bisMitarbeiter:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, Name, Vorname,Strasse, Plz, Ort FROM DBCore.Mitarbeiter 
	WHERE Mandant = :MandantOid AND Nummer between :vonMitarbeiter AND :bisMitarbeiter</SqlQuery>
</Query>

<Query name="ListeForDropDrownNachRolle">
<Type>%SQLQuery</Type>
<FormalSpec>RolleOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT Nummer, Vorname, Name, ID 
		FROM DBCore.Mitarbeiter 
		WHERE Benutzer IN (SELECT Benutzer 
								FROM DBCore.Rollenvergabe 
								WHERE Rolle=:RolleOid)
		ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeAlleNachAbteilung">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, 
			Nummer, 
			Vorname, 
			Name,
			Abteilung,
			NVL(Abteilung->Abteilungnr, 0) As Abteilungnr,
			NVL(DBCore.Abteilung_GetBezeichnungClass(Abteilung, :MandantOid, :Lang), '') As AbteilungBezeichnung 
		FROM DBCore.Mitarbeiter 
		WHERE Mandant=:MandantOid
		ORDER BY NVL(Abteilung->Abteilungnr,0), Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.PostleitzahlAF">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>60948,39455.54454</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Plz, PlzInklZusatz, Ort, Kanton, Land, GemNr FROM DBCore.Postleitzahl ORDER BY Ort</SqlQuery>
</Query>

<Query name="GetOrtByPlz">
<Type>%SQLQuery</Type>
<FormalSpec>plz:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Plz, PlzInklZusatz, Ort FROM DBCore.Postleitzahl WHERE Plz LIKE :plz ORDER BY Plz</SqlQuery>
</Query>

<Query name="GetPlzByOrt">
<Type>%SQLQuery</Type>
<FormalSpec>ort:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Plz, PlzInklZusatz, Ort FROM DBCore.Postleitzahl WHERE Ort LIKE :ort ORDER BY Ort</SqlQuery>
</Query>

<Query name="GetOrtByPlzZusatz">
<Type>%SQLQuery</Type>
<FormalSpec>plzzusatz:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Plz, PlzInklZusatz, Ort FROM DBCore.Postleitzahl WHERE PlzInklZusatz LIKE :plzzusatz ORDER BY Plz</SqlQuery>
</Query>

<Query name="GetIdByPlzOrt">
<Type>%SQLQuery</Type>
<FormalSpec>plz:%String,ort:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID FROM DBCore.Postleitzahl WHERE Plz LIKE :plz AND Ort LIKE :ort ORDER BY Plz</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.PrintJobAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62423,62188.583681</TimeChanged>
<TimeCreated>62423,61514.541751</TimeCreated>

<Query name="ListeNachBenutzer">
<Type>%SQLQuery</Type>
<FormalSpec>BenutzerId:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, Name, Status, Error,
	StartTime, PrintTime
	FROM DBCore.PrintJob 
	WHERE Benutzer = :BenutzerId
	ORDER by StartTime DESC</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.RechtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61653,52223.811417</TimeCreated>

<Query name="ListeIdsGlobalNachRolle">
<Type>%SQLQuery</Type>
<FormalSpec>RollenId:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID
	FROM DBCore.RechtGlobal WHERE Rolle = :RollenId</SqlQuery>
</Query>

<Query name="ListeIdsMandNachRolle">
<Type>%SQLQuery</Type>
<FormalSpec>RollenId:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID
	FROM DBCore.RechtMandant WHERE Rolle = :RollenId</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.ReportFooterAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61184,49158.853767</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, DBCore.ReportFooter_GetBezeichnungClass(%ID, :MandOid, :Lang) As Bezeichnung, Format
	FROM DBCore.ReportFooter 
	ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.ReportHeaderAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61136,69983.771894</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, DBCore.ReportHeader_GetBezeichnungClass(%ID, :MandOid, :Lang) As Bezeichnung, Format
	FROM DBCore.ReportHeader 
	ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.ReportMailTextAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61679,57851.372171</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[ 
	SELECT %ID, PositionsNr, 
	DBCore.ReportMailText_GetText1Class(%ID, :MandantOid, :Lang) As Text,
	DBCore.ReportMailText_GetBetreffClass(%ID, :MandantOid, :Lang) As Betreff,
	Mandant
	FROM DBCore.ReportMailText
	WHERE Mandant = :MandantOid 
	AND (LENGTH(DBCore.ReportMailText_GetText1Class(%ID, :MandantOid, :Lang)) > 0)
	ORDER BY PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.ReportSelektionsvorlageAF">
<Super>%Persistent</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>62307,41255.783807</TimeCreated>

<Query name="ListeVorlagen">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,ListenNummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, VorlageNummer, Bezeichnung 
	FROM DBCore.ReportSelektionsvorlage 
	WHERE Mandant = :MandantOid AND
		ListenNummer=:ListenNummer 
	ORDER BY VorlageNummer</SqlQuery>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.AF.ReportSelekDAD7D</DataLocation>
<DefaultData>ReportSelektionsvorlageAFDefaultData</DefaultData>
<IdLocation>^DBCore.AF.ReportSelekDAD7D</IdLocation>
<IndexLocation>^DBCore.AF.ReportSelekDAD7I</IndexLocation>
<StreamLocation>^DBCore.AF.ReportSelekDAD7S</StreamLocation>
<Data name="ReportSelektionsvorlageAFDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.AF.ReportStreamAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62423,61729.714431</TimeChanged>
<TimeCreated>62423,60028.904794</TimeCreated>

<Query name="ListeAlleIDs">
<Type>%SQLQuery</Type>
<SqlProc>1</SqlProc>
<SqlQuery>    SELECT ID
    FROM DBCore.ReportStream</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.ReportTitlepageAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61241,59504.996392</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, DBCore.ReportTitlepage_GetBezeichnungClass(%ID,:MandOid, :Lang) As Bezeichnung, Format
	FROM DBCore.ReportTitlepage 
	ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.RolleAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61501,32495.700021</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBCore.Rolle_GetBezeichnungClass(%ID, :Lang) As Bezeichnung FROM DBCore.Rolle ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBCore.Rolle_GetBezeichnungClass(%ID, :Lang) As Bezeichnung FROM DBCore.Rolle WHERE Nr = :Nr ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeGesamtZuweisung">
<Type>%SQLQuery</Type>
<FormalSpec>Lang:%String,Benutzer:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBCore.Rolle_GetBezeichnungClass(%ID, :Lang) As Bezeichnung, (select count(*) from dbcore.rollenvergabe rv where rv.Rolle = r.ID AND rv.Benutzer = :Benutzer) As zugewiesen FROM DBCore.Rolle r ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeNachBenutzer">
<Type>%SQLQuery</Type>
<FormalSpec>Lang:%String,BenutzerOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT Rolle As ID, 
		Rolle->Nr As Nr, 
		DBCore.Rolle_GetBezeichnungClass(Rolle, :Lang) As Bezeichnung
	FROM DBCore.Rollenvergabe 
	WHERE Benutzer = :BenutzerOid ORDER BY Rolle->Nr]]></SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.RollenvergabeAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>61506,59239.966847</TimeCreated>

<Query name="ListeRollenNachUser">
<Type>%SQLQuery</Type>
<FormalSpec>BenutzerOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT Rolle->ID As RollenId FROM DBCore.Rollenvergabe WHERE Benutzer = :BenutzerOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBCore.AF.UserEinstellungAF">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62417,31506</TimeChanged>
<TimeCreated>60926,42545.332741</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>BenutzerOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID FROM DBCore.UserEinstellung WHERE Benutzer = :BenutzerOid</SqlQuery>
</Query>

<Query name="GetSetting">
<Type>%SQLQuery</Type>
<FormalSpec>einstellung:%Integer,BenutzerOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, StringWert, FloatWert, DoubleWert, ShortWert, IntWert, LongWert, BoolWert, DateWert, TimeWert FROM DBCore.UserEinstellung WHERE Einstellung = :einstellung  AND Benutzer = :BenutzerOid Order By ID</SqlQuery>
</Query>
</Class>


<Class name="DBCore.Abteilung">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62432,29616</TimeChanged>
<TimeCreated>61298,39243.152198</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Abteilungnr">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="999"/>
<Parameter name="MINVAL" value="1"/>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="AbteilungAbzug">
<Type>DBAgrofresh.BenAbzuege</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="GebindeTransport">
<Type>DBAgrofresh.SD.GebTransKosten</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="MargeAbt">
<Type>DBAgrofreshEK.SD.MargeAbt</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="AuftragAbteilung">
<Type>DBAgrofresh.Auftragskopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="AuftragEKAbteilung">
<Type>DBAgrofreshEK.BestellungsKopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBCore.Abteilung).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Abteilungnr) into :nr From DBCore.Abteilung)
	Quit +nr +1
]]></Implementation>
</Method>

<Method name="GetAbteilungOidByAbteilungnr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Abteilungnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	Set oid = ""
	&sql(SELECT ID INTO :oid
		 FROM DBCore.Abteilung
		 WHERE Mandant=:MandantOid AND
		 		Abteilungnr = :Abteilungnr)
		 		
	if (SQLCODE'=0) {
		Set oid = ""
	}
	Quit oid
]]></Implementation>
</Method>

<Property name="BestStrgVorschlag">
<Type>DBAgrofreshEK.BestStrg</Type>
<Cardinality>many</Cardinality>
<Inverse>VorschlagAbteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="QsMeldungVk">
<Type>DBAgrofreshEK.QSMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>VkAbteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="QsMeldungEk">
<Type>DBAgrofreshEK.QSMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>EkAbteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="ChargenEingang">
<Type>DBAgrofreshEK.ChargenEingang</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="ChargenAusgang">
<Type>DBAgrofreshEK.ChargenAusgang</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="FaktAuftragsposAbteilung">
<Type>DBFakturierung.Auftragspos</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="FaktAuftragAbteilung">
<Type>DBFakturierung.Auftragskopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Barkonto">
<Type>DBFibu.Konto</Type>
<Cardinality>one</Cardinality>
<Inverse>AbteilungBarkonto</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Barkonto"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="BarkontoIndex">
<Properties>Barkonto</Properties>
</Index>

<Property name="InventarArtikel">
<Type>DBAgrofresh.ArtikelInventar</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="GebindeInventar">
<Type>DBAgrofresh.GebindeInventar</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="VerbuchungMandantNr">
<Type>%Integer</Type>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Index name="MandantAbteilungIdx">
<Properties>Mandant,Abteilungnr</Properties>
<Unique>1</Unique>
</Index>

<Property name="Mitarbeiter">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>many</Cardinality>
<Inverse>Abteilung</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.AbteilungD</DataLocation>
<DefaultData>AbteilungDefaultData</DefaultData>
<IdLocation>^DBCore.AbteilungD</IdLocation>
<IndexLocation>^DBCore.AbteilungI</IndexLocation>
<StreamLocation>^DBCore.AbteilungS</StreamLocation>
<Data name="AbteilungDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Abteilungnr</Value>
</Value>
<Value name="3">
<Value>Barkonto</Value>
</Value>
<Value name="4">
<Value>MandantNr</Value>
</Value>
<Value name="5">
<Value>VerbuchungMandantNr</Value>
</Value>
<Value name="6">
<Value>Mandant</Value>
</Value>
</Data>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Abteilungnr">
</Property>
<Property name="Barkonto">
</Property>
<Property name="Mandant">
</Property>
<Property name="MandantNr"/>
<Property name="VerbuchungMandantNr">
</Property>
</Storage>
</Class>


<Class name="DBCore.AppEinstellung">
<Description>
</Description>
<Owner>cbt</Owner>
<Super>%Persistent</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>60926,41565.281987</TimeCreated>

<Property name="Einstellung">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Index name="EinstellungIndex">
<Properties>Einstellung</Properties>
<Unique>1</Unique>
</Index>

<Property name="StringWert">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="FloatWert">
<Type>%Library.Float</Type>
</Property>

<Property name="DoubleWert">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="ShortWert">
<Type>%Library.SmallInt</Type>
</Property>

<Property name="IntWert">
<Type>%Library.Integer</Type>
</Property>

<Property name="LongWert">
<Type>%Library.BigInt</Type>
</Property>

<Property name="BoolWert">
<Type>%Library.Boolean</Type>
</Property>

<Property name="DateWert">
<Type>%Library.TimeStamp</Type>
</Property>

<Property name="Beschreibung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="500"/>
</Property>

<Method name="GetIntEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>einstellung:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set intVal = 0
	&sql(SELECT IntWert INTO intVal FROM DBCore.AppEinstellung WHERE Einstellung = :einstellung Order By ID)
	quit intVal
]]></Implementation>
</Method>

<Method name="GetShortEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>einstellung:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set short = 0
	&sql(SELECT ShortWert INTO short FROM DBCore.AppEinstellung WHERE Einstellung = :einstellung Order By ID)
	quit short
]]></Implementation>
</Method>

<Method name="GetStringEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>einstellung:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set string = ""
	&sql(SELECT StringWert INTO string FROM DBCore.AppEinstellung WHERE Einstellung = :einstellung Order By ID)
	quit string
]]></Implementation>
</Method>

<Method name="GetLongEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>einstellung:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set longVal = 0
	&sql(SELECT LongWert INTO longVal FROM DBCore.AppEinstellung WHERE Einstellung = :einstellung Order By ID)
	quit longVal
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.AppEinstellungD</DataLocation>
<DefaultData>AppEinstellungDefaultData</DefaultData>
<IdLocation>^DBCore.AppEinstellungD</IdLocation>
<IndexLocation>^DBCore.AppEinstellungI</IndexLocation>
<StreamLocation>^DBCore.AppEinstellungS</StreamLocation>
<Data name="AppEinstellungDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Einstellung</Value>
</Value>
<Value name="3">
<Value>StringWert</Value>
</Value>
<Value name="4">
<Value>FloatWert</Value>
</Value>
<Value name="5">
<Value>DoubleWert</Value>
</Value>
<Value name="6">
<Value>ShortWert</Value>
</Value>
<Value name="7">
<Value>IntWert</Value>
</Value>
<Value name="8">
<Value>LongWert</Value>
</Value>
<Value name="9">
<Value>BoolWert</Value>
</Value>
<Value name="10">
<Value>DateWert</Value>
</Value>
<Value name="11">
<Value>Beschreibung</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Beschreibung">
</Property>
<Property name="BoolWert">
</Property>
<Property name="DateWert">
</Property>
<Property name="DoubleWert">
</Property>
<Property name="Einstellung">
</Property>
<Property name="FloatWert">
</Property>
<Property name="IntWert">
</Property>
<Property name="LongWert">
</Property>
<Property name="ShortWert">
</Property>
<Property name="StringWert">
</Property>
</Storage>
</Class>


<Class name="DBCore.Bankenstamm">
<Description>
</Description>
<Super>%Persistent</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61100,30857.452564</TimeCreated>

<Property name="Bankengruppe">
<Description>
Bankengruppe</Description>
<Type>%Integer</Type>
</Property>

<Property name="ClearingNr">
<Description>
Clearing-Nr</Description>
<Type>%Integer</Type>
</Property>

<Property name="FilialID">
<Description>
Filial-ID</Description>
<Type>%Integer</Type>
</Property>

<Property name="ClearingNrNeu">
<Description>
Clearing-Nr Neu (Verkettung)</Description>
<Type>%Integer</Type>
</Property>

<Property name="SICNummer">
<Description>
SIC-Nummer</Description>
<Type>%Integer</Type>
</Property>

<Property name="Hauptsitznummer">
<Description>
Hauptsitznummer</Description>
<Type>%Integer</Type>
</Property>

<Property name="ClearingTyp">
<Description>
Clearing-Typ</Description>
<Type>%Integer</Type>
</Property>

<Property name="RecGueltigAbDatum">
<Description>
Record gültig ab Datum</Description>
<Type>%Date</Type>
</Property>

<Property name="SICTeilnahme">
<Description>
SIC Teilnahme</Description>
<Type>%Integer</Type>
</Property>

<Property name="EuroSICTeilnahme">
<Description>
Euro-SIC-Teilnahme</Description>
<Type>%Integer</Type>
</Property>

<Property name="Sprachcode">
<Description>
Sprachcode</Description>
<Type>%Integer</Type>
</Property>

<Property name="Kurzbezeichnung">
<Description>
Kurzbezeichnung</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="BankInstitut">
<Description>
Bank/Institut</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Adresse1">
<Description>
Adresse1</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Adresse2">
<Description>
Adresse2</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Plz">
<Description>
PLZ</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Ort">
<Description>
Ort</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Telefon">
<Description>
Tel</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Fax">
<Description>
Fax</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Landesvorwahl">
<Description>
Landesvorwahl</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="10"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="LandISO">
<Description>
Land (ISO)</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="3"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Postkonto">
<Description>
Postkonto</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="SWIFTAdresse">
<Description>
SWIFT-Adresse</Description>
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="ImportFile">
<Description>
importiert den BC-Bankenstamm für das Clearing 
und ersetzt die bestehenden Daten</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>PathName:%String,DeleteFile:%Boolean</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
     Quit:($Length(PathName)=0)
     //||($Length(strServer)=0)||($Length(strUrl)=0)
     //Do ..GetFileFromWeb(strServer,strUrl,PathName)
     Set PathFileName=PathName
     Set stream=##class(%FileCharacterStream).%New()
     Set stream.Filename=PathFileName
     Quit:(stream.Size=0)
     TStart
     Kill ^DBCore.BankenstammD
     While 'stream.AtEnd {
          Set line=stream.ReadLine()
          Set rs=..%New(), pos=0
          Set rs.Bankengruppe      =+$ZStrip($Extract(line,pos+1,$I(pos, 2)),"<>W")
          Set rs.ClearingNr        =+$ZStrip($E(line,pos+1,$I(pos, 5)),"<>W")
          Set rs.FilialID          =+$ZStrip($E(line,pos+1,$I(pos, 4)),"<>W")
          Set rs.ClearingNrNeu     =+$ZStrip($E(line,pos+1,$I(pos, 5)),"<>W")
          Set rs.SICNummer         =+$ZStrip($E(line,pos+1,$I(pos, 6)),"<>W")
          Set rs.Hauptsitznummer   =+$ZStrip($E(line,pos+1,$I(pos, 5)),"<>W")
          Set rs.ClearingTyp       =+$ZStrip($E(line,pos+1,$I(pos, 1)),"<>W")
          Set rs.RecGueltigAbDatum =$ZDATEH($ZStrip($E(line,pos+1,$I(pos, 8)),"<>W"),8)
          Set rs.SICTeilnahme      =+$ZStrip($E(line,pos+1,$I(pos, 1)),"<>W")
          Set rs.EuroSICTeilnahme  =+$ZStrip($E(line,pos+1,$I(pos, 1)),"<>W")
          Set rs.Sprachcode        =+$ZStrip($E(line,pos+1,$I(pos, 1)),"<>W")
          Set rs.Kurzbezeichnung   = $ZStrip($E(line,pos+1,$I(pos,15)),"<>W")
          Set rs.BankInstitut      = $ZStrip($E(line,pos+1,$I(pos,60)),"<>W")
          Set rs.Adresse1          = $ZStrip($E(line,pos+1,$I(pos,35)),"<>W")
          Set rs.Adresse2          = $ZStrip($E(line,pos+1,$I(pos,35)),"<>W")
          Set rs.Plz               = $ZStrip($E(line,pos+1,$I(pos,10)),"<>W")
          Set rs.Ort               = $ZStrip($E(line,pos+1,$I(pos,35)),"<>W")
          Set rs.Telefon           = $ZStrip($E(line,pos+1,$I(pos,18)),"<>W")
          Set rs.Fax               = $ZStrip($E(line,pos+1,$I(pos,18)),"<>W")
          Set rs.Landesvorwahl     = $ZStrip($E(line,pos+1,$I(pos, 5)),"<>W")
          Set rs.LandISO           = $ZStrip($E(line,pos+1,$I(pos, 2)),"<>W")
          Set rs.Postkonto         = $ZStrip($E(line,pos+1,$I(pos,12)),"<>W")
          Set rs.SWIFTAdresse      = $ZStrip($E(line,pos+1,$I(pos,14)),"<>W")
          Set sc=rs.%Save()
          Quit:$$$ISERR(sc)
     }
     If $$$ISOK(sc) { 
     	TCommit
     } Else { 
     	TRollBack 
     }
     Set stream=""
     if (DeleteFile) {
     	Set Cmd="DEL /F "_PathName
     	Do $ZF(-1,Cmd)
     }
     Quit sc
]]></Implementation>
</Method>

<Method name="GetFileFromWeb">
<Description>
[Previously private]</Description>
<Final>1</Final>
<ClassMethod>1</ClassMethod>
<FormalSpec>strServer:%String,strUrl:%String,PathName:%String</FormalSpec>
<Implementation><![CDATA[
    Set Cmd="DEL /F "_PathName_"BCTEMP.ZIP"
    Do $ZF(-1,Cmd)
    Set Cmd="DEL /F "_PathName_"bcbankenstamm"
    Do $ZF(-1,Cmd)
    Set Cmd="DEL /F "_PathName_"UnZipTmp.vbs"
    Do $ZF(-1,Cmd)
    Set vbs=##class(%FileCharacterStream).%New()
    Set vbs.Filename=PathName_"UnZipTmp.vbs"
	Do vbs.WriteLine("Set url=WScript.Arguments")
	Do vbs.WriteLine("Set sa=CreateObject(""Shell.Application"")")
	Do vbs.WriteLine("Set zip=sa.NameSpace(url(1))")
	Do vbs.WriteLine("Set filesInZip=sa.NameSpace(url(0)).Items")
	Do vbs.WriteLine("zip.CopyHere(filesInZip)")
	Do vbs.WriteLine("Set filesInZip=Nothing")
	Do vbs.WriteLine("Set sa=Nothing")
	Do vbs.WriteLine("Set url=Nothing")
	Do vbs.SaveStream()
	Set vbs=""
	Set httprequest=##class(%Net.HttpRequest).%New()
	Set httprequest.Server=strServer
	Do httprequest.Get(strUrl)
    Set stream=##class(%FileBinaryStream).%New()
    Set stream.Filename=PathName_"BCTEMP.ZIP"
    Set Ret=stream.CopyFromAndSave(httprequest.HttpResponse.Data)
    Set Cmd=PathName_"UnZipTmp.vbs "_PathName_"BCTEMP.ZIP "_PathName
    Do $ZF(-1,Cmd)
    Set Cmd="DEL /F "_PathName_"BCTEMP.ZIP"
    Do $ZF(-1,Cmd)
    Set Cmd="DEL /F "_PathName_"UnZipTmp.vbs"
    Do $ZF(-1,Cmd)
]]></Implementation>
</Method>

<Method name="LastClearingNr">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set clearingNr = $Order(^DBCore.BankenstammI("ClearingNrIndex",""),-1)
	set oid = $Order(^DBCore.BankenstammI("ClearingNrIndex",clearingNr,""),-1)
	Quit oid
]]></Implementation>
</Method>

<Method name="FirstClearingNr">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set clearingNr = $Order(^DBCore.BankenstammI("ClearingNrIndex",""))
	set oid = $Order(^DBCore.BankenstammI("ClearingNrIndex",clearingNr,""))
	Quit oid
]]></Implementation>
</Method>

<Method name="NextClearingNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>ClearingNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set clearingNr = $Order(^DBCore.BankenstammI("ClearingNrIndex", ClearingNr))
	set oid = ""
	if clearingNr '= "" {
		set oid = $Order(^DBCore.BankenstammI("ClearingNrIndex", clearingNr, ""))
	
		if oid = "" {
			set clearingNr = $Order(^DBCore.BankenstammI("ClearingNrIndex", ClearingNr),-1)
			if clearingNr '= "" {
				set oid = $Order(^DBCore.BankenstammI("ClearingNrIndex", clearingNr, ""),-1)
			}
		}
	} else {
		
		set oid = ##class(DBCore.Bank).LastClearingNr()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="PrevClearingNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>ClearingNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set clearingNr = $Order(^DBCore.BankenstammI("ClearingNrIndex", ClearingNr),-1)
	set oid = ""
	if clearingNr '= "" {
		set oid = $Order(^DBCore.BankenstammI("ClearingNrIndex", clearingNr, ""),-1)
	
		if oid = "" {
			set clearingNr = $Order(^DBCore.BankenstammI("ClearingNrIndex", ClearingNr))
			if clearingNr '= "" {
				set oid = $Order(^DBCore.BankenstammI("ClearingNrIndex", clearingNr, ""))
			}
		}
	} else {
		
		set oid = ##class(DBCore.Bankenstamm).FirstClearingNr()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.BankenstammD</DataLocation>
<DefaultData>BankenstammDefaultData</DefaultData>
<IdLocation>^DBCore.BankenstammD</IdLocation>
<IndexLocation>^DBCore.BankenstammI</IndexLocation>
<StreamLocation>^DBCore.BankenstammS</StreamLocation>
<Data name="BankenstammDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Bankengruppe</Value>
</Value>
<Value name="3">
<Value>ClearingNr</Value>
</Value>
<Value name="4">
<Value>FilialID</Value>
</Value>
<Value name="5">
<Value>ClearingNrNeu</Value>
</Value>
<Value name="6">
<Value>SICNummer</Value>
</Value>
<Value name="7">
<Value>Hauptsitznummer</Value>
</Value>
<Value name="8">
<Value>ClearingTyp</Value>
</Value>
<Value name="9">
<Value>RecGueltigAbDatum</Value>
</Value>
<Value name="10">
<Value>SICTeilnahme</Value>
</Value>
<Value name="11">
<Value>EuroSICTeilnahme</Value>
</Value>
<Value name="12">
<Value>Sprachcode</Value>
</Value>
<Value name="13">
<Value>Kurzbezeichnung</Value>
</Value>
<Value name="14">
<Value>BankInstitut</Value>
</Value>
<Value name="15">
<Value>Adresse1</Value>
</Value>
<Value name="16">
<Value>Adresse2</Value>
</Value>
<Value name="17">
<Value>Plz</Value>
</Value>
<Value name="18">
<Value>Ort</Value>
</Value>
<Value name="19">
<Value>Telefon</Value>
</Value>
<Value name="20">
<Value>Fax</Value>
</Value>
<Value name="21">
<Value>Landesvorwahl</Value>
</Value>
<Value name="22">
<Value>LandISO</Value>
</Value>
<Value name="23">
<Value>Postkonto</Value>
</Value>
<Value name="24">
<Value>SWIFTAdresse</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Adresse1">
</Property>
<Property name="Adresse2">
</Property>
<Property name="BankInstitut">
</Property>
<Property name="Bankengruppe">
</Property>
<Property name="ClearingNr">
</Property>
<Property name="ClearingNrNeu">
</Property>
<Property name="ClearingTyp">
</Property>
<Property name="EuroSICTeilnahme">
</Property>
<Property name="Fax">
</Property>
<Property name="FilialID">
</Property>
<Property name="Hauptsitznummer">
</Property>
<Property name="Kurzbezeichnung">
</Property>
<Property name="LandISO">
</Property>
<Property name="Landesvorwahl">
</Property>
<Property name="Ort">
</Property>
<Property name="Plz">
</Property>
<Property name="Postkonto">
</Property>
<Property name="RecGueltigAbDatum">
</Property>
<Property name="SICNummer">
</Property>
<Property name="SICTeilnahme">
</Property>
<Property name="SWIFTAdresse">
</Property>
<Property name="Sprachcode">
</Property>
<Property name="Telefon">
</Property>
</Storage>
</Class>


<Class name="DBCore.Benutzer">
<Description>
</Description>
<Owner>cbt</Owner>
<Super>%Persistent,%Populate</Super>
<TimeChanged>62430,59137.669727</TimeChanged>
<TimeCreated>60911,48128.287826</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Benutzernr">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="999"/>
<Parameter name="MINVAL" value="1"/>
</Property>

<Property name="Benutzername">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Vorname">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="FirstName()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Name">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="Name()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Windowsbenutzer">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Passwort">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Sprachcode">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="TelefonDirekt">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="USPhone()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="TelefonExtern">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="USPhone()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="EMail">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Aktiv">
<Type>%Library.Boolean</Type>
</Property>

<Property name="AutoLogin">
<Type>%Library.Boolean</Type>
</Property>

<Property name="AutoloadModule">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="9999999999"/>
<Parameter name="MINVAL" value="0"/>
<Parameter name="POPSPEC" value="ValueList(&quot;,9999999999,9999999998&quot;)"/>
</Property>

<Property name="Baumansicht">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="99"/>
<Parameter name="MINVAL" value="0"/>
</Property>

<Property name="SelektierteAdresse">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="999999999"/>
<Parameter name="MINVAL" value="1"/>
</Property>

<Property name="PrintPreviewAktiv">
<Type>%Library.Boolean</Type>
</Property>

<Property name="MandantUserEinstellungBenutzer">
<Type>DBCore.MandantUserEinstellung</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="ReportBenutzer">
<Type>DBCore.ReportBenutzer</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="EtikettenDrucker">
<Type>DBPrint.EtikBenPrint</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FormDruckerBenBenutzer">
<Type>DBAgrofresh.SD.FormDruckerBen</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Mitarbeiter">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="EKFormDruckerBen">
<Type>DBAgrofreshEK.SD.FormDruckerBen</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="RVBenutzer">
<Type>DBCore.Rollenvergabe</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="UserEinstellung">
<Type>DBCore.UserEinstellung</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FaktFormDruckerBenBenutzer">
<Type>DBFakturierung.SD.FormDruckerBen</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FaktEKFormDruckerBenBenutzer">
<Type>DBFaktEK.SD.FormDruckerBen</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="MailserverHost">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="MailserverPort">
<Type>%Library.Integer</Type>
</Property>

<Property name="MailserverBenutzer">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="MailserverPasswort">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="MailserverSSL">
<Type>%Library.Boolean</Type>
</Property>

<Property name="PrintMitMutiertenAktiv">
<Type>%Library.Boolean</Type>
</Property>

<Property name="PrintNurFreigegebeneAktiv">
<Type>%Library.Boolean</Type>
</Property>

<Property name="PrintDefaultPrvZoom">
<Type>%Library.Integer</Type>
</Property>

<Property name="FaxNr">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Mobile">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="PrintJobs">
<Type>DBCore.PrintJob</Type>
<Cardinality>many</Cardinality>
<Inverse>Benutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="SetActiveMandantId">
<Description>
Weist dem Benutzer den aktiven Mandant zu.
Falls kein Benutzer übergeben wird, wird der Standard-Mandant gesetzt</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantId:%String="",MandantJahrId:%String="",BenutzerId:%String="",Maschine:%String=""</FormalSpec>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	If +BenutzerId=0 {
		Set ^AM = $lb(+MandantId,+MandantJahrId)
	} ElseIf Maschine="" {
		Set ^AM(+BenutzerId) = $lb(+MandantId,+MandantJahrId)
	} Else {
		Set ^AM(+BenutzerId, Maschine) = $lb(+MandantId,+MandantJahrId)
		Set ^AM(+BenutzerId) = $lb(+MandantId,+MandantJahrId)
	}
]]></Implementation>
</Method>

<Method name="GetAktiveMandantId">
<ClassMethod>1</ClassMethod>
<FormalSpec>BenutzerId:%String="",Maschine:%String=""</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	
	if +BenutzerId=0 {
		Quit ..getStandardMand()
		
	} ElseIf (Maschine="") {
		Quit ..getBenutzerMand(BenutzerId)
		
	} Else {
		// 1 OR 11 = presence of data within the global
		if ($Data(^AM(+BenutzerId, Maschine))=1) || ($Data(^AM(+BenutzerId, Maschine))=11) {
			Set AM = ^AM(+BenutzerId, Maschine)
			If AM = "" {
				Quit ..getBenutzerMand(BenutzerId)
				
			} Else {
				Set AM1 = ..CheckAM(AM)
				Quit AM1
			}
	
		} Else {
			Quit ..getBenutzerMand(BenutzerId)
		}
	}
]]></Implementation>
</Method>

<Method name="getStandardMand">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	If ($Data(^AM)=1) || ($Data(^AM)=11) {
		Set AM = ^AM
		If AM = "" {
			Set AM1 = ..CheckAM("")
			Quit AM1
		} Else {
			Set AM1 = ..CheckAM(AM)
			Quit AM1
		}
	} Else {
		Set AM1 = ..CheckAM("")
		Quit AM1
	}
]]></Implementation>
</Method>

<Method name="getBenutzerMand">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>Benutzer:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	// 1 OR 11 = presence of data within the global
	If ($Data(^AM(+Benutzer))=1) || ($Data(^AM(+Benutzer))=11) {
		Set AM = ^AM(+Benutzer)
		If AM = "" {
			Quit ..getStandardMand()
				
		} Else {
			Set AM1 = ..CheckAM(AM)
			Quit AM1	
		}
	} Else {
		Quit ..getStandardMand()	
	}
]]></Implementation>
</Method>

<Method name="CheckAM">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>AM:%List</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	If AM="" {
		//Quit AM
		set retval = ""
		set id = ""
		set jahrId = ""
		&sql(SELECT %ID INTO :id FROM DBCore.Mandant WHERE Mandantnr=10000)
		if (id '= "") {
			&sql(SELECT ID INTO :jahrId FROM DBCore.MandantJahr WHERE Mandant = :id
				AND GeschaeftsjahrEnde >= all (SELECT GeschaeftsjahrEnde FROM DBCore.MandantJahr
												WHERE Mandant = :id))
			if (jahrId '= "") {
				set retval = $lb(+id, +jahrId)	
			} else {
				set retval = $lb(+id,"")
			}
		} else {
			set retval = $lb("","")	
		}
		Quit retval
	} Else {
		Set cnt = 0
		//Mandant aus erster Arraystelle auslesen
		set mand = $list(AM,1)
		&sql(SELECT COUNT(*) INTO :cnt
			 FROM DBCore.Mandant
			 WHERE ID = :mand)
		if cnt = 0 {
			//Quit AM
			set retval = ""
			set id = ""
			set jahrId = ""
			&sql(SELECT %ID INTO :id FROM DBCore.Mandant WHERE Mandantnr=10000)
			if (id '= "") {
				&sql(SELECT ID INTO :jahrId FROM DBCore.MandantJahr WHERE Mandant = :id
					AND GeschaeftsjahrEnde >= all (SELECT GeschaeftsjahrEnde FROM DBCore.MandantJahr
													WHERE Mandant = :id))
				if (jahrId '= "") {
					set retval = $lb(+id, +jahrId)	
				} else {
					set retval = $lb(+id,"")
				}
			} else {
				set retval = $lb("","")	
			}
			Quit retval
		}
		Else {
			//Mandant existiert sicher -> Prüfung ob Jahr existiert, ansonsten höchstes ausgeben
			//Jahr an zweiter Stelle in der List
			set jahr = $list(AM,2)
			set jahrCnt = 0
			&sql(SELECT COUNT(*) INTO :jahrCnt FROM DBCore.MandantJahr WHERE
					Mandant = :mand AND ID = :jahr)
			if (jahrCnt = 0) {
				// Quit AM
				set jahrId = ""
				&sql(SELECT ID INTO :jahrId FROM DBCore.MandantJahr WHERE Mandant = :mand
					AND GeschaeftsjahrEnde >= all (SELECT GeschaeftsjahrEnde FROM DBCore.MandantJahr
													WHERE Mandant = :mand))
				if (jahrId '= "") {
					Quit $lb(+mand, +jahrId)	
				} else {
					Quit $lb(+mand,"")
				}				
			} Else {
				//alles OK, Mandant und Jahr existieren
				Quit AM	
			}
		}
	}
]]></Implementation>
</Method>

<Method name="GetOidByBenutzerNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>BenutzerNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT TOP 1 ID INTO :oid FROM DBCore.Benutzer WHERE Benutzernr = :BenutzerNr)
	if (SQLCODE '= 0) {
		set oid = ""
	}
	Quit oid
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set myId = $lg(oid,1)
	Set status = 1
	
	Set strSQL="SELECT ID FROM DBCore.Mitarbeiter WHERE Benutzer="_myId
    Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
    Do rs.Prepare(strSQL)
    Set sc=rs.Execute()
    if ($$$ISERR(sc)) {
		w "DBCore.Benutzer.%OnDelete- Fehler bei SQL-Statement",!
		w sc,!
		QUIT $$$ERROR()
	}

    while (rs.Next() && status = 1) {
		Set id = rs.Data("ID")
		Set mit = ##class(DBCore.Mitarbeiter).%OpenId(id)
		if (mit '= "") {
			Set mit.Benutzer = ""
			Set status = mit.%Save()	
		}
    }
       
    set st = ##class(DBUtils.ClassHelper).DeleteManyRelations("DBCore.Benutzer", myId)
	
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgBeforeDelete">
<Code><![CDATA[	new myId
	set myId = {ID*O}
	
	Set strSQL="SELECT ID FROM DBCore.Mitarbeiter WHERE Benutzer="_myId
    Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
    Do rs.Prepare(strSQL)
    Set sc=rs.Execute()
    if ($$$ISERR(sc)) {
		w "DBCore.Benutzer.%OnDelete- Fehler bei SQL-Statement",!
		w sc,!
		QUIT $$$ERROR()
	}

    while (rs.Next() && status = 1) {
		Set id = rs.Data("ID")
		Set mit = ##class(DBCore.Mitarbeiter).%OpenId(id)
		if (mit '= "") {
			Set mit.Benutzer = ""
			Set status = mit.%Save()	
			KILL status
		}
    }
    
    set st = ##class(DBUtils.ClassHelper).DeleteManyRelations("DBCore.Benutzer", myId)
	
	Quit st]]></Code>
<Event>DELETE</Event>
<Foreach>row</Foreach>
</Trigger>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.BenutzerD</DataLocation>
<DefaultData>BenutzerDefaultData</DefaultData>
<IdLocation>^DBCore.BenutzerD</IdLocation>
<IndexLocation>^DBCore.BenutzerI</IndexLocation>
<StreamLocation>^DBCore.BenutzerS</StreamLocation>
<Data name="BenutzerDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Benutzernr</Value>
</Value>
<Value name="3">
<Value>Benutzername</Value>
</Value>
<Value name="4">
<Value>Vorname</Value>
</Value>
<Value name="5">
<Value>Name</Value>
</Value>
<Value name="6">
<Value>Windowsbenutzer</Value>
</Value>
<Value name="7">
<Value>Passwort</Value>
</Value>
<Value name="8">
<Value>Sprachcode</Value>
</Value>
<Value name="9">
<Value>TelefonDirekt</Value>
</Value>
<Value name="10">
<Value>TelefonExtern</Value>
</Value>
<Value name="11">
<Value>EMail</Value>
</Value>
<Value name="12">
<Value>Aktiv</Value>
</Value>
<Value name="13">
<Value>AutoLogin</Value>
</Value>
<Value name="14">
<Value>AutoloadModule</Value>
</Value>
<Value name="15">
<Value>Baumansicht</Value>
</Value>
<Value name="16">
<Value>SelektierteAdresse</Value>
</Value>
<Value name="17">
<Value>Abteilung</Value>
</Value>
<Value name="18">
<Value>VorschlagLagerort</Value>
</Value>
<Value name="19">
<Value>Lagerort</Value>
</Value>
<Value name="20">
<Value>PrintPreviewAktiv</Value>
</Value>
<Value name="21">
<Value>LagerortFakt</Value>
</Value>
<Value name="22">
<Value>MailserverHost</Value>
</Value>
<Value name="23">
<Value>MailserverPort</Value>
</Value>
<Value name="24">
<Value>MailserverBenutzer</Value>
</Value>
<Value name="25">
<Value>MailserverPasswort</Value>
</Value>
<Value name="26">
<Value>MailserverSSL</Value>
</Value>
<Value name="27">
<Value>PrintMitMutiertenAktiv</Value>
</Value>
<Value name="28">
<Value>PrintNurFreigegebeneAktiv</Value>
</Value>
<Value name="29">
<Value>PrintDefaultPrvZoom</Value>
</Value>
<Value name="30">
<Value>FaxNr</Value>
</Value>
<Value name="31">
<Value>Mobile</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Abteilung"/>
<Property name="Aktiv">
</Property>
<Property name="AutoLogin">
</Property>
<Property name="AutoloadModule">
</Property>
<Property name="Baumansicht">
</Property>
<Property name="Benutzername">
</Property>
<Property name="Benutzernr">
</Property>
<Property name="EMail">
</Property>
<Property name="FaxNr">
</Property>
<Property name="Lagerort"/>
<Property name="LagerortFakt"/>
<Property name="MailserverBenutzer">
</Property>
<Property name="MailserverHost">
</Property>
<Property name="MailserverPasswort">
</Property>
<Property name="MailserverPort">
</Property>
<Property name="MailserverSSL">
</Property>
<Property name="Mobile">
</Property>
<Property name="Name">
</Property>
<Property name="Passwort">
</Property>
<Property name="PrintDefaultPrvZoom">
</Property>
<Property name="PrintMitMutiertenAktiv">
</Property>
<Property name="PrintNurFreigegebeneAktiv">
</Property>
<Property name="PrintPreviewAktiv">
</Property>
<Property name="SelektierteAdresse">
</Property>
<Property name="Sprachcode">
</Property>
<Property name="TelefonDirekt">
</Property>
<Property name="TelefonExtern">
</Property>
<Property name="Vorname">
</Property>
<Property name="Windowsbenutzer">
</Property>
</Storage>
</Class>


<Class name="DBCore.COFont">
<Super>%SerialObject</Super>
<TimeChanged>61707,30001</TimeChanged>
<TimeCreated>61700,51472.297912</TimeCreated>

<Property name="Aktiv">
<Type>%Boolean</Type>
</Property>

<Property name="Name">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Size">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Bold">
<Type>%Boolean</Type>
</Property>

<Property name="Italic">
<Type>%Boolean</Type>
</Property>

<Property name="Strikeout">
<Type>%Boolean</Type>
</Property>

<Property name="Underline">
<Type>%Boolean</Type>
</Property>

<Property name="Color">
<Type>%Integer</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<State>COFontState</State>
<StreamLocation>^DBCore.COFontS</StreamLocation>
<Data name="COFontState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>Aktiv</Value>
</Value>
<Value name="2">
<Value>Name</Value>
</Value>
<Value name="3">
<Value>Size</Value>
</Value>
<Value name="4">
<Value>Bold</Value>
</Value>
<Value name="5">
<Value>Italic</Value>
</Value>
<Value name="6">
<Value>Strikeout</Value>
</Value>
<Value name="7">
<Value>Underline</Value>
</Value>
<Value name="8">
<Value>Color</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.COFormat">
<Super>%SerialObject</Super>
<TimeChanged>61700,51661.090905</TimeChanged>
<TimeCreated>61700,51647.641231</TimeCreated>

<Property name="AnzDezStellen">
<Type>%Integer</Type>
</Property>

<Property name="Einheit">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="KeineAusgabe">
<Type>%Boolean</Type>
</Property>

<Property name="Datum">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Totalisieren">
<Type>%Boolean</Type>
</Property>

<Property name="TextFallsLeer">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="GetFormatTextFallsLeer">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..TextFallsLeer, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="SetFormatTextFallsLeerLeer">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..TextFallsLeer, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<State>COFormatState</State>
<StreamLocation>^DBCore.COFormatS</StreamLocation>
<Data name="COFormatState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>AnzDezStellen</Value>
</Value>
<Value name="2">
<Value>Einheit</Value>
</Value>
<Value name="3">
<Value>KeineAusgabe</Value>
</Value>
<Value name="4">
<Value>Datum</Value>
</Value>
<Value name="5">
<Value>Totalisieren</Value>
</Value>
<Value name="6">
<Value>TextFallsLeer</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.COPosition">
<Super>%SerialObject</Super>
<TimeChanged>61724,50694.645855</TimeChanged>
<TimeCreated>61724,50689.666081</TimeCreated>

<Property name="Links">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Oben">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Breite">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Hoehe">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<State>COPositionState</State>
<StreamLocation>^DBCore.COPositionS</StreamLocation>
<Data name="COPositionState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>Links</Value>
</Value>
<Value name="2">
<Value>Oben</Value>
</Value>
<Value name="3">
<Value>Breite</Value>
</Value>
<Value name="4">
<Value>Hoehe</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.CORahmen">
<Super>%SerialObject</Super>
<TimeChanged>61707,30001</TimeChanged>
<TimeCreated>61700,51548.541024</TimeCreated>

<Property name="Aktiv">
<Type>%Boolean</Type>
</Property>

<Property name="AktivLinks">
<Type>%Boolean</Type>
</Property>

<Property name="BreiteLinks">
<Type>%Integer</Type>
</Property>

<Property name="AbstandLinks">
<Type>%Integer</Type>
</Property>

<Property name="AktivOben">
<Type>%Boolean</Type>
</Property>

<Property name="BreiteOben">
<Type>%Integer</Type>
</Property>

<Property name="AbstandOben">
<Type>%Integer</Type>
</Property>

<Property name="AktivRechts">
<Type>%Boolean</Type>
</Property>

<Property name="BreiteRechts">
<Type>%Integer</Type>
</Property>

<Property name="AbstandRechts">
<Type>%Integer</Type>
</Property>

<Property name="AktivUnten">
<Type>%Boolean</Type>
</Property>

<Property name="BreiteUnten">
<Type>%Integer</Type>
</Property>

<Property name="AbstandUnten">
<Type>%Integer</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<State>CORahmenState</State>
<StreamLocation>^DBCore.CORahmenS</StreamLocation>
<Data name="CORahmenState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>Aktiv</Value>
</Value>
<Value name="2">
<Value>AktivLinks</Value>
</Value>
<Value name="3">
<Value>BreiteLinks</Value>
</Value>
<Value name="4">
<Value>AbstandLinks</Value>
</Value>
<Value name="5">
<Value>AktivOben</Value>
</Value>
<Value name="6">
<Value>BreiteOben</Value>
</Value>
<Value name="7">
<Value>AbstandOben</Value>
</Value>
<Value name="8">
<Value>AktivRechts</Value>
</Value>
<Value name="9">
<Value>BreiteRechts</Value>
</Value>
<Value name="10">
<Value>AbstandRechts</Value>
</Value>
<Value name="11">
<Value>AktivUnten</Value>
</Value>
<Value name="12">
<Value>BreiteUnten</Value>
</Value>
<Value name="13">
<Value>AbstandUnten</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.DBWrapper">
<Description>
</Description>
<Super>%RegisteredObject</Super>
<TimeChanged>62437,55659.059605</TimeChanged>
<TimeCreated>60926,51872.881888</TimeCreated>

<Method name="LoadDefinition">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[pfad:%String,&errorlog:%String,&loadedlist:%String]]></FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set result = $system.OBJ.Load(pfad, "", errorlog, loadedlist, 0, "", "")
	Quit result
]]></Implementation>
</Method>

<Method name="BuildIndices">
<ClassMethod>1</ClassMethod>
<Implementation><![CDATA[
	do ##class(DBCore.Postleitzahl).%BuildIndices()
	do ##class(DBCore.Benutzer).%BuildIndices()
	do ##class(DBCore.Mandant).%BuildIndices()
	do ##class(DBCore.AppEinstellung).%BuildIndices()
	do ##class(DBAdressen.SD.Branche).%BuildIndices()
	do ##class(DBAdressen.SD.Anrede).%BuildIndices()
	do ##class(DBAdressen.SD.Briefanrede).%BuildIndices()
	do ##class(DBAdressen.SD.Gebiet).%BuildIndices()
	do ##class(DBAdressen.SD.Kundengruppe).%BuildIndices()
	do ##class(DBAdressen.SD.Kundenkategorie).%BuildIndices()
	do ##class(DBAdressen.SD.Preiskategorie).%BuildIndices()
	do ##class(DBAdressen.SD.Selektion1).%BuildIndices()
	do ##class(DBAdressen.SD.Selektion2).%BuildIndices()
	do ##class(DBAdressen.SD.Status).%BuildIndices()
	do ##class(DBAdressen.SD.Vertreter).%BuildIndices()
	do ##class(DBAdressen.Adresse).%BuildIndices()
	do ##class(DBAdressen.Mitarbeiter).%BuildIndices()
	do ##class(DBAdressen.BrancheAdresse).%BuildIndices()
]]></Implementation>
</Method>

<Method name="CompileAllInNamespace">
<ClassMethod>1</ClassMethod>
<FormalSpec>compFlags:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set result = $system.OBJ.CompileAll(compFlags, "")
	Quit result
]]></Implementation>
</Method>

<Method name="DeleteClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>classname:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set result = $system.OBJ.Delete(classname)
	Quit result
]]></Implementation>
</Method>
</Class>


<Class name="DBCore.EinstIndWaage">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57261.071854</TimeChanged>
<TimeCreated>61558,30146.505257</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="WaageNr">
<Description>
WaageNr</Description>
<Type>%Integer</Type>
</Property>

<Property name="Standard">
<Description>
Standard</Description>
<Type>%Boolean</Type>
</Property>

<Property name="Bezeichnung">
<Description>
Bezeichnung</Description>
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ComAnschluss">
<Description>
ComAnschluss</Description>
<Type>%Integer</Type>
</Property>

<Property name="Baudrate">
<Description>
Baudrate</Description>
<Type>%Integer</Type>
</Property>

<Property name="DatenBit">
<Description>
DatenBit</Description>
<Type>%Integer</Type>
</Property>

<Property name="Parity">
<Description>
Parity</Description>
<Type>%Integer</Type>
</Property>

<Property name="StopBit">
<Description>
StopBit</Description>
<Type>%Integer</Type>
</Property>

<Property name="Empfangmodus">
<Description>
Empfangmodus</Description>
<Type>%Boolean</Type>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String="",Lang:%String=""</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBCore.EinstIndWaage).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextWaageNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set maxJnr = 0
	&sql(SELECT MAX(WaageNr) INTO :maxJnr FROM DBCore.EinstIndWaage WHERE Mandant = :MandantOid)
	Set maxJnr = maxJnr + 1
	Quit maxJnr
]]></Implementation>
</Method>

<Method name="GetIdByWaageNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,WaageNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.EinstIndWaage WHERE Mandant = :MandantOid
		 AND WaageNr = :WaageNr)
	Quit id
]]></Implementation>
</Method>

<Method name="SetAsDefault">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,WaageNr:%Integer</FormalSpec>
<Implementation><![CDATA[
	&sql(UPDATE DBCore.EinstIndWaage SET Standard = 0 WHERE Mandant = :MandantOid
		 AND WaageNr <> :WaageNr)
]]></Implementation>
</Method>

<Method name="GetIdofDefault">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.EinstIndWaage WHERE Mandant = :MandantOid
		 AND Standard = 1)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.EinstIndWaageD</DataLocation>
<DefaultData>EinstIndWaageDefaultData</DefaultData>
<IdLocation>^DBCore.EinstIndWaageD</IdLocation>
<IndexLocation>^DBCore.EinstIndWaageI</IndexLocation>
<StreamLocation>^DBCore.EinstIndWaageS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="EinstIndWaageDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>WaageNr</Value>
</Value>
<Value name="3">
<Value>Default</Value>
</Value>
<Value name="4">
<Value>ComAnschluss</Value>
</Value>
<Value name="5">
<Value>Baudrate</Value>
</Value>
<Value name="6">
<Value>DatenBit</Value>
</Value>
<Value name="7">
<Value>Parity</Value>
</Value>
<Value name="8">
<Value>StopBit</Value>
</Value>
<Value name="9">
<Value>Empfangmodus</Value>
</Value>
<Value name="10">
<Value>Mandant</Value>
</Value>
<Value name="11">
<Value>Standard</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Baudrate">
</Property>
<Property name="ComAnschluss">
</Property>
<Property name="DatenBit">
</Property>
<Property name="Empfangmodus">
</Property>
<Property name="Mandant">
</Property>
<Property name="Parity">
</Property>
<Property name="Standard">
</Property>
<Property name="StopBit">
</Property>
<Property name="WaageNr">
</Property>
</Storage>
</Class>


<Class name="DBCore.EinstLadenWaage">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57261.190974</TimeChanged>
<TimeCreated>61558,56333.942867</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="WaageNr">
<Description>
WaageNr</Description>
<Type>%Integer</Type>
</Property>

<Property name="Standard">
<Description>
Standard</Description>
<Type>%Boolean</Type>
</Property>

<Property name="Bezeichnung">
<Description>
Bezeichnung</Description>
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ComAnschluss">
<Description>
ComAnschluss</Description>
<Type>%Integer</Type>
</Property>

<Property name="Baudrate">
<Description>
Baudrate</Description>
<Type>%Integer</Type>
</Property>

<Property name="DatenBit">
<Description>
DatenBit</Description>
<Type>%Integer</Type>
</Property>

<Property name="Parity">
<Description>
Parity</Description>
<Type>%Integer</Type>
</Property>

<Property name="StopBit">
<Description>
StopBit</Description>
<Type>%Integer</Type>
</Property>

<Property name="TimeOut">
<Description>
TimeOut</Description>
<Type>%Integer</Type>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String="",Lang:%String=""</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBCore.EinstLadenWaage).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextWaageNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set maxJnr = 0
	&sql(SELECT MAX(WaageNr) INTO :maxJnr FROM DBCore.EinstLadenWaage WHERE Mandant = :MandantOid)
	Set maxJnr = maxJnr + 1
	Quit maxJnr
]]></Implementation>
</Method>

<Method name="GetIdByWaageNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,WaageNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.EinstLadenWaage WHERE Mandant = :MandantOid
		 AND WaageNr = :WaageNr)
	Quit id
]]></Implementation>
</Method>

<Method name="SetAsDefault">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,WaageNr:%Integer</FormalSpec>
<Implementation><![CDATA[
	&sql(UPDATE DBCore.EinstLadenWaage SET Standard = 0 WHERE Mandant = :MandantOid
		 AND WaageNr <> :WaageNr)
]]></Implementation>
</Method>

<Method name="GetIdofDefault">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.EinstLadenWaage WHERE Mandant = :MandantOid
		 AND Standard = 1)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.EinstLadenWaageD</DataLocation>
<DefaultData>EinstLadenWaageDefaultData</DefaultData>
<IdLocation>^DBCore.EinstLadenWaageD</IdLocation>
<IndexLocation>^DBCore.EinstLadenWaageI</IndexLocation>
<StreamLocation>^DBCore.EinstLadenWaageS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="EinstLadenWaageDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>WaageNr</Value>
</Value>
<Value name="3">
<Value>Standard</Value>
</Value>
<Value name="4">
<Value>ComAnschluss</Value>
</Value>
<Value name="5">
<Value>Baudrate</Value>
</Value>
<Value name="6">
<Value>DatenBit</Value>
</Value>
<Value name="7">
<Value>Parity</Value>
</Value>
<Value name="8">
<Value>StopBit</Value>
</Value>
<Value name="9">
<Value>Mandant</Value>
</Value>
<Value name="10">
<Value>TimeOut</Value>
</Value>
</Data>
<Property name="Baudrate"/>
<Property name="ComAnschluss"/>
<Property name="DatenBit"/>
<Property name="Mandant"/>
<Property name="Parity"/>
<Property name="Standard"/>
<Property name="StopBit"/>
<Property name="TimeOut"/>
<Property name="WaageNr"/>
</Storage>
</Class>


<Class name="DBCore.ErrorCodes">
<Super>%RegisteredObject</Super>
<TimeChanged>61774,36275.269419</TimeChanged>
<TimeCreated>61312,57754.138087</TimeCreated>

<Method name="ABZUGEXISTSCODE">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit -1
]]></Implementation>
</Method>

<Method name="ABZUGEXISTSMSG">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit "Dieser Artikel ist einem Abzug zugewiesen"
]]></Implementation>
</Method>

<Method name="ABZUGNICHTNACHGEFUEHRTCODE">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit -2
]]></Implementation>
</Method>

<Method name="ABZUGNICHTNACHGEFUEHRTMSG">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit "Die Artikelnummern auf den Abzügen konnten nicht nachgeführt werden"
]]></Implementation>
</Method>

<Method name="OBJEKTREFSNICHTLOESCHBAR">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit -3
]]></Implementation>
</Method>

<Method name="OBJEKTREFSNICHTLOESCHBARMSG">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit "Die Objektreferenzen zum gewünschten Objekt können nicht gelöscht werden"
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.ErrorCodesD</DataLocation>
<DefaultData>ErrorCodesDefaultData</DefaultData>
<IdLocation>^DBCore.ErrorCodesD</IdLocation>
<IndexLocation>^DBCore.ErrorCodesI</IndexLocation>
<StreamLocation>^DBCore.ErrorCodesS</StreamLocation>
<Data name="ErrorCodesDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.FeldhilfeFeld">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61466,52022.236665</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="ControlName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="1024"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Index name="ControlNameIndex">
<Properties>ControlName</Properties>
<Unique>1</Unique>
</Index>

<Property name="Stream">
<Type>DBCore.FeldhilfeStream</Type>
<Cardinality>many</Cardinality>
<Inverse>Feld</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputStream">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set ControlName=..ControlName
	Set Ret=""
	If ControlName'="" {
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.FeldhilfeStream 
		     WHERE Feld->ControlName=:ControlName AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.FeldhilfeStream 
				 WHERE Feld->ControlName=:ControlName AND 
				       Sprache=:Sprache)
			Set s=##Class(DBCore.FeldhilfeStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		} Else {
			Set StdSprache="de"
			&sql(SELECT count(*) As Cnt INTO :Cnt
			     FROM DBCore.FeldhilfeStream 
			     WHERE Feld->ControlName=:ControlName AND Sprache=:StdSprache)
			If (Cnt>0) {
				&sql(SELECT %ID INTO :sID 
				     FROM DBCore.FeldhilfeStream 
				     WHERE Feld->ControlName=:ControlName AND 
				           Sprache=:StdSprache)
				Set s=##Class(DBCore.FeldhilfeStream).%OpenId(sID)
				Set Size=s.DataStream.Size
				Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
			}
		}
	}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set ControlName=..ControlName
	Set sID = ""
	If (ControlName'="") {
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.FeldhilfeStream 
		     WHERE Feld->ControlName=:ControlName AND Sprache='de')
		
		If (Cnt=0) {
			Set myId=..%Id()
			Set n=##Class(DBCore.FeldhilfeStream).%New()
			Set n.Sprache = "de"
			Set n.Feld = ##Class(DBCore.FeldhilfeFeld).%OpenId(myId)
			Set n.LetzteAenderung = $ZDT($H,3)
			Set Ret=n.%Save()
			Set Ret=n.DataStream.CopyFromAndSave(Stream)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.FeldhilfeStream 
		     WHERE Feld->ControlName=:ControlName AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()
			
			w "DBCore.FeldhilfeFeld.InputStream myId:"_myId,!
			
			Set n=##Class(DBCore.FeldhilfeStream).%New()
			Set n.Sprache = Sprache
			Set n.Feld = ##Class(DBCore.FeldhilfeFeld).%OpenId(myId)
			Set n.LetzteAenderung = $ZDT($H,3)
			Set Ret=n.%Save()
			w "DBCore.FeldhilfeFeld.InputStream Save:"_Ret,!
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBCore.FeldhilfeStream 
		     WHERE feld->ControlName=:ControlName AND 
		           Sprache=:Sprache)
		
		Set s=##Class(DBCore.FeldhilfeStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set s.LetzteAenderung = $ZDT($H,3)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set feldOid = $lg(oid,1)
	
	&sql(DELETE FROM DBCore.FeldhilfeStream WHERE Feld = :feldOid)
			
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	&sql(DELETE FROM DBCore.FeldhilfeStream WHERE Feld = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Method name="GetFeldByControlname">
<ClassMethod>1</ClassMethod>
<FormalSpec>controlName:%String</FormalSpec>
<ReturnType>DBCore.FeldhilfeFeld</ReturnType>
<Implementation><![CDATA[
	set myID = ""
	&sql(SELECT ID INTO myID FROM DBCore.FeldhilfeFeld WHERE controlName=:controlName)
	Quit ##class(DBCore.FeldhilfeFeld).%OpenId(myID)
]]></Implementation>
</Method>

<Method name="GetClassName">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set lenght = $L(..ControlName,".")
	set name = $p(..ControlName,".",1,lenght-1)
	quit name
]]></Implementation>
</Method>

<Method name="GetClassNameClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>ID:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set o = ##class(DBCore.FeldhilfeFeld).%OpenId(ID)
	set name = o.GetClassName()
	set o = ""
	quit name
]]></Implementation>
</Method>

<Method name="GetStreamObject">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>DBCore.FeldhilfeStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(DBCore.FeldhilfeStream).%New()
	Set ControlName=..ControlName
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.FeldhilfeStream 
		      WHERE Feld->ControlName=:ControlName AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.FeldhilfeStream 
				 WHERE Feld->ControlName=:ControlName AND Sprache=:Sprache)
			Set tmpStream=##Class(DBCore.FeldhilfeStream).%OpenId(sID)
		}
		
	Quit tmpStream
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.FeldhilfeFeldD</DataLocation>
<DefaultData>FeldhilfeFeldDefaultData</DefaultData>
<IdLocation>^DBCore.FeldhilfeFeldD</IdLocation>
<IndexLocation>^DBCore.FeldhilfeFeldI</IndexLocation>
<StreamLocation>^DBCore.FeldhilfeFeldS</StreamLocation>
<Data name="FeldhilfeFeldDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>ControlName</Value>
</Value>
<Value name="3">
<Value>Status</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="ControlName">
</Property>
</Storage>
</Class>


<Class name="DBCore.FeldhilfeFirmaFeld">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61471,42507.171717</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="ControlName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="1024"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Index name="ControlNameIndex">
<Properties>ControlName</Properties>
<Unique>1</Unique>
</Index>

<Property name="Stream">
<Type>DBCore.FeldhilfeFirmaStream</Type>
<Cardinality>many</Cardinality>
<Inverse>Feld</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="OutputStream">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set ControlName=..ControlName
	Set Ret=""
	If ControlName'="" {
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.FeldhilfeFirmaStream 
		     WHERE Feld->ControlName=:ControlName AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.FeldhilfeFirmaStream 
				 WHERE Feld->ControlName=:ControlName AND 
				       Sprache=:Sprache)
			Set s=##Class(DBCore.FeldhilfeFirmaStream).%OpenId(sID)
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		} Else {
			Set StdSprache="de"
			&sql(SELECT count(*) As Cnt INTO :Cnt
			     FROM DBCore.FeldhilfeFirmaStream 
			     WHERE Feld->ControlName=:ControlName AND Sprache=:StdSprache)
			If (Cnt>0) {
				&sql(SELECT %ID INTO :sID 
				     FROM DBCore.FeldhilfeFirmaStream 
				     WHERE Feld->ControlName=:ControlName AND 
				           Sprache=:StdSprache)
				Set s=##Class(DBCore.FeldhilfeFirmaStream).%OpenId(sID)
				Set Size=s.DataStream.Size
				Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
			}
		}
	}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set ControlName=..ControlName
	Set sID = ""
	If (ControlName'="") {
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.FeldhilfeFirmaStream 
		     WHERE Feld->ControlName=:ControlName AND Sprache='de')
		
		If (Cnt=0) {
			Set myId=..%Id()
			Set n=##Class(DBCore.FeldhilfeFirmaStream).%New()
			Set n.Sprache = "de"
			Set n.Feld = ##Class(DBCore.FeldhilfeFirmaFeld).%OpenId(myId)
			Set Ret=n.%Save()
			Set Ret=n.DataStream.CopyFromAndSave(Stream)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.FeldhilfeFirmaStream 
		     WHERE Feld->ControlName=:ControlName AND Sprache=:Sprache)
		
		If (Cnt=0) {
			Set myId=..%Id()
			
			Set n=##Class(DBCore.FeldhilfeFirmaStream).%New()
			Set n.Sprache = Sprache
			Set n.Feld = ##Class(DBCore.FeldhilfeFirmaFeld).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBCore.FeldhilfeFirmaStream 
		     WHERE feld->ControlName=:ControlName AND 
		           Sprache=:Sprache)
		
				Set s=##Class(DBCore.FeldhilfeFirmaStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set feldOid = $lg(oid,1)
	
	&sql(DELETE FROM DBCore.FeldhilfeFirmaStream WHERE Feld = :feldOid)
			
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	&sql(DELETE FROM DBCore.FeldhilfeFirmaStream WHERE Feld = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Method name="GetFeldByControlname">
<ClassMethod>1</ClassMethod>
<FormalSpec>controlName:%String</FormalSpec>
<ReturnType>DBCore.FeldhilfeFirmaFeld</ReturnType>
<Implementation><![CDATA[
	set myID = ""
	&sql(SELECT ID INTO myID FROM DBCore.FeldhilfeFirmaFeld WHERE controlName=:controlName)
	Quit ##class(DBCore.FeldhilfeFirmaFeld).%OpenId(myID)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.FeldhilfeFirmaFeldD</DataLocation>
<DefaultData>FeldhilfeFirmaFeldDefaultData</DefaultData>
<IdLocation>^DBCore.FeldhilfeFirmaFeldD</IdLocation>
<IndexLocation>^DBCore.FeldhilfeFirmaFeldI</IndexLocation>
<StreamLocation>^DBCore.FeldhilfeFirmaFeldS</StreamLocation>
<Data name="FeldhilfeFirmaFeldDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>ControlName</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="ControlName">
</Property>
</Storage>
</Class>


<Class name="DBCore.FeldhilfeFirmaStream">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61471,42491.096483</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Sprache">
<Type>%String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="MINLEN" value="2"/>
</Property>

<Index name="SpracheIndex">
<Type>bitmap</Type>
<Properties>Sprache</Properties>
</Index>

<Property name="DataStream">
<Type>%GlobalBinaryStream</Type>
</Property>

<Property name="Feld">
<Type>DBCore.FeldhilfeFirmaFeld</Type>
<Cardinality>one</Cardinality>
<Inverse>Stream</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="FeldIndex">
<Properties>Feld</Properties>
</Index>

<Method name="InputFile">
<FormalSpec>PathFileName:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	If (PathFileName'="") {
		Set stream=##class(%FileBinaryStream).%New()
		Set stream.Filename=PathFileName
		Set Ret=..DataStream.CopyFromAndSave(stream)
		Set stream=""
		do ..%Save()
		Quit Ret=1 
	} Else {
		Quit 0
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.FeldhilfeFirmaStreamD</DataLocation>
<DefaultData>FeldhilfeFirmaStreamDefaultData</DefaultData>
<IdLocation>^DBCore.FeldhilfeFirmaStreamD</IdLocation>
<IndexLocation>^DBCore.FeldhilfeFirmaStreamI</IndexLocation>
<StreamLocation>^DBCore.FeldhilfeFirmaStreamS</StreamLocation>
<Data name="FeldhilfeFirmaStreamDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Sprache</Value>
</Value>
<Value name="3">
<Value>DataStream</Value>
</Value>
<Value name="4">
<Value>Feld</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="DataStream">
</Property>
<Property name="Feld">
</Property>
<Property name="Sprache">
</Property>
</Storage>
</Class>


<Class name="DBCore.FeldhilfeStream">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61466,52363.130202</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Sprache">
<Type>%String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="MINLEN" value="2"/>
</Property>

<Index name="SpracheIndex">
<Type>bitmap</Type>
<Properties>Sprache</Properties>
</Index>

<Property name="DataStream">
<Type>%GlobalBinaryStream</Type>
</Property>

<Property name="Feld">
<Type>DBCore.FeldhilfeFeld</Type>
<Cardinality>one</Cardinality>
<Inverse>Stream</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="FeldIndex">
<Properties>Feld</Properties>
</Index>

<Property name="LetzteAenderung">
<Type>%TimeStamp</Type>
</Property>

<Property name="Status">
<Type>%Integer</Type>
</Property>

<Property name="LetzterBenutzer">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="InputFile">
<FormalSpec>PathFileName:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	If (PathFileName'="") {
		Set stream=##class(%FileBinaryStream).%New()
		Set stream.Filename=PathFileName
		Set Ret=..DataStream.CopyFromAndSave(stream)
		Set stream=""
		Set ..LetzteAenderung = $ZDT($H,3)
		do ..%Save()
		Quit Ret=1 
	} Else {
		Quit 0
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.FeldhilfeStreamD</DataLocation>
<DefaultData>FeldhilfeStreamDefaultData</DefaultData>
<IdLocation>^DBCore.FeldhilfeStreamD</IdLocation>
<IndexLocation>^DBCore.FeldhilfeStreamI</IndexLocation>
<StreamLocation>^DBCore.FeldhilfeStreamS</StreamLocation>
<Data name="FeldhilfeStreamDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Sprache</Value>
</Value>
<Value name="3">
<Value>DataStream</Value>
</Value>
<Value name="4">
<Value>Feld</Value>
</Value>
<Value name="5">
<Value>LetzteAenderung</Value>
</Value>
<Value name="6">
<Value>Status</Value>
</Value>
<Value name="7">
<Value>LetzterBenutzer</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="DataStream">
</Property>
<Property name="Feld">
</Property>
<Property name="LetzteAenderung">
</Property>
<Property name="LetzterBenutzer">
</Property>
<Property name="Sprache">
</Property>
<Property name="Status">
</Property>
</Storage>
</Class>


<Class name="DBCore.FormularNr">
<Super>%RegisteredObject</Super>
<TimeChanged>62222,56131.721927</TimeChanged>
<TimeCreated>62104,52854.245855</TimeCreated>

<Method name="FormNrAgrofreshAuftrag">
<Description>
Formularnummerierungsart für Agrofresh Auftragsnummer</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 0
]]></Implementation>
</Method>

<Method name="FormNrAgrofreshLieferung">
<Description>
Formularnummerierungsart für Agrofresh LieferscheinNr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1
]]></Implementation>
</Method>

<Method name="FormNrAgrofreshRechnung">
<Description>
Formularnummerierungsart für Agrofresh RechnungsNr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 2
]]></Implementation>
</Method>

<Method name="FormNrAgrofreshEKBestellung">
<Description>
Formularnummerierungsart für Agrofresh Einkauf BestellungsNr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 3
]]></Implementation>
</Method>

<Method name="FormNrAgrofreshEKAnnahme">
<Description>
Formularnummerierungsart für Agrofresh Einkauf Annahmenummer</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 4
]]></Implementation>
</Method>

<Method name="FormNrAgrofreshEKAbrechnung">
<Description>
Formularnummerierungsart für Agrofresh Einkauf Abrechnungsnr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 5
]]></Implementation>
</Method>

<Method name="FormNrAgrofreshVerteilliste">
<Description>
Formularnummerierungsart für Agrofresh Einkauf Abrechnungsnr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 6
]]></Implementation>
</Method>

<Method name="EanLaufnrOrthoArtikel">
<Description>
Laufnummer für die Ean-Codes der Schuhe im Ortho-Modul</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[     Quit 7
]]></Implementation>
</Method>

<Method name="FormNrAgrofreshHogaImpProtokoll">
<Description>
Formularnummerierungsart für Agrofresh Einkauf Abrechnungsnr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 8
]]></Implementation>
</Method>

<Method name="FormNrDispoTransportschein">
<Description>
Formularnummerierungsart für Agrofresh Einkauf Abrechnungsnr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 9
]]></Implementation>
</Method>

<Method name="FormNrAgrofreshEKBestelliste">
<Description>
Formularnummerierungsart für AgrofreshEK Bestelliste</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 10
]]></Implementation>
</Method>

<Method name="FormNrFaktAuftrag">
<Description>
Formularnummerierungsart für Agrofresh Auftragsnummer</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 11
]]></Implementation>
</Method>

<Method name="FormNrFaktLieferung">
<Description>
Formularnummerierungsart für Agrofresh LieferscheinNr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 12
]]></Implementation>
</Method>

<Method name="FormNrFaktRechnung">
<Description>
Formularnummerierungsart für Agrofresh RechnungsNr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 13
]]></Implementation>
</Method>

<Method name="FormNrFaktEKBestellung">
<Description>
Formularnummerierungsart für FaktEK BestellungsNr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 14
]]></Implementation>
</Method>

<Method name="FormNrFaktEKAnnahme">
<Description>
Formularnummerierungsart für FaktEK AnnahmeNr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 15
]]></Implementation>
</Method>

<Method name="FormNrFaktEKAbrechnung">
<Description>
Formularnummerierungsart für FaktEK AbrechnungsNr</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 16
]]></Implementation>
</Method>

<Method name="GetAktuelleNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Typ:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit $Get(^FormularNr(MandantOid, Typ))
]]></Implementation>
</Method>

<Method name="SetAktuelleNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Typ:%Integer,AktuelleNr:%Integer</FormalSpec>
<Implementation><![CDATA[	Set ^FormularNr(MandantOid, Typ) = AktuelleNr
]]></Implementation>
</Method>
</Class>


<Class name="DBCore.HelpMenuEntry">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57214.36688</TimeChanged>
<TimeCreated>61586,39516.357162</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Nummer">
<Type>%Integer</Type>
<InitialExpression>0</InitialExpression>
<Parameter name="MINVAL" value="0"/>
</Property>

<Property name="Sprache">
<Type>%String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Text">
<Type>%String</Type>
<Parameter name="MAXLEN" value="50"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ToolTipText">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Pfad">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ModulNummer">
<Type>%Integer</Type>
</Property>

<Property name="Parent">
<Type>DBCore.HelpMenuEntry</Type>
<Cardinality>one</Cardinality>
<Inverse>Child</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="ParentIndex">
<Properties>Parent</Properties>
</Index>

<Property name="Child">
<Type>DBCore.HelpMenuEntry</Type>
<Cardinality>many</Cardinality>
<Inverse>Parent</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="%OnDelete">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set myId = $lg(oid,1)
	d ##class(DBUtils.ClassHelper).DeleteManyRelations("DBCore.HelpMenuEntry", myId)
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code>	set myId = {ID*O}
	Quit ##class(DBUtils.ClassHelper).DeleteManyRelations("DBCore.HelpMenuEntry", myId)</Code>
<Event>DELETE</Event>
</Trigger>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.HelpMenuEntryD</DataLocation>
<DefaultData>HelpMenuEntryDefaultData</DefaultData>
<IdLocation>^DBCore.HelpMenuEntryD</IdLocation>
<IndexLocation>^DBCore.HelpMenuEntryI</IndexLocation>
<StreamLocation>^DBCore.HelpMenuEntryS</StreamLocation>
<Data name="HelpMenuEntryDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Sprache</Value>
</Value>
<Value name="4">
<Value>Text</Value>
</Value>
<Value name="5">
<Value>Pfad</Value>
</Value>
<Value name="6">
<Value>ModulNummer</Value>
</Value>
<Value name="7">
<Value>Parent</Value>
</Value>
<Value name="8">
<Value>ToolTipText</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="ModulNummer">
</Property>
<Property name="Nummer">
</Property>
<Property name="Parent">
</Property>
<Property name="Pfad">
</Property>
<Property name="Sprache">
</Property>
<Property name="Text">
</Property>
<Property name="ToolTipText">
</Property>
</Storage>
</Class>


<Class name="DBCore.Helpers">
<Super>%RegisteredObject</Super>
<TimeChanged>61422,29490</TimeChanged>
<TimeCreated>61256,32236.68455</TimeCreated>

<Method name="Exists">
<ClassMethod>1</ClassMethod>
<FormalSpec>Value:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	///Quit length(ISNULL(Value,'')) = 0
	/// Set re=##Class(DBCore.Report).%OpenId(myID)
	/// Set result = re.Benutzer = null
	/// Set re=##Class(DBCore.Report).%OpenId(myID)
	if (Value = "") {
		Quit 0
	} else {
		Quit 1	
	}
]]></Implementation>
</Method>
</Class>


<Class name="DBCore.Konst">
<Super>%RegisteredObject</Super>
<TimeChanged>62241,58905.230209</TimeChanged>
<TimeCreated>61332,43188.730256</TimeCreated>

<Parameter name="SPRACHCODEDE">
<Default>de</Default>
</Parameter>

<Parameter name="SPRACHCODEFR">
<Default>fr</Default>
</Parameter>

<Parameter name="SPRACHCODEIT">
<Default>it</Default>
</Parameter>

<Parameter name="SPRACHCODEEN">
<Default>en</Default>
</Parameter>

<Method name="KEINRECHTERFASST">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit -1
]]></Implementation>
</Method>

<Method name="KEINRECHT">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 0
]]></Implementation>
</Method>

<Method name="LESERECHT">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1
]]></Implementation>
</Method>

<Method name="SCHREIBRECHT">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 2
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Konstante der MandantenEinstellungen

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Einstellung ob die anzahl Pallette in der Faktuierung automatisch berechnet werden wird

]]></Content>
</UDLText>

<Method name="AGROFRESHAUTOPALCALC">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1180079
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Konstante der MandantenEinstellungen

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Einstellung welcher Gebindetyp das Pallett ist"

]]></Content>
</UDLText>

<Method name="AGROFRESHGEBTYPPALLETTE">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1180080
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Konstante der MandantenEinstellungen Agrofresh

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Einstellung bis zu welcher Artikelgruppe Rabatt gegeben wird.

]]></Content>
</UDLText>

<Method name="AGROFRESHABZUGBISAGR">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1180099
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Konstante der MandantenEinstellungen Agrofresh Einkauf

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Einstellung ob die anzahl Pallette in der Faktuierung automatisch berechnet werden wird

]]></Content>
</UDLText>

<Method name="AGROFRESHEKAUTOPALCALC">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1210059
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Konstante der MandantenEinstellungen Agrofresh Einkauf

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Einstellung welcher Gebindetyp das Pallett ist"

]]></Content>
</UDLText>

<Method name="AGROFRESHEKGEBTYPPALLETTE">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1210060
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Konstante der MandantenEinstellungen Stammdaten

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Einstellung ob Beträge auf 5er oder Rappen gerundet sind

]]></Content>
</UDLText>

<Method name="STAMMDATENSTAMMRUNDUNG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1040001
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Konstante der MandantenEinstellungen Fakturierung

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Einstellung der letzten vergebenen EAN Nummer

]]></Content>
</UDLText>

<Method name="FAKTURIERUNGEANNUMMER">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1150074
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Einstellung  Beträge werden auf Rappen gerundet

]]></Content>
</UDLText>

<Method name="RUNDUNG1">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Einstellung  Beträge werden auf Franken gerundet

]]></Content>
</UDLText>

<Method name="RUNDUNG1FR">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 2
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Einstellung  Beträge werden auf 5 Rappen gerundet

]]></Content>
</UDLText>

<Method name="RUNDUNG5">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 5
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Mwst Code Steuerung Keine

]]></Content>
</UDLText>

<Method name="MWSTSTEUERUNGKEINE">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[	Quit 0
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Mwst Code Steuerung Inkl

]]></Content>
</UDLText>

<Method name="MWSTSTEUERUNGINKL">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[	Quit 1
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Mwst Code Steuerung Urproduktion

]]></Content>
</UDLText>

<Method name="MWSTSTEUERUNGURPROD">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[	Quit 2
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Mwst Code Steuerung Exklusive

]]></Content>
</UDLText>

<Method name="MWSTSTEUERUNGEXKL">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[	Quit 3
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Mwst Code Steuerung Export

]]></Content>
</UDLText>

<Method name="MWSTSTEUERUNGEXPORT">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[	Quit 4
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Einstellungen für die Plattform / Allianz

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Mandant Oid, auf welcher die Plattform läuft

]]></Content>
</UDLText>

<Method name="PLATTFORMMANDANT">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1000025
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Einstellung für Path von Agris.exe

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Damit diese aus Cache aufgerufen werden kann

]]></Content>
</UDLText>

<Method name="AGRISPATH">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1000026
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Einstellung für Plattform / Verteilung

]]></Content>
</UDLText>

<Method name="AGROFRESHVERARBEITUNGSTYP">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1180106
]]></Implementation>
</Method>

<Method name="AGROFRESHEDIPREISUEBERNEHMEN">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1180209
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//Konstanten für Wochentage

]]></Content>
</UDLText>

<Method name="SONNTAG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 0
]]></Implementation>
</Method>

<Method name="MONTAG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1
]]></Implementation>
</Method>

<Method name="DIENSTAG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 2
]]></Implementation>
</Method>

<Method name="MITTWOCH">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 3
]]></Implementation>
</Method>

<Method name="DONNERSTAG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 4
]]></Implementation>
</Method>

<Method name="FREITAG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 5
]]></Implementation>
</Method>

<Method name="SAMSTAG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 6
]]></Implementation>
</Method>

<Method name="WOCHENBEGINN">
<Description>
Einstellung für Wochenbeginn</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1010013
]]></Implementation>
</Method>

<Method name="KALENDERWOCHENART">
<Description>
Einstellung für Kalenderwoche</Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1010014
]]></Implementation>
</Method>

<Method name="WOCHENBEGINNMONTAG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 0
]]></Implementation>
</Method>

<Method name="WOCHENBEGINNSONNTAG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1
]]></Implementation>
</Method>

<Method name="KALENDERWOCHEGEMUSA">
<Description><![CDATA[
Gemäss Cache: http://localhost:57772/csp/docbook/DocBook.UI.Page.cls?KEY=RSQL_week</summary>]]></Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 0
]]></Implementation>
</Method>

<Method name="KALENDERWOCHEGEMISONORM">
<Description><![CDATA[
Gemäss ISO NORM: http://de.wikipedia.org/wiki/Woche#Z.C3.A4hlweise_nach_DIN_1355_.2F_ISO_8601</summary>]]></Description>
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1
]]></Implementation>
</Method>

<Method name="INVOICEBUYER">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1180145
]]></Implementation>
</Method>

<Method name="INVOICERECHNUNGSPRUEFUNG">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1180146
]]></Implementation>
</Method>

<Method name="MANDANTSTATUSAKTIV">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[	Quit 0
]]></Implementation>
</Method>

<Method name="MANDANTSTATUSINAKTIV">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[	Quit 1
]]></Implementation>
</Method>

<Method name="MANDANTSTATUSGESPERRT">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[	Quit 2
]]></Implementation>
</Method>

<Method name="AGROFRESHDISPOCHECKANGEBOT">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit 1200011
]]></Implementation>
</Method>
</Class>


<Class name="DBCore.MandAHV">
<Description>
</Description>
<Owner>cbt</Owner>
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61025,28305.272172</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Property name="AHVNr">
<Type>%Integer</Type>
</Property>

<UDLText name="T">
<Content><![CDATA[
//Relationship AHV As DBCore.AHV [ Cardinality = one, Inverse = AHVMandant ];

]]></Content>
</UDLText>

<Index name="MandAHVIndex">
<Properties>Mandant,AHVNr</Properties>
<Unique>1</Unique>
</Index>

<Property name="Laufnummer">
<Type>%Integer</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.MandAHVD</DataLocation>
<DefaultData>MandAHVDefaultData</DefaultData>
<IdLocation>^DBCore.MandAHVD</IdLocation>
<IndexLocation>^DBCore.MandAHVI</IndexLocation>
<StreamLocation>^DBCore.MandAHVS</StreamLocation>
<Data name="MandAHVDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>AHVNr</Value>
</Value>
<Value name="4">
<Value>Laufnummer</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="AHVNr">
</Property>
<Property name="Laufnummer">
</Property>
<Property name="Mandant">
</Property>
</Storage>
</Class>


<Class name="DBCore.Mandant">
<Super>%Persistent,%Populate,%XML.Adaptor</Super>
<TimeChanged>62427,55485.37662</TimeChanged>
<TimeCreated>60911,48143.406303</TimeCreated>
<Inheritance>right</Inheritance>

<Index name="MandIdIndex">
<Properties>StrId</Properties>
<Unique>1</Unique>
</Index>

<Property name="StrId">
<Type>%String</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {StrId}={ID} </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Mandantnr">
<Type>%Library.Integer</Type>
<Required>1</Required>
<Parameter name="MAXVAL" value="9999999"/>
<Parameter name="MINVAL" value="10000"/>
<Parameter name="POPSPEC" value="Integer(10000,99999)"/>
</Property>

<Property name="Anrede">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="ValueList(&quot;,Herr,Frau&quot;)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Kurzname">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="Name()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Name">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="LastName()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Sprachcode">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Strasse">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="Street()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Telefon">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="USPhone()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Telefon2">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="USPhone()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Fax">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="USPhone()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Mobil">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="USPhone()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="EMail">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(35)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Web">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(60)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Bemerkung">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(50)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Bezeichnung">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(40)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Branchencode">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(35)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ZuHanden">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(25)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="PersAnrede">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(50)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Gebiet">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="99"/>
<Parameter name="MINVAL" value="0"/>
<Parameter name="POPSPEC" value="Integer(0,99)"/>
</Property>

<Property name="MwstNummer">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(10)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Ablage">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="String(25)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Fremdmandanten">
<Type>%Integer</Type>
<Collection>array</Collection>
</Property>

<Property name="Ort">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="City()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Plz">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="15"/>
<Parameter name="POPSPEC" value="USZip()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="PlzInklZusatz">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="15"/>
<Parameter name="POPSPEC" value="USZip()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="UID">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="12"/>
<Parameter name="POPSPEC" value="String(12)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="LastMandant">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set mandnr = $Order(^DBCore.MandantI("MandantnrIndex",""),-1)
	set oid = $Order(^DBCore.MandantI("MandantnrIndex",mandnr,""),-1)
	Quit oid
]]></Implementation>
</Method>

<Method name="FirstMandant">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set mandnr = $Order(^DBCore.MandantI("MandantnrIndex",""))
	set oid = $Order(^DBCore.MandantI("MandantnrIndex",mandnr,""))
	Quit oid
]]></Implementation>
</Method>

<Method name="NextMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>Mandnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set mandnr = $Order(^DBCore.MandantI("MandantnrIndex", Mandnr))
	set oid = ""
	if mandnr '= "" {
		set oid = $Order(^DBCore.MandantI("MandantnrIndex", mandnr, ""))
	
		if oid = "" {
			set mandnr = $Order(^DBCore.MandantI("MandantnrIndex", Mandnr),-1)
			if mandnr '= "" {
				set oid = $Order(^DBCore.MandantI("MandantnrIndex", mandnr, ""),-1)
			}
		}
	} else {
		
		set oid = ##class(DBCore.Mandant).LastMandant()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="PrevMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>Mandnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set mandnr = $Order(^DBCore.MandantI("MandantnrIndex", Mandnr),-1)
	set oid = ""
	if mandnr '= "" {
		set oid = $Order(^DBCore.MandantI("MandantnrIndex", mandnr, ""),-1)
	
		if oid = "" {
			set mandnr = $Order(^DBCore.MandantI("MandantnrIndex", Mandnr))
			if mandnr '= "" {
				set oid = $Order(^DBCore.MandantI("MandantnrIndex", mandnr, ""))
			}
		}
	} else {
		
		set oid = ##class(DBCore.Mandant).FirstMandant()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Index name="MandantnrIndex">
<Properties>Mandantnr</Properties>
<Unique>1</Unique>
</Index>

<Method name="GetFremdmandant">
<FormalSpec>Modul:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set res = ..Fremdmandanten.GetAt(Modul)
	if (res'="") {
		Quit res
	} Else {
		Quit -1
	}
]]></Implementation>
</Method>

<Method name="SetFremdmandant">
<FormalSpec>Modul:%Integer,MandNr:%Integer</FormalSpec>
<Implementation><![CDATA[

	Set res = ..Fremdmandanten.SetAt(MandNr,Modul)
]]></Implementation>
</Method>

<Method name="GetMandantIdByMandantNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set id = ""
	&sql(SELECT ID INTO :id
			FROM DBCore.Mandant 
			WHERE Mandantnr = :MandantNr 
			ORDER BY Mandantnr)
	Quit id
]]></Implementation>
</Method>

<Method name="CopyMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>srcOid:%String,destMandnr:%Integer,destMandKurzname:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
 
	set retval = ""
	set result = ##class(%Library.ResultSet).%New("DBCore.AF.MandantAF:ListeNachMandnr")
	set mands = result.%Execute(destMandnr)
	set id = ""
	set status = 0
	
	while result.Next(.mands) {
		set id = result.Data("ID")
	}
	
	if id '= "" {
		Quit retval
	
	} else {
		
		set mandOld = ##class(DBCore.Mandant).%OpenId(srcOid)
		
		set ptr = ##class(DBCore.Mandant).%New()
		set ptr.Mandantnr = destMandnr
		set ptr.Kurzname = destMandKurzname
		set ptr.Anrede = mandOld.Anrede
		set ptr.Name = mandOld.Name
		set ptr.Sprachcode = mandOld.Sprachcode
		set ptr.Strasse = mandOld.Strasse
		set ptr.Telefon = mandOld.Telefon
		set ptr.Telefon2 = mandOld.Telefon2
		set ptr.Fax = mandOld.Fax
		set ptr.Mobil = mandOld.Mobil
		set ptr.EMail = mandOld.EMail
		set ptr.Web = mandOld.Web
		set ptr.Bemerkung = mandOld.Bemerkung
		set ptr.Bezeichnung = mandOld.Bezeichnung
		set ptr.Branchencode = mandOld.Branchencode
		set ptr.ZuHanden = mandOld.ZuHanden
		set ptr.PersAnrede = mandOld.PersAnrede
		set ptr.Gebiet = mandOld.Gebiet
		set ptr.GeschaeftsjahrBeginn = mandOld.GeschaeftsjahrBeginn
		set ptr.GeschaeftsjahrEnde = mandOld.GeschaeftsjahrEnde
		set ptr.MwstNummer = mandOld.MwstNummer
		set ptr.Ablage = mandOld.Ablage
		set ptr.Plz = mandOld.Plz
		set ptr.Sachbearbeiter1 = mandOld.Sachbearbeiter1
		set ptr.Sachbearbeiter2 = mandOld.Sachbearbeiter2
		//set ptr.BenutzerAktiverMandant = mandOld.BenutzerAktiverMandant
		do ptr.%Save()
		set retval = ptr.%Id()
		
		//*************************************************************
		//Hier sämtliche zu kopierenden Klassen aufführen!!!
		//*************************************************************
		do ..CopyClassRelation(srcOid, retval, "DBAdressen.SD.Anrede", "AktMandant")
		
		/*
		do ##class(DBAdressen.SD.Anrede).CopyAnredenFromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Branche).CopyBranchenFromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Briefanrede).CopyBriefanredenFromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Gebiet).CopyGebietFromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Kundengruppe).CopyKundengruppenFromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Kundenkategorie).CopyKundenkategorieFromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Preiskategorie).CopyPreiskategorieFromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Selektion1).CopySelektion1FromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Selektion2).CopySelektion2FromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Status).CopyStatiFromMandant(srcOid, retval)
		do ##class(DBAdressen.SD.Vertreter).CopyVertreterFromMandant(srcOid, retval)
		*/
		do ##class(DBCore.Mandant).%BuildIndices()
		
		Quit retval
			
	}
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	
	set myId = $lg(oid,1)
	set st = ##class(DBUtils.ClassHelper).DeleteManyRelations("DBCore.Mandant", myId)
	if ($$$ISOK(st)) {
		set stFK = ##class(DBUtils.ClassHelper).DeleteMandantFKRelations(myId)
		Quit stFK
	} else {
		Quit st	
	}
]]></Implementation>
</Method>

<Trigger name="DeleteAllRel">
<Description>
Löscht alle Objekte von Klassen die in einer Many-Beziehung stehen</Description>
<Code>	new myId
	Set myId={ID}
	do ##class(DBUtils.ClassHelper).DeleteManyRelations("DBCore.Mandant", myId)
	do ##class(DBUtils.ClassHelper).DeleteMandantFKRelations(myId)</Code>
<Event>DELETE</Event>
<Foreach>row</Foreach>
</Trigger>

<Method name="ExportXml">
<Description>
Exportiert ein Objekt mit allen seinen Abhängigkeiten und 
in Beziehung stehenden Klassen in ein XML-File.
ACHTUNG: die Klassen-OREF (ID) werden nicht ausgegeben</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>myPathFile:%String,myID:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
    Quit:($L(myPathFile,"\")<=1)||(myID="") 0
    Set xmlWriter=##class(%XML.Writer).%New()
    Set xmlWriter.Indent=1
    Set sc=xmlWriter.OutputToFile(myPathFile)
    Set:$$$ISOK(sc) sc=xmlWriter.RootElement("Daten")
    If $$$ISOK(sc) {
	    Set rs=..%OpenId(myID)
        Set sc=xmlWriter.Object(rs)
    }
    Set:$$$ISOK(sc) sc=xmlWriter.EndRootElement()
    Do:$$$ISERR(sc) $System.Status.DisplayError(sc)
    Quit sc
]]></Implementation>
</Method>

<Method name="ImportXml">
<ClassMethod>1</ClassMethod>
<FormalSpec>myPathFile:%String</FormalSpec>
<ReturnType>%Library.Status</ReturnType>
<Implementation><![CDATA[
	//Alter Import
  /*  // Create an instance of %XML.Reader
    Set xmlReader = ##class(%XML.Reader).%New()
    // Begin processing of the file
    Set sc = xmlReader.OpenFile(myPathFile)
    
    Set myClass=$classmethod("DBCore.Mandant","%New") 
    If $$$ISOK(sc) { 
        // Associate a class name with the XML element name 
        Do xmlReader.Correlate("Mandant", "DBCore.Mandant") 
        // read myClass objects from xml file 
        While xmlReader.Next(.myClass,.sc) { 
            Set sc=myClass.%Save() 
            Quit:$$$ISERR(sc) 
        } 
    }
    Do:$$$ISERR(sc) $system.OBJ.DisplayError(sc) 
    Quit sc*/
    
    //Aktueller Import
]]></Implementation>
</Method>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<UDLText name="T">
<Content><![CDATA[
//Parameter XMLIGNORENULL = 1;

]]></Content>
</UDLText>

<Method name="CopyClassRelation">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oId:%String,nId:%String,cName:%String,rName:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	Quit:(oId="")||(nId="")||(cName="") 0 ;$$$OK
	Set strSQL="SELECT ID FROM "_cName_" WHERE "_rName_" = "_oId
	Set s=##class(%ResultSet).%New("%DynamicQuery:SQL")
	Do s.Prepare(strSQL)
	Set sc=s.Execute()
	IF $$$ISOK(sc) {
		While s.Next(.sc) {
			Set n=$CLASSMETHOD(cName,"%New")
			Set o=$CLASSMETHOD(cName,"%OpenId",s.ID)
			Set n=o.%ConstructClone(0)
			Set prp="n."_rName
			;w prp,!
			//Set @(prp_"=##class(DBCore.Mandant).%OpenId(nId)") ;##class(DBCore.Mandant).%OpenId(nId)
			Set n.Mandant=4
			Set sc=n.%Save()
			Quit:$$$ISERR(sc)
		}
	}
	Quit sc
]]></Implementation>
</Method>

<Method name="GetSprachcode">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set m=..%OpenId(MandOid)
	Set sc=m.Sprachcode
	kill m
	Quit sc
]]></Implementation>
</Method>

<Trigger name="trgOnAfterSave">
<Code>	set myId = {ID*N}
	do ##class(DBCore.Mandant).GenerateStandardValues(myId)</Code>
<Event>INSERT</Event>
<Time>AFTER</Time>
<Foreach>row</Foreach>
</Trigger>

<Method name="%OnAfterSave">
<FormalSpec>insert:%Library.Boolean</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set cs = 1
	if (insert) {
		set myId = +..%Id()
		do ##class(DBCore.Mandant).GenerateStandardValues(myId)
		
	}
	Quit cs
]]></Implementation>
</Method>

<Method name="GenerateStandardValues">
<ClassMethod>1</ClassMethod>
<FormalSpec>myId:%Integer</FormalSpec>
<Implementation><![CDATA[
	
	set exists = ""
	&sql(SELECT ID INTO :exists 
		FROM DBFibu_SD.Fremdwaehrung 
		WHERE Mandant = :myId AND FWCode=1)
	if (exists="") {
		set fw = ##class(DBFibu.SD.Fremdwaehrung).%New()
		set fw.Mandant = myId
		set fw.FWCode = 1
		set fw.Faktor = 1.0
		set fw.KursAnkauf = 1.0
		set fw.KursVK = 1.0
		set fw.Waehrung = "SFr"
		set fw.ISOSWIFTCode = "CHF"
		do fw.Bezeichnung.SetAt("Basiswährung", ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"))
		do fw.Bezeichnung.SetAt("monnaie de base", ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"))
		do fw.Bezeichnung.SetAt("valuta di base", ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"))
		do fw.Bezeichnung.SetAt("base currency", ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"))
		set cs = fw.%Save()
		set fw = ""
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBFibu_SD.KontoBereichTyp
		WHERE Mandant = :myId AND Nr=0)
	if (exists="") {
		set bertyp = ##class(DBFibu.SD.KontoBereichTyp).%New()
		set bertyp.Mandant = myId
		set bertyp.Nr = "0"
		set bertyp.Bezeichnung = "Standardbereich"
		set cs = bertyp.%Save()
		set bertyp = ""
	}
			
	&sql(SELECT ID INTO :exists 
		FROM DBFakturierung_SD.Lagerort
		WHERE Mandant = :myId AND PositionsNr=0)
	if (exists="") {
	// Lagerort Gesamtlager
		set lagerort = ##class(DBFakturierung.SD.Lagerort).%New()
		set lagerort.Mandant = myId
		set lagerort.PositionsNr = "0"
		do lagerort.Text.SetAt("Gesamtlager", ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"))
		do lagerort.Text.SetAt("dépôt globale", ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"))
		do lagerort.Text.SetAt("magazzino totale", ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"))
		do lagerort.Text.SetAt("total stock", ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"))
		do lagerort.%Save()
	}

	&sql(SELECT ID INTO :exists 
		FROM DBFakturierung_SD.Lagerort
		WHERE Mandant = :myId AND PositionsNr=1)
	if (exists="") {
		// Lagerort Fakturierung Hauptlager
		set lagerort = ##class(DBFakturierung.SD.Lagerort).%New()
		set lagerort.Mandant = myId
		set lagerort.PositionsNr = "1"
		do lagerort.Text.SetAt("Hauptlager", ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"))
		do lagerort.Text.SetAt("dépôt principale", ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"))
		do lagerort.Text.SetAt("magazzino principale", ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"))
		do lagerort.Text.SetAt("main stock", ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"))
		do lagerort.%Save()
	}

	&sql(SELECT ID INTO :exists 
		FROM DBAgrofresh_SD.Lagerort
		WHERE Mandant = :myId AND PositionsNr=0)
	if (exists="") {
	// Lagerort Gesamtlager
		set lagerort = ##class(DBAgrofresh.SD.Lagerort).%New()
		set lagerort.Mandant = myId
		set lagerort.PositionsNr = "0"
		do lagerort.Text.SetAt("Gesamtlager", ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"))
		do lagerort.Text.SetAt("dépôt globale", ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"))
		do lagerort.Text.SetAt("magazzino totale", ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"))
		do lagerort.Text.SetAt("total stock", ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"))
		do lagerort.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBAgrofresh_SD.Lagerort
		WHERE Mandant = :myId AND PositionsNr=1)
	if (exists="") {
	// Lagerort Hauptlager
		set lagerort = ##class(DBAgrofresh.SD.Lagerort).%New()
		set lagerort.Mandant = myId
		set lagerort.PositionsNr = "1"
		do lagerort.Text.SetAt("Hauptlager", ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"))
		do lagerort.Text.SetAt("dépôt principale", ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"))
		do lagerort.Text.SetAt("magazzino principale", ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"))
		do lagerort.Text.SetAt("main stock", ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"))
		do lagerort.%Save()
	}

	&sql(SELECT ID INTO :exists 
		FROM DBAgrofresh_SD.Drucktyp
		WHERE Mandant = :myId AND PositionsNr=1)
	if (exists="") {
	// Drucktyp - Standard
		set drucktyp = ##class(DBAgrofresh.SD.Drucktyp).%New()
		set drucktyp.Mandant = myId
		set drucktyp.PositionsNr = "1"
		do drucktyp.Text.SetAt("Standard", ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"))
		do drucktyp.Text.SetAt("standard", ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"))
		do drucktyp.Text.SetAt("standard", ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"))
		do drucktyp.Text.SetAt("standard", ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"))
		do drucktyp.%Save()
	}

	&sql(SELECT ID INTO :exists 
		FROM DBCore.MandantSprache
		WHERE Mandant = :myId AND Code=1)
	if (exists="") {
	//Sprachen
		set sprache = ##class(DBCore.MandantSprache).%New()
		set sprache.Mandant = myId
		set sprache.Code = 1
		set sprache.Sprachkey = ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE")
		set sprache.Bezeichnung = "Deutsch"
		set cs = sprache.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBCore.MandantSprache
		WHERE Mandant = :myId AND Code=2)
	if (exists="") {
		set sprache2 = ##class(DBCore.MandantSprache).%New()
		set sprache2.Mandant = myId
		set sprache2.Code = 2
		set sprache2.Sprachkey = ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR")
		set sprache2.Bezeichnung = "Französisch"
		set cs = sprache2.%Save()
	}

	&sql(SELECT ID INTO :exists 
		FROM DBCore.MandantSprache
		WHERE Mandant = :myId AND Code=3)
	if (exists="") {
		set sprache3 = ##class(DBCore.MandantSprache).%New()
		set sprache3.Mandant = myId
		set sprache3.Code = 3
		set sprache3.Sprachkey = ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT")
		set sprache3.Bezeichnung = "Italienisch"
		set cs = sprache3.%Save()
	}

	&sql(SELECT ID INTO :exists 
		FROM DBCore.MandantSprache
		WHERE Mandant = :myId AND Code=4)
	if (exists="") {
		set sprache4 = ##class(DBCore.MandantSprache).%New()
		set sprache4.Mandant = myId
		set sprache4.Code = 4
		set sprache4.Sprachkey = ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN")
		set sprache4.Bezeichnung = "Englisch"
		set cs = sprache4.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBAdressen_SD.KorrTyp
		WHERE AktMandant = :myId AND Code= DBAdressen.Konst_SerienbriefStd())
	if (exists="") {
	// Korrespondenztyp Serienbrief
		set korrtyp = ##class(DBAdressen.SD.KorrTyp).%New()
		set korrtyp.AktMandant = myId
		set korrtyp.Code = ##class(DBAdressen.Konst).SerienbriefStd()
		set korrtyp.Kuerzel = "SB"
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"), "Serienbrief")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"), "lettre en série")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"), "lettre di serie")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"), "serial letter")
		do korrtyp.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBAdressen_SD.KorrTyp
		WHERE AktMandant = :myId AND Code= DBAdressen.Konst_SerienbriefVerband())
	if (exists="") {
	// Korrespondenztyp Verbandsbrief
		set korrtyp = ##class(DBAdressen.SD.KorrTyp).%New()
		set korrtyp.AktMandant = myId
		set korrtyp.Code = ##class(DBAdressen.Konst).SerienbriefVerband()
		set korrtyp.Kuerzel = "VB"
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"), "Verbandsbrief")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"), "lettré de association")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"), "lettra dei associazione")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"), "association letter")
		do korrtyp.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBAdressen_SD.KorrTyp
		WHERE AktMandant = :myId AND Code= DBAdressen.Konst_SerienbriefMitglied())
	if (exists="") {
	// Korrespondenztyp Mitgliedsbrief
		set korrtyp = ##class(DBAdressen.SD.KorrTyp).%New()
		set korrtyp.AktMandant = myId
		set korrtyp.Code = ##class(DBAdressen.Konst).SerienbriefMitglied()
		set korrtyp.Kuerzel = "MB"
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"), "Mitgliedsbrief")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"), "lettré de membre")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"), "lettra dei membro")
		do korrtyp.SetKorrTypText(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"), "member letter")
		do korrtyp.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBAdressen_SD.Status
		WHERE AktMandant = :myId AND Code= DBAdressen.Konst_StatusErfasst())
	if (exists="") {
	// Status Erfasst
		set korrtyp = ##class(DBAdressen.SD.Status).%New()
		set korrtyp.AktMandant = myId
		set korrtyp.Code = ##class(DBAdressen.Konst).StatusErfasst()
	do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"), "Erfasst")
	do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"), "enregistré")
	do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"), "registrata")
	do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"), "documented")
		do korrtyp.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBAdressen_SD.Status
		WHERE AktMandant = :myId AND Code= DBAdressen.Konst_StatusNachfassen())
	if (exists="") {
	// Status Nachfassen
		set korrtyp = ##class(DBAdressen.SD.Status).%New()
		set korrtyp.AktMandant = myId
		set korrtyp.Code = ##class(DBAdressen.Konst).StatusNachfassen()
		do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"), "Nachfassen")
		do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"), "Nachfassen")
		do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"), "Nachfassen")
		do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"), "Nachfassen")
		do korrtyp.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBAdressen_SD.Status
		WHERE AktMandant = :myId AND Code= DBAdressen.Konst_StatusErledigt())
	if (exists="") {
	// Status Erledigt
		set korrtyp = ##class(DBAdressen.SD.Status).%New()
		set korrtyp.AktMandant = myId
		set korrtyp.Code = ##class(DBAdressen.Konst).StatusErledigt()
		do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"), "Erledigt")
		do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"), "donné")
		do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"), "concluso")
		do korrtyp.SetStatustext(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"), "done")
		do korrtyp.%Save()
	}
	
	&sql(SELECT ID INTO :exists 
		FROM DBIntrap_SD.Tarifart
		WHERE Mandant = :myId AND Nummer= DBIntrap.Konst_TarifartGesperrt())
	if (exists="") {
		// Gesperrt
		set tarifart = ##class(DBIntrap.SD.Tarifart).%New()
		set tarifart.Mandant = myId
		set tarifart.Nummer = ##class(DBIntrap.Konst).TarifartGesperrt()
		do tarifart.SetBezeichnung(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEDE"), "Gesperrt")
		do tarifart.SetBezeichnung(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEFR"), "verrouillé")
		do tarifart.SetBezeichnung(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEIT"), "bloccato")
		do tarifart.SetBezeichnung(myId, ##class(DBCore.Konst).%GetParameter("SPRACHCODEEN"), "locked")
		do tarifart.%Save()
	}
]]></Implementation>
</Method>

<Method name="CopyMandantStart">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[cID:%Integer,&Stack:%String,NewMandNr:%Integer]]></FormalSpec>
<Implementation><![CDATA[
	set cls = "DBCore.Mandant"
	// Copy Class "cls" complete
	Set n=$CLASSMETHOD(cls,"%New")
	Set o=$CLASSMETHOD(cls,"%OpenId",cID)
	// Copy Dataset
	Set n=o.%ConstructClone(0)
	Set n.Mandantnr = NewMandNr
	Set sc=n.%Save()
	set nID = n.%Id()
	set o = ""
	set n = ""
	do ..SubCopyMandant(cls,cID,Stack,0,"", nID)
]]></Implementation>
</Method>

<Method name="SubCopyMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[cls:%String,cID:%Integer,&Stack:%String,RelID:%Integer=0,RelName:%String="",startId:%String=""]]></FormalSpec>
<Implementation><![CDATA[
	// Copy Class "cls" complete
	if (startId = "") {
		Set n=$CLASSMETHOD(cls,"%New")
		Set o=$CLASSMETHOD(cls,"%OpenId",cID)
		// Copy Dataset
		Set n=o.%ConstructClone(0)
		// If Class is a Child/Many-Relation
		Set:(RelID>0) $PROPERTY(n, RelName)=RelID
		Set sc=n.%Save()
		Set newID=n.%Id()
	} else {
		Set newID = startId
	}
	// Open Definition of Class
	Set cdef = ##class(%Dictionary.ClassDefinition).%OpenId(cls)
	Set cnt=cdef.Properties.Count() // count Properties of Class
	// for each Property
	For I=1:1:cnt {
		Set prop=cdef.Properties.GetAt(I) // Set Property
		If prop.Relationship {
			Set pType=prop.Type // Property-Type (Relation-Class-Name)
			Set pName=prop.Name // Property-Name
			Set pCard=prop.Cardinality // Get the Relation-Cardinality
			Set xType="<"_pName_"="_pType_">" // Create Stack-Marker to prevent endless recursiv loops
			// only if "Many" and Marker not found in Stack
			If ((pCard="many")||(pCard="child"))&&($F(Stack,xType)=0) {
				Set Stack=Stack_" "_xType // remember this Marker at Stack
				Set iName=prop.Inverse // Get the Inverse Relation Property
				// Open Recordset for all Elements at the Relation
				Set strSQL="SELECT ID "_
				"FROM "_pType_" "_
				"WHERE "_iName_" = "_cID
				Set s=##class(%ResultSet).%New("%DynamicQuery:SQL")
				Do s.Prepare(strSQL)
				Set sc=s.Execute()
				// For each related Element
				IF $$$ISOK(sc) {
					While s.Next(.sc) {
						Set nID=s.Data("ID")
						// Call Copy for each Relation-Dataset
						Do ..SubCopyMandant(pType,nID,.Stack,newID,iName,"")
						Quit:$$$ISERR(sc)
					}
				}
			}
		}
	}
]]></Implementation>
</Method>

<Method name="ImportXmlFile">
<ClassMethod>1</ClassMethod>
<FormalSpec>myfile:%String,myClass:%String</FormalSpec>
<Implementation><![CDATA[
    Kill ^XmlImportID
    Set myNode=$P(myClass,".",$L(myClass,"."))
    Set status=##class(%XML.TextReader).ParseFile(myfile,.myXml)
    //check status
    If $$$ISERR(status) Do $System.Status.DisplayError(status) Quit
    //iterate through document, node by node
    Set myName=""
    While myXml.Read() {
	    Set myName=myXml.Name
	    If myName=myNode {
		    Do ..WriteNode(.myXml,myName,myClass)
	    }
    }
    //Kill ^XmlImportID
]]></Implementation>
</Method>

<Method name="WriteNode">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[&myXml:%XML.TextReader,myNode:%String,myClass:%String]]></FormalSpec>
<Implementation><![CDATA[
	Set cdef=##Class(%Dictionary.ClassDefinition).%OpenId(myClass)
    Set prop=##Class(%Dictionary.PropertyDefinition).%New()
	Set myNode1=$P(myClass,".",$L(myClass,"."))
	Set myIndex="", myName="", myType="", myElement=""
	Set myID=0
	// Get ID and other ONE-Relations from Attribut
    If myXml.HasAttributes {
	    //======== Attribute auslesen ================================
	    Kill myAttrib  ;temp Array for Relations
	    // for each Attribut of Node (Lookup for ID and other Attributes)
	    For a=1:1:myXml.AttributeCount {
	    	Do myXml.MoveToAttributeIndex(a)
	        If myXml.Name="ID" {
		        Set myID=myXml.Value
	        } Else {
		        Set myAttrib(myXml.Name)=myXml.Value   ;myAttrib(AktMandant)=1 Store for the Attribute the old Relation-ID
	        }
	    }
	    //======== Attribute auslesen Ende ===========================
    }
    // if still imported or invalid ID...
    If $DATA(^XmlImportID(myClass,myID))||($Get(myID,0)=0) {
	    // read up to the end of this Node
	    While myXml.Read() {
		    Quit:(myXml.NodeType="endelement")&&(myNode1=myXml.Name) 
	    }
    } Else {
	    Set cls=$System.OBJ.New(myClass) ; new Object
    	While myXml.Read() {
		    Set myType=myXml.NodeType
		    // =========  Endelement =====================================================================
		    If (myType="endelement") {
			    // leaf, if this is the end-tag of Node
			    If (myXml.Name=myNode1) {
				    Do ..SaveImportedObject(myClass, .myID, .myAttrib, .cdef, .cls) 
				    Quit
			    }
			// ========= Element =====================================================================
		    } ElseIf (myType="element") {
			    Set myName=myXml.Name
			    // Search for valid Property
			    Set pName=..LookupProperty(myName, .cdef, .prop, .pType)
			    // Only if this Property found...
			    If (pName=myName) {
				    Set mypType=pType
				    If prop.Relationship {
						Do ..SaveImportedObject(myClass, .myID, .myAttrib, .cdef, .cls)
						Set myNode2=$P(pType,".",$L(pType,"."))
					    // For each (Record) Object
					    While myXml.Read() {
						    // If Node = related class
						    // Read Object (Sub-Class)
					    	Do:(myXml.NodeType="element")&&(myNode2=myXml.Name) ..WriteNode(.myXml,myName,pType) ; recursive call
						    // exit While, when current node=End and if it has the same name as the node of Relation
						    Quit:(myXml.NodeType="endelement")&&(myName=myXml.Name) 
					    }
				    } else {
					    // store Name of Property as Element
		            	Set myElement=myName
			        }
			    // If Node is an Array-Value of an Element...
			    } ElseIf (myXml.HasAttributes)&&(myElement_"Item"=myName_"") {
				    // store the attribute for this array-Element node
				    For a=1:1:myXml.AttributeCount {
				    	Do myXml.MoveToAttributeIndex(a)
				        Set myIndex=myXml.Value
				    }
				// no Property or Array of Property found...
		        } Else {
			        // it could not be a valid Element
			        Set myElement=""
		        }
		    // ========= Value =====================================================================
		    } ElseIf (myType="chars") {
			    // Only if valid Element found...
			    If ($L(myElement)'=0) {
				    // read Value
				    Set myValue=myXml.Value
				    // translate Boolean
			     	If ((mypType="%Boolean")||(mypType="%Library.Boolean")) {
				     	// lookup for the Property of this Element
					    Set myValue=("true"[myValue)
					} ElseIf ((mypType="%Library.Date")||(mypType="%Date")) {
						Set myValue=$ZDATEH(myValue,3)
					}
				 	If ($L(myIndex)'=0) {
					 	// Add Array-Value
						Do $METHOD($PROPERTY(cls, myElement), "SetAt", myValue, myIndex)
					} Else {
						// Add Value
						Set $PROPERTY(cls, myElement)=myValue
					}
					Set myIndex=""
			    }
		    }
	    }
    }
]]></Implementation>
</Method>

<Method name="SaveImportedObject">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[myClass:%String,&myID:%Integer,&myAttrib,&cdef:%Dictionary.ClassDefinition,&cls:%CacheObject]]></FormalSpec>
<Implementation><![CDATA[
    // Set Relations
    If $DATA(myAttrib)&&(myID'=0) {
		Set key=$Order(myAttrib("")) ;Get the first Index (i.e. "AktMandant")
		// For each ONE-Relation
	    While (key'="") {
		    // Search for Property-Definition (search for the Relation)
		    Set pName=..LookupProperty(key,.cdef,.prop,.pType)
		    // Save new Relation / prop.Type = Full-Class-Name (i.e. DBCore.Mandant)
		    Set:(pName=key) $PROPERTY(cls, key)=$System.OBJ.OpenId(pType,^XmlImportID(pType, myAttrib(key)))
		    // look up next
	     	Set key=$Order(myAttrib(key))
	    }
    } ;-- End set Relations
    // Save new Object
    Set sc=cls.%Save()
    w "Save von Klasse: "_myClass
    If $$$ISERR(sc) {
	    Do $System.Status.DisplayError(sc) 
	    Quit
    }
    // Store reference to new ID
    Quit:(myID=0)
	Set ^XmlImportID(myClass,myID)=cls.%Id(), myID=0
]]></Implementation>
</Method>

<Method name="LookupProperty">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec><![CDATA[myName:%String,&cdef:%Dictionary.ClassDefinition,&prop:%Dictionary.PropertyDefinition,&pType:%String]]></FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    Set pName="", cnt=cdef.Properties.Count()
    For i=1:1:cnt {
    	Set prop=cdef.Properties.GetAt(i)
    	Set pType=prop.Type
    	Set pName=prop.Name
    	// Stop when found
    	Quit:pName=myName
    }
    // if not found: check also the super classes
    If (pName'=myName) {
		For s=1:1:$L(cdef.Super,",") {
			Set sub=$P(cdef.Super,",",s)
			If ($E(sub)'="%") {
		    	Set scdef=##class(%Dictionary.ClassDefinition).%OpenId(sub)
			    For i=1:1:scdef.Properties.Count() {
			    	Set prop=scdef.Properties.GetAt(i)
			    	Set pType=prop.Type
			    	Set pName=prop.Name
			    	// Stop when found
			    	Quit:pName=myName
			    }
		    }
	    }
    	//Kill scdef
    }
    Quit pName
]]></Implementation>
</Method>

<Method name="GetAnzMand">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[

	set cnt = 0
	&sql(SELECT COUNT(*) INTO :cnt FROM DBCore.Mandant)	
	Quit cnt
]]></Implementation>
</Method>

<Method name="GetAnzAktivMand">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set cnt = 0
	
	&sql(SELECT COUNT(*) INTO :cnt 
	FROM DBCore.MandantJahr WHERE NVL(Status,0) <> DBCore.Konst_MANDANTSTATUSINAKTIV() 
	AND Mandant = :MandOid)	
	
	Quit cnt
]]></Implementation>
</Method>

<Method name="GetNextAktivMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	
	&sql(SELECT ID INTO :id 
	FROM DBCore.MandantJahr WHERE NVL(Status,0) <> DBCore.Konst_MANDANTSTATUSINAKTIV() 
	AND Mandant = :MandOid
	ORDER BY GeschaeftsjahrEnde DESC)	
	
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.MandantD</DataLocation>
<DefaultData>MandantDefaultData</DefaultData>
<IdLocation>^DBCore.MandantD</IdLocation>
<IndexLocation>^DBCore.MandantI</IndexLocation>
<StreamLocation>^DBCore.MandantS</StreamLocation>
<Data name="Fremdmandanten">
<Attribute>Fremdmandanten</Attribute>
<Structure>subnode</Structure>
<Subscript>"Fremdmandanten"</Subscript>
</Data>
<Data name="MandantDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandantnr</Value>
</Value>
<Value name="3">
<Value>Anrede</Value>
</Value>
<Value name="4">
<Value>Kurzname</Value>
</Value>
<Value name="5">
<Value>Name</Value>
</Value>
<Value name="6">
<Value>Sprachcode</Value>
</Value>
<Value name="7">
<Value>Aktiv</Value>
</Value>
<Value name="8">
<Value>Strasse</Value>
</Value>
<Value name="9">
<Value>Telefon</Value>
</Value>
<Value name="10">
<Value>Telefon2</Value>
</Value>
<Value name="11">
<Value>Fax</Value>
</Value>
<Value name="12">
<Value>Mobil</Value>
</Value>
<Value name="13">
<Value>EMail</Value>
</Value>
<Value name="14">
<Value>Web</Value>
</Value>
<Value name="15">
<Value>Bemerkung</Value>
</Value>
<Value name="16">
<Value>Bezeichnung</Value>
</Value>
<Value name="17">
<Value>Branchencode</Value>
</Value>
<Value name="18">
<Value>ZuHanden</Value>
</Value>
<Value name="19">
<Value>PersAnrede</Value>
</Value>
<Value name="20">
<Value>Gebiet</Value>
</Value>
<Value name="21">
<Value>GeschaeftsjahrBeginn</Value>
</Value>
<Value name="22">
<Value>GeschaeftsjahrEnde</Value>
</Value>
<Value name="23">
<Value>MwstNummer</Value>
</Value>
<Value name="24">
<Value>Ablage</Value>
</Value>
<Value name="25">
<Value>Ort</Value>
</Value>
<Value name="26">
<Value>Plz</Value>
</Value>
<Value name="27">
<Value>PlzInklZusatz</Value>
</Value>
<Value name="28">
<Value>SachbearbeiterNr1</Value>
</Value>
<Value name="29">
<Value>SachbearbeiterBenutzername1</Value>
</Value>
<Value name="30">
<Value>SachbearbeiterVorname1</Value>
</Value>
<Value name="31">
<Value>SachbearbeiterName1</Value>
</Value>
<Value name="32">
<Value>SachbearbeiterNr2</Value>
</Value>
<Value name="33">
<Value>SachbearbeiterBenutzername2</Value>
</Value>
<Value name="34">
<Value>SachbearbeiterVorname2</Value>
</Value>
<Value name="35">
<Value>SachbearbeiterName2</Value>
</Value>
<Value name="36">
<Value>UID</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Ablage">
</Property>
<Property name="Aktiv"/>
<Property name="Anrede">
</Property>
<Property name="Bemerkung">
</Property>
<Property name="Bezeichnung">
</Property>
<Property name="Branchencode">
</Property>
<Property name="EMail">
</Property>
<Property name="Fax">
</Property>
<Property name="Gebiet">
</Property>
<Property name="GeschaeftsjahrBeginn"/>
<Property name="GeschaeftsjahrEnde"/>
<Property name="Kurzname">
</Property>
<Property name="Mandantnr">
</Property>
<Property name="Mobil">
</Property>
<Property name="MwstNummer">
</Property>
<Property name="Name">
</Property>
<Property name="Ort">
</Property>
<Property name="PersAnrede">
</Property>
<Property name="Plz">
</Property>
<Property name="PlzInklZusatz">
</Property>
<Property name="SachbearbeiterBenutzername1"/>
<Property name="SachbearbeiterBenutzername2"/>
<Property name="SachbearbeiterName1"/>
<Property name="SachbearbeiterName2"/>
<Property name="SachbearbeiterNr1"/>
<Property name="SachbearbeiterNr2"/>
<Property name="SachbearbeiterVorname1"/>
<Property name="SachbearbeiterVorname2"/>
<Property name="Sprachcode">
</Property>
<Property name="StrId">
</Property>
<Property name="Strasse">
</Property>
<Property name="Telefon">
</Property>
<Property name="Telefon2">
</Property>
<Property name="UID">
</Property>
<Property name="Web">
</Property>
<Property name="ZuHanden">
</Property>
</Storage>
</Class>


<Class name="DBCore.MandantEinstellung">
<Description>
</Description>
<Owner>cbt</Owner>
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61003,34481.468424</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Einstellung">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="StringWert">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="FloatWert">
<Type>%Library.Float</Type>
</Property>

<Property name="DoubleWert">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="ShortWert">
<Type>%Library.SmallInt</Type>
</Property>

<Property name="IntWert">
<Type>%Library.Integer</Type>
</Property>

<Property name="LongWert">
<Type>%Library.BigInt</Type>
</Property>

<Property name="BoolWert">
<Type>%Library.Boolean</Type>
</Property>

<Property name="DateWert">
<Type>%Library.Date</Type>
</Property>

<Property name="Beschreibung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="500"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Property name="StringArray">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="TimeWert">
<Type>%Library.Time</Type>
</Property>

<Index name="MandEinstIdx">
<Properties>Mandant,Einstellung</Properties>
<Unique>1</Unique>
</Index>

<Method name="SetMengeAktiv">
<ClassMethod>1</ClassMethod>
<FormalSpec>mandantOid:%String,mengenerfassung:%Boolean</FormalSpec>
<Implementation><![CDATA[	Set ^MengeAktiv(mandantOid) = mengenerfassung
]]></Implementation>
</Method>

<Method name="GetIntEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>mandantOid:%String,einstellung:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set intVal = 0
	&sql(SELECT IntWert INTO :intVal FROM DBCore.MandantEinstellung WHERE Einstellung = :einstellung AND Mandant = :mandantOid Order By ID)
	if (SQLCODE'=0) {
		Set intVal = 0
	}
	quit intVal
]]></Implementation>
</Method>

<Method name="GetShortEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>mandantOid:%String,einstellung:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set short = 0
	&sql(SELECT ShortWert INTO :short FROM DBCore.MandantEinstellung WHERE Einstellung = :einstellung AND Mandant = :mandantOid Order By ID)
	if (SQLCODE'=0) {
		Set short = 0
	}
	quit short
]]></Implementation>
</Method>

<Method name="GetStringEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>mandantOid:%String,einstellung:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set string = ""
	&sql(SELECT StringWert INTO :string FROM DBCore.MandantEinstellung WHERE Einstellung = :einstellung AND Mandant = :mandantOid Order By ID)
	if (SQLCODE'=0) {
		Set string = ""
	}
	quit string
]]></Implementation>
</Method>

<Method name="GetLongEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>mandantOid:%String,einstellung:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set longVal = 0
	&sql(SELECT LongWert INTO :longVal FROM DBCore.MandantEinstellung WHERE Einstellung = :einstellung AND Mandant = :mandantOid Order By ID)
	if (SQLCODE'=0) {
		Set longVal = 0
	}
	quit longVal
]]></Implementation>
</Method>

<Method name="GetBoolEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>mandantOid:%String,einstellung:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set boolVal = 0
	&sql(SELECT BoolWert INTO :boolVal FROM DBCore.MandantEinstellung WHERE Einstellung = :einstellung AND Mandant = :mandantOid Order By ID)
	if (SQLCODE'=0) {
		Set boolVal = 0
	}
	quit boolVal
]]></Implementation>
</Method>

<Method name="SetIntEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>mandantOid:%String,einstellung:%Integer,wert:%Integer</FormalSpec>
<Implementation><![CDATA[	&sql(Update DBCore.MandantEinstellung SET IntWert = :wert WHERE Einstellung = :einstellung AND Mandant = :mandantOid)
]]></Implementation>
</Method>

<Method name="SetLongEinst">
<ClassMethod>1</ClassMethod>
<FormalSpec>mandantOid:%String,einstellung:%Integer,wert:%Library.BigInt</FormalSpec>
<Implementation><![CDATA[	&sql(Update DBCore.MandantEinstellung SET LongWert = :wert WHERE Einstellung = :einstellung AND Mandant = :mandantOid)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.MandantEinstellungD</DataLocation>
<DefaultData>MandantEinstellungDefaultData</DefaultData>
<IdLocation>^DBCore.MandantEinstellungD</IdLocation>
<IndexLocation>^DBCore.MandantEinstellungI</IndexLocation>
<StreamLocation>^DBCore.MandantEinstellungS</StreamLocation>
<Data name="MandantEinstellungDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Einstellung</Value>
</Value>
<Value name="3">
<Value>StringWert</Value>
</Value>
<Value name="4">
<Value>FloatWert</Value>
</Value>
<Value name="5">
<Value>DoubleWert</Value>
</Value>
<Value name="6">
<Value>ShortWert</Value>
</Value>
<Value name="7">
<Value>IntWert</Value>
</Value>
<Value name="8">
<Value>LongWert</Value>
</Value>
<Value name="9">
<Value>BoolWert</Value>
</Value>
<Value name="10">
<Value>DateWert</Value>
</Value>
<Value name="11">
<Value>Beschreibung</Value>
</Value>
<Value name="12">
<Value>Mandant</Value>
</Value>
<Value name="13">
<Value>TimeWert</Value>
</Value>
</Data>
<Data name="StringArray">
<Attribute>StringArray</Attribute>
<Structure>subnode</Structure>
<Subscript>"StringArray"</Subscript>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Beschreibung">
</Property>
<Property name="BoolWert">
</Property>
<Property name="DateWert">
</Property>
<Property name="DoubleWert">
</Property>
<Property name="Einstellung">
</Property>
<Property name="FloatWert">
</Property>
<Property name="IntWert">
</Property>
<Property name="LongWert">
</Property>
<Property name="Mandant">
</Property>
<Property name="ShortWert">
</Property>
<Property name="StringWert">
</Property>
<Property name="TimeWert">
</Property>
</Storage>
</Class>


<Class name="DBCore.MandantJahr">
<Super>%Persistent,%XML.Adaptor,%Populate,DBCore.MandantRel</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61562,32409.358861</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Property name="Mandantnr">
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {Mandantnr}=##class(DBCore.MandantRel).GetMandantnr({Mandant}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="GeschaeftsjahrBeginn">
<Type>%Library.Date</Type>
<Parameter name="POPSPEC" value="Date(30000,55000)"/>
</Property>

<Property name="GeschaeftsjahrEnde">
<Type>%Library.Date</Type>
<Parameter name="POPSPEC" value="Date(30000,55000)"/>
</Property>

<UDLText name="T">
<Content><![CDATA[
//***********************

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Sachbearbeiter wurden extra nicht als Relation abgebildet

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// -> haben nur informativen Charakter und würden bei einem Datenaustausch

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// verloren gehen, da die Benutzerinformationen auf dem Zielsystem nicht vorhanden

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// wären

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//***********************

]]></Content>
</UDLText>

<Property name="SachbearbeiterNr1">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="999"/>
<Parameter name="MINVAL" value="1"/>
</Property>

<Property name="SachbearbeiterBenutzername1">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="SachbearbeiterVorname1">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="FirstName()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="SachbearbeiterName1">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="Name()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="SachbearbeiterNr2">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="999"/>
<Parameter name="MINVAL" value="1"/>
</Property>

<Property name="SachbearbeiterBenutzername2">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="SachbearbeiterVorname2">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="FirstName()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="SachbearbeiterName2">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="Name()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Index name="JahrIdx">
<Properties>Mandantnr,GeschaeftsjahrEnde</Properties>
<Unique>1</Unique>
</Index>

<Property name="DebitorUmsatzMandantJahr">
<Type>DBDebiKredi.DebitorUmsatz</Type>
<Cardinality>many</Cardinality>
<Inverse>MandantJahr</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="KreditorUmsatzMandantJahr">
<Type>DBDebiKredi.KreditorUmsatz</Type>
<Cardinality>many</Cardinality>
<Inverse>MandantJahr</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="KontoJahrMandantJahr">
<Type>DBFibu.KontoJahr</Type>
<Cardinality>many</Cardinality>
<Inverse>MandantJahr</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="BuchungJahrMandantJahr">
<Type>DBFibu.Buchung</Type>
<Cardinality>many</Cardinality>
<Inverse>MandantJahr</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Status">
<Type>%Integer</Type>
</Property>

<Method name="MandantHasJahre">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	
	set cnt = 0
	&sql(SELECT COUNT(*) INTO :cnt FROM DBCore.MandantJahr WHERE Mandant = :MandantOid)
	if (cnt = 0) {
		Quit 0	
	} else {
		Quit 1
	}
]]></Implementation>
</Method>

<Method name="GetMaxJahrByMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set jahrId = ""
	&sql(SELECT ID INTO :jahrId FROM DBCore.MandantJahr WHERE Mandant = :MandantOid
					AND GeschaeftsjahrEnde >= all (SELECT GeschaeftsjahrEnde FROM DBCore.MandantJahr
													WHERE Mandant = :MandantOid))
	Quit:(SQLCODE'=0) ""
	Quit jahrId
]]></Implementation>
</Method>

<Method name="GetMaxJahrJahrByMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set date = 0
	&sql(SELECT GeschaeftsjahrEnde INTO :date FROM DBCore.MandantJahr WHERE Mandant = :MandantOid
					AND GeschaeftsjahrEnde >= all (SELECT GeschaeftsjahrEnde FROM DBCore.MandantJahr
													WHERE Mandant = :MandantOid))
	Quit:(SQLCODE'=0) 0
	Quit ##class(DBUtils.DateUtils).GetYearFromDate(date)
]]></Implementation>
</Method>

<Method name="GetMinJahrJahrByMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set date = 0
	&sql(SELECT GeschaeftsjahrBeginn INTO :date FROM DBCore.MandantJahr WHERE Mandant = :MandantOid
					AND GeschaeftsjahrBeginn <= all (SELECT GeschaeftsjahrBeginn FROM DBCore.MandantJahr
													WHERE Mandant = :MandantOid))
	Quit:(SQLCODE'=0) 0
	Quit ##class(DBUtils.DateUtils).GetYearFromDate(date)
]]></Implementation>
</Method>

<Method name="GetAnzahlJahre">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set cnt = 0
	&sql(SELECT COUNT(*) INTO :cnt FROM DBCore.MandantJahr WHERE Mandant = :MandantOid)
	Quit cnt
]]></Implementation>
</Method>

<Method name="MoveFirstOnMandJahr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set j = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr,""),1)
	if (j '= ""){
		set id = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr,j,""),1)
	} else {
		Quit ""	
	}
	Quit id
]]></Implementation>
</Method>

<Method name="MoveLastOnMandJahr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set j = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr,""),-1)
	if (j '= ""){
		set id = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr,j,""),-1)
	} else {
		Quit ""	
	}
	Quit id
]]></Implementation>
</Method>

<Method name="MoveNextOnMandJahr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantNr:%Integer,Jahr:%Date</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
    set nextNr = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr,Jahr))
	if (nextNr '= "") {
		set id = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr,nextNr,""))

	} else {
		//Wenn letzter Eintrag eines Mandanten erreicht wurde -> auf nächsten Mandant springen
		set nextNr = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr))
		if (nextNr '= "") {
			set datum = $Order(^DBCore.MandantJahrI("JahrIdx",nextNr,""))
			if (datum '= "") {
				set id = $Order(^DBCore.MandantJahrI("JahrIdx",nextNr,datum,""))
			} else {
				// letzter Mandant, letzter Eintrag
				set id = ##class(DBCore.MandantJahr).MoveLastOnMandJahr(nextNr)
			}
		} else {
			set id = ##class(DBCore.MandantJahr).MoveLastOnMandJahr(MandantNr)
		}
	}	
	Quit id
]]></Implementation>
</Method>

<Method name="MovePrevOnMandJahr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantNr:%Integer,Jahr:%Date</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
    set nextNr = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr,Jahr),-1)
	if (nextNr '= "") {
		set id = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr,nextNr,""),-1)

	} else {
		//Wenn letzter Eintrag eines Mandanten erreicht wurde -> auf nächsten Mandant springen
		set nextNr = $Order(^DBCore.MandantJahrI("JahrIdx",MandantNr),-1)
		if (nextNr '= "") {
			set datum = $Order(^DBCore.MandantJahrI("JahrIdx",nextNr,""),-1)
			if (datum '= "") {
				set id = $Order(^DBCore.MandantJahrI("JahrIdx",nextNr,datum,""),-1)
			} else {
				// letzter Mandant, letzter Eintrag
				set id = ##class(DBCore.MandantJahr).MoveFirstOnMandJahr(nextNr)
			}
		} else {
			set id = ##class(DBCore.MandantJahr).MoveFirstOnMandJahr(MandantNr)
		}
	}	
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByDatum">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Datum:%Date</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.MandantJahr WHERE Mandant = :MandantOid AND
			:Datum BETWEEN GeschaeftsjahrBeginn AND GeschaeftsjahrEnde)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.MandantJahrD</DataLocation>
<DefaultData>MandantJahrDefaultData</DefaultData>
<IdLocation>^DBCore.MandantJahrD</IdLocation>
<IndexLocation>^DBCore.MandantJahrI</IndexLocation>
<StreamLocation>^DBCore.MandantJahrS</StreamLocation>
<Data name="MandantJahrDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>GeschaeftsjahrBeginn</Value>
</Value>
<Value name="4">
<Value>GeschaeftsjahrEnde</Value>
</Value>
<Value name="5">
<Value>SachbearbeiterNr1</Value>
</Value>
<Value name="6">
<Value>SachbearbeiterBenutzername1</Value>
</Value>
<Value name="7">
<Value>SachbearbeiterVorname1</Value>
</Value>
<Value name="8">
<Value>SachbearbeiterName1</Value>
</Value>
<Value name="9">
<Value>SachbearbeiterNr2</Value>
</Value>
<Value name="10">
<Value>SachbearbeiterBenutzername2</Value>
</Value>
<Value name="11">
<Value>SachbearbeiterVorname2</Value>
</Value>
<Value name="12">
<Value>SachbearbeiterName2</Value>
</Value>
<Value name="13">
<Value>Aktiv</Value>
</Value>
<Value name="14">
<Value>Status</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Aktiv"/>
<Property name="GeschaeftsjahrBeginn">
</Property>
<Property name="GeschaeftsjahrEnde">
</Property>
<Property name="Mandant">
</Property>
<Property name="Mandantnr">
</Property>
<Property name="SachbearbeiterBenutzername1">
</Property>
<Property name="SachbearbeiterBenutzername2">
</Property>
<Property name="SachbearbeiterName1">
</Property>
<Property name="SachbearbeiterName2">
</Property>
<Property name="SachbearbeiterNr1">
</Property>
<Property name="SachbearbeiterNr2">
</Property>
<Property name="SachbearbeiterVorname1">
</Property>
<Property name="SachbearbeiterVorname2">
</Property>
<Property name="Status">
</Property>
</Storage>
</Class>


<Class name="DBCore.MandantRel">
<Super>%RegisteredObject</Super>
<TimeChanged>61720,83516.781659</TimeChanged>
<TimeCreated>61710,34780.714528</TimeCreated>

<Method name="GetMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>DBCore.Mandant</ReturnType>
<Implementation><![CDATA[

	Quit ##class(DBCore.Mandant).%OpenId(MandantOid)
]]></Implementation>
</Method>

<Method name="GetMandantnr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = 0
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.Mandantnr
	}
	kill mand
	Quit retval
]]></Implementation>
</Method>

<Method name="GetMandKurzname">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = ""
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.Kurzname
	}	
	kill mand
	Quit retval
]]></Implementation>
</Method>

<Method name="GetMandName">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = ""
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.Name
	}
	kill mand	
	Quit retval
]]></Implementation>
</Method>

<Method name="GetMandStrasse">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = ""
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.Strasse
	}
	kill mand	
	Quit retval
]]></Implementation>
</Method>

<Method name="GetMandTelefon">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = ""
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.Telefon
	}
	kill mand	
	Quit retval
]]></Implementation>
</Method>

<Method name="GetMandTelefon2">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = ""
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.Telefon2
	}	
	kill mand
	Quit retval
]]></Implementation>
</Method>

<Method name="GetMandEMail">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = ""
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.EMail
	}
	kill mand	
	Quit retval
]]></Implementation>
</Method>

<Method name="GetMandOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = ""
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.Ort
	}
	kill mand	
	Quit retval
]]></Implementation>
</Method>

<Method name="GetMandPlz">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	
	set retval = ""
	set mand = ##class(DBCore.Mandant).%OpenId(MandantOid)
	if (mand '= "") {
		set retval = mand.Plz
	}
	kill mand	
	Quit retval
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.MandantRelD</DataLocation>
<DefaultData>MandantRelDefaultData</DefaultData>
<IdLocation>^DBCore.MandantRelD</IdLocation>
<IndexLocation>^DBCore.MandantRelI</IndexLocation>
<StreamLocation>^DBCore.MandantRelS</StreamLocation>
<Data name="MandantRelDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.MandantSprache">
<Super>%Persistent,%Populate,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61135,58643.083594</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Property name="Code">
<Type>%Integer</Type>
</Property>

<Property name="Sprachkey">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Bezeichnung">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="GetSpracheByNummer">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Code:%Integer</FormalSpec>
<ReturnType>DBCore.MandantSprache</ReturnType>
<Implementation><![CDATA[

	Set oid = ""
	&sql(SELECT ID INTO :oid
		 FROM DBCore.MandantSprache
		 WHERE Mandant = :MandantOid AND Code = :Code)
	
	If oid '="" {
		Quit ##class(DBCore.MandantSprache).%OpenId(oid)	
	}  Else {
		Quit ""	
	}
]]></Implementation>
</Method>

<Method name="GetSpracheBySprachkey">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Sprachkey:%String</FormalSpec>
<ReturnType>DBCore.MandantSprache</ReturnType>
<Implementation><![CDATA[
	
	Set oid = ""
	&sql(SELECT ID INTO :oid
		 FROM DBCore.MandantSprache
		 WHERE Mandant = :MandantOid AND Sprachkey = :Sprachkey)
	
	If oid ="" {
		Quit ##class(DBCore.MandantSprache).%OpenId(oid)	
	} Else {
		Quit ""	
	}
]]></Implementation>
</Method>

<Method name="CopySprachenFromMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>srcMandOid:%String,dstMandOid:%String</FormalSpec>
<Implementation><![CDATA[
	set result = ##class(%Library.ResultSet).%New("DBCore.AF.MandantSpracheAF:ListeGesamt")
	set sprachen = result.%Execute(srcMandOid)
	
	while result.Next(.sprachen) {
		set ptr = ##class(DBCore.MandantSprache).%New()
		set ptr.Code = result.Data("Code")
		set ptr.Sprachkey = result.Data("Sprachkey")
		set ptr.Bezeichnung = result.Data("Bezeichnung")
		set ptr.Mandant = ##class(DBCore.Mandant).%OpenId(dstMandOid)
		do ptr.%Save()	
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.MandantSpracheD</DataLocation>
<DefaultData>MandantSpracheDefaultData</DefaultData>
<IdLocation>^DBCore.MandantSpracheD</IdLocation>
<IndexLocation>^DBCore.MandantSpracheI</IndexLocation>
<StreamLocation>^DBCore.MandantSpracheS</StreamLocation>
<Data name="MandantSpracheDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Code</Value>
</Value>
<Value name="4">
<Value>Sprachkey</Value>
</Value>
<Value name="5">
<Value>Bezeichnung</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Bezeichnung">
</Property>
<Property name="Code">
</Property>
<Property name="Mandant">
</Property>
<Property name="Sprachkey">
</Property>
</Storage>
</Class>


<Class name="DBCore.MandantUserEinstellung">
<Description>
</Description>
<Owner>cbt</Owner>
<Super>%Persistent,DBCore.MandantRel</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61003,34481.468424</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Einstellung">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="StringWert">
<Type>%String</Type>
<Parameter name="MAXLEN" value="200"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="FloatWert">
<Type>%Library.Float</Type>
</Property>

<Property name="DoubleWert">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="ShortWert">
<Type>%Library.SmallInt</Type>
</Property>

<Property name="IntWert">
<Type>%Library.Integer</Type>
</Property>

<Property name="LongWert">
<Type>%Library.BigInt</Type>
</Property>

<Property name="BoolWert">
<Type>%Library.Boolean</Type>
</Property>

<Property name="DateWert">
<Type>%Library.Date</Type>
</Property>

<Property name="Beschreibung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="500"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Property name="Benutzer">
<Type>DBCore.Benutzer</Type>
<Cardinality>one</Cardinality>
<Inverse>MandantUserEinstellungBenutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="BenutzerIndex">
<Properties>Benutzer</Properties>
</Index>

<Index name="MandBenEinstIdx">
<Properties>Mandant,Benutzer,Einstellung</Properties>
<Unique>1</Unique>
</Index>

<Property name="StringArray">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.MandantUserEinstellungD</DataLocation>
<DefaultData>MandantUserEinstellungDefaultData</DefaultData>
<IdLocation>^DBCore.MandantUserEinstellungD</IdLocation>
<IndexLocation>^DBCore.MandantUserEinstellungI</IndexLocation>
<StreamLocation>^DBCore.MandantUserEinstellungS</StreamLocation>
<Data name="MandantUserEinstellungDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Einstellung</Value>
</Value>
<Value name="3">
<Value>StringWert</Value>
</Value>
<Value name="4">
<Value>FloatWert</Value>
</Value>
<Value name="5">
<Value>DoubleWert</Value>
</Value>
<Value name="6">
<Value>ShortWert</Value>
</Value>
<Value name="7">
<Value>IntWert</Value>
</Value>
<Value name="8">
<Value>LongWert</Value>
</Value>
<Value name="9">
<Value>BoolWert</Value>
</Value>
<Value name="10">
<Value>DateWert</Value>
</Value>
<Value name="11">
<Value>Beschreibung</Value>
</Value>
<Value name="12">
<Value>Mandant</Value>
</Value>
<Value name="13">
<Value>Benutzer</Value>
</Value>
</Data>
<Data name="StringArray">
<Attribute>StringArray</Attribute>
<Structure>subnode</Structure>
<Subscript>"StringArray"</Subscript>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Benutzer">
</Property>
<Property name="Beschreibung">
</Property>
<Property name="BoolWert">
</Property>
<Property name="DateWert">
</Property>
<Property name="DoubleWert">
</Property>
<Property name="Einstellung">
</Property>
<Property name="FloatWert">
</Property>
<Property name="IntWert">
</Property>
<Property name="LongWert">
</Property>
<Property name="Mandant">
</Property>
<Property name="ShortWert">
</Property>
<Property name="StringWert">
</Property>
</Storage>
</Class>


<Class name="DBCore.Mitarbeiter">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61499,62005.409503</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
<Parameter name="MAXVAL" value="99999999"/>
<Parameter name="MINVAL" value="1"/>
</Property>

<Index name="NummerIndex">
<Data>%%ID,Nummer,Kurzname,Name,Plz,Ort</Data>
<Properties>Mandant,Nummer</Properties>
<Unique>1</Unique>
</Index>

<Property name="Kurzname">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Index name="KurznameIndex">
<Type>bitmap</Type>
<Properties>Kurzname:Exact</Properties>
</Index>

<Index name="KurznameMoveIndex">
<Data>%%ID,Nummer,Kurzname,Name,Plz,Ort</Data>
<Properties>Mandant:Exact,Kurzname</Properties>
</Index>

<Property name="Anrede">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Name">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Index name="NameIndex">
<Type>bitmap</Type>
<Properties>Name:Exact</Properties>
</Index>

<Index name="NameMoveIndex">
<Data>%%ID,Nummer,Kurzname,Name,Plz,Ort</Data>
<Properties>Mandant:Exact,Name</Properties>
</Index>

<Property name="Vorname">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Zusatz">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Strasse">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Ort">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Plz">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="15"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="PlzInklZusatz">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="15"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="PersAnrede">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ZuHanden">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Telefon1">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Telefon2">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Fax">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Mobil">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="EMail">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Web">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Sprachcode">
<Type>%String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Aktiv">
<Type>%Boolean</Type>
</Property>

<Property name="Erfassungsdatum">
<Type>%Date</Type>
</Property>

<Property name="Bearbeitungsdatum">
<Type>%Date</Type>
</Property>

<UDLText name="T">
<Content><![CDATA[
//***********************

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// Bearbeiter und Erfasser wurden extra nicht als Relation abgebildet

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// -> haben nur informativen Charakter und wÃ¼rden bei einem Datenaustausch

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// verloren gehen, da die Benutzerinformationen auf dem Zielsystem nicht vorhanden

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// wÃ¤ren

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//***********************

]]></Content>
</UDLText>

<Property name="BearbeiterNr">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="999"/>
<Parameter name="MINVAL" value="1"/>
</Property>

<Property name="BearbeiterBenutzername">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="BearbeiterVorname">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="BearbeiterName">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ErfasserNr">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="999"/>
<Parameter name="MINVAL" value="1"/>
</Property>

<Property name="ErfasserBenutzername">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ErfasserVorname">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ErfasserName">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Property name="Benutzer">
<Type>DBCore.Benutzer</Type>
<Cardinality>one</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Index name="BenutzerIndex">
<Properties>Benutzer</Properties>
</Index>

<Property name="WordVersion">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="99"/>
<Parameter name="MINVAL" value="0"/>
</Property>

<Property name="ExcelVersion">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="99"/>
<Parameter name="MINVAL" value="0"/>
</Property>

<Property name="TelefonatErfasser">
<Type>DBAdressen.TelefonatKopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Erfasser</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="TelefonatBearbeiter">
<Type>DBAdressen.TelefonatDetail</Type>
<Cardinality>many</Cardinality>
<Inverse>Bearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="LeistungMitarbeiter">
<Type>DBIntrap.Leistung</Type>
<Cardinality>many</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Beruf">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="TelIntern">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="MoveFirstOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
	set adr = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,""),1)
	if (adr '= ""){
		set id = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,adr,""),1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveLastOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
	set adr = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,""),-1)
	if (adr '= ""){
		set id = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,adr,""),-1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
    set nextNr = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,Nr))
	if (nextNr '= "") {
		set res = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,nextNr,""),1,list)
	} else {
		set list = ##class(DBCore.Mitarbeiter).MoveLastOnNr(MandantOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
    set nextNr = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,Nr),-1)
	if (nextNr '= "") {
		set res = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,nextNr,""),-1,list)
	} else {
		set list = ##class(DBCore.Mitarbeiter).MoveFirstOnNr(MandantOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="MoveFirstOnKurzname">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()

	set adr = $Order(^DBCore.MitarbeiterI("KurznameMoveIndex",MandantOid,""),1)
	if (adr '= ""){
		set id = $Order(^DBCore.MitarbeiterI("KurznameMoveIndex",MandantOid,adr,""),1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveLastOnKurzname">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()

	set adr = $Order(^DBCore.MitarbeiterI("KurznameMoveIndex",MandantOid,""),-1)
	if (adr '= ""){
		set id = $Order(^DBCore.MitarbeiterI("KurznameMoveIndex",MandantOid,adr,""),-1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnKurzname">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Kurzname:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set nextNr = $Order(^DBCore.MitarbeiterI("KurznameMoveIndex",MandantOid,Kurzname))
	if (nextNr '= "") {
		set res = $Order(^DBCore.MitarbeiterI("KurznameMoveIndex",MandantOid,nextNr,""),1,list)
	} else {
		set list = ##class(DBCore.Mitarbeiter).MoveLastOnKurzname(MandantOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnKurzname">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Kurzname:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set nextNr = $Order(^DBCore.MitarbeiterI("KurznameMoveIndex",MandantOid,Kurzname),-1)
	if (nextNr '= "") {
		set res = $Order(^DBCore.MitarbeiterI("KurznameMoveIndex",MandantOid,nextNr,""),-1,list)
	} else {
		set list = ##class(DBCore.Mitarbeiter).MoveFirstOnKurzname(MandantOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="MoveFirstOnName">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()

	set adr = $Order(^DBCore.MitarbeiterI("NameMoveIndex",MandantOid,""),1)
	if (adr '= ""){
		set id = $Order(^DBCore.MitarbeiterI("NameMoveIndex",MandantOid,adr,""),1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveLastOnName">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()

	set adr = $Order(^DBCore.MitarbeiterI("NameMoveIndex",MandantOid,""),-1)
	if (adr '= ""){
		set id = $Order(^DBCore.MitarbeiterI("NameMoveIndex",MandantOid,adr,""),-1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnName">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Kurzname:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set nextNr = $Order(^DBCore.MitarbeiterI("NameMoveIndex",MandantOid,Kurzname))
	if (nextNr '= "") {
		set res = $Order(^DBCore.MitarbeiterI("NameMoveIndex",MandantOid,nextNr,""),1,list)
	} else {
		set list = ##class(DBCore.Mitarbeiter).MoveLastOnName(MandantOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnName">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Kurzname:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set nextNr = $Order(^DBCore.MitarbeiterI("NameMoveIndex",MandantOid,Kurzname),-1)
	if (nextNr '= "") {
		set res = $Order(^DBCore.MitarbeiterI("NameMoveIndex",MandantOid,nextNr,""),-1,list)
	} else {
		set list = ##class(DBCore.Mitarbeiter).MoveFirstOnName(MandantOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="GetAdresseByKurznameOrName">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Bezeichnung:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set bez = Bezeichnung_"%"
	&sql(SELECT TOP 1 ID INTO :id 
		 FROM DBCore.Mitarbeiter 
		 WHERE Mandant = :MandantOid
		 	AND Kurzname LIKE :bez
		 ORDER BY Kurzname)
	
	if (id '= "") {
		Quit id
	
		// keine Daten gefunden -> nach Bezeichnung suchen	
	} else {
		set nId = ""
		&sql(SELECT TOP 1 ID INTO :nId 
		 	 FROM DBCore.Mitarbeiter
		 	 WHERE Mandant = :MandantOid
		 	 	AND Name LIKE :bez
		 	 ORDER BY Name)
		 if (nId '= "") {
			Quit nId 
		 
		 } else {
			 Quit ""
		 }
	}
]]></Implementation>
</Method>

<Method name="GetIdByNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid
		 AND Nummer = :Nr)
	Quit id
]]></Implementation>
</Method>

<Method name="GetNrById">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,id:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set Nr = ""
	&sql(SELECT Nummer INTO :Nr FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid
		 AND ID = :id)
	Quit Nr
]]></Implementation>
</Method>

<Method name="GetFirstObidByNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBCore.Mitarbeiter WHERE Mandant = :MandantOid
			ORDER BY Nummer)
	Quit id
]]></Implementation>
</Method>

<Method name="GetLastObidByNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set MandantOid = " "_MandantOid
	set adr = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,""),-1)
	if (adr '= ""){
		set id = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,adr,""),-1,list)
	} else {
		Quit ""	
	}
	Quit id
]]></Implementation>
</Method>

<Method name="GetNextObidByNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set MandantOid = " "_MandantOid
    set nextNr = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,Nr))
	if (nextNr '= "") {
		set id = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,nextNr,""),1,list)
	}
	Quit id
]]></Implementation>
</Method>

<Method name="GetPrevObidByNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set MandantOid = " "_MandantOid
    set nextNr = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,Nr),-1)
	if (nextNr '= "") {
		set id = $Order(^DBCore.MitarbeiterI("NummerIndex",MandantOid,nextNr,""),-1,list)
	}
	Quit id
]]></Implementation>
</Method>

<Method name="GetMitarbeiterWordVersion">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,BenutzerOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set version = 0
	&sql(SELECT TOP 1 WordVersion INTO :version 
		 FROM DBCore.Mitarbeiter 
		 WHERE Mandant = :MandantOid
		 AND Benutzer->ID = :BenutzerOid)
	if (SQLCODE '= 0) {
		set version = 0
	}
	quit version
]]></Implementation>
</Method>

<Method name="GetMitarbeiterExcelVersion">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,BenutzerOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set version = 0
	&sql(SELECT TOP 1 ExcelVersion INTO :version 
		 FROM DBCore.Mitarbeiter 
		 WHERE Mandant = :MandantOid
		 AND Benutzer->ID = :BenutzerOid)
	if (SQLCODE '= 0) {
		set version = 0
	}
	quit version
]]></Implementation>
</Method>

<Method name="GetMitarbeiterIdByUser">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,BenutzerOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set ma = ""
	&sql(SELECT ID INTO :ma 
		 FROM DBCore.Mitarbeiter 
		 WHERE Mandant = :MandantOid
		 AND Benutzer->ID = :BenutzerOid)
	if (SQLCODE '= 0) {
		set ma = ""
	}
	quit ma
]]></Implementation>
</Method>

<Property name="FehlerReportErfasser">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>Erfasser</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FehlerReportZustaendiger">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>Zustaendiger</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FehlerReportErlediger">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>Erlediger</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FehlerNotizErfasser">
<Type>DBProduktQS.FehlerNotiz</Type>
<Cardinality>many</Cardinality>
<Inverse>Erfasser</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="MatrixEntryProzess">
<Type>DBTQM.MatrixEntryProzess</Type>
<Cardinality>many</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="MatrixEntryFunktion">
<Type>DBTQM.MatrixEntryFunktion</Type>
<Cardinality>many</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Tarifgruppe">
<Type>DBIntrap.SD.Tarifgruppe</Type>
<Cardinality>one</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Tarifgruppe"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="VorabaustauschSachbe">
<Type>DBFakturierung.Vorabtausch</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="ProjektProjektleiterIntern">
<Type>DBIntrap.SD.Projekt</Type>
<Cardinality>many</Cardinality>
<Inverse>ProjektleiterIntern</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="ProjektSachbearbeiter">
<Type>DBIntrap.SD.Projekt</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Sollzeittabelle">
<Type>DBIntrap.SD.Sollzeittabelle</Type>
<Cardinality>one</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="SollzeittabelleIndex">
<Properties>Sollzeittabelle</Properties>
</Index>

<Property name="ReparaturAuftragSachbe">
<Type>DBFakturierung.RepAuftrag</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="IntrapBerechtigt">
<Type>%Integer</Type>
<InitialExpression>0</InitialExpression>
</Property>

<Property name="QMeldAufnehmer">
<Type>DBTQM.QMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>Aufnehmer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="QMeldVisumAbklaerung">
<Type>DBTQM.QMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>VisumAbklaerung</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="QMeldVisumMassnahmen">
<Type>DBTQM.QMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>VisumMassnahmen</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="QMeldVisumEntscheid">
<Type>DBTQM.QMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>VisumEntscheid</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="QMeldVisumGeprueft">
<Type>DBTQM.QMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>VisumGeprueft</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="QMeldVisumMassnahmen2">
<Type>DBTQM.QMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>VisumMassnahmen2</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="QMeldVisumKosten">
<Type>DBTQM.QMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>VisumKosten</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FehlerGeprueft">
<Type>DBProduktQS.FehlerReport</Type>
<Cardinality>many</Cardinality>
<Inverse>GeprueftVisum</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="RapportSachbearbeiter">
<Type>DBAdressen.Besuchsrapport</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Etikette">
<Type>DBPrint.Etikette</Type>
<Cardinality>one</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="OPDebiZusatzSachbearbeiter">
<Type>DBDebiKredi.OPDebiZusatz</Type>
<Cardinality>many</Cardinality>
<Inverse>SachbearbeiterIntern</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Statistik">
<Type>DBIntrap.StatistikMitarbeiter</Type>
<Cardinality>many</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Arbeitszeiterfassung">
<Type>DBLohn.ArbeitszeitErf</Type>
<Cardinality>many</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="WartungsvertragBearbeiter">
<Type>DBSpezial.Wartung.Kopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Arbeitsschema">
<Type>DBLohn.SD.Arbeitsschema</Type>
<Cardinality>one</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Arbeitsschema"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="BearbeiterLagerbew">
<Type>DBFakturierung.Lagerbew</Type>
<Cardinality>many</Cardinality>
<Inverse>Bearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="BearbeiterPendenz">
<Type>DBAdressen.Pendenz</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="MandatskontrolleS1">
<Type>DBIntrap.Mandatskontrolle</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter1</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="MandatskontrolleS2">
<Type>DBIntrap.Mandatskontrolle</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter2</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Visum">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="BestKopfWarenannehmer">
<Type>DBAgrofreshEK.BestellungsKopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Warenannehmer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="BestKopfSachbearbeiter">
<Type>DBAgrofreshEK.BestellungsKopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="QSWarenannehmer">
<Type>DBAgrofreshEK.QSMeldung</Type>
<Cardinality>many</Cardinality>
<Inverse>EkWarenannehmer</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="AuftrKopfSachbearbeiter">
<Type>DBAgrofresh.Auftragskopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FaktAuftrSachbearbeiter">
<Type>DBFakturierung.Auftragskopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FaktEKBestSachbearbeiter">
<Type>DBFaktEK.Bestellungskopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Sachbearbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Abteilung">
<Type>DBCore.Abteilung</Type>
<Cardinality>one</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="AbteilungIndex">
<Properties>Abteilung</Properties>
</Index>

<Property name="Lagerort">
<Type>DBAgrofresh.SD.Lagerort</Type>
<Cardinality>one</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="LagerortIndex">
<Properties>Lagerort</Properties>
</Index>

<Property name="Korrespondenz">
<Type>DBAdressen.Korrespondenz</Type>
<Cardinality>many</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="MitarbeiterLohn">
<Type>DBLohn.Mitarbeiter</Type>
<Cardinality>children</Cardinality>
<Inverse>MitarbeiterBasis</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Dossier">
<Type>DBSpezial.Versich.Dossier</Type>
<Cardinality>many</Cardinality>
<Inverse>Berater</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Method name="GetNextNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%Library.Integer</ReturnType>
<Implementation><![CDATA[
	set retval = 0
	&sql(SELECT Max(Nummer) INTO :retval FROM DBCore.Mitarbeiter WHERE Mandant = :MandOid)
	if (SQLCODE '= 0) {
		set retval = 0
	}
	Set retval = +retval + 1
	Quit retval
]]></Implementation>
</Method>

<Property name="Versicherungsdokument">
<Type>DBSpezial.Versich.DokStream</Type>
<Cardinality>many</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="WPruefung">
<Type>DBFaktEK.WerkzeugPruefung</Type>
<Cardinality>many</Cardinality>
<Inverse>Mitarbeiter</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.MitarbeiterD</DataLocation>
<DefaultData>MitarbeiterDefaultData</DefaultData>
<IdLocation>^DBCore.MitarbeiterD</IdLocation>
<IndexLocation>^DBCore.MitarbeiterI</IndexLocation>
<StreamLocation>^DBCore.MitarbeiterS</StreamLocation>
<Data name="MitarbeiterDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Kurzname</Value>
</Value>
<Value name="4">
<Value>Anrede</Value>
</Value>
<Value name="5">
<Value>Name</Value>
</Value>
<Value name="6">
<Value>Vorname</Value>
</Value>
<Value name="7">
<Value>Zusatz</Value>
</Value>
<Value name="8">
<Value>Strasse</Value>
</Value>
<Value name="9">
<Value>Ort</Value>
</Value>
<Value name="10">
<Value>Plz</Value>
</Value>
<Value name="11">
<Value>PlzInklZusatz</Value>
</Value>
<Value name="12">
<Value>PersAnrede</Value>
</Value>
<Value name="13">
<Value>ZuHanden</Value>
</Value>
<Value name="14">
<Value>Telefon1</Value>
</Value>
<Value name="15">
<Value>Telefon2</Value>
</Value>
<Value name="16">
<Value>Fax</Value>
</Value>
<Value name="17">
<Value>Mobil</Value>
</Value>
<Value name="18">
<Value>EMail</Value>
</Value>
<Value name="19">
<Value>Web</Value>
</Value>
<Value name="20">
<Value>Bemerkung1</Value>
</Value>
<Value name="21">
<Value>Bemerkung2</Value>
</Value>
<Value name="22">
<Value>Bemerkung3</Value>
</Value>
<Value name="23">
<Value>Sprachcode</Value>
</Value>
<Value name="24">
<Value>Aktiv</Value>
</Value>
<Value name="25">
<Value>Erfassungsdatum</Value>
</Value>
<Value name="26">
<Value>Bearbeitungsdatum</Value>
</Value>
<Value name="27">
<Value>Adressstatus</Value>
</Value>
<Value name="28">
<Value>BearbeiterNr</Value>
</Value>
<Value name="29">
<Value>BearbeiterBenutzername</Value>
</Value>
<Value name="30">
<Value>BearbeiterVorname</Value>
</Value>
<Value name="31">
<Value>BearbeiterName</Value>
</Value>
<Value name="32">
<Value>ErfasserNr</Value>
</Value>
<Value name="33">
<Value>ErfasserBenutzername</Value>
</Value>
<Value name="34">
<Value>ErfasserVorname</Value>
</Value>
<Value name="35">
<Value>ErfasserName</Value>
</Value>
<Value name="36">
<Value>Mandant</Value>
</Value>
<Value name="37">
<Value>Benutzer</Value>
</Value>
<Value name="38">
<Value>WordVersion</Value>
</Value>
<Value name="39">
<Value>ExcelVersion</Value>
</Value>
<Value name="40">
<Value>Tarif</Value>
</Value>
<Value name="41">
<Value>Tarifart</Value>
</Value>
<Value name="42">
<Value>Beruf</Value>
</Value>
<Value name="43">
<Value>TelIntern</Value>
</Value>
<Value name="44">
<Value>Tarifgruppe</Value>
</Value>
<Value name="45">
<Value>Sollzeittabelle</Value>
</Value>
<Value name="46">
<Value>IntrapBeraechtigt</Value>
</Value>
<Value name="47">
<Value>IntrapBerechtigt</Value>
</Value>
<Value name="48">
<Value>Etikette</Value>
</Value>
<Value name="49">
<Value>Arbeitsschema</Value>
</Value>
<Value name="50">
<Value>ArbeitsschemaDropDown</Value>
</Value>
<Value name="51">
<Value>DropDown</Value>
</Value>
<Value name="52">
<Value>Visum</Value>
</Value>
<Value name="53">
<Value>Abteilung</Value>
</Value>
<Value name="54">
<Value>Lagerort</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Abteilung">
</Property>
<Property name="Adressstatus"/>
<Property name="Aktiv">
</Property>
<Property name="Anrede">
</Property>
<Property name="Arbeitsschema">
</Property>
<Property name="BearbeiterBenutzername">
</Property>
<Property name="BearbeiterName">
</Property>
<Property name="BearbeiterNr">
</Property>
<Property name="BearbeiterVorname">
</Property>
<Property name="Bearbeitungsdatum">
</Property>
<Property name="Benutzer">
</Property>
<Property name="Beruf">
</Property>
<Property name="EMail">
</Property>
<Property name="ErfasserBenutzername">
</Property>
<Property name="ErfasserName">
</Property>
<Property name="ErfasserNr">
</Property>
<Property name="ErfasserVorname">
</Property>
<Property name="Erfassungsdatum">
</Property>
<Property name="Etikette">
</Property>
<Property name="ExcelVersion">
</Property>
<Property name="Fax">
</Property>
<Property name="IntrapBerechtigt">
</Property>
<Property name="Kurzname">
</Property>
<Property name="Lagerort">
</Property>
<Property name="Mandant">
</Property>
<Property name="Mobil">
</Property>
<Property name="Name">
</Property>
<Property name="Nummer">
</Property>
<Property name="Ort">
</Property>
<Property name="PersAnrede">
</Property>
<Property name="Plz">
</Property>
<Property name="PlzInklZusatz">
</Property>
<Property name="Sollzeittabelle">
</Property>
<Property name="Sprachcode">
</Property>
<Property name="Strasse">
</Property>
<Property name="Tarifart"/>
<Property name="Tarifgruppe">
</Property>
<Property name="TelIntern">
</Property>
<Property name="Telefon1">
</Property>
<Property name="Telefon2">
</Property>
<Property name="Visum">
</Property>
<Property name="Vorname">
</Property>
<Property name="Web">
</Property>
<Property name="WordVersion">
</Property>
<Property name="ZuHanden">
</Property>
<Property name="Zusatz">
</Property>
</Storage>
</Class>


<Project name="DBCore" Target="##class(DBCore.Report).GetBoolEinstByIndexClass(&quot;10&quot;,2)" TargetType="0">
  <Items>
    <ProjectItem name="DBCore.AF.AbteilungAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.AppEinstellungAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.BankenstammAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.BenutzerAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.EinstIndWaageAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.EinstLadenWaageAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.FeldhilfeFeldAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.HelpMenuEntryAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.MandAHVAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.MandantAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.MandantEinstellungAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.MandantJahrAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.MandantSpracheAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.MandantUserEinstellungAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.MitarbeiterAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.PostleitzahlAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.PrintJobAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.RechtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.ReportFooterAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.ReportHeaderAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.ReportMailTextAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.ReportSelektionsvorlageAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.ReportStreamAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.ReportTitlepageAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.RolleAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.RollenvergabeAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AF.UserEinstellungAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Abteilung" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.AppEinstellung" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Bankenstamm" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Benutzer" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.COFont" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.COFormat" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.COPosition" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.CORahmen" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.DBWrapper" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.EinstIndWaage" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.EinstLadenWaage" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ErrorCodes" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.FeldhilfeFeld" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.FeldhilfeFirmaFeld" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.FeldhilfeFirmaStream" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.FeldhilfeStream" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.FormularNr" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.HelpMenuEntry" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Helpers" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Konst" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.MandAHV" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Mandant" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.MandantEinstellung" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.MandantJahr" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.MandantRel" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.MandantSprache" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.MandantUserEinstellung" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Mitarbeiter" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Postleitzahl" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.PrintJob" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Recht" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.RechtGlobal" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.RechtMandant" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Report" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportBenutzer" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportFooter" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportHeader" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportMailText" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportMandant" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportSelektionEntry" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportSelektionsvorlage" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportStream" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.ReportTitlepage" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Rolle" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.Rollenvergabe" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.TriggerBase" type="CLS"></ProjectItem>
    <ProjectItem name="DBCore.UserEinstellung" type="CLS"></ProjectItem>
  </Items>
</Project>


<Class name="DBCore.Postleitzahl">
<Description>
</Description>
<Owner>cbt</Owner>
<Super>%Persistent,%Populate</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>60911,52112.056857</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Kanton">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="POPSPEC" value="ValueList(&quot;,AG,AR,AI,BL,BS,BE,FR,GE,GL,GR,JU,LU,NE,NW,OW,SH,SZ,SG,SO,TI,TG,UR,VD,VS,ZG,ZH&quot;)"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Land">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="3"/>
<Parameter name="POPSPEC" value="USState()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Ort">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="POPSPEC" value="City()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Plz">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="15"/>
<Parameter name="POPSPEC" value="USZip()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="PlzInklZusatz">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="15"/>
<Parameter name="POPSPEC" value="USZip()"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<UDLText name="T">
<Content><![CDATA[
//Relationship Mandant As DBCore.Mandant [ Cardinality = many, Inverse = Plz ];

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
//Relationship Adresse As DBAdressen.Adresse [ Cardinality = many, Inverse = Plz ];

]]></Content>
</UDLText>

<Index name="PlzInklZusatzIndex">
<Data>%%ID,PlzInklZusatz,Plz,Ort</Data>
<Properties>PlzInklZusatz:Exact</Properties>
</Index>

<Index name="OrtIndex">
<Data>%%ID,PlzInklZusatz,Plz,Ort</Data>
<Properties>Ort:Exact,PlzInklZusatz:Exact</Properties>
</Index>

<UDLText name="T">
<Content><![CDATA[
// Move Methoden auf PLZ

]]></Content>
</UDLText>

<Method name="MoveFirstOnPlz">
<ClassMethod>1</ClassMethod>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()

	set plz = $Order(^DBCore.PostleitzahlI("PlzInklZusatzIndex",""))
	set oid = $Order(^DBCore.PostleitzahlI("PlzInklZusatzIndex",plz,""),1,list)
	Quit list
]]></Implementation>
</Method>

<Method name="MoveLastOnPlz">
<ClassMethod>1</ClassMethod>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()

	set plz = $Order(^DBCore.PostleitzahlI("PlzInklZusatzIndex",""),-1)
	set oid = $Order(^DBCore.PostleitzahlI("PlzInklZusatzIndex",plz,""),-1,list)
	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnPlz">
<ClassMethod>1</ClassMethod>
<FormalSpec>PlzInklZusatz:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    
    if PlzInklZusatz '= "" {
		set plz = $Order(^DBCore.PostleitzahlI("PlzInklZusatzIndex",PlzInklZusatz))
		if plz '= "" {
			set oid = $Order(^DBCore.PostleitzahlI("PlzInklZusatzIndex",plz,""),1,list)
		} else {
			set list = ##class(DBCore.Postleitzahl).MoveLastOnPlz()
		}
		
    }
	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnPlz">
<ClassMethod>1</ClassMethod>
<FormalSpec>PlzInklZusatz:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()

    if PlzInklZusatz '= "" {
		set plz = $Order(^DBCore.PostleitzahlI("PlzInklZusatzIndex",PlzInklZusatz),-1)
		if plz '= "" {
			set oid = $Order(^DBCore.PostleitzahlI("PlzInklZusatzIndex",plz,""),-1,list)
		} else {
			set list = ##class(DBCore.Postleitzahl).MoveFirstOnPlz()
		}
    }
	
	Quit list
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
// Move Methoden auf Ort

]]></Content>
</UDLText>

<Method name="MoveFirstOnOrt">
<ClassMethod>1</ClassMethod>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	
	set ort = $Order(^DBCore.PostleitzahlI("OrtIndex",""))
	set plzInklZusatz = $Order(^DBCore.PostleitzahlI("OrtIndex",ort,""))
	set oid = $Order(^DBCore.PostleitzahlI("OrtIndex",ort,plzInklZusatz,""),1,list)
	Quit list
]]></Implementation>
</Method>

<Method name="MoveLastOnOrt">
<ClassMethod>1</ClassMethod>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()

	set ort = $Order(^DBCore.PostleitzahlI("OrtIndex",""),-1)
	set plzInklZusatz = $Order(^DBCore.PostleitzahlI("OrtIndex",ort,""),-1)
	set oid = $Order(^DBCore.PostleitzahlI("OrtIndex",ort,plzInklZusatz,""),-1,list)
	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>Ort:%String,PlzInklZusatz:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set ortIntern = Ort
	set plzinklzusatzIntern = $Order(^DBCore.PostleitzahlI("OrtIndex",ortIntern,PlzInklZusatz))
	if plzinklzusatzIntern = "" {
		set ortIntern = $Order(^DBCore.PostleitzahlI("OrtIndex",Ort))
		if ortIntern '= "" {
			set plzinklzusatzIntern = $Order(^DBCore.PostleitzahlI("OrtIndex",ortIntern,""))
		}
	
	} 
	if ortIntern '= "" {
		set oid = $Order(^DBCore.PostleitzahlI("OrtIndex",ortIntern,plzinklzusatzIntern,""),1,list)
	} else {
		set list = ##class(DBCore.Postleitzahl).MoveLastOnOrt()
	}
		
    
	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>Ort:%String,PlzInklZusatz:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	
	set list = $ListBuild()
    set ortIntern = Ort
	set plzinklzusatzIntern = $Order(^DBCore.PostleitzahlI("OrtIndex",ortIntern,PlzInklZusatz),-1)
	if plzinklzusatzIntern = "" {
		set ortIntern = $Order(^DBCore.PostleitzahlI("OrtIndex",Ort),-1)
		if ortIntern '= "" {
			set plzinklzusatzIntern = $Order(^DBCore.PostleitzahlI("OrtIndex",ortIntern,""),-1)
		}
	
	} 
	if ortIntern '= "" {
		set oid = $Order(^DBCore.PostleitzahlI("OrtIndex",ortIntern,plzinklzusatzIntern,""),-1,list)
	} else {
		set list = ##class(DBCore.Postleitzahl).MoveFirstOnOrt()
	}
		
    
	Quit list
]]></Implementation>
</Method>

<UDLText name="T">
<Content><![CDATA[
//Relationship BankPlz As DBFibu.SD.Bank [ Cardinality = many, Inverse = Plz ];

]]></Content>
</UDLText>

<Method name="GetOidByPlzOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>Plz:%String,Ort:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
 &sql(SELECT TOP 1 ID INTO :id FROM DBCore.Postleitzahl 
 		WHERE Plz LIKE :Plz 
 		AND Ort LIKE :Ort)
 Quit id
]]></Implementation>
</Method>

<Method name="GetPlzInklZusatzByPlzOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>Plz:%String,Ort:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
 set plzInklZusatz = ""
 &sql(SELECT TOP 1 PlzInklZusatz INTO :plzInklZusatz FROM DBCore.Postleitzahl 
 		WHERE Plz LIKE :Plz 
 		AND Ort LIKE :Ort)
 		
 if (plzInklZusatz = "") {
		  &sql(SELECT TOP 1 PlzInklZusatz INTO :plzInklZusatz FROM DBCore.Postleitzahl 
 		WHERE Plz LIKE :Plz
 		AND Ort LIKE :Ort_'%')
 }
 Quit plzInklZusatz
]]></Implementation>
</Method>

<Method name="ImportFile">
<Description>
importiert die Postleitzahlen vom Web-Server der CBT 
und ersetzt die bestehenden Daten</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>strServer:%String,strUrl:%String,PathName:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
     // Abbruch, wenn ein Parameter fehlt oder ungültig
     Quit:($Length(PathName,"\")=1)||($Length(strServer)=0)||($Length(strUrl)=0)
     // lade Postleitzahlen aus dem Web
     Do ..GetFileFromWeb(strServer,strUrl,PathName)
     // öffne Postleitzahlen
     Set PathFileName=PathName_"Plz.txt"
     Set stream=##class(%FileCharacterStream).%New()
     Set stream.Filename=PathFileName
     // Abbruch, wenn keine Daten vorhanden
     Quit:stream.Size=0
     // Begin Transaction
     TStart
     // lösche bestehende Postleitzahlen und deren Indexe
     Kill ^DBCore.PostleitzahlI
     Kill ^DBCore.PostleitzahlD
     // lese Postleitzahlen-Download zeilenweise ein
     While 'stream.AtEnd {
          Set line=stream.ReadLine()
          // neues Objekt (Datensatz)
          Set rs=..%New()
          Set rs.Plz			= $ZStrip($P(Line,$C(9),3),"<>W")
          Set rs.PlzInklZusatz	= $ZStrip($P(Line,$C(9),3),"<>W")_"0"_
                                  $ZStrip($P(Line,$C(9),4),"<>W")
          Set rs.Ort			= $ZStrip($P(Line,$C(9),6),"<>W")
          If $ZStrip($P(Line,$C(9),7),"<>W")="FL" {
	          Set rs.Kanton			= ""
	          Set rs.Land			= "FL"
          } Else {
	          Set rs.Kanton			= $ZStrip($P(Line,$C(9),7),"<>W")
	          Set rs.Land			= "CH"
          }
          Set sc=rs.%Save()
          // Abbruch, wenn Fehler beim Speichern
          Quit:$$$ISERR(sc)
     }
     If $$$ISOK(sc) {
	     // Transaktion erfolgreich
     	 TCommit
     	 // erstelle Indexe neu
     	 Do ..%PurgeIndices()
     	 Do ..%BuildIndices()
     } Else {
	     /* Transaktion fehlgeschlagen
	        mache alles wieder rückgängig und 
	        stelle Original-Zustand wiedr her */
     	 TRollBack 
     }
     // schliesse Postleitzahlen
     Set stream=""
     // lösche Datei mit Postleitzahlen wieder
     Set Cmd="DEL /F "_PathName_"Plz.txt"
     Do $ZF(-1,Cmd)
     // Ende: gebe ggf. Fehlerstatus zurück
     Quit sc
]]></Implementation>
</Method>

<Method name="GetFileFromWeb">
<Description>
Läd eine ZIP-Datei (hier für Postleitzahlen) von einem Web-Server
und entpackt diese.
Alle erzeugten Hilfs-Dateien werden anschliessend wieder gelöscht.
[Previously private]</Description>
<Final>1</Final>
<ClassMethod>1</ClassMethod>
<FormalSpec>strServer:%String,strUrl:%String,PathName:%String</FormalSpec>
<Implementation><![CDATA[
    /* lösche sicherheitshalber Dateien, 
       falls diese noch vorhanden         */
    Set Cmd="DEL /F "_PathName_"PLZTEMP.ZIP"
    Do $ZF(-1,Cmd)
    Set Cmd="DEL /F "_PathName_"Plz.txt"
    Do $ZF(-1,Cmd)
    Set Cmd="DEL /F "_PathName_"UnZipTmp.vbs"
    Do $ZF(-1,Cmd)
    // generiere VBScript zum entpacken der ZIP
    Set vbs=##class(%FileCharacterStream).%New()
    Set vbs.Filename=PathName_"UnZipTmp.vbs"
	Do vbs.WriteLine("Set url=WScript.Arguments")
	Do vbs.WriteLine("Set sa=CreateObject(""Shell.Application"")")
	Do vbs.WriteLine("Set zip=sa.NameSpace(url(1))")
	Do vbs.WriteLine("Set filesInZip=sa.NameSpace(url(0)).Items")
	Do vbs.WriteLine("zip.CopyHere(filesInZip)")
	Do vbs.WriteLine("Set filesInZip=Nothing")
	Do vbs.WriteLine("Set sa=Nothing")
	Do vbs.WriteLine("Set url=Nothing")
	Do vbs.SaveStream()
	Set vbs=""
	// öffne Zugang zum Web-Server
	Set httprequest=##class(%Net.HttpRequest).%New()
	Set httprequest.Server=strServer
	// lade ZIP-Datei
	Do httprequest.Get(strUrl)
    Set stream=##class(%FileBinaryStream).%New()
    Set stream.Filename=PathName_"PLZTEMP.ZIP"
    Set Ret=stream.CopyFromAndSave(httprequest.HttpResponse.Data)
    // entpacke ZIP mit Hilfe von generiertem VBScript
    Set Cmd=PathName_"UnZipTmp.vbs "_PathName_"PLZTEMP.ZIP "_PathName
    Do $ZF(-1,Cmd)
    // lösche geladene ZIP wieder
    Set Cmd="DEL /F "_PathName_"PLZTEMP.ZIP"
    Do $ZF(-1,Cmd)
    // lösche generiertes VBScript wieder
    Set Cmd="DEL /F "_PathName_"UnZipTmp.vbs"
    Do $ZF(-1,Cmd)
]]></Implementation>
</Method>

<Method name="GetIdByPlzInklZusatz">
<ClassMethod>1</ClassMethod>
<FormalSpec>plzInklZusatz:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT TOP 1 ID INTO :id
		 FROM DBCore.Postleitzahl 
		 WHERE PlzInklZusatz = :plzInklZusatz)
	Quit id
]]></Implementation>
</Method>

<Property name="GemNr">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="15"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.PostleitzahlD</DataLocation>
<DefaultData>PostleitzahlDefaultData</DefaultData>
<IdLocation>^DBCore.PostleitzahlD</IdLocation>
<IndexLocation>^DBCore.PostleitzahlI</IndexLocation>
<StreamLocation>^DBCore.PostleitzahlS</StreamLocation>
<Data name="PostleitzahlDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Kanton</Value>
</Value>
<Value name="3">
<Value>Land</Value>
</Value>
<Value name="4">
<Value>Ort</Value>
</Value>
<Value name="5">
<Value>Plz</Value>
</Value>
<Value name="6">
<Value>PlzInklZusatz</Value>
</Value>
<Value name="7">
<Value>GemNr</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="GemNr">
</Property>
<Property name="Kanton">
</Property>
<Property name="Land">
</Property>
<Property name="Ort">
</Property>
<Property name="Plz">
</Property>
<Property name="PlzInklZusatz">
</Property>
</Storage>
</Class>


<Class name="DBCore.PrintJob">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62431,51919</TimeChanged>
<TimeCreated>62423,61482.935959</TimeCreated>

<Property name="Nummer">
<Type>%Integer</Type>
</Property>

<Property name="Name">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Status">
<Type>%Integer</Type>
</Property>

<Property name="Error">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Benutzer">
<Type>DBCore.Benutzer</Type>
<Cardinality>one</Cardinality>
<Inverse>PrintJobs</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="BenutzerIndex">
<Properties>Benutzer</Properties>
</Index>

<Property name="StartTime">
<Type>%TimeStamp</Type>
</Property>

<Property name="PrintTime">
<Type>%TimeStamp</Type>
</Property>

<Method name="DeleteAllByBenutzer">
<ClassMethod>1</ClassMethod>
<FormalSpec>BenutzerId:%String</FormalSpec>
<Implementation><![CDATA[	&sql(DELETE DBCore.PrintJob WHERE Benutzer = :BenutzerId)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.PrintJobD</DataLocation>
<DefaultData>PrintJobDefaultData</DefaultData>
<IdLocation>^DBCore.PrintJobD</IdLocation>
<IndexLocation>^DBCore.PrintJobI</IndexLocation>
<StreamLocation>^DBCore.PrintJobS</StreamLocation>
<Data name="PrintJobDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Name</Value>
</Value>
<Value name="4">
<Value>Status</Value>
</Value>
<Value name="5">
<Value>Error</Value>
</Value>
<Value name="6">
<Value>Benutzer</Value>
</Value>
<Value name="7">
<Value>StartTime</Value>
</Value>
<Value name="8">
<Value>PrintTime</Value>
</Value>
</Data>
<Property name="%%CLASSNAME"/>
<Property name="Benutzer"/>
<Property name="Error"/>
<Property name="Name"/>
<Property name="Nummer"/>
<Property name="PrintTime"/>
<Property name="StartTime"/>
<Property name="Status"/>
</Storage>
</Class>


<Class name="DBCore.Recht">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61500,35949.741981</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="RechtId">
<Type>%Integer</Type>
</Property>

<Property name="Schreiben">
<Type>%Boolean</Type>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.RechtD</DataLocation>
<DefaultData>RechtDefaultData</DefaultData>
<IdLocation>^DBCore.RechtD</IdLocation>
<IndexLocation>^DBCore.RechtI</IndexLocation>
<StreamLocation>^DBCore.RechtS</StreamLocation>
<Data name="RechtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Id</Value>
</Value>
<Value name="3">
<Value>Aktiv</Value>
</Value>
<Value name="4">
<Value>Schreiben</Value>
</Value>
<Value name="5">
<Value>RechtId</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="RechtId">
</Property>
<Property name="Schreiben">
</Property>
</Storage>
</Class>


<Class name="DBCore.RechtGlobal">
<Super>DBCore.Recht</Super>
<TimeChanged>62063,67868.485302</TimeChanged>
<TimeCreated>61500,35949.860422</TimeCreated>

<Property name="Rolle">
<Type>DBCore.Rolle</Type>
<Cardinality>one</Cardinality>
<Inverse>RechteGlobal</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Rolle"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="RolleGIndex">
<Properties>Rolle</Properties>
</Index>

<Index name="RechtGlobalIdx">
<Properties>RechtId,Rolle</Properties>
<Unique>1</Unique>
</Index>

<UDLText name="T">
<Content><![CDATA[
// 0 = keine Rechte

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// 1 = Leserechte

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// 2 = Schreibrechte

]]></Content>
</UDLText>

<Method name="IsRechtSet">
<ClassMethod>1</ClassMethod>
<FormalSpec>Nr:%Integer,RollenOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set retval = 0
	set id = ""
	set schreiben = 0
	&sql(SELECT %ID, Schreiben INTO :id, :schreiben FROM DBCore.RechtGlobal
			WHERE RechtId = :Nr AND Rolle = :RollenOid)
	
	//Datensatz gefunden	
	if (id '= "") {
		if (schreiben = 0) {
			set retval =  ##class(DBCore.Konst).LESERECHT()
		} elseif (schreiben = 1) {
			set retval =  ##class(DBCore.Konst).SCHREIBRECHT()
		} 		
	} else {
		set retval = ##class(DBCore.Konst).KEINRECHT()	
	}
	Quit retval
]]></Implementation>
</Method>

<Method name="GetRechtIdByRolle">
<ClassMethod>1</ClassMethod>
<FormalSpec>RechtId:%Integer,RollenOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.RechtGlobal WHERE RechtId = :RechtId AND Rolle = :RollenOid)
	Quit id
]]></Implementation>
</Method>

<Method name="RolleHasGlobalRechte">
<ClassMethod>1</ClassMethod>
<FormalSpec>RollenOid:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set retval = 0
	set cnt = 0
	&sql(SELECT COUNT(*) INTO :cnt FROM DBCore.RechtGlobal WHERE Rolle = :RollenOid)
	if (cnt > 0) {
		set retval = 1	
	} 
	Quit retval
]]></Implementation>
</Method>

<Method name="SetGlobalRechtForAllRollen">
<ClassMethod>1</ClassMethod>
<FormalSpec>RechtId:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set retval = 1
	Set strSQL="SELECT ID From DBCore.Rolle"
    Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
    Do rs.Prepare(strSQL)
    Set sc=rs.Execute()
    
    if ($$$ISERR(sc)) {
		w "DBCore.RechteGlobal - Fehler bei SQL-Statement für SetGlobalRechtForAllRollen",!
	}
	While (rs.Next()) {
		set rolle = rs.Data("ID")
		//w "Rolle: ", rolle, !
		set rechtId = ##class(DBCore.RechtGlobal).GetRechtIdByRolle(RechtId, rolle)
		// Neues Recht Anlegen
		if ((rechtId="")||(rechtId = $c(0))){
			//w "Neues Recht ", !
			set recht = ##class(DBCore.RechtGlobal).%New()
			set rollenObjekt = ##class(DBCore.Rolle).%OpenId(rolle)
			set recht.Rolle = rollenObjekt
			set recht.RechtId = RechtId
			set recht.Schreiben = 1
			set state = recht.%Save()
		} else {
			// Sosnt prüfen ob Berechtigung und wenn nicht setzen
			set hasRecht = ##class(DBCore.RechtGlobal).IsRechtSet(RechtId, rolle)
			//w "Bestehendes Recht ",hasRecht, !
			if (hasRecht '= 1) {
				set recht = ##class(DBCore.RechtGlobal).%OpenId(rechtId)
				set recht.Schreiben = 1
				set state = recht.%Save()
			}
		}
	}
	Quit retval
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>RechtGlobalDefaultData</DefaultData>
<Data name="RechtGlobalDefaultData">
<Structure>listnode</Structure>
<Subscript>"RechtGlobal"</Subscript>
<Value name="1">
<Value>Rolle</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.RechtMandant">
<Super>DBCore.Recht,DBCore.MandantRel</Super>
<TimeChanged>61865,39483.3865</TimeChanged>
<TimeCreated>61500,35949.958394</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Rolle">
<Type>DBCore.Rolle</Type>
<Cardinality>one</Cardinality>
<Inverse>RechteMandant</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Rolle"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="RolleRMIndex">
<Properties>Rolle</Properties>
</Index>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Index name="RechtMandIdx">
<Properties>RechtId,Mandant,Rolle</Properties>
<Unique>1</Unique>
</Index>

<UDLText name="T">
<Content><![CDATA[
// 0 = keine Rechte

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// 1 = Leserechte

]]></Content>
</UDLText>

<UDLText name="T">
<Content><![CDATA[
// 2 = Schreibrechte

]]></Content>
</UDLText>

<Method name="IsRechtSet">
<ClassMethod>1</ClassMethod>
<FormalSpec>Nr:%Integer,RollenOid:%String,MandOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set retval = 0
	set id = ""
	set schreiben = 0
	&sql(SELECT ID, Schreiben INTO :id, :schreiben FROM DBCore.RechtMandant
			WHERE RechtId = :Nr AND Rolle = :RollenOid AND Mandant = :MandOid)
			
	//Datensatz gefunden	
	if (id '= "") {
		if (schreiben = 0) {
			set retval =  ##class(DBCore.Konst).LESERECHT()
		} elseif (schreiben = 1) {
			set retval =  ##class(DBCore.Konst).SCHREIBRECHT()
		} 		
	} else {
		set retval = ##class(DBCore.Konst).KEINRECHT()	
	}
	Quit retval
]]></Implementation>
</Method>

<Method name="GetRechtIdByRolleMand">
<ClassMethod>1</ClassMethod>
<FormalSpec>RechtId:%Integer,RollenOid:%String,MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.RechtMandant WHERE RechtId = :RechtId AND Rolle = :RollenOid AND Mandant = :MandOid)
	Quit id
]]></Implementation>
</Method>

<Method name="GetFirstMandRechtOidByRolle">
<ClassMethod>1</ClassMethod>
<FormalSpec>RollenOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT TOP 1 Mandant INTO :oid FROM DBCore.RechtMandant WHERE Rolle = :RollenOid 
			ORDER BY RechtId)
	Quit oid
]]></Implementation>
</Method>

<Method name="CheckMandRechtOidByRolle">
<ClassMethod>1</ClassMethod>
<FormalSpec>RollenOid:%String,MandantOid:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT TOP 1 Mandant INTO :oid FROM DBCore.RechtMandant WHERE Rolle = :RollenOid AND Mandant = :MandantOid
			ORDER BY RechtId)
	Quit (oid'="")
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>RechtMandantDefaultData</DefaultData>
<Data name="RechtMandantDefaultData">
<Structure>listnode</Structure>
<Subscript>"RechtMandant"</Subscript>
<Value name="1">
<Value>Rolle</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBCore.Report">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62431,53037.364961</TimeChanged>
<TimeCreated>61125,48634.522139</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<UDLText name="T">
<Content><![CDATA[
// List ID

]]></Content>
</UDLText>

<Property name="Nummer">
<Type>%Integer</Type>
<Required>1</Required>
</Property>

<Index name="NummerIndex">
<Properties>Nummer</Properties>
</Index>

<UDLText name="T">
<Content><![CDATA[
// Einstellung für Speicherung (0 Global, 1 Mandantenbezogen, 2 Benutzerbezogen)

]]></Content>
</UDLText>

<Property name="Einstellung">
<Type>%Integer</Type>
</Property>

<Property name="Fuss">
<Type>DBCore.ReportFooter</Type>
<Cardinality>one</Cardinality>
<Inverse>ReportFuss</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Fuss"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Kopf">
<Type>DBCore.ReportHeader</Type>
<Cardinality>one</Cardinality>
<Inverse>ReportKopf</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Kopf"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Titelblatt">
<Type>DBCore.ReportTitlepage</Type>
<Cardinality>one</Cardinality>
<Inverse>ReportTitelblatt</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Titelblatt"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="DuplexDruck">
<Type>%Library.Boolean</Type>
</Property>

<Property name="Zebramuster">
<Type>%Library.Boolean</Type>
</Property>

<Property name="Zebrafarbe">
<Type>%Integer</Type>
</Property>

<Property name="Drucker1">
<Type>%String</Type>
</Property>

<Property name="Schacht1">
<Type>%String</Type>
</Property>

<Property name="NextPageSamePrinter">
<Type>%Library.Boolean</Type>
</Property>

<Property name="Drucker2">
<Type>%String</Type>
</Property>

<Property name="Schacht2">
<Type>%String</Type>
</Property>

<Property name="LabelValues">
<Type>%String</Type>
<MultiDimensional>1</MultiDimensional>
<Parameter name="MAXLEN" value="255"/>
</Property>

<UDLText name="T">
<Content><![CDATA[
// Vorschlags- Einstellung für den Formulardruck, Bsp. bei RG Open Rechts: Gelterkinden, heute oder Gelterkinden, RgDatum

]]></Content>
</UDLText>

<Property name="DruckDatumAlsPerDatum">
<Type>%Library.Boolean</Type>
</Property>

<Method name="GetDatumAlsPerDatumByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set report = ##class(DBCore.Report).GetReportByListId(ListId)
	quit report.DruckDatumAlsPerDatum
]]></Implementation>
</Method>

<Method name="SetDatumAlsPerDatumByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer,value:%Boolean</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set report = ##class(DBCore.Report).GetReportByListId(ListId)
	set report.DruckDatumAlsPerDatum = value
	quit report.%Save()
]]></Implementation>
</Method>

<Method name="GetReportByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer</FormalSpec>
<ReturnType>DBCore.Report</ReturnType>
<Implementation><![CDATA[
	Set sID = ""
	&sql(SELECT %ID INTO :sID 
			 FROM DBCore.Report
			 WHERE Nummer=:ListId)		
	// Falls kein Eintrag zur Liste vorhanden Eintrag anlegen
	if (sID = "") {
		set stdEntry = ##Class(DBCore.Report).%New()
		set stdEntry.Nummer = ListId
		set stdEntry.NextPageSamePrinter = 1
		set stdEntry.Drucker1 = "Standarddrucker"
		set stdEntry.Schacht1 = ""
		set stdEntry.Drucker2 = "Standarddrucker"
		set stdEntry.Schacht2 = ""
		set stdEntry.Zebrafarbe = -256
		set stdEntry.Zebramuster = 0
		set stdEntry.DuplexDruck = 0
		set stdEntry.Einstellung = 0
		set headerOid = ##class(DBCore.ReportHeader).GetReportHeaderOidByCode(1)
		if (headerOid '= "") {
			set header = ##class(DBCore.ReportHeader).%OpenId(headerOid)
			set stdEntry.Kopf = header
			k header
		}
		set tittelOid = ##class(DBCore.ReportTitlepage).GetReportTitlepageOidByCode(1)
		if (tittelOid '= "") {
			set page = ##class(DBCore.ReportTitlepage).%OpenId(tittelOid)
			set stdEntry.Titelblatt = page
			k page
		}
		set sc = stdEntry.%Save()
		w sc
		set sID = stdEntry.%Id()
	}
	Set s=##Class(DBCore.Report).%OpenId(sID)
	Quit s
]]></Implementation>
</Method>

<Method name="GetOidByValues">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set sID = ""
	&sql(SELECT %ID INTO :sID 
		FROM DBCore.Report
		WHERE Nummer=:ListId)
	Quit sID
]]></Implementation>
</Method>

<Method name="GetSettingsArray">
<ClassMethod>1</ClassMethod>
<ReturnType>%Library.ArrayOfDataTypes</ReturnType>
<Implementation><![CDATA[
	set arr = ##Class(%Library.ArrayOfDataTypes).%New()
	quit arr
]]></Implementation>
</Method>

<Method name="SetAsDefault">
<ClassMethod>1</ClassMethod>
<FormalSpec>Lists:%Library.ArrayOfDataTypes,ReportOid:%String</FormalSpec>
<Implementation><![CDATA[
	Set default = ##Class(DBCore.Report).%OpenId(ReportOid)
	For i=1:1:Lists.Count() {
		set list = +Lists.GetAt(i)
		Set NewOid = ##Class(DBCore.Report).GetOidByValues(list)
		Set rep = ""
		If (NewOid) {
			Set rep = ##Class(DBCore.Report).%OpenId(NewOid)
		} Else {
			Set rep = ##Class(DBCore.Report).%New()
		}
		if (rep) {
			w "da"
			Set rep.Nummer = list
			Set rep.Drucker1 = default.Drucker1
			Set rep.Drucker2 = default.Drucker2
			Set rep.DuplexDruck = default.DuplexDruck
			Set rep.Einstellung = default.Einstellung
			Set rep.Fuss = default.Fuss
			Set rep.Kopf = default.Kopf
			Set rep.NextPageSamePrinter = default.NextPageSamePrinter
			Set rep.Schacht1 = default.Schacht1
			Set rep.Schacht2 = default.Schacht2
			Set rep.Titelblatt = default.Titelblatt
			Set rep.Zebrafarbe = default.Zebrafarbe
			Set rep.Zebramuster = default.Zebramuster
			set sc = rep.%Save()
		}
		kill rep
		set rep = ""
	}
	kill default
]]></Implementation>
</Method>

<Method name="DelReportEinstByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	&sql(Delete From DBCore.Report WHERE Nummer=:ListId)
	Quit (SQLCODE = 0 || SQLCODE = 100)
	Quit 1
]]></Implementation>
</Method>

<Method name="GetIntEinstByIndexClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>oId:%String,index:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set rep = ##class(DBCore.Report).%OpenId(oId)
	quit rep.GetIntEinstByIndex(index)
]]></Implementation>
</Method>

<Method name="GetIntEinstByIndex">
<FormalSpec>index:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	if ($DATA(..LabelValues(index)) '= 0) {
		quit +$GET(..LabelValues(index))
	} else {
		quit 0	
	}
]]></Implementation>
</Method>

<Method name="GetBoolEinstByIndexClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>oId:%String,index:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set rep = ##class(DBCore.Report).%OpenId(oId)
	quit rep.GetBoolEinstByIndex(index)
]]></Implementation>
</Method>

<Method name="GetBoolEinstByIndex">
<FormalSpec>index:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set result = $GET(..LabelValues(index))
	Quit (result = "1")
]]></Implementation>
</Method>

<Method name="GetStringEinstByIndexClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>oId:%String,index:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set rep = ##class(DBCore.Report).%OpenId(oId)
	quit rep.GetStringEinstByIndex(index)
]]></Implementation>
</Method>

<Method name="GetStringEinstByIndex">
<FormalSpec>index:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit $GET(..LabelValues(index))
]]></Implementation>
</Method>

<Method name="SetEinstByIndexClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>oId:%String,einst:%Integer,index:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set rep =##class(DBCore.Report).%OpenId(oId)
	quit rep.SetEinstByIndex(einst, index)
]]></Implementation>
</Method>

<Method name="SetStringEinstByIndex">
<FormalSpec>einstString:%String,index:%Integer</FormalSpec>
<Implementation><![CDATA[
	set ..LabelValues(index) = einstString
	do ..%Save()
]]></Implementation>
</Method>

<Method name="SetDoubleEinstByIndex">
<FormalSpec>einstInt:%Decimal(SCALE=5),index:%Integer</FormalSpec>
<Implementation><![CDATA[
	set ..LabelValues(index) = einstInt
	do ..%Save()
]]></Implementation>
</Method>

<Method name="SetBoolEinstByIndex">
<FormalSpec>einstBool:%Boolean,index:%Integer</FormalSpec>
<Implementation><![CDATA[
	set ..LabelValues(index) = einstBool
	do ..%Save()
]]></Implementation>
</Method>

<Method name="SetDateEinstByIndex">
<FormalSpec>einstDate:%Date,index:%Integer</FormalSpec>
<Implementation><![CDATA[
	set ..LabelValues(index) = $ZDATEH($ZD(einstDate, 1))
	do ..%Save()
]]></Implementation>
</Method>

<Method name="GetDateEinstByIndexClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>oId:%String,index:%Integer</FormalSpec>
<ReturnType>%Date</ReturnType>
<Implementation><![CDATA[
	set rep = ##class(DBCore.Report).%OpenId(oId)
	quit rep.GetDateEinstByIndex(index)
]]></Implementation>
</Method>

<Method name="GetDateEinstByIndex">
<FormalSpec>index:%Integer</FormalSpec>
<ReturnType>%Date</ReturnType>
<Implementation><![CDATA[	quit +$GET(..LabelValues(index))
]]></Implementation>
</Method>

<Method name="GetDoubleEinstByIndex">
<FormalSpec>index:%Integer</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<ReturnTypeParams>SCALE=5</ReturnTypeParams>
<Implementation><![CDATA[	quit +$GET(..LabelValues(index))
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.ReportD</DataLocation>
<DefaultData>ReportDefaultData</DefaultData>
<IdLocation>^DBCore.ReportD</IdLocation>
<IndexLocation>^DBCore.ReportI</IndexLocation>
<StreamLocation>^DBCore.ReportS</StreamLocation>
<Data name="ReportDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Mandant</Value>
</Value>
<Value name="4">
<Value>Benutzer</Value>
</Value>
<Value name="5">
<Value>Einstellung</Value>
</Value>
<Value name="6">
<Value>Fuss</Value>
</Value>
<Value name="7">
<Value>Kopf</Value>
</Value>
<Value name="8">
<Value>Titelblatt</Value>
</Value>
<Value name="9">
<Value>DuplexDruck</Value>
</Value>
<Value name="10">
<Value>Zebramuster</Value>
</Value>
<Value name="11">
<Value>Zebrafarbe</Value>
</Value>
<Value name="12">
<Value>Drucker1</Value>
</Value>
<Value name="13">
<Value>Schacht1</Value>
</Value>
<Value name="14">
<Value>NextPageSamePrinter</Value>
</Value>
<Value name="15">
<Value>Drucker2</Value>
</Value>
<Value name="16">
<Value>Schacht2</Value>
</Value>
<Value name="17">
<Value>LabelValues</Value>
</Value>
<Value name="18">
<Value>DruckDatumAlsPerDatum</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="DruckDatumAlsPerDatum">
</Property>
<Property name="Drucker1">
</Property>
<Property name="Drucker2">
</Property>
<Property name="DuplexDruck">
</Property>
<Property name="Einstellung">
</Property>
<Property name="Fuss">
</Property>
<Property name="Kopf">
</Property>
<Property name="LabelValues"/>
<Property name="NextPageSamePrinter">
</Property>
<Property name="Nummer">
</Property>
<Property name="Schacht1">
</Property>
<Property name="Schacht2">
</Property>
<Property name="Titelblatt">
</Property>
<Property name="Zebrafarbe">
</Property>
<Property name="Zebramuster">
</Property>
</Storage>
</Class>


<Class name="DBCore.ReportBenutzer">
<Super>DBCore.Report</Super>
<TimeChanged>61718,68098.816142</TimeChanged>
<TimeCreated>61292,49873.444057</TimeCreated>

<UDLText name="T">
<Content><![CDATA[
// Benutzer

]]></Content>
</UDLText>

<Property name="Benutzer">
<Type>DBCore.Benutzer</Type>
<Cardinality>one</Cardinality>
<Inverse>ReportBenutzer</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetBenutzerReportByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer,CurrUser:%String</FormalSpec>
<ReturnType>DBCore.Report</ReturnType>
<Implementation><![CDATA[
	
	Set sID = ""
	// 1. Priortität Benutzer
	&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportBenutzer
				 WHERE Nummer=:ListId AND Benutzer =:CurrUser)
	if (sID '= "") {
		quit ##class(DBCore.ReportBenutzer).%OpenId(sID)
	} else {
		quit ""
	}
]]></Implementation>
</Method>

<Method name="DelBenutzertReportEinstByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer,CurrUser:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	&sql(Delete From DBCore.ReportBenutzer WHERE Nummer=:ListId AND Benutzer =:CurrUser)

	Quit (SQLCODE = 0 || SQLCODE = 100)
]]></Implementation>
</Method>

<Method name="GetBenutzerReportOidByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer,CurrUser:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set sID = ""
	&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportBenutzer
				 WHERE Nummer=:ListId AND Benutzer =:CurrUser)
	quit sID
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBCore.ReportFooter">
<Super>%Persistent</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61125,51474.592447</TimeCreated>

<Property name="Nummer">
<Type>%Integer</Type>
<Required>1</Required>
</Property>

<Index name="NummerIndex">
<Properties>Nummer</Properties>
<Unique>1</Unique>
</Index>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Format">
<Type>%Integer</Type>
</Property>

<Property name="Hoehe">
<Type>%Integer</Type>
</Property>

<Property name="FooterFile">
<Type>DBCore.ReportStream</Type>
<Cardinality>many</Cardinality>
<Inverse>Footer</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="ReportFuss">
<Type>DBCore.Report</Type>
<Cardinality>many</Cardinality>
<Inverse>Fuss</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBCore.ReportFooter).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBCore.ReportFooter)
	Quit +nr +1
]]></Implementation>
</Method>

<Method name="OutputStream">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set Nummer=..Nummer
	Set Ret=""
	If Nummer'="" {
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Footer->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportStream 
				 WHERE Footer->Nummer=:Nummer AND 
				       Sprache=:Sprache)
			Set s=##Class(DBCore.ReportStream).%OpenId(sID)
			//Set Ret=s.OutputStream()
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		} Else {
			Set StdSprache="de"
			&sql(SELECT count(*) As Cnt INTO :Cnt
			     FROM DBCore.ReportStream 
			     WHERE Footer->Nummer=:Nummer AND Sprache=:StdSprache)
			If (Cnt>0) {
				&sql(SELECT %ID INTO :sID 
				     FROM DBCore.ReportStream 
				     WHERE Footer->Nummer=:Nummer AND 
				           Sprache=:StdSprache)
				Set s=##Class(DBCore.ReportStream).%OpenId(sID)
				// Set Ret=s.OutputStream()
				Set Size=s.DataStream.Size
				Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
			}
		}
	}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="OutputFile">
<FormalSpec>PathFileName:%String,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set DelFile=PathFileName
	Set DelFile=$Replace(DelFile,".lst",".*")
	Set Cmd="DEL /F "_DelFile
	Do $ZF(-1,Cmd)
	Set res=0
	Set Nummer=..Nummer
	If Nummer'="" {
		Set sID = ""
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Footer->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportStream 
				 WHERE Footer->Nummer=:Nummer AND 
				       Sprache=:Sprache)
			Set s=##Class(DBCore.ReportStream).%OpenId(sID)
			Set Ret=s.OutputFile(PathFileName)
			Set res=Ret=1
			
		} Else {
			Set StdSprache="de"
			&sql(SELECT count(*) As Cnt INTO :Cnt
			     FROM DBCore.ReportStream 
			     WHERE Footer->Nummer=:Nummer AND Sprache=:StdSprache)
			If (Cnt>0) {
				&sql(SELECT %ID INTO :sID 
				     FROM DBCore.ReportStream 
				     WHERE Footer->Nummer=:Nummer AND 
				           Sprache=:StdSprache)
				Set s=##Class(DBCore.ReportStream).%OpenId(sID)
				Set Ret=s.OutputFile(PathFileName)
				Set res=Ret=1
			}
		}
	}
	Quit res
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set Nummer=..Nummer
	Set sID = ""
	If Nummer'="" {
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Footer->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt=0) {
			Set myId=..%Id()
			Set n=##Class(DBCore.ReportStream).%New()
			Set n.Sprache = Sprache
			Set n.Footer = ##Class(DBCore.ReportFooter).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBCore.ReportStream 
		     WHERE Footer->Nummer=:Nummer AND 
		           Sprache=:Sprache)
		Set s=##Class(DBCore.ReportStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="InputFile">
<FormalSpec>PathFileName:%String,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set Cmd="DEL /F C:\Test.txt"
	Do $ZF(-1,Cmd)
	Set res=0
	Set Nummer=..Nummer
	Set sID = ""
	If Nummer'="" {
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Footer->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt=0) {
			Set myId=..%Id()
			Set n=##Class(DBCore.ReportStream).%New()
			Set n.Sprache = Sprache
			Set n.Footer = ##Class(DBCore.ReportFooter).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBCore.ReportStream 
		     WHERE Footer->Nummer=:Nummer AND 
		           Sprache=:Sprache)
		Set s=##Class(DBCore.ReportStream).%OpenId(sID)
		Set Ret=s.InputFile(PathFileName)
		Set RetS = s.%Save()
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="GetReportFooterOidByCode">
<ClassMethod>1</ClassMethod>
<FormalSpec>ReportFooterNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	QUIT:(ReportFooterNr<0)
	Set oid = ""
	&sql(SELECT ID INTO :oid
		 FROM DBCore.ReportFooter
		 WHERE Nummer = :ReportFooterNr)
	Quit oid
]]></Implementation>
</Method>

<Method name="CopyReportFooter">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String,dstNr:%Integer,dstBez:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set footer = ##class(ReportFooter).%OpenId(oid)
	set newObj = footer.%ConstructClone(0)
	Set newObj.Nummer = dstNr
	Set newObj.Bezeichnung = dstBez
	set status = newObj.%Save()
	quit status
]]></Implementation>
</Method>

<Method name="CopyReportFooterOnExisting">
<ClassMethod>1</ClassMethod>
<FormalSpec>srcOid:%String,dstOid:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set footer = ##class(ReportFooter).%OpenId(srcOid)
	set newObj = ##class(ReportFooter).%OpenId(dstOid)
	
	set dstNr = newObj.Nummer
	set dstBez = newObj.Bezeichnung
	
	set newObj = footer.%ConstructClone(0)
	
	Set newObj.Nummer = dstNr
	Set newObj.Bezeichnung = dstBez
	set status = newObj.%Save()
	quit status
]]></Implementation>
</Method>

<Method name="LastFuss">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set fussnr = $Order(^DBCore.ReportFooterI("NummerIndex",""),-1)
	set oid = $Order(^DBCore.ReportFooterI("NummerIndex",fussnr,""),-1)
	Quit oid
]]></Implementation>
</Method>

<Method name="FirstFuss">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set fussnr = $Order(^DBCore.ReportFooterI("NummerIndex",""))
	set oid = $Order(^DBCore.ReportFooterI("NummerIndex",fussnr,""))
	Quit oid
]]></Implementation>
</Method>

<Method name="NextFuss">
<ClassMethod>1</ClassMethod>
<FormalSpec>Fussnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set fussnr = $Order(^DBCore.ReportFooterI("NummerIndex", Fussnr))
	set oid = ""
	if fussnr '= "" {
		set oid = $Order(^DBCore.ReportFooterI("NummerIndex", fussnr, ""))
	
		if oid = "" {
			set fussnr = $Order(^DBCore.ReportFooterI("NummerIndex", Fussnr),-1)
			if fussnr '= "" {
				set oid = $Order(^DBCore.ReportFooterI("NummerIndex", fussnr, ""),-1)
			}
		}
	} else {
		
		set oid = ##class(DBCore.ReportFooter).LastFuss()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="PrevFuss">
<ClassMethod>1</ClassMethod>
<FormalSpec>Fussnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set fussnr = $Order(^DBCore.ReportFooterI("NummerIndex", Fussnr),-1)
	set oid = ""
	if fussnr '= "" {
		set oid = $Order(^DBCore.ReportFooterI("NummerIndex", fussnr, ""),-1)
	
		if oid = "" {
			set fussnr = $Order(^DBCore.ReportFooterI("NummerIndex", Fussnr))
			if fussnr '= "" {
				set oid = $Order(^DBCore.ReportFooterI("NummerIndex", fussnr, ""))
			}
		}
	} else {
		
		set oid = ##class(DBCore.ReportFooter).FirstFuss()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set reportOid = $lg(oid,1)
	
	&sql(DELETE FROM DBCore.ReportStream WHERE Footer = :reportOid)
			
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	&sql(DELETE FROM DBCore.ReportStream WHERE Footer = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.ReportFooterD</DataLocation>
<DefaultData>ReportFooterDefaultData</DefaultData>
<IdLocation>^DBCore.ReportFooterD</IdLocation>
<IndexLocation>^DBCore.ReportFooterI</IndexLocation>
<StreamLocation>^DBCore.ReportFooterS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="ReportFooterDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Format</Value>
</Value>
<Value name="4">
<Value>Hoehe</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Format">
</Property>
<Property name="Hoehe">
</Property>
<Property name="Nummer">
</Property>
</Storage>
</Class>


<Class name="DBCore.ReportHeader">
<Super>%Persistent</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61125,51472.914303</TimeCreated>

<Property name="Nummer">
<Type>%Integer</Type>
<Required>1</Required>
</Property>

<Index name="NummerIndex">
<Properties>Nummer</Properties>
<Unique>1</Unique>
</Index>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Format">
<Type>%Integer</Type>
</Property>

<Property name="Hoehe">
<Type>%Integer</Type>
</Property>

<Property name="HeaderFile">
<Type>DBCore.ReportStream</Type>
<Cardinality>many</Cardinality>
<Inverse>Header</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="ReportKopf">
<Type>DBCore.Report</Type>
<Cardinality>many</Cardinality>
<Inverse>Kopf</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="OutputStream">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set Nummer=..Nummer
	Set Ret=""
	If Nummer'="" {
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Header->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportStream 
				 WHERE Header->Nummer=:Nummer AND 
				       Sprache=:Sprache)
			Set s=##Class(DBCore.ReportStream).%OpenId(sID)
			//Set Ret=s.OutputStream()
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		} Else {
			Set StdSprache="de"
			&sql(SELECT count(*) As Cnt INTO :Cnt
			     FROM DBCore.ReportStream 
			     WHERE Header->Nummer=:Nummer AND Sprache=:StdSprache)
			If (Cnt>0) {
				&sql(SELECT %ID INTO :sID 
				     FROM DBCore.ReportStream 
				     WHERE Header->Nummer=:Nummer AND 
				           Sprache=:StdSprache)
				Set s=##Class(DBCore.ReportStream).%OpenId(sID)
				// Set Ret=s.OutputStream()
				Set Size=s.DataStream.Size
				Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
			}
		}
	}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="OutputFile">
<FormalSpec>PathFileName:%String,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set DelFile=PathFileName
	Set DelFile=$Replace(DelFile,".crd",".*")
	Set Cmd="DEL /F "_DelFile
	Do $ZF(-1,Cmd)
	Set res=0
	Set Nummer=..Nummer
	If Nummer'="" {
		Set sID = ""
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Header->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportStream 
				 WHERE Header->Nummer=:Nummer AND 
				       Sprache=:Sprache)
			Set s=##Class(DBCore.ReportStream).%OpenId(sID)
			Set Ret=s.OutputFile(PathFileName)
			Set res=Ret=1
			
		} Else {
			Set StdSprache="de"
			&sql(SELECT count(*) As Cnt INTO :Cnt
			     FROM DBCore.ReportStream 
			     WHERE Header->Nummer=:Nummer AND Sprache=:StdSprache)
			If (Cnt>0) {
				&sql(SELECT %ID INTO :sID 
				     FROM DBCore.ReportStream 
				     WHERE Header->Nummer=:Nummer AND 
				           Sprache=:StdSprache)
				Set s=##Class(DBCore.ReportStream).%OpenId(sID)
				Set Ret=s.OutputFile(PathFileName)
				Set res=Ret=1
			}
		}
	}
	Quit res
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set Nummer=..Nummer
	Set sID = ""
	If Nummer'="" {
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Header->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt=0) {
			Set myId=..%Id()
			Set n=##Class(DBCore.ReportStream).%New()
			Set n.Sprache = Sprache
			Set n.Header = ##Class(DBCore.ReportHeader).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBCore.ReportStream 
		     WHERE Header->Nummer=:Nummer AND 
		           Sprache=:Sprache)
		Set s=##Class(DBCore.ReportStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="InputFile">
<FormalSpec>PathFileName:%String,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set Cmd="DEL /F C:\Test.txt"
	Do $ZF(-1,Cmd)
	Set res=0
	Set Nummer=..Nummer
	Set sID = ""
	If Nummer'="" {
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Header->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt=0) {
			Set myId=..%Id()
			Set n=##Class(DBCore.ReportStream).%New()
			Set n.Sprache = Sprache
			Set n.Header = ##Class(DBCore.ReportHeader).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBCore.ReportStream 
		     WHERE Header->Nummer=:Nummer AND 
		           Sprache=:Sprache)
		Set s=##Class(DBCore.ReportStream).%OpenId(sID)
		Set Ret=s.InputFile(PathFileName)
		Set RetS = s.%Save()
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBCore.ReportHeader).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="GetReportHeaderOidByCode">
<ClassMethod>1</ClassMethod>
<FormalSpec>ReportHeaderNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	QUIT:(ReportHeaderNr<0)
	Set oid = ""
	&sql(SELECT ID INTO :oid
		 FROM DBCore.ReportHeader
		 WHERE Nummer = :ReportHeaderNr)
	Quit oid
]]></Implementation>
</Method>

<Method name="CopyReportHeader">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String,dstNr:%Integer,dstBez:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set header = ##class(ReportHeader).%OpenId(oid)
	set newObj = header.%ConstructClone(0)
	Set newObj.Nummer = dstNr
	Set newObj.Bezeichnung = dstBez
	set status = newObj.%Save()
	quit status
]]></Implementation>
</Method>

<Method name="CopyReportHeaderOnExisting">
<ClassMethod>1</ClassMethod>
<FormalSpec>srcOid:%String,dstOid:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set header = ##class(ReportHeader).%OpenId(srcOid)
	set newObj = ##class(ReportHeader).%OpenId(dstOid)
	
	set dstNr = newObj.Nummer
	set dstBez = newObj.Bezeichnung
	
	set newObj = header.%ConstructClone(0)
	
	Set newObj.Nummer = dstNr
	Set newObj.Bezeichnung = dstBez
	set status = newObj.%Save()
	quit status
]]></Implementation>
</Method>

<Method name="LastKopf">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set kopfnr = $Order(^DBCore.ReportHeaderI("NummerIndex",""),-1)
	set oid = $Order(^DBCore.ReportHeaderI("NummerIndex",kopfnr,""),-1)
	Quit oid
]]></Implementation>
</Method>

<Method name="FirstKopf">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set kopfnr = $Order(^DBCore.ReportHeaderI("NummerIndex",""))
	set oid = $Order(^DBCore.ReportHeaderI("NummerIndex",kopfnr,""))
	Quit oid
]]></Implementation>
</Method>

<Method name="NextKopf">
<ClassMethod>1</ClassMethod>
<FormalSpec>Kopfnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set kopfnr = $Order(^DBCore.ReportHeaderI("NummerIndex", Kopfnr))
	set oid = ""
	if kopfnr '= "" {
		set oid = $Order(^DBCore.ReportHeaderI("NummerIndex", kopfnr, ""))
	
		if oid = "" {
			set kopfnr = $Order(^DBCore.ReportHeaderI("NummerIndex", Kopfnr),-1)
			if kopfnr '= "" {
				set oid = $Order(^DBCore.ReportHeaderI("NummerIndex", kopfnr, ""),-1)
			}
		}
	} else {
		
		set oid = ##class(DBCore.ReportHeader).LastKopf()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="PrevKopf">
<ClassMethod>1</ClassMethod>
<FormalSpec>Kopfnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set kopfnr = $Order(^DBCore.ReportHeaderI("NummerIndex", Kopfnr),-1)
	set oid = ""
	if kopfnr '= "" {
		set oid = $Order(^DBCore.ReportHeaderI("NummerIndex", kopfnr, ""),-1)
	
		if oid = "" {
			set kopfnr = $Order(^DBCore.ReportHeaderI("NummerIndex", Kopfnr))
			if kopfnr '= "" {
				set oid = $Order(^DBCore.ReportHeaderI("NummerIndex", kopfnr, ""))
			}
		}
	} else {
		
		set oid = ##class(DBCore.ReportHeader).FirstKopf()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBCore.ReportHeader)
	Quit +nr+1
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set reportOid = $lg(oid,1)
	
	&sql(DELETE FROM DBCore.ReportStream WHERE Header = :reportOid)
			
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	&sql(DELETE FROM DBCore.ReportStream WHERE Header = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Property name="PLKopfFolgeFM">
<Type>DBAgrofresh.SD.PLPreislistenTyp</Type>
<Cardinality>many</Cardinality>
<Inverse>KopfFolgeFM</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="PLKopfFolge">
<Type>DBAgrofresh.SD.PLPreislistenTyp</Type>
<Cardinality>many</Cardinality>
<Inverse>KopfFolge</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="PLKopfSeite1FM">
<Type>DBAgrofresh.SD.PLPreislistenTyp</Type>
<Cardinality>many</Cardinality>
<Inverse>KopfSeite1FM</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="PLKopfSeite1">
<Type>DBAgrofresh.SD.PLPreislistenTyp</Type>
<Cardinality>many</Cardinality>
<Inverse>KopfSeite1</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="DrucktypAgrofresh">
<Type>DBAgrofresh.SD.DTypRepHeader</Type>
<Cardinality>many</Cardinality>
<Inverse>ReportHeader</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="DrucktypAgrofreshEK">
<Type>DBAgrofreshEK.SD.DTypRepHead</Type>
<Cardinality>many</Cardinality>
<Inverse>ReportHeader</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="DrucktypFakturierung">
<Type>DBFakturierung.SD.DTypRepHead</Type>
<Cardinality>many</Cardinality>
<Inverse>ReportHeader</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="DrucktypFaktEK">
<Type>DBFaktEK.SD.DTypRepHead</Type>
<Cardinality>many</Cardinality>
<Inverse>ReportHeader</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.ReportHeaderD</DataLocation>
<DefaultData>ReportHeaderDefaultData</DefaultData>
<IdLocation>^DBCore.ReportHeaderD</IdLocation>
<IndexLocation>^DBCore.ReportHeaderI</IndexLocation>
<StreamLocation>^DBCore.ReportHeaderS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="ReportHeaderDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Format</Value>
</Value>
<Value name="4">
<Value>Hoehe</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Format">
</Property>
<Property name="Hoehe">
</Property>
<Property name="Hoehe0"/>
<Property name="Hoehe1"/>
<Property name="Hoehe10"/>
<Property name="Hoehe11"/>
<Property name="Hoehe12"/>
<Property name="Hoehe13"/>
<Property name="Hoehe14"/>
<Property name="Hoehe15"/>
<Property name="Hoehe16"/>
<Property name="Hoehe17"/>
<Property name="Hoehe18"/>
<Property name="Hoehe19"/>
<Property name="Hoehe2"/>
<Property name="Hoehe20"/>
<Property name="Hoehe21"/>
<Property name="Hoehe22"/>
<Property name="Hoehe23"/>
<Property name="Hoehe24"/>
<Property name="Hoehe25"/>
<Property name="Hoehe26"/>
<Property name="Hoehe27"/>
<Property name="Hoehe28"/>
<Property name="Hoehe29"/>
<Property name="Hoehe3"/>
<Property name="Hoehe30"/>
<Property name="Hoehe31"/>
<Property name="Hoehe32"/>
<Property name="Hoehe33"/>
<Property name="Hoehe34"/>
<Property name="Hoehe35"/>
<Property name="Hoehe36"/>
<Property name="Hoehe37"/>
<Property name="Hoehe38"/>
<Property name="Hoehe39"/>
<Property name="Hoehe4"/>
<Property name="Hoehe40"/>
<Property name="Hoehe41"/>
<Property name="Hoehe42"/>
<Property name="Hoehe43"/>
<Property name="Hoehe44"/>
<Property name="Hoehe45"/>
<Property name="Hoehe46"/>
<Property name="Hoehe47"/>
<Property name="Hoehe48"/>
<Property name="Hoehe49"/>
<Property name="Hoehe5"/>
<Property name="Hoehe50"/>
<Property name="Hoehe51"/>
<Property name="Hoehe52"/>
<Property name="Hoehe53"/>
<Property name="Hoehe54"/>
<Property name="Hoehe55"/>
<Property name="Hoehe56"/>
<Property name="Hoehe57"/>
<Property name="Hoehe58"/>
<Property name="Hoehe59"/>
<Property name="Hoehe6"/>
<Property name="Hoehe7"/>
<Property name="Hoehe8"/>
<Property name="Hoehe9"/>
<Property name="Nummer">
</Property>
</Storage>
</Class>


<Class name="DBCore.ReportMailText">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61679,54121.198777</TimeCreated>
<Inheritance>right</Inheritance>

<Parameter name="XMLIGNOREINVALIDATTRIBUTE">
<Description><![CDATA[
Controls how to handle attributes that are unexpected.
-> If this parameter is 1 (the default), such attributes are ignored.
-> If it is 0, they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNOREINVALIDTAG">
<Description><![CDATA[
Controls how to handle tags that are unexpected. 
-> If this parameter is 1, such tags are ignored. 
-> If it is 0 (the default), they are treated as errors, and import fails.]]></Description>
<Default>1</Default>
</Parameter>

<Parameter name="XMLIGNORENULL">
<Default>1</Default>
</Parameter>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="PositionsNr">
<Description>
Position_Nr</Description>
<Type>%Integer</Type>
</Property>

<Property name="Text1">
<Description>
Text 1</Description>
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="32767"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Property name="DebitorPrintText">
<Type>DBDebiKredi.Debitor</Type>
<Cardinality>many</Cardinality>
<Inverse>PrintMailText</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="KreditorPrintText">
<Type>DBDebiKredi.Kreditor</Type>
<Cardinality>many</Cardinality>
<Inverse>PrintMailText</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Betreff">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Method name="GetText1">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Text1, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetText1Class">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBCore.ReportMailText).%OpenId(myID)
		set text = rs.GetText1(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText1">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Text1, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBetreff">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Betreff, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBetreffClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBCore.ReportMailText).%OpenId(myID)
		set text = rs.GetBetreff(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBetreff">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Betreff, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetIdByPosNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.ReportMailText
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr
		 AND LENGTH(DBCore.ReportMailText_GetText1Class(%ID, :MandantOid, :Lang)) > 0)
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByPosNrOnMandWOCheckText">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.ReportMailText
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr)
	Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>FusstextOid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
	set obj = ##class(DBCore.ReportMailText).%OpenId(FusstextOid)
	if (obj '= "") {
		set val = obj.Text1.GetAt(Lang)
		if (val '= "") {
			do obj.Text1.SetAt("",Lang)	
		}
		
		do obj.%Save()
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.ReportMailTextD</DataLocation>
<DefaultData>ReportMailTextDefaultData</DefaultData>
<IdLocation>^DBCore.ReportMailTextD</IdLocation>
<IndexLocation>^DBCore.ReportMailTextI</IndexLocation>
<StreamLocation>^DBCore.ReportMailTextS</StreamLocation>
<Data name="Betreff">
<Attribute>Betreff</Attribute>
<Structure>subnode</Structure>
<Subscript>"Betreff"</Subscript>
</Data>
<Data name="ReportMailTextDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Mandant</Value>
</Value>
</Data>
<Data name="Text1">
<Attribute>Text1</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text1"</Subscript>
</Data>
<Data name="Text2">
<Attribute>Text2</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text2"</Subscript>
</Data>
<Data name="Text3">
<Attribute>Text3</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text3"</Subscript>
</Data>
<Data name="Text4">
<Attribute>Text4</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text4"</Subscript>
</Data>
<Property name="%%CLASSNAME"/>
<Property name="Mandant"/>
<Property name="PositionsNr"/>
</Storage>
</Class>


<Class name="DBCore.ReportMandant">
<Super>DBCore.Report,DBCore.MandantRel</Super>
<TimeChanged>61720,83162.825746</TimeChanged>
<TimeCreated>61132,41633.980667</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Method name="GetMandantReportByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer,CurrMandant:%String</FormalSpec>
<ReturnType>DBCore.Report</ReturnType>
<Implementation><![CDATA[
	Set sID = ""
	// 2. Priorität Mandant
	&sql(SELECT %ID INTO :sID 
			 FROM DBCore.ReportMandant
			 WHERE Nummer=:ListId AND Mandant =:CurrMandant)
	if (sID '= "") {
		quit ##class(DBCore.ReportMandant).%OpenId(sID)
	} else {
		quit ""
	}
]]></Implementation>
</Method>

<Method name="DelMandantEinstByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer,CurrMandant:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	&sql(Delete From DBCore.ReportMandant WHERE Nummer=:ListId AND Mandant =:CurrMandant)
	Quit (SQLCODE = 0 || SQLCODE = 100)
]]></Implementation>
</Method>

<Method name="GetMandantReportOidByListId">
<ClassMethod>1</ClassMethod>
<FormalSpec>ListId:%Integer,CurrMandant:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set sID = ""
	&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportMandant
				 WHERE Nummer=:ListId AND Mandant =:CurrMandant)
	quit sID
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBCore.ReportSelektionEntry">
<Super>%Persistent,DBCore.MandantRel</Super>
<TimeChanged>62416,57315.540057</TimeChanged>
<TimeCreated>62306,58319.345221</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Vorlage">
<Type>DBCore.ReportSelektionsvorlage</Type>
<Cardinality>parent</Cardinality>
<Inverse>Entries</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Nummer">
<Type>%Integer</Type>
</Property>

<Property name="ValueString">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ValueInt">
<Type>%Integer</Type>
</Property>

<Property name="ValueDecimal">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="ValueBool">
<Type>%Boolean</Type>
</Property>

<Property name="ValueDate">
<Type>%Date</Type>
</Property>

<Method name="GetEinstOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set myId = ""
	&sql(SELECT ID InTo :myId 
		FROM DBCore.ReportSelektionEntry
		WHERE Vorlage=:VorlageOid AND
			Nummer=:Nummer)
			
	if (SQLCODE'=0) {
		set myId = ""
	}
	
	Quit myId
]]></Implementation>
</Method>

<Method name="GetEinstString">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set res = ""
	&sql(SELECT ValueString InTo :res 
		FROM DBCore.ReportSelektionEntry
		WHERE Vorlage=:VorlageOid AND
			Nummer=:Nummer)
			
	if (SQLCODE'=0) {
		set res = ""
	}
	
	Quit res
]]></Implementation>
</Method>

<Method name="GetEinstInt">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set res = 0
	&sql(SELECT ValueInt InTo :res 
		FROM DBCore.ReportSelektionEntry
		WHERE Vorlage=:VorlageOid AND
			Nummer=:Nummer)
			
	if (SQLCODE'=0) {
		set res = 0
	}
	
	Quit res
]]></Implementation>
</Method>

<Method name="GetEinstDecimal">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<ReturnTypeParams>SCALE=5</ReturnTypeParams>
<Implementation><![CDATA[
	set res = 0
	&sql(SELECT ValueDecimal InTo :res 
		FROM DBCore.ReportSelektionEntry
		WHERE Vorlage=:VorlageOid AND
			Nummer=:Nummer)
			
	if (SQLCODE'=0) {
		set res = 0
	}
	
	Quit res
]]></Implementation>
</Method>

<Method name="GetEinstDate">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%Date</ReturnType>
<Implementation><![CDATA[
	set res = ""
	&sql(SELECT ValueDate InTo :res 
		FROM DBCore.ReportSelektionEntry
		WHERE Vorlage=:VorlageOid AND
			Nummer=:Nummer)
			
	if (SQLCODE'=0) {
		set res = ""
	}
	
	Quit res
]]></Implementation>
</Method>

<Method name="GetEinstBool">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set res = 0
	&sql(SELECT ValueBool InTo :res 
		FROM DBCore.ReportSelektionEntry
		WHERE Vorlage=:VorlageOid AND
			Nummer=:Nummer)
			
	if (SQLCODE'=0) {
		set res = 0
	}
	
	Quit res
]]></Implementation>
</Method>

<Method name="SetEinstString">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer,Value:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set einstOid = ##class(DBCore.ReportSelektionEntry).GetEinstOid(VorlageOid, Nummer)
	if ((einstOid="") || (einstOid=$c(0)) || (einstOid=$$$NULLOREF)) {
		set einst = ##class(DBCore.ReportSelektionEntry).%New()
		do einst.VorlageSetObjectId(VorlageOid)
		set einst.Nummer = Nummer
	} else {
		set einst = ##class(DBCore.ReportSelektionEntry).%OpenId(einstOid)
	}
	
	set einst.ValueString = Value
	
	set status = einst.%Save()
	
	Quit status
]]></Implementation>
</Method>

<Method name="SetEinstInt">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer,Value:%Integer</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set einstOid = ##class(DBCore.ReportSelektionEntry).GetEinstOid(VorlageOid, Nummer)
	if ((einstOid="") || (einstOid=$c(0)) || (einstOid=$$$NULLOREF)) {
		set einst = ##class(DBCore.ReportSelektionEntry).%New()
		do einst.VorlageSetObjectId(VorlageOid)
		set einst.Nummer = Nummer
	} else {
		set einst = ##class(DBCore.ReportSelektionEntry).%OpenId(einstOid)
	}
	
	set einst.ValueInt = Value
	
	set status = einst.%Save()
	
	Quit status
]]></Implementation>
</Method>

<Method name="SetEinstDecimal">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer,Value:%Decimal</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set einstOid = ##class(DBCore.ReportSelektionEntry).GetEinstOid(VorlageOid, Nummer)
	if ((einstOid="") || (einstOid=$c(0)) || (einstOid=$$$NULLOREF)) {
		set einst = ##class(DBCore.ReportSelektionEntry).%New()
		do einst.VorlageSetObjectId(VorlageOid)
		set einst.Nummer = Nummer
	} else {
		set einst = ##class(DBCore.ReportSelektionEntry).%OpenId(einstOid)
	}
	
	set einst.ValueDecimal = Value
	
	set status = einst.%Save()
	
	Quit status
]]></Implementation>
</Method>

<Method name="SetEinstDate">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer,Value:%Date</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set einstOid = ##class(DBCore.ReportSelektionEntry).GetEinstOid(VorlageOid, Nummer)
	if ((einstOid="") || (einstOid=$c(0)) || (einstOid=$$$NULLOREF)) {
		set einst = ##class(DBCore.ReportSelektionEntry).%New()
		do einst.VorlageSetObjectId(VorlageOid)
		set einst.Nummer = Nummer
	} else {
		set einst = ##class(DBCore.ReportSelektionEntry).%OpenId(einstOid)
	}
	
	set einst.ValueDate = Value
	
	set status = einst.%Save()
	
	Quit status
]]></Implementation>
</Method>

<Method name="SetEinstBool">
<ClassMethod>1</ClassMethod>
<FormalSpec>VorlageOid:%String,Nummer:%Integer,Value:%Boolean</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set einstOid = ##class(DBCore.ReportSelektionEntry).GetEinstOid(VorlageOid, Nummer)
	if ((einstOid="") || (einstOid=$c(0)) || (einstOid=$$$NULLOREF)) {
		set einst = ##class(DBCore.ReportSelektionEntry).%New()
		do einst.VorlageSetObjectId(VorlageOid)
		set einst.Nummer = Nummer
	} else {
		set einst = ##class(DBCore.ReportSelektionEntry).%OpenId(einstOid)
	}
	
	set einst.ValueBoolean = Value
	
	set status = einst.%Save()
	
	Quit status
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Entries")</DataLocation>
<DefaultData>ReportSelektionEntryDefaultData</DefaultData>
<IdLocation>^DBCore.ReportSelekA088C("Entries")</IdLocation>
<IndexLocation>^DBCore.ReportSelektionEntryI</IndexLocation>
<StreamLocation>^DBCore.ReportSelektionEntryS</StreamLocation>
<Data name="ReportSelektionEntryDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>valueString</Value>
</Value>
<Value name="3">
<Value>valueInt</Value>
</Value>
<Value name="4">
<Value>valueDecimal</Value>
</Value>
<Value name="5">
<Value>valueBool</Value>
</Value>
<Value name="6">
<Value>valueDate</Value>
</Value>
<Value name="7">
<Value>Nummer</Value>
</Value>
<Value name="8">
<Value>ValueString</Value>
</Value>
<Value name="9">
<Value>ValueInt</Value>
</Value>
<Value name="10">
<Value>ValueDecimal</Value>
</Value>
<Value name="11">
<Value>ValueBool</Value>
</Value>
<Value name="12">
<Value>ValueDate</Value>
</Value>
</Data>
<Property name="Nummer"/>
<Property name="ValueBool"/>
<Property name="ValueDate"/>
<Property name="ValueDecimal"/>
<Property name="ValueInt"/>
<Property name="ValueString"/>
<Property name="Vorlage"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBCore.ReportSelektionsvorlage">
<Super>%Persistent,DBCore.MandantRel</Super>
<TimeChanged>62416,57264.25476</TimeChanged>
<TimeCreated>62306,57304.472778</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Mandant">
<Type>%String</Type>
</Property>

<ForeignKey name="FKMandant">
<Properties>Mandant</Properties>
<ReferencedClass>DBCore.Mandant</ReferencedClass>
<ReferencedKey>MandIdIndex</ReferencedKey>
</ForeignKey>

<Index name="MandantIdx">
<Properties>Mandant</Properties>
</Index>

<Property name="ListenNummer">
<Type>%Integer</Type>
</Property>

<Index name="ListenNummerIndex">
<Properties>ListenNummer</Properties>
</Index>

<Property name="VorlageNummer">
<Type>%Integer</Type>
</Property>

<Index name="VorlageNummerIndex">
<Properties>VorlageNummer</Properties>
</Index>

<Index name="ListenVorlageIndex">
<Properties>ListenNummer,VorlageNummer</Properties>
<Unique>1</Unique>
</Index>

<Property name="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Entries">
<Type>DBCore.ReportSelektionEntry</Type>
<Cardinality>children</Cardinality>
<Inverse>Vorlage</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetVorlageOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,ListenNummer:%Integer,VorlageNummer:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set myId = ""
	&sql(SELECT ID InTo :myId 
		FROM DBCore.ReportSelektionsvorlage
		WHERE Mandant=:MandantOid AND 
			VorlageNummer=:VorlageNummer AND
			ListenNummer=:ListenNummer)
			
	if (SQLCODE'=0) {
		set myId = ""
	}
	
	Quit myId
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,ListenNummer:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(SELECT max(VorlageNummer) InTo :nr 
		FROM DBCore.ReportSelektionsvorlage 
		WHERE Mandant = :MandantOid AND
			ListenNummer=:ListenNummer)
			
	if (SQLCODE'=0) {
		set nr = 0
	}		
	Quit +nr+1
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.ReportSelekA088D</DataLocation>
<DefaultData>ReportSelektionsvorlageDefaultData</DefaultData>
<IdLocation>^DBCore.ReportSelekA088D</IdLocation>
<IndexLocation>^DBCore.ReportSelekA088I</IndexLocation>
<StreamLocation>^DBCore.ReportSelekA088S</StreamLocation>
<Data name="ReportSelektionsvorlageDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>ListenNummer</Value>
</Value>
<Value name="4">
<Value>VorlageNummer</Value>
</Value>
<Value name="5">
<Value>Bezeichnung</Value>
</Value>
</Data>
<Property name="Bezeichnung"/>
<Property name="ListenNummer"/>
<Property name="Mandant"/>
<Property name="VorlageNummer"/>
</Storage>
</Class>


<Class name="DBCore.ReportStream">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62437,54195</TimeChanged>
<TimeCreated>61125,56999.924645</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Sprache">
<Type>%String</Type>
<Parameter name="MAXLEN" value="2"/>
<Parameter name="MINLEN" value="2"/>
</Property>

<Index name="SpracheIndex">
<Type>bitmap</Type>
<Properties>Sprache</Properties>
</Index>

<Property name="DataStream">
<Type>%GlobalBinaryStream</Type>
</Property>

<Property name="Header">
<Type>DBCore.ReportHeader</Type>
<Cardinality>one</Cardinality>
<Inverse>HeaderFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Header"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="HeaderIndex">
<Properties>Header</Properties>
</Index>

<Property name="Footer">
<Type>DBCore.ReportFooter</Type>
<Cardinality>one</Cardinality>
<Inverse>FooterFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Footer"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FooterIndex">
<Properties>Footer</Properties>
</Index>

<Property name="Titlepage">
<Type>DBCore.ReportTitlepage</Type>
<Cardinality>one</Cardinality>
<Inverse>TitlepageFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Titlepage"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="TitlepageIndex">
<Properties>Titlepage</Properties>
</Index>

<Property name="AdrReport">
<Type>DBAdressen.SD.AdressReport</Type>
<Cardinality>one</Cardinality>
<Inverse>ReportFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="AdrReport"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="AdrReportIndex">
<Properties>AdrReport</Properties>
</Index>

<Property name="Etikette">
<Type>DBPrint.Etikette</Type>
<Cardinality>one</Cardinality>
<Inverse>EtikettenFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Etikette"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="EtiketteIndex">
<Properties>Etikette</Properties>
</Index>

<Method name="InputFile">
<FormalSpec>PathFileName:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	If (PathFileName'="") {
		Set stream=##class(%FileBinaryStream).%New()
		Set stream.Filename=PathFileName
		Set Ret=..DataStream.CopyFromAndSave(stream)
		Set stream=""
		do ..%Save()
		Quit Ret=1 
	} Else {
		Quit 0
	}
]]></Implementation>
</Method>

<Property name="AgrofreshFormular">
<Type>DBAgrofresh.SD.Formular</Type>
<Cardinality>one</Cardinality>
<Inverse>FormularFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="AgrofreshFormular"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="AgrofreshFormularIndex">
<Properties>AgrofreshFormular</Properties>
</Index>

<Property name="AgrofreshEKFormular">
<Type>DBAgrofreshEK.SD.Formular</Type>
<Cardinality>one</Cardinality>
<Inverse>FormularFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="AgrofreshEKFormular"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="AgrofreshEKFormularIndex">
<Properties>AgrofreshEKFormular</Properties>
</Index>

<Property name="FakturierungFormular">
<Type>DBFakturierung.SD.Formular</Type>
<Cardinality>one</Cardinality>
<Inverse>FormularFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="FakturierungFormular"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FakturierungFormularIndex">
<Properties>FakturierungFormular</Properties>
</Index>

<Property name="PLFormular">
<Type>DBAgrofresh.SD.PLFormular</Type>
<Cardinality>one</Cardinality>
<Inverse>FormularFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="PLFormular"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="PLFormularIndex">
<Properties>PLFormular</Properties>
</Index>

<Property name="FaktEKFormular">
<Type>DBFaktEK.SD.Formular</Type>
<Cardinality>one</Cardinality>
<Inverse>FormularFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="FaktEKFormular"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FaktEKFormularIndex">
<Properties>FaktEKFormular</Properties>
</Index>

<Property name="LohnFormular">
<Type>DBLohn.SD.Formular</Type>
<Cardinality>one</Cardinality>
<Inverse>FormularFile</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="LohnFormular"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="LohnFormularIndex">
<Properties>LohnFormular</Properties>
</Index>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.ReportStreamD</DataLocation>
<DefaultData>ReportStreamDefaultData</DefaultData>
<IdLocation>^DBCore.ReportStreamD</IdLocation>
<IndexLocation>^DBCore.ReportStreamI</IndexLocation>
<StreamLocation>^DBCore.ReportStreamS</StreamLocation>
<Data name="ReportStreamDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Sprache</Value>
</Value>
<Value name="3">
<Value>DataStream</Value>
</Value>
<Value name="4">
<Value>Header</Value>
</Value>
<Value name="5">
<Value>Footer</Value>
</Value>
<Value name="6">
<Value>Titlepage</Value>
</Value>
<Value name="7">
<Value>AdrReport</Value>
</Value>
<Value name="8">
<Value>Etikette</Value>
</Value>
<Value name="9">
<Value>AgrofreshFormular</Value>
</Value>
<Value name="10">
<Value>AgrofreshEKFormular</Value>
</Value>
<Value name="11">
<Value>EKEtikette</Value>
</Value>
<Value name="12">
<Value>FakturierungFormular</Value>
</Value>
<Value name="13">
<Value>FakturierungEKFormular</Value>
</Value>
<Value name="14">
<Value>FaktEKFormular</Value>
</Value>
<Value name="15">
<Value>PLFormular</Value>
</Value>
<Value name="16">
<Value>MahnungFormular</Value>
</Value>
<Value name="17">
<Value>LohnFormular</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="AdrReport">
</Property>
<Property name="AgrofreshEKFormular">
</Property>
<Property name="AgrofreshFormular">
</Property>
<Property name="DataStream">
</Property>
<Property name="EKEtikette"/>
<Property name="Etikette">
</Property>
<Property name="FaktEKFormular">
</Property>
<Property name="FakturierungFormular">
</Property>
<Property name="Footer">
</Property>
<Property name="Header">
</Property>
<Property name="LohnFormular">
</Property>
<Property name="MahnungFormular"/>
<Property name="PLFormular">
</Property>
<Property name="Sprache">
</Property>
<Property name="Titlepage">
</Property>
</Storage>
</Class>


<Class name="DBCore.ReportTitlepage">
<Super>%Persistent</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61241,56194.684923</TimeCreated>

<Property name="Nummer">
<Type>%Integer</Type>
<Required>1</Required>
</Property>

<Index name="NummerIndex">
<Properties>Nummer</Properties>
<Unique>1</Unique>
</Index>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Format">
<Type>%Integer</Type>
</Property>

<Property name="TitlepageFile">
<Type>DBCore.ReportStream</Type>
<Cardinality>many</Cardinality>
<Inverse>Titlepage</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="ReportTitelblatt">
<Type>DBCore.Report</Type>
<Cardinality>many</Cardinality>
<Inverse>Titelblatt</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID '= "") {
		Set rs=##Class(DBCore.ReportTitlepage).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetNextFreeNumber">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBCore.ReportTitlepage)
	Quit +nr+1
]]></Implementation>
</Method>

<Method name="OutputStream">
<FormalSpec>Sprache:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set Nummer=..Nummer
	Set Ret=""
	If Nummer'="" {
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Titlepage->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportStream 
				 WHERE Titlepage->Nummer=:Nummer AND 
				       Sprache=:Sprache)
			Set s=##Class(DBCore.ReportStream).%OpenId(sID)
			//Set Ret=s.OutputStream()
			Set Size=s.DataStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
		} Else {
			Set StdSprache="de"
			&sql(SELECT count(*) As Cnt INTO :Cnt
			     FROM DBCore.ReportStream 
			     WHERE Titlepage->Nummer=:Nummer AND Sprache=:StdSprache)
			If (Cnt>0) {
				&sql(SELECT %ID INTO :sID 
				     FROM DBCore.ReportStream 
				     WHERE Titlepage->Nummer=:Nummer AND 
				           Sprache=:StdSprache)
				Set s=##Class(DBCore.ReportStream).%OpenId(sID)
				// Set Ret=s.OutputStream()
				Set Size=s.DataStream.Size
				Set Ret=tmpStream.CopyFromAndSave(s.DataStream)
			}
		}
	}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="OutputFile">
<FormalSpec>PathFileName:%String,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set DelFile=PathFileName
	Set DelFile=$Replace(DelFile,".lst",".*")
	Set Cmd="DEL /F "_DelFile
	Do $ZF(-1,Cmd)
	Set res=0
	Set Nummer=..Nummer
	If Nummer'="" {
		Set sID = ""
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Titlepage->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
				 FROM DBCore.ReportStream 
				 WHERE Titlepage->Nummer=:Nummer AND 
				       Sprache=:Sprache)
			Set s=##Class(DBCore.ReportStream).%OpenId(sID)
			Set Ret=s.OutputFile(PathFileName)
			Set res=Ret=1
			
		} Else {
			Set StdSprache="de"
			&sql(SELECT count(*) As Cnt INTO :Cnt
			     FROM DBCore.ReportStream 
			     WHERE Titlepage->Nummer=:Nummer AND Sprache=:StdSprache)
			If (Cnt>0) {
				&sql(SELECT %ID INTO :sID 
				     FROM DBCore.ReportStream 
				     WHERE Titlepage->Nummer=:Nummer AND 
				           Sprache=:StdSprache)
				Set s=##Class(DBCore.ReportStream).%OpenId(sID)
				Set Ret=s.OutputFile(PathFileName)
				Set res=Ret=1
			}
		}
	}
	Quit res
]]></Implementation>
</Method>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set Nummer=..Nummer
	Set sID = ""
	If Nummer'="" {
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Titlepage->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt=0) {
			Set myId=..%Id()
			Set n=##Class(DBCore.ReportStream).%New()
			Set n.Sprache = Sprache
			Set n.Titlepage = ##Class(DBCore.ReportTitlepage).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBCore.ReportStream 
		     WHERE Titlepage->Nummer=:Nummer AND 
		           Sprache=:Sprache)
		Set s=##Class(DBCore.ReportStream).%OpenId(sID)
		Set Ret=s.DataStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="InputFile">
<FormalSpec>PathFileName:%String,Sprache:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set Cmd="DEL /F C:\Test.txt"
	Do $ZF(-1,Cmd)
	Set res=0
	Set Nummer=..Nummer
	Set sID = ""
	If Nummer'="" {
		Set Cnt=0
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBCore.ReportStream 
		     WHERE Titlepage->Nummer=:Nummer AND Sprache=:Sprache)
		If (Cnt=0) {
			Set myId=..%Id()
			Set n=##Class(DBCore.ReportStream).%New()
			Set n.Sprache = Sprache
			Set n.Titlepage = ##Class(DBCore.ReportTitlepage).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT ID InTo :sID 
		     FROM DBCore.ReportStream 
		     WHERE Titlepage->Nummer=:Nummer AND 
		           Sprache=:Sprache)
		Set s=##Class(DBCore.ReportStream).%OpenId(sID)
		Set Ret=s.InputFile(PathFileName)
		Set RetS = s.%Save()
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="GetReportTitlepageOidByCode">
<ClassMethod>1</ClassMethod>
<FormalSpec>ReportTitlepageNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	QUIT:(ReportTitlepageNr<0)
	Set oid = ""
	&sql(SELECT ID INTO :oid
		 FROM DBCore.ReportTitlepage
		 WHERE Nummer = :ReportTitlepageNr)
	Quit oid
]]></Implementation>
</Method>

<Method name="CopyReportTitlepage">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String,dstNr:%Integer,dstBez:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set footer = ##class(ReportTitlepage).%OpenId(oid)
	set newObj = footer.%ConstructClone(0)
	Set newObj.Nummer = dstNr
	Set newObj.Bezeichnung = dstBez
	set status = newObj.%Save()
	quit status
]]></Implementation>
</Method>

<Method name="CopyReportTitlepageOnExisting">
<ClassMethod>1</ClassMethod>
<FormalSpec>srcOid:%String,dstOid:%String</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	set footer = ##class(ReportTitlepage).%OpenId(srcOid)
	set newObj = ##class(ReportTitlepage).%OpenId(dstOid)
	
	set dstNr = newObj.Nummer
	set dstBez = newObj.Bezeichnung
	
	set newObj = footer.%ConstructClone(0)
	
	Set newObj.Nummer = dstNr
	Set newObj.Bezeichnung = dstBez
	set status = newObj.%Save()
	quit status
]]></Implementation>
</Method>

<Method name="LastTitel">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set titelnr = $Order(^DBCore.ReportTitlepageI("NummerIndex",""),-1)
	set oid = $Order(^DBCore.ReportTitlepageI("NummerIndex",titelnr,""),-1)
	Quit oid
]]></Implementation>
</Method>

<Method name="FirstTitel">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set titelnr = $Order(^DBCore.ReportTitlepageI("NummerIndex",""))
	set oid = $Order(^DBCore.ReportTitlepageI("NummerIndex",titelnr,""))
	Quit oid
]]></Implementation>
</Method>

<Method name="NextTitel">
<ClassMethod>1</ClassMethod>
<FormalSpec>Titelnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set titelnr = $Order(^DBCore.ReportTitlepageI("NummerIndex", Titelnr))
	set oid = ""
	if titelnr '= "" {
		set oid = $Order(^DBCore.ReportTitlepageI("NummerIndex", titelnr, ""))
	
		if oid = "" {
			set titelnr = $Order(^DBCore.ReportTitlepageI("NummerIndex", Titelnr),-1)
			if titelnr '= "" {
				set oid = $Order(^DBCore.ReportTitlepageI("NummerIndex", titelnr, ""),-1)
			}
		}
	} else {
		
		set oid = ##class(DBCore.ReportTitlepage).LastTitel()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="PrevTitel">
<ClassMethod>1</ClassMethod>
<FormalSpec>Titelnr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set titelnr = $Order(^DBCore.ReportTitlepageI("NummerIndex", Titelnr),-1)
	set oid = ""
	if titelnr '= "" {
		set oid = $Order(^DBCore.ReportTitlepageI("NummerIndex", titelnr, ""),-1)
	
		if oid = "" {
			set titelnr = $Order(^DBCore.ReportTitlepageI("NummerIndex", Titelnr))
			if titelnr '= "" {
				set oid = $Order(^DBCore.ReportTitlepageI("NummerIndex", titelnr, ""))
			}
		}
	} else {
		
		set oid = ##class(DBCore.ReportTitlepage).FirstTitel()
	}
	
	Quit oid
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set reportOid = $lg(oid,1)
	
	&sql(DELETE FROM DBCore.ReportStream WHERE Titlepage = :reportOid)
			
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgOnDelete">
<Code><![CDATA[	set myId = {ID*O}
	&sql(DELETE FROM DBCore.ReportStream WHERE Titlepage = :myId)]]></Code>
<Event>DELETE</Event>
</Trigger>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.ReportTitlepageD</DataLocation>
<DefaultData>ReportTitlepageDefaultData</DefaultData>
<IdLocation>^DBCore.ReportTitlepageD</IdLocation>
<IndexLocation>^DBCore.ReportTitlepageI</IndexLocation>
<StreamLocation>^DBCore.ReportTitlepageS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="ReportTitlepageDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Format</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Format">
</Property>
<Property name="Nummer">
</Property>
</Storage>
</Class>


<Class name="DBCore.Rolle">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61500,36225.586924</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Nr">
<Type>%Integer</Type>
</Property>

<Property name="Bezeichnung">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="RechteGlobal">
<Type>DBCore.RechtGlobal</Type>
<Cardinality>many</Cardinality>
<Inverse>Rolle</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="RechteMandant">
<Type>DBCore.RechtMandant</Type>
<Cardinality>many</Cardinality>
<Inverse>Rolle</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="RVRolle">
<Type>DBCore.Rollenvergabe</Type>
<Cardinality>many</Cardinality>
<Inverse>Rolle</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="DokumentRecht">
<Type>DBAdressen.DokumentRecht</Type>
<Cardinality>many</Cardinality>
<Inverse>Rolle</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="KorrespondenzRecht">
<Type>DBAdressen.KorrespondenzRecht</Type>
<Cardinality>many</Cardinality>
<Inverse>Rolle</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetBezeichnung">
<FormalSpec>Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Bezeichnung, Lang, "")
]]></Implementation>
</Method>

<Method name="GetBezeichnungClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if (myID'="") {
		Set rs=##Class(DBCore.Rolle).%OpenId(myID)
		set text = rs.GetBezeichnung(Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetBezeichnung">
<FormalSpec>Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, "")
]]></Implementation>
</Method>

<Method name="CopyRolle">
<ClassMethod>1</ClassMethod>
<FormalSpec>SrcRollenOid:%String,DstNr:%Integer,DstBez:%String,Lng:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set srcRolle = ##class(DBCore.Rolle).%OpenId(SrcRollenOid)
	set srcRolleID = srcRolle.%Id()
	
	TSTART
	set newRolle = ##class(DBCore.Rolle).%New()
	set newRolle.Nr = DstNr
	d newRolle.SetBezeichnung(Lng, DstBez)
	d newRolle.%Save()
	set rID  = newRolle.%Id()
	&sql(INSERT INTO DBCore.RechtGlobal (RechtId, Schreiben, Rolle)
			SELECT RechtId, Schreiben,:rID FROM DBCore.RechtGlobal WHERE Rolle = :srcRolleID)
	w "role"_srcRolleID
	w "code nach global:"_SQLCODE
	if ((SQLCODE '= 0) && (SQLCODE '= 100)) {
		TROLLBACK
		set newRolle = ""
		set srcRolle = ""
		Quit ""	
	}	
	w !,"vor mand"	
	&sql(INSERT INTO DBCore.RechtMandant (RechtId, Schreiben, Rolle, Mandant)
			SELECT RechtId, Schreiben, :rID, Mandant FROM DBCore.RechtMandant WHERE Rolle = :srcRolleID)
	w "code nach mandant:"_SQLCODE
	if ((SQLCODE '= 0) && (SQLCODE '= 100)) {
		TROLLBACK
		set newRolle = ""
		set srcRolle = ""
		Quit ""	
	}			
	
	set res = newRolle.%Save()
	TCOMMIT
	set srcRolle = ""
	set id = newRolle.%Id()
	set newRolle = ""
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.Rolle WHERE Nr = :Nr)
	Quit id
]]></Implementation>
</Method>

<Method name="DelRechteGlobal">
<ClassMethod>1</ClassMethod>
<FormalSpec>RolleOid:%String</FormalSpec>
<Implementation><![CDATA[
	
	set rs = ##class(%Library.ResultSet).%New("DBCore.AF.RechtAF:ListeIdsGlobalNachRolle")
	
	set sc=rs.Execute(RolleOid)
    if ($$$ISOK(sc)) {
		while (rs.Next(.sc)) {
			set id =rs.Data("ID")
			do ##class(DBCore.RechtGlobal).%DeleteId(id)
		}
    }
]]></Implementation>
</Method>

<Method name="DelRechteMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>RolleOid:%String</FormalSpec>
<Implementation><![CDATA[
	set rs = ##class(%Library.ResultSet).%New("DBCore.AF.RechtAF:ListeIdsMandNachRolle")
	
	set sc=rs.Execute(RolleOid)
    if ($$$ISOK(sc)) {
		while (rs.Next(.sc)) {
			set id =rs.Data("ID")
			do ##class(DBCore.RechtMandant).%DeleteId(id)
		}
    }
]]></Implementation>
</Method>

<Method name="%OnDelete">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Delete</METHOD> method to 
provide notification that the object specified by <VAR>oid</VAR> is being deleted.

<P>If this method returns an error then the object will not be deleted.
[Previously private]]]></Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	set myId = $lg(oid,1)	

	do ..DelRechteGlobal(myId)
	do ..DelRechteMandant(myId)
	
	Quit $$$OK
]]></Implementation>
</Method>

<Trigger name="trgBeforeDelete">
<Code>	do ..DelRechteGlobal({ID})
	do ..DelRechteMandant({ID})</Code>
<Event>DELETE</Event>
</Trigger>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.RolleD</DataLocation>
<DefaultData>RolleDefaultData</DefaultData>
<IdLocation>^DBCore.RolleD</IdLocation>
<IndexLocation>^DBCore.RolleI</IndexLocation>
<StreamLocation>^DBCore.RolleS</StreamLocation>
<Data name="RolleDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nr</Value>
</Value>
<Value name="3">
<Value>Bezeichnung</Value>
</Value>
<Value name="4">
<Value>Mandant</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Bezeichnung">
</Property>
<Property name="Mandant"/>
<Property name="Nr">
</Property>
</Storage>
</Class>


<Class name="DBCore.Rollenvergabe">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61500,38299.691678</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="Rolle">
<Type>DBCore.Rolle</Type>
<Cardinality>one</Cardinality>
<Inverse>RVRolle</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Rolle"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="RolleIndex">
<Properties>Rolle</Properties>
</Index>

<Property name="Benutzer">
<Type>DBCore.Benutzer</Type>
<Cardinality>one</Cardinality>
<Inverse>RVBenutzer</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Benutzer"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="BenutzerIndex">
<Properties>Benutzer</Properties>
</Index>

<Index name="IdxComb">
<Properties>Rolle,Benutzer</Properties>
<Unique>1</Unique>
</Index>

<Method name="GetZuweisungsId">
<ClassMethod>1</ClassMethod>
<FormalSpec>RolleOid:%String,BenutzerOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set id = ""
	&sql(SELECT ID INTO :id FROM DBCore.Rollenvergabe WHERE Rolle = :RolleOid AND
			Benutzer = :BenutzerOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.RollenvergabeD</DataLocation>
<DefaultData>RollenvergabeDefaultData</DefaultData>
<IdLocation>^DBCore.RollenvergabeD</IdLocation>
<IndexLocation>^DBCore.RollenvergabeI</IndexLocation>
<StreamLocation>^DBCore.RollenvergabeS</StreamLocation>
<Data name="RollenvergabeDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Rolle</Value>
</Value>
<Value name="3">
<Value>Benutzer</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Benutzer">
</Property>
<Property name="Rolle">
</Property>
</Storage>
</Class>


<Class name="DBCore.TriggerBase">
<Super>%RegisteredObject</Super>
<TimeChanged>62427,55322.206365</TimeChanged>
<TimeCreated>61387,52049.689142</TimeCreated>

<Trigger name="OnDeleteBeforeDeleteArraysAndLists">
<Code>	Set tId={ID}
	Set tClass = {%%CLASSNAMEQ}
	Do ..DelArray(tClass,tId)</Code>
<Event>DELETE</Event>
<Foreach>row</Foreach>
</Trigger>

<Method name="%OnDelete">
<Description>
[Previously private]</Description>
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%ObjectIdentity</FormalSpec>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
    Set tId = $LG(oid,1)
    Set tClass = ..%ClassName()
	Do ..DelArray(tClass,tId)
]]></Implementation>
</Method>

<Method name="DelArray">
<Description>
[Previously private]</Description>
<Final>1</Final>
<ClassMethod>1</ClassMethod>
<FormalSpec>tClass:%String,tId:%String</FormalSpec>
<Implementation><![CDATA[
	Set tCD=##Class(%Dictionary.ClassDefinition).%OpenId(tClass)
 	Set cls=$System.OBJ.OpenId(tClass,tId)
	For i=1:1:tCD.Properties.Count() {
		Set tPName=tCD.Properties.GetAt(i).Name
		Set tPType=tCD.Properties.GetAt(i).Collection
		If (tPType="array")||(tPType="list") {
			Do $METHOD($PROPERTY(cls, tPName), "Clear")
		}
	}
	Do cls.%Save()
]]></Implementation>
</Method>
</Class>


<Class name="DBCore.UserEinstellung">
<Description>
</Description>
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62423,55644</TimeChanged>
<TimeCreated>61003,34481.468424</TimeCreated>
<Inheritance>right</Inheritance>

<Property name="IdForExport">
<Type>%XML.Id</Type>
<Private>1</Private>
<Transient>1</Transient>
<Parameter name="XMLNAME" value="ID"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
</Property>

<Property name="Einstellung">
<Type>%Library.Integer</Type>
<Required>1</Required>
</Property>

<Property name="StringWert">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="FloatWert">
<Type>%Library.Float</Type>
</Property>

<Property name="DoubleWert">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="ShortWert">
<Type>%Library.SmallInt</Type>
</Property>

<Property name="IntWert">
<Type>%Library.Integer</Type>
</Property>

<Property name="LongWert">
<Type>%Library.BigInt</Type>
</Property>

<Property name="BoolWert">
<Type>%Library.Boolean</Type>
</Property>

<Property name="DateWert">
<Type>%Library.Date</Type>
</Property>

<Property name="Beschreibung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="500"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Benutzer">
<Type>DBCore.Benutzer</Type>
<Cardinality>one</Cardinality>
<Inverse>UserEinstellung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Benutzer"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="BenutzerIndex">
<Properties>Benutzer</Properties>
</Index>

<Property name="StringArray">
<Type>%String</Type>
<Collection>array</Collection>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="TimeWert">
<Type>%Library.Time</Type>
</Property>

<Index name="BenEinstIdx">
<Properties>Einstellung,Benutzer</Properties>
<Unique>1</Unique>
</Index>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBCore.UserEinstellungD</DataLocation>
<DefaultData>UserEinstellungDefaultData</DefaultData>
<IdLocation>^DBCore.UserEinstellungD</IdLocation>
<IndexLocation>^DBCore.UserEinstellungI</IndexLocation>
<StreamLocation>^DBCore.UserEinstellungS</StreamLocation>
<Data name="StringArray">
<Attribute>StringArray</Attribute>
<Structure>subnode</Structure>
<Subscript>"StringArray"</Subscript>
</Data>
<Data name="UserEinstellungDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Einstellung</Value>
</Value>
<Value name="3">
<Value>StringWert</Value>
</Value>
<Value name="4">
<Value>FloatWert</Value>
</Value>
<Value name="5">
<Value>DoubleWert</Value>
</Value>
<Value name="6">
<Value>ShortWert</Value>
</Value>
<Value name="7">
<Value>IntWert</Value>
</Value>
<Value name="8">
<Value>LongWert</Value>
</Value>
<Value name="9">
<Value>BoolWert</Value>
</Value>
<Value name="10">
<Value>DateWert</Value>
</Value>
<Value name="11">
<Value>Beschreibung</Value>
</Value>
<Value name="12">
<Value>Benutzer</Value>
</Value>
<Value name="13">
<Value>TimeWert</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Benutzer">
</Property>
<Property name="Beschreibung">
</Property>
<Property name="BoolWert">
</Property>
<Property name="DateWert">
</Property>
<Property name="DoubleWert">
</Property>
<Property name="Einstellung">
</Property>
<Property name="FloatWert">
</Property>
<Property name="IntWert">
</Property>
<Property name="LongWert">
</Property>
<Property name="ShortWert">
</Property>
<Property name="StringWert">
</Property>
<Property name="TimeWert">
</Property>
</Storage>
</Class>
</Export>
