<?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-14 17:36:28">
<Class name="DBSpezial.Eier.Vorbestellung">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57287.084811</TimeChanged>
<TimeCreated>62272,58792.380777</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="Kopf">
<Type>DBSpezial.Eier.VorbestellungKopf</Type>
<Cardinality>parent</Cardinality>
<Inverse>Detail</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>VorbestellungArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Artikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Method name="VorbestellungHasArtikel">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfOid:%String,ArtOid:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set found = 0
	&sql(SELECT COUNT(ID) INTO :found FROM DBSpezial_Eier.Vorbestellung where Kopf = :KopfOid AND Artikel = :ArtOid)
	if (found = 0) {
		quit 0	
	} else {
		quit 1
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Eier.VorbestellungD</DataLocation>
<DefaultData>VorbestellungDefaultData</DefaultData>
<IdLocation>^DBSpezial.Eier.VorbestellungD</IdLocation>
<IndexLocation>^DBSpezial.Eier.VorbestellungI</IndexLocation>
<StreamLocation>^DBSpezial.Eier.VorbestellungS</StreamLocation>
<Data name="VorbestellungDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionNr</Value>
</Value>
<Value name="3">
<Value>Text</Value>
</Value>
<Value name="4">
<Value>Einheit</Value>
</Value>
<Value name="5">
<Value>Vorschlag</Value>
</Value>
<Value name="6">
<Value>AbDatum</Value>
</Value>
<Value name="7">
<Value>Artikel</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Eier.VorbestellungKopf">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57229.409032</TimeChanged>
<TimeCreated>62272,59235.549649</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="Adresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>Vorbestellung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Adresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Detail">
<Type>DBSpezial.Eier.Vorbestellung</Type>
<Cardinality>children</Cardinality>
<Inverse>Kopf</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetNextPosNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfOid:%String,AbNummer:%Integer,BisNumber:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = AbNummer
	&sql(SELECT MAX(PositionNr) INTO :nr FROM DBSpezial_Eier.Vorbestellung where Kopf = :KopfOid AND PositionNr BETWEEN :AbNummer AND :BisNumber )
	if (nr < AbNummer) {
		quit AbNummer
	} else {
		quit (nr+1)
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial84E2.Vorbestellu8727D</DataLocation>
<DefaultData>VorbestellungKopfDefaultData</DefaultData>
<IdLocation>^DBSpezial84E2.Vorbestellu8727D</IdLocation>
<IndexLocation>^DBSpezial84E2.Vorbestellu8727I</IndexLocation>
<StreamLocation>^DBSpezial84E2.Vorbestellu8727S</StreamLocation>
<Data name="VorbestellungKopfDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Adresse</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Fakt.AF.AufbereitDetAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62157,48053.023245</TimeCreated>

<Query name="ListeByKopf">
<Type>%SQLQuery</Type>
<FormalSpec>KopfOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PositionsNr, Bezeichnung1, Bezeichnung2, Kopf->Adresse AS AdressID, 
	Artikel AS ArtikelId, Faktor, BerechnungsArt, Preis, Betrag, Anzahl, Kopf AS KopfID,
	PositionAuftrag, Kopf->Adresse->Sprachcode as Sprachcode
	FROM DBSpezial_Fakt.AufbereitDet
	WHERE Kopf = :KopfOid ORDER BY PositionsNr]]></SqlQuery>
</Query>

<Query name="ListeByKundenGrp">
<Type>%SQLQuery</Type>
<FormalSpec>KundenGrpOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PositionsNr, Bezeichnung1, Bezeichnung2, Kopf->Adresse AS AdressID,
	Artikel AS ArtikelId, Faktor, BerechnungsArt, Preis, Betrag, Anzahl, Kopf AS KopfID,
	PositionAuftrag, Kopf->Adresse->Sprachcode as Sprachcode
	FROM DBSpezial_Fakt.AufbereitDet
	WHERE Kopf->Adresse->Kundengruppe = :KundenGrpOid
	AND Betrag > 0 AND NVL(Kopf->Verrechnet,0) = 0
	ORDER BY Kopf->Adresse, PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fakt.AF.SD.PosBerArtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61982,33755.879492</TimeCreated>

<Query name="ListeByKundengruppe">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Kundengruppe:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, PositionsNr, 
	DBSpezial_Fakt_SD.PosBerArt_GetBezeichnung1Class(ID, :MandantOid, :Lang) AS Bezeichnung1, 
	DBSpezial_Fakt_SD.PosBerArt_GetBezeichnung2Class(ID, :MandantOid, :Lang) AS Bezeichnung2, 
	Artikel, Faktor, BerechnungsArt, PositionAuftrag, Tabellenkopf
	FROM DBSpezial_Fakt_SD.PosBerArt
	WHERE Mandant = :MandantOid AND Kundengruppe = :Kundengruppe</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fakt.AF.SD.RueckerstAF">
<Super>%RegisteredObject,%XML.Adaptor</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62384,37002.801622</TimeCreated>
<Inheritance>right</Inheritance>

<Query name="ListeLsv">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nr, DBSpezial_Fakt_SD.Rueckerst_GetBezeichnungClass(ID, :MandantOid, :Lang) As "Bezeichnung"
	FROM DBSpezial_Fakt_SD.Rueckerst
	WHERE Mandant = :MandantOid
	ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fakt.AF.SD.ZuweisTabAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61982,34560.777441</TimeCreated>

<Query name="ListeByMandant">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID,
	Nr, Bezeichnung, Dateityp, Pfad, Zuweisungskey, ZuweisungskeySpalte
	FROM DBSpezial_Fakt_SD.ZuweisTab
	WHERE Mandant = :MandantOid</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fakt.AufbereitDet">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57287.208712</TimeChanged>
<TimeCreated>62157,47499.915132</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">
<Type>%Integer</Type>
</Property>

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

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

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>AufbereitDetArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Artikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

<Property name="Kopf">
<Type>DBSpezial.Fakt.AufbereitKopf</Type>
<Cardinality>parent</Cardinality>
<Inverse>Detail</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

<Method name="GetIdByKopfNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfId:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT ID INTO :oid FROM DBSpezial_Fakt.AufbereitDet where Kopf = :KopfId AND PositionsNr = :PosNr )
	if (SQLCODE '= 0) {
		quit ""
	} else {
		quit oid
	}
]]></Implementation>
</Method>

<Method name="GetAnzByKopfNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfId:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
	set anzahl = 0
	&sql(SELECT Anzahl INTO :anzahl FROM DBSpezial_Fakt.AufbereitDet where Kopf = :KopfId AND PositionsNr = :PosNr )
	if (SQLCODE '= 0) {
		quit 0
	} else {
		quit anzahl
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Detail")</DataLocation>
<DefaultData>AufbereitDetDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fakt.AufbereitKopfC("Detail")</IdLocation>
<IndexLocation>^DBSpezial.Fakt.AufbereitDetI</IndexLocation>
<StreamLocation>^DBSpezial.Fakt.AufbereitDetS</StreamLocation>
<Data name="AufbereitDetDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Bezeichnung1</Value>
</Value>
<Value name="4">
<Value>Bezeichnung2</Value>
</Value>
<Value name="5">
<Value>Artikel</Value>
</Value>
<Value name="6">
<Value>Faktor</Value>
</Value>
<Value name="7">
<Value>BerechnungsArt</Value>
</Value>
<Value name="8">
<Value>Anzahl</Value>
</Value>
<Value name="9">
<Value>Betrag</Value>
</Value>
<Value name="10">
<Value>Preis</Value>
</Value>
<Value name="11">
<Value>PositionAuftrag</Value>
</Value>
</Data>
<Property name="Anzahl"/>
<Property name="Artikel"/>
<Property name="BerechnungsArt"/>
<Property name="Betrag"/>
<Property name="Bezeichnung1"/>
<Property name="Bezeichnung2"/>
<Property name="Faktor"/>
<Property name="Kopf"/>
<Property name="PositionAuftrag"/>
<Property name="PositionsNr"/>
<Property name="Preis"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Fakt.AufbereitKopf">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57229.600155</TimeChanged>
<TimeCreated>62157,47173.127483</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="LetzteAbrechnung">
<Type>%Date</Type>
</Property>

<Property name="Adresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>AufbereitungsKopf</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Adresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Detail">
<Type>DBSpezial.Fakt.AufbereitDet</Type>
<Cardinality>children</Cardinality>
<Inverse>Kopf</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

<Method name="GetIdByAdrId">
<ClassMethod>1</ClassMethod>
<FormalSpec>AdrId:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT ID INTO :oid FROM DBSpezial_Fakt.AufbereitKopf where Adresse = :AdrId )
	if (SQLCODE '= 0) {
		quit ""
	} else {
		quit oid
	}
]]></Implementation>
</Method>

<Method name="GetNextPosNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(SELECT MAX(PositionsNr) INTO :nr FROM DBSpezial_Fakt.AufbereitDet where Kopf = :KopfOid)
	if (SQLCODE '= 0) {
		quit 1
	} else {
		quit (nr+1)
	}
]]></Implementation>
</Method>

<Method name="DeleteDetails">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfOid:%String</FormalSpec>
<Implementation><![CDATA[	&sql(DELETE FROM DBSpezial_Fakt.AufbereitDet where Kopf = :KopfOid)
]]></Implementation>
</Method>

<Method name="ResetVerechnetKG">
<ClassMethod>1</ClassMethod>
<FormalSpec>KundenGrpOid:%String</FormalSpec>
<Implementation><![CDATA[	&sql(UPDATE DBSpezial_Fakt.AufbereitKopf SET Verrechnet = 0 where Adresse->Kundengruppe = :KundenGrpOid)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fakt.AufbereitKopfD</DataLocation>
<DefaultData>AufbereitKopfDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fakt.AufbereitKopfD</IdLocation>
<IndexLocation>^DBSpezial.Fakt.AufbereitKopfI</IndexLocation>
<StreamLocation>^DBSpezial.Fakt.AufbereitKopfS</StreamLocation>
<Data name="AufbereitKopfDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>LetzteAbrechnung</Value>
</Value>
<Value name="3">
<Value>Adresse</Value>
</Value>
<Value name="4">
<Value>Verrechnet</Value>
</Value>
<Value name="5">
<Value>Wert1</Value>
</Value>
<Value name="6">
<Value>Wert2</Value>
</Value>
<Value name="7">
<Value>Wert3</Value>
</Value>
<Value name="8">
<Value>Selektion1</Value>
</Value>
</Data>
<Property name="Adresse"/>
<Property name="LetzteAbrechnung"/>
<Property name="Selektion1"/>
<Property name="Verrechnet"/>
<Property name="Wert1"/>
<Property name="Wert2"/>
<Property name="Wert3"/>
</Storage>
</Class>


<Class name="DBSpezial.Fakt.SD.PosBerArt">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57287.337138</TimeChanged>
<TimeCreated>61982,33293.627585</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="PositionsNr">
<Type>%Integer</Type>
</Property>

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

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

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>BrechnungsArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Artikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

<Property name="Kundengruppe">
<Type>DBAdressen.SD.Kundengruppe</Type>
<Cardinality>one</Cardinality>
<Inverse>SpezBerechnungsart</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Kundengruppe"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

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

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

<Method name="GetBezeichnung1Class">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	w "MyID: "_myID,!
	if (myID '= "") {
		Set rs=##Class(DBSpezial.Fakt.SD.PosBerArt).%OpenId(myID)
		set text = rs.GetBezeichnung1(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

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

<Method name="GetBezeichnung2Class">
<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(DBSpezial.Fakt.SD.PosBerArt).%OpenId(myID)
		set text = rs.GetBezeichnung2(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fakt.SD.PosBerArtD</DataLocation>
<DefaultData>PosBerArtDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fakt.SD.PosBerArtD</IdLocation>
<IndexLocation>^DBSpezial.Fakt.SD.PosBerArtI</IndexLocation>
<StreamLocation>^DBSpezial.Fakt.SD.PosBerArtS</StreamLocation>
<Data name="Bezeichnung1">
<Attribute>Bezeichnung1</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung1"</Subscript>
</Data>
<Data name="Bezeichnung2">
<Attribute>Bezeichnung2</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung2"</Subscript>
</Data>
<Data name="PosBerArtDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>PositionsNr</Value>
</Value>
<Value name="6">
<Value>DateiartHerkunft</Value>
</Value>
<Value name="7">
<Value>Spalte</Value>
</Value>
<Value name="8">
<Value>DatentypHerkunft</Value>
</Value>
<Value name="9">
<Value>PositionsNrFakt</Value>
</Value>
<Value name="10">
<Value>SpalteSelektion</Value>
</Value>
<Value name="11">
<Value>SpaltenBreite</Value>
</Value>
<Value name="12">
<Value>SelektionVon</Value>
</Value>
<Value name="13">
<Value>SelektionBis</Value>
</Value>
<Value name="14">
<Value>Bedingung</Value>
</Value>
<Value name="15">
<Value>Artikelcode</Value>
</Value>
<Value name="16">
<Value>Artikel</Value>
</Value>
<Value name="17">
<Value>ZuweisungsTabelle</Value>
</Value>
<Value name="18">
<Value>Faktor</Value>
</Value>
<Value name="19">
<Value>BerechnungsArt</Value>
</Value>
<Value name="20">
<Value>Kundengruppe</Value>
</Value>
<Value name="21">
<Value>PositionAuftrag</Value>
</Value>
<Value name="22">
<Value>Tabellenkopf</Value>
</Value>
</Data>
<Property name="Artikel"/>
<Property name="BerechnungsArt"/>
<Property name="Bezeichnung1"/>
<Property name="Bezeichnung2"/>
<Property name="Faktor"/>
<Property name="Kundengruppe"/>
<Property name="Mandant"/>
<Property name="PositionAuftrag"/>
<Property name="PositionsNr"/>
<Property name="Tabellenkopf"/>
</Storage>
</Class>


<Class name="DBSpezial.Fakt.SD.Rueckerst">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57287.483833</TimeChanged>
<TimeCreated>62382,33532.30619</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="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="Adresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>Rueckerstattung</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="AdresseIndex">
<Properties>Adresse</Properties>
</Index>

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

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

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

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

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

<Property name="ArtSelektionBisNr">
<Type>%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="ListenTyp">
<Type>%Integer</Type>
</Property>

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

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

<Property name="MaximalbetragCHF">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</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(DBSpezial.Fakt.SD.Rueckerst).%OpenId(myID)
		set text = rs.GetBezeichnung(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Fakt_SD.Rueckerst
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fakt.SD.RueckerstD</DataLocation>
<DefaultData>RueckerstDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fakt.SD.RueckerstD</IdLocation>
<IndexLocation>^DBSpezial.Fakt.SD.RueckerstI</IndexLocation>
<StreamLocation>^DBSpezial.Fakt.SD.RueckerstS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="RueckerstDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>RueckerstattungsNr</Value>
</Value>
<Value name="3">
<Value>Adresse</Value>
</Value>
<Value name="4">
<Value>Selektion</Value>
</Value>
<Value name="5">
<Value>SelektionVonNr</Value>
</Value>
<Value name="6">
<Value>SelektionBisNr</Value>
</Value>
<Value name="7">
<Value>ArtikelSelektion</Value>
</Value>
<Value name="8">
<Value>ArtSelektionVonNr</Value>
</Value>
<Value name="9">
<Value>ArtSelektionBisNr</Value>
</Value>
<Value name="10">
<Value>Mandant</Value>
</Value>
<Value name="11">
<Value>ListenTyp</Value>
</Value>
<Value name="12">
<Value>Prozent</Value>
</Value>
<Value name="13">
<Value>MinimalbetragCHF</Value>
</Value>
<Value name="14">
<Value>MaximalbetragCHF</Value>
</Value>
<Value name="15">
<Value>Nr</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Fakt.SD.ZuweisTab">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57229.705841</TimeChanged>
<TimeCreated>61982,34338.054309</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="Nr">
<Type>%Integer</Type>
</Property>

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

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

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

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

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

<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 DBSpezial_Fakt_SD.ZuweisTab
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fakt.SD.ZuweisTabD</DataLocation>
<DefaultData>ZuweisTabDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fakt.SD.ZuweisTabD</IdLocation>
<IndexLocation>^DBSpezial.Fakt.SD.ZuweisTabI</IndexLocation>
<StreamLocation>^DBSpezial.Fakt.SD.ZuweisTabS</StreamLocation>
<Data name="ZuweisTabDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
<Value name="4">
<Value>Bezeichnung</Value>
</Value>
<Value name="5">
<Value>Dateityp</Value>
</Value>
<Value name="6">
<Value>Pfad</Value>
</Value>
<Value name="7">
<Value>Zuweisungskey</Value>
</Value>
<Value name="8">
<Value>ZuweisungskeySpalte</Value>
</Value>
<Value name="9">
<Value>Tabellenkopf</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Fzv.AF.FahrzeugAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62193,28768.965555</TimeCreated>

<Query name="ListeBaum">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, DBSpezial_Fzv_SD.FahrzeugTyp_GetTextClass(Fahrzeugtyp, AktMandant, :Lang) AS Fahrzeugtyp, Nummernschild, AktMandant,
	DBAdressen.Adresse_GetName(Adresse->Adresscode, Adresse->Name, Adresse->VornameZusatz1, 0)AS Kunde, Adresse
	FROM DBSpezial_Fzv.Fahrzeug
	WHERE AktMandant = :MandantOid
	ORDER BY Kunde]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, DBSpezial_Fzv_SD.FahrzeugTyp_GetTextClass(Fahrzeugtyp, AktMandant, :Lang) AS Fahrzeugtyp,
	Inverkehrssetzung, AktMandant, Adresse, Adresse->Adressnummer
	FROM DBSpezial_Fzv.Fahrzeug
	WHERE AktMandant = :MandantOid
	ORDER BY Adresse->Adressnummer]]></SqlQuery>
</Query>

<Query name="ListeDruck2">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, DBSpezial_Fzv_SD.FahrzeugTyp_GetTextClass(Fahrzeugtyp, AktMandant, :Lang) AS Fahrzeugtyp,
	Inverkehrssetzung, AktMandant, Adresse, Adresse->Adressnummer
	FROM DBSpezial_Fzv.Fahrzeug
	WHERE AktMandant = :MandantOid
	ORDER BY DBSpezial_Fzv_SD.FahrzeugTyp_GetTextClass(Fahrzeugtyp, AktMandant, :Lang)]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fzv.AF.SD.AufbauArtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62166,34029.395623</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.AufbauArt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Fzv_SD.AufbauArt
WHERE AktMandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.AufbauArt_GetTextClass(%ID, :MandantOid, :Lang) AS wert1, "" AS wert2 FROM DBSpezial_Fzv_SD.AufbauArt WHERE AktMandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Code:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.AufbauArt_GetTextClass(%ID, :MandantOid, :Lang) As Text FROM DBSpezial_Fzv_SD.AufbauArt WHERE AktMandant = :MandantOid AND Code = :Code ORDER BY Code</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fzv.AF.SD.AufbauTypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62166,34029.540261</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.AufbauTyp_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Fzv_SD.AufbauTyp
WHERE AktMandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.AufbauTyp_GetTextClass(%ID, :MandantOid, :Lang) AS wert1, "" AS wert2 FROM DBSpezial_Fzv_SD.AufbauTyp WHERE AktMandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Code:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.AufbauTyp_GetTextClass(%ID, :MandantOid, :Lang) As Text FROM DBSpezial_Fzv_SD.AufbauTyp WHERE AktMandant = :MandantOid AND Code = :Code ORDER BY Code</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fzv.AF.SD.FahrzeugTypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62166,34029.698244</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.FahrzeugTyp_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Fzv_SD.FahrzeugTyp
WHERE AktMandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.FahrzeugTyp_GetTextClass(%ID, :MandantOid, :Lang) AS wert1, "" AS wert2 FROM DBSpezial_Fzv_SD.FahrzeugTyp WHERE AktMandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Code:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.FahrzeugTyp_GetTextClass(%ID, :MandantOid, :Lang) As Text FROM DBSpezial_Fzv_SD.FahrzeugTyp WHERE AktMandant = :MandantOid AND Code = :Code ORDER BY Code</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fzv.AF.SD.ServiceArtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62166,55640.974898</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.ServiceArt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Fzv_SD.ServiceArt
WHERE AktMandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.ServiceArt_GetTextClass(%ID, :MandantOid, :Lang) AS wert1, "" AS wert2 FROM DBSpezial_Fzv_SD.ServiceArt WHERE AktMandant = :MandantOid ORDER BY Code</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Code:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBSpezial_Fzv_SD.ServiceArt_GetTextClass(%ID, :MandantOid, :Lang) As Text FROM DBSpezial_Fzv_SD.ServiceArt WHERE AktMandant = :MandantOid AND Code = :Code ORDER BY Code</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fzv.AF.STKopfAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62173,53780.846785</TimeCreated>

<Query name="ListeBaum">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, ServiceNr, ServiceBez, AktMandant
	FROM DBSpezial_Fzv.STKopf
	WHERE AktMandant = :MandantOid</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fzv.AF.ServiceTypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62172,55423.775531</TimeCreated>

<Query name="ListeByKopf">
<Type>%SQLQuery</Type>
<FormalSpec>STKopfOid:%String,MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PosNr, Artikel->ArtikelNr AS ArtikelNr, Artikel->Kurztext AS Text,
	DBFakturierung_SD.Mengencode_GetTextClass(Artikel->Mengeneinheit,:MandantOid,:Lang) AS Einheit,
	Anzahl, Preis, Betrag
	FROM DBSpezial_Fzv.ServiceTyp
	WHERE STKopf = :STKopfOid
	ORDER BY PosNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Fzv.Fahrzeug">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57287.666229</TimeChanged>
<TimeCreated>62166,33564.412079</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="AktMandant">
<Type>%String</Type>
</Property>

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

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Property name="Fahrzeugtyp">
<Type>DBSpezial.Fzv.SD.FahrzeugTyp</Type>
<Cardinality>one</Cardinality>
<Inverse>Fahrzeug</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Fahrzeugtyp"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FahrzeugtypIndex">
<Properties>Fahrzeugtyp</Properties>
</Index>

<Property name="Adresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>Fahrzeug</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Adresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Aufbautyp">
<Type>DBSpezial.Fzv.SD.AufbauTyp</Type>
<Cardinality>one</Cardinality>
<Inverse>Fahrzeug</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Aufbautyp"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="AufbautypIndex">
<Properties>Aufbautyp</Properties>
</Index>

<Property name="Aufbauart">
<Type>DBSpezial.Fzv.SD.AufbauArt</Type>
<Cardinality>one</Cardinality>
<Inverse>Fahrzeug</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Aufbauart"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="AufbauartIndex">
<Properties>Aufbauart</Properties>
</Index>

<Property name="Nummernschild">
<Type>%String</Type>
<Parameter name="MAXLEN" value="12"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

<Property name="Bemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="400"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="FahrgestellNr">
<Type>%String</Type>
<Parameter name="MAXLEN" value="30"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

<Property name="Allgemein1">
<Type>%String</Type>
<Parameter name="MAXLEN" value="25"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

<Property name="Allgemein2">
<Type>%String</Type>
<Parameter name="MAXLEN" value="25"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

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

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

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

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

<Property name="SerienNr">
<Type>%String</Type>
<Parameter name="MAXLEN" value="30"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="SobagNr">
<Type>%String</Type>
<Parameter name="MAXLEN" value="30"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

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

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

<Property name="ServiceArt">
<Type>DBSpezial.Fzv.SD.ServiceArt</Type>
<Cardinality>one</Cardinality>
<Inverse>Fahrzeug</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="ServiceArt"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Method name="GetIdBySobagNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,SobagNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
        
    set id = ""
    &sql(SELECT ID INTO :id 
    		FROM DBSpezial_Fzv.Fahrzeug
			WHERE SobagNr = :SobagNr AND 
					AktMandant = :MandantOid)
					
    if (SQLCODE '= 0) {
		QUIT ""   
    } else {
		Quit id
    }
]]></Implementation>
</Method>

<Method name="GetIdBySerienNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,SerienNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    set id = ""
    &sql(SELECT ID INTO :id 
    		FROM DBSpezial_Fzv.Fahrzeug
    		WHERE SerienNr = :SerienNr AND 
    				AktMandant = :MandantOid)
    				
     if (SQLCODE '= 0) {
		QUIT ""   
    } else {
		Quit id
    }
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fzv.FahrzeugD</DataLocation>
<DefaultData>FahrzeugDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fzv.FahrzeugD</IdLocation>
<IndexLocation>^DBSpezial.Fzv.FahrzeugI</IndexLocation>
<StreamLocation>^DBSpezial.Fzv.FahrzeugS</StreamLocation>
<Data name="FahrzeugDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>AktMandant</Value>
</Value>
<Value name="3">
<Value>Fahrzeugtyp</Value>
</Value>
<Value name="4">
<Value>Adresse</Value>
</Value>
<Value name="5">
<Value>Aufbautyp</Value>
</Value>
<Value name="6">
<Value>Aufbauart</Value>
</Value>
<Value name="7">
<Value>Nummernschild</Value>
</Value>
<Value name="8">
<Value>GarantieBis</Value>
</Value>
<Value name="9">
<Value>Bemerkung</Value>
</Value>
<Value name="10">
<Value>FahrgestellNr</Value>
</Value>
<Value name="11">
<Value>FahrzeugAktiv</Value>
</Value>
<Value name="12">
<Value>ServiceAktive</Value>
</Value>
<Value name="13">
<Value>Allgemein1</Value>
</Value>
<Value name="14">
<Value>Inverkehrssetzung</Value>
</Value>
<Value name="15">
<Value>Allgemein2</Value>
</Value>
<Value name="16">
<Value>ServiceintervallMonate</Value>
</Value>
<Value name="17">
<Value>LetzterService</Value>
</Value>
<Value name="18">
<Value>NaechsterService</Value>
</Value>
<Value name="19">
<Value>KmStand</Value>
</Value>
<Value name="20">
<Value>DatumAufgebot</Value>
</Value>
<Value name="21">
<Value>AbgeliefertAm</Value>
</Value>
<Value name="22">
<Value>SerienNr</Value>
</Value>
<Value name="23">
<Value>SobagNr</Value>
</Value>
<Value name="24">
<Value>Datum</Value>
</Value>
<Value name="25">
<Value>Service1</Value>
</Value>
<Value name="26">
<Value>Service2</Value>
</Value>
<Value name="27">
<Value>Service3</Value>
</Value>
<Value name="28">
<Value>ServiceArt</Value>
</Value>
</Data>
<Property name="AbgeliefertAm"/>
<Property name="Adresse"/>
<Property name="AktMandant"/>
<Property name="Allgemein"/>
<Property name="Allgemein1"/>
<Property name="Allgemein2"/>
<Property name="AmtlKennzeichen"/>
<Property name="Aufbauart"/>
<Property name="Aufbautyp"/>
<Property name="Bemerkung"/>
<Property name="Datum"/>
<Property name="DatumAufgebot"/>
<Property name="FahrgestellNr"/>
<Property name="FahrzeugAktiv"/>
<Property name="Fahrzeugtyp"/>
<Property name="GarantieBis"/>
<Property name="Inverkehrssetzung"/>
<Property name="KmStand"/>
<Property name="LetzterService"/>
<Property name="NaechsterService"/>
<Property name="Nummernschild"/>
<Property name="SerienNr"/>
<Property name="Service1"/>
<Property name="Service2"/>
<Property name="Service3"/>
<Property name="ServiceAktive"/>
<Property name="ServiceArt"/>
<Property name="ServiceintervallMonate"/>
<Property name="SobagNr"/>
</Storage>
</Class>


<Class name="DBSpezial.Fzv.SD.AufbauArt">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57287.837896</TimeChanged>
<TimeCreated>62166,33780.406662</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="Code">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="99"/>
<Parameter name="MINVAL" value="1"/>
</Property>

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

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

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

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="CodeIndex">
<Properties>AktMandant,Code</Properties>
<Unique>1</Unique>
</Index>

<Property name="Fahrzeug">
<Type>DBSpezial.Fzv.Fahrzeug</Type>
<Cardinality>many</Cardinality>
<Inverse>Aufbauart</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Fzv.SD.AufbauArt).%OpenId(myID)
                               Set text = rs.GetText(MandOid, Lang)
                }
                Quit text
]]></Implementation>
</Method>

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

<Method name="GetLastStatusByMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
                set id = ""
                &SQL(Select Top 1 ID into :id FROM DBSpezial_Fzv_SD.AufbauArt WHERE AktMandant = :MandOid Order by Code DESC)
                Quit:(SQLCODE'=0) ""
                Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fzv.SD.AufbauArtD</DataLocation>
<DefaultData>AufbauArtDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fzv.SD.AufbauArtD</IdLocation>
<IndexLocation>^DBSpezial.Fzv.SD.AufbauArtI</IndexLocation>
<StreamLocation>^DBSpezial.Fzv.SD.AufbauArtS</StreamLocation>
<Data name="AufbauArtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Code</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="AktMandant"/>
<Property name="Code"/>
</Storage>
</Class>


<Class name="DBSpezial.Fzv.SD.AufbauTyp">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57287.953956</TimeChanged>
<TimeCreated>62166,30663.234329</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="Code">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="99"/>
<Parameter name="MINVAL" value="1"/>
</Property>

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

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

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

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="CodeIndex">
<Properties>AktMandant,Code</Properties>
<Unique>1</Unique>
</Index>

<Property name="Fahrzeug">
<Type>DBSpezial.Fzv.Fahrzeug</Type>
<Cardinality>many</Cardinality>
<Inverse>Aufbautyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Fzv.SD.AufbauTyp).%OpenId(myID)
                               Set text = rs.GetText(MandOid, Lang)
                }
                Quit text
]]></Implementation>
</Method>

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

<Method name="GetLastStatusByMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
                set id = ""
                &SQL(Select Top 1 ID into :id FROM DBSpezial_Fzv_SD.AufbauTyp WHERE AktMandant = :MandOid Order by Code DESC)
                Quit:(SQLCODE'=0) ""
                Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fzv.SD.AufbauTypD</DataLocation>
<DefaultData>AufbauTypDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fzv.SD.AufbauTypD</IdLocation>
<IndexLocation>^DBSpezial.Fzv.SD.AufbauTypI</IndexLocation>
<StreamLocation>^DBSpezial.Fzv.SD.AufbauTypS</StreamLocation>
<Data name="AufbauTypDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Code</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Fzv.SD.FahrzeugTyp">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57288.070283</TimeChanged>
<TimeCreated>62166,33780.561352</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="Code">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="99"/>
<Parameter name="MINVAL" value="1"/>
</Property>

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

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

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

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="CodeIndex">
<Properties>AktMandant,Code</Properties>
<Unique>1</Unique>
</Index>

<Property name="Fahrzeug">
<Type>DBSpezial.Fzv.Fahrzeug</Type>
<Cardinality>many</Cardinality>
<Inverse>Fahrzeugtyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Fzv.SD.FahrzeugTyp).%OpenId(myID)
                               Set text = rs.GetText(MandOid, Lang)
                }
                Quit text
]]></Implementation>
</Method>

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

<Method name="GetLastStatusByMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
                set id = ""
                &SQL(Select Top 1 ID into :id FROM DBSpezial_Fzv_SD.FahrzeugTyp WHERE AktMandant = :MandOid Order by Code DESC)
                Quit:(SQLCODE'=0) ""
                Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fzv.SD.FahrzeugTypD</DataLocation>
<DefaultData>FahrzeugTypDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fzv.SD.FahrzeugTypD</IdLocation>
<IndexLocation>^DBSpezial.Fzv.SD.FahrzeugTypI</IndexLocation>
<StreamLocation>^DBSpezial.Fzv.SD.FahrzeugTypS</StreamLocation>
<Data name="FahrzeugTypDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Code</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="AktMandant"/>
<Property name="Code"/>
</Storage>
</Class>


<Class name="DBSpezial.Fzv.SD.ServiceArt">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57288.193119</TimeChanged>
<TimeCreated>62166,55580.827721</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="Code">
<Type>%Library.Integer</Type>
<Parameter name="MAXVAL" value="99"/>
<Parameter name="MINVAL" value="1"/>
</Property>

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

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

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

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Index name="CodeIndex">
<Properties>AktMandant,Code</Properties>
<Unique>1</Unique>
</Index>

<Property name="STKopf">
<Type>DBSpezial.Fzv.STKopf</Type>
<Cardinality>many</Cardinality>
<Inverse>ServiceArt</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Fahrzeug">
<Type>DBSpezial.Fzv.Fahrzeug</Type>
<Cardinality>many</Cardinality>
<Inverse>ServiceArt</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Fzv.SD.ServiceArt).%OpenId(myID)
                               Set text = rs.GetText(MandOid, Lang)
                }
                Quit text
]]></Implementation>
</Method>

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

<Method name="GetLastStatusByMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
                set id = ""
                &SQL(Select Top 1 ID into :id FROM DBSpezial_Fzv_SD.ServiceArt WHERE AktMandant = :MandOid Order by Code DESC)
                Quit:(SQLCODE'=0) ""
                Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fzv.SD.ServiceArtD</DataLocation>
<DefaultData>ServiceArtDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fzv.SD.ServiceArtD</IdLocation>
<IndexLocation>^DBSpezial.Fzv.SD.ServiceArtI</IndexLocation>
<StreamLocation>^DBSpezial.Fzv.SD.ServiceArtS</StreamLocation>
<Data name="ServiceArtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Code</Value>
</Value>
<Value name="3">
<Value>AktMandant</Value>
</Value>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="AktMandant"/>
<Property name="Code"/>
</Storage>
</Class>


<Class name="DBSpezial.Fzv.STKopf">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57288.331781</TimeChanged>
<TimeCreated>62173,53016.384505</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="AktMandant">
<Type>%String</Type>
</Property>

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

<Index name="AktMandantIdx">
<Properties>AktMandant</Properties>
</Index>

<Property name="ServiceNr">
<Type>%String</Type>
<Parameter name="MAXLEN" value="30"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ServiceBez">
<Type>%String</Type>
<Parameter name="MAXLEN" value="60"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ServiceArbeiten">
<Type>%String</Type>
<Parameter name="MAXLEN" value="400"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ServiceArt">
<Type>DBSpezial.Fzv.SD.ServiceArt</Type>
<Cardinality>one</Cardinality>
<Inverse>STKopf</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="ServiceArt"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="ServiceArtIndex">
<Properties>ServiceArt</Properties>
</Index>

<Property name="ServiceTyp">
<Type>DBSpezial.Fzv.ServiceTyp</Type>
<Cardinality>children</Cardinality>
<Inverse>STKopf</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fzv.STKopfD</DataLocation>
<DefaultData>STKopfDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fzv.STKopfD</IdLocation>
<IndexLocation>^DBSpezial.Fzv.STKopfI</IndexLocation>
<StreamLocation>^DBSpezial.Fzv.STKopfS</StreamLocation>
<Data name="STKopfDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>AktMandant</Value>
</Value>
<Value name="3">
<Value>ServiceNr</Value>
</Value>
<Value name="4">
<Value>ServiceBez</Value>
</Value>
<Value name="5">
<Value>ServiceArbeiten</Value>
</Value>
<Value name="6">
<Value>ServiceArt</Value>
</Value>
</Data>
<Property name="AktMandant"/>
<Property name="ServiceArbeiten"/>
<Property name="ServiceArt"/>
<Property name="ServiceBez"/>
<Property name="ServiceNr"/>
</Storage>
</Class>


<Class name="DBSpezial.Fzv.ServiceTyp">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57332.383603</TimeChanged>
<TimeCreated>62172,49766.637665</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="PosNr">
<Type>%Integer</Type>
</Property>

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

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

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

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>ServiceTyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Artikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="ArtikelIndex">
<Properties>Artikel</Properties>
</Index>

<Property name="STKopf">
<Type>DBSpezial.Fzv.STKopf</Type>
<Cardinality>parent</Cardinality>
<Inverse>ServiceTyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="STKopf"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Method name="GetIdByPosNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>STKopfOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
                
    set id = ""
    &sql(SELECT ID INTO :id FROM DBSpezial_Fzv.ServiceTyp
         WHERE PosNr = :PosNr AND STKopf = :STKopfOid)
    Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Fzv.ServiceTypD</DataLocation>
<DefaultData>ServiceTypDefaultData</DefaultData>
<IdLocation>^DBSpezial.Fzv.ServiceTypD</IdLocation>
<IndexLocation>^DBSpezial.Fzv.ServiceTypI</IndexLocation>
<StreamLocation>^DBSpezial.Fzv.ServiceTypS</StreamLocation>
<Data name="ServiceTypDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PosNr</Value>
</Value>
<Value name="3">
<Value>Anzahl</Value>
</Value>
<Value name="4">
<Value>Preis</Value>
</Value>
<Value name="5">
<Value>Betrag</Value>
</Value>
<Value name="6">
<Value>Artikel</Value>
</Value>
</Data>
<Property name="Anzahl"/>
<Property name="Artikel"/>
<Property name="Betrag"/>
<Property name="Einheit"/>
<Property name="PosNr"/>
<Property name="Preis"/>
<Property name="STKopf"/>
<Property name="Text"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.AF.AnnahmeDetAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62259,52070.682497</TimeCreated>

<Query name="ListeNachAnnahme">
<Type>%SQLQuery</Type>
<FormalSpec>AnnahmeOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, PositionsNr, Abzugsart, Text, Text2, Menge, 
Prozent, AbzugMenge, Einheit, AbzugEinheit, Abzug,
Abzug->DruckGroesse, Abzug->DruckFett, Abzug->DruckVorschub
FROM DBSpezial_Getr.AnnahmeDet
WHERE Annahme = :AnnahmeOid
ORDER BY PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.AbholrabattAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62263,33211.934368</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.Abholrabatt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Abholrabatt
WHERE Mandant = :MandantOid
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeGesamtGrid">
<Type>%SQLQuery</Type>
<FormalSpec>GewichtOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID,
CAST(element_key AS DEC) AS Gewicht,
CAST(TRabatt_RabattFr AS DEC) AS RabattFr,
CAST(TRabatt_RabattProzent AS DEC) AS RabattProzent
FROM DBSpezial_Getr_SD.Abholrabatt_TRabatt
WHERE Abholrabatt = :GewichtOid
ORDER BY Abholrabatt</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.Abholrabatt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Abholrabatt
WHERE Mandant = :MandantOid AND Nummer = :Nummer
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonGew:%Decimal,BisGew:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, 
CAST(element_key AS DEC) AS BisGewicht,
CAST(TRabatt_RabattFr AS DEC) AS RabattFr,
CAST(TRabatt_RabattProzent AS DEC) AS RabattProzent,
Abholrabatt->Nummer AS Nummer,
DBSpezial_Getr_SD.Abholrabatt_GetTextClass(Abholrabatt->%ID, :MandantOid, :Lang) As Text,
Abholrabatt->Bemerkung AS Bemerkung
FROM DBSpezial_Getr_SD.Abholrabatt_TRabatt
WHERE Abholrabatt->Mandant = :MandantOid
AND CAST(element_key AS DEC) >= :VonGew
AND CAST(element_key AS DEC) <= :BisGew
AND CAST(TRabatt_RabattFr AS DEC) > 0
AND CAST(TRabatt_RabattProzent AS DEC) > 0
ORDER BY Abholrabatt->Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.AbzugAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62242,62081.828317</TimeCreated>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.Abzug_GetTextClass(%ID, :MandantOid, :Lang) As Text,
DBSpezial_Getr_SD.Abzug_GetText2Class(%ID, :MandantOid, :Lang) As Text2
FROM DBSpezial_Getr_SD.Abzug
WHERE Mandant = :MandantOid AND PositionsNr = :Nr
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.Abzug_GetTextClass(%ID, :MandantOid, :Lang) As Text,
DBSpezial_Getr_SD.Abzug_GetText2Class(%ID, :MandantOid, :Lang) As Text2,
BetragMutierbar, Abzugsart, DruckFett, DruckGroesse
FROM DBSpezial_Getr_SD.Abzug
WHERE Mandant = :MandantOid
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT %ID, PositionsNr,
    DBSpezial_Getr_SD.Abzug_GetTextClass(%ID, Mandant, :Lang) As Text,
    DBSpezial_Getr_SD.Abzug_GetText2Class(%ID, Mandant, :Lang) As Text2,
    Abzugsart, BetragMutierbar, DruckFett, DruckGroesse, Artikel->ArtikelNr AS ArtikelNr,
    DBAgrofresh.Artikel_GetArtikeltextClass(Artikel, :MandantOid, :Lang) AS ArtikelText
	FROM DBSpezial_Getr_SD.Abzug
    WHERE Mandant = :MandantOid
    ORDER BY PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.FeutigkeitAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62227,58066.107851</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>FeutigkeitOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID,
CAST(element_key AS DEC) AS Feuchtigkeit,
CAST(Tabelle_Trocknungskosten AS DEC) AS Trocknungskosten,
CAST(Tabelle_Trocknungsverlust AS DEC) AS Trocknungsverlust
FROM DBSpezial_Getr_SD.Feuchtigkeit_Tabelle
WHERE Feuchtigkeit = :FeutigkeitOid
ORDER BY Feuchtigkeit</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.Feuchtigkeit_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Feuchtigkeit
WHERE Mandant = :MandantOid AND PositionsNr = :Nr
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeGesamt2">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.Feuchtigkeit_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Feuchtigkeit
WHERE Mandant = :MandantOid
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonFeucht:%Decimal,BisFeucht:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, 
CAST(element_key AS DEC) AS Feuchtigkeit,
CAST(Tabelle_Trocknungskosten AS DEC) AS Trocknungskosten,
CAST(Tabelle_Trocknungsverlust AS DEC) AS Trocknungsverlust,
Feuchtigkeit->PositionsNr AS Nr,
DBSpezial_Getr_SD.Feuchtigkeit_GetTextClass(Feuchtigkeit->%ID, :MandantOid, :Lang) As Text,
Feuchtigkeit->Bemerkung AS Bemerking
FROM DBSpezial_Getr_SD.Feuchtigkeit_Tabelle
WHERE Feuchtigkeit->Mandant = :MandantOid
AND CAST(element_key AS DEC) >= :VonFeucht
AND CAST(element_key AS DEC) <= :BisFeucht
AND CAST(Tabelle_Trocknungskosten AS DEC) > 0
AND CAST(Tabelle_Trocknungsverlust AS DEC) > 0
ORDER BY Feuchtigkeit->PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.GetrartAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62228,38855.484649</TimeCreated>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, PositionsNr, DBSpezial_Getr_SD.Getrart_GetTextClass(%ID, :MandantOid, :Lang) As Text
	FROM DBSpezial_Getr_SD.Getrart
	WHERE Mandant = :MandantOid AND PositionsNr = :Nr
	ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, PositionsNr, DBSpezial_Getr_SD.Getrart_GetTextClass(%ID, :MandantOid, :Lang) As Text,
	DBSpezial_Getr_SD.HektLiterZuschlag_GetTextClass(Hektorlitergewicht ->%ID, :MandantOid, :Lang) AS Hektolitergewicht,
	DBSpezial_Getr_SD.Feuchtigkeit_GetTextClass(Feuchtigkeit->%ID, :MandantOid, :Lang) AS Feuchtigkeit,
	DBSpezial_Getr_SD.Probergew_GetTextClass(Probergewicht->%ID, :MandantOid, :Lang)AS Probergewicht,
	DBSpezial_Getr_SD.GewichtRabatt_GetTextClass(GewichtRabatt->%ID, :MandantOid, :Lang)AS GewichtRabatt,
	DBAgrofreshEK_SD.Hilfstexte_GetTextClass(Abrechnungstyp, :MandantOid, :Lang) AS Abrechnungstyp,
	Abrechnungsart, Grundgebuehr, Rueckbehalt, NachzahlungRueckbehalt
	FROM DBSpezial_Getr_SD.Getrart
	WHERE Mandant = :MandantOid
	ORDER BY PositionsNr]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT Getreideart->ID, Getreideart->PositionsNr, DBSpezial_Getr_SD.Getrart_GetTextClass(Getreideart, :MandantOid, :Lang) As Text,
	DBSpezial_Getr_SD.HektLiterZuschlag_GetTextClass(Getreideart->Hektorlitergewicht ->%ID, :MandantOid, :Lang) AS Hektolitergewicht,
	DBSpezial_Getr_SD.Feuchtigkeit_GetTextClass(Getreideart->Feuchtigkeit->%ID, :MandantOid, :Lang) AS Feuchtigkeit,
	DBSpezial_Getr_SD.Probergew_GetTextClass(Getreideart->Probergewicht->%ID, :MandantOid, :Lang)AS Probergewicht,
	DBSpezial_Getr_SD.GewichtRabatt_GetTextClass(Getreideart->GewichtRabatt->%ID, :MandantOid, :Lang)AS GewichtRabatt,
	DBAgrofresh_SD.Hilfstexte_GetTextClass(Produktionsart->%ID, :MandantOid, :Lang) As SorteProduktionsart,
	DBSpezial_Getr_SD.Getrsorte_GetTextClass(%ID, :MandantOid, :Lang) AS SorteBez,
	DBSpezial_Getr_SD.Getrart_GetTextClass(FutterSorte->Getreideart, :MandantOid, :Lang) As FutterArt,
	DBAgrofresh.Artikel_GetArtikeltextClass(ArtikelLager->%ID, :MandantOid, :Lang) AS SorteArtText1,
	DBAgrofresh.Artikel_GetArtikeltext2Class(ArtikelLager->%ID, :MandantOid, :Lang) AS SorteArtText2,
	DBSpezial_Getr_SD.Getrsorte_GetTextClass(FutterSorte, Mandant, :Lang) As FutterSorte,
	DBAgrofresh_SD.Hilfstexte_GetTextClass(VorschlagLagerort->%ID, :MandantOid, :Lang) As SorteVorschlagLagerort,
	ArtikelLager->ArtikelNr AS SorteArtikelNr, Getreideart->Grundgebuehr AS Grundgebuehr, Getreideart->Rueckbehalt AS Rueckbehalt,
	Getreideart->NachzahlungRueckbehalt AS NachzahlungRueckbehalt,
	DBAgrofreshEK_SD.Abrechnungstyp_GetTextClass(Getreideart->Abrechnungstyp->%ID, :MandantOid, :Lang) AS Abrechnungstyp,
	Getreideart->Abrechnungsart, Getreideart->Fusstext, PositionsNr AS SorteNr, Kurzbezeichnung AS SorteKurzBez,
	Grundpreis AS SorteGrundPreis, UnteresHLGewicht AS SorteUnteresHLGewicht,
	UnterFallzahlIPS AS SorteUnterFallzahlIPS, ArtikelLager AS SorteArtikelLager,
	FallzahlFuttergetreide AS SorteFallzahlFuttergetreide, FallzahlProzentabzug AS SorteFallzahlProzentabzug,
	DBSpezial_Getr_SD.PreiseTS_GetTextClass(PreistabelleTS->%ID, :MandantOid, :Lang) AS PreistabelleTS
	FROM DBSpezial_Getr_SD.Getrsorte
	WHERE Getreideart->Mandant = :MandantOid
	ORDER BY Getreideart->PositionsNr, SorteNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.GetrartAbzugAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62248,53482.402611</TimeCreated>

<Query name="ListeNachGetrart">
<Type>%SQLQuery</Type>
<FormalSpec>GetrartOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, Abzug, MengeBetrag, Abzug->PositionsNr, DBSpezial_Getr_SD.Abzug_GetTextClass(Abzug, Abzug->Mandant, :Lang) As Text,
DBSpezial_Getr_SD.Abzug_GetText2Class(Abzug, Abzug->Mandant, :Lang) As Text2,
Abzug->Abzugsart
FROM DBSpezial_Getr_SD.GetrartAbzug
WHERE Getreideart = :GetrartOid
ORDER BY Abzug->PositionsNr]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT ID, Abzug->PositionsNr AS Nummer,
    DBSpezial_Getr_SD.Abzug_GetTextClass(Abzug->%ID, :MandantOid, :Lang) As Text,
   	DBSpezial_Getr_SD.Abzug_GetText2Class(Abzug->%ID, :MandantOid, :Lang) As Text2,
   	MengeBetrag,Getreideart->PositionsNr AS GetrNr,
    DBSpezial_Getr_SD.Getrart_GetTextClass(Getreideart->%ID, :MandantOid, :Lang)As GetrText,
    DBSpezial_Getr_SD.HektLiterZuschlag_GetTextClass(Getreideart->Hektorlitergewicht->%ID, :MandantOid, :Lang) AS ZuschlaegeAbzuege,
    DBSpezial_Getr_SD.Feuchtigkeit_GetTextClass(Getreideart->Feuchtigkeit->%ID, :MandantOid, :Lang) AS Trocknungskosten,
	DBSpezial_Getr_SD.Probergew_GetTextClass(Getreideart->Probergewicht->%ID, :MandantOid, :Lang)AS Probergewicht,
	Getreideart->Abrechnungsart
	FROM DBSpezial_Getr_SD.GetrartAbzug
	WHERE Abzug->Mandant = :MandantOid
	ORDER BY Abzug->PositionsNr, Getreideart->PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.GetrsorteAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62214,56081.644724</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>GetreideartOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, PositionsNr, DBSpezial_Getr_SD.Getrsorte_GetTextClass(%ID, Getreideart->Mandant, :Lang) As Text,
	Produktionsart->PositionsNr AS ProdArtNr, DBAgrofresh_SD.Hilfstexte_GetTextClass(Produktionsart->ID, Getreideart->Mandant, :Lang)  AS ProdArtText,
	DBSpezial_Getr_SD.Getrsorte_GetTextClass(FutterSorte->ID, Getreideart->Mandant, :Lang) As FutterSorteText,
	DBSpezial_Getr_SD.Getrart_GetTextClass(FutterSorte->Getreideart->ID, Getreideart->Mandant, :Lang) As FutterArtText,
	Kurzbezeichnung
	FROM DBSpezial_Getr_SD.Getrsorte
	WHERE Getreideart = :GetreideartOid
	ORDER BY PositionsNr]]></SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>GetreideartOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, PositionsNr, DBSpezial_Getr_SD.Getrsorte_GetTextClass(%ID, Getreideart->Mandant, :Lang) As Text
	FROM DBSpezial_Getr_SD.Getrsorte
	WHERE Getreideart = :GetreideartOid AND PositionsNr = :Nr
	ORDER BY PositionsNr]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>GetreideartOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT %ID, PositionsNr AS Nr, Getreideart->Mandant,
    DBSpezial_Getr_SD.Getrsorte_GetTextClass(%ID, Getreideart->Mandant, :Lang) As wert1, 
    DBAgrofresh_SD.Hilfstexte_GetTextClass(Produktionsart->ID, Getreideart->Mandant, :Lang)  AS wert2
	FROM DBSpezial_Getr_SD.Getrsorte as Stammdate 
    WHERE Getreideart = :GetreideartOid ORDER BY Nr]]></SqlQuery>
</Query>

<Query name="GetEntryByKurzbez">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Kurzbez:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT %ID, ArtSortenNr, DBSpezial_Getr_SD.Getrsorte_GetTextClass(%ID, Getreideart->Mandant, :Lang) As Text, 
    Getreideart, Kurzbezeichnung
    FROM DBSpezial_Getr_SD.Getrsorte as Stammdate 
    WHERE Getreideart->Mandant = :MandantOid AND Kurzbezeichnung LIKE :Kurzbez
    ORDER BY ArtSortenNr]]></SqlQuery>
</Query>

<Query name="GetEntryByArtNr">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT %ID, ArtSortenNr, DBSpezial_Getr_SD.Getrsorte_GetTextClass(%ID, Getreideart->Mandant, :Lang) As Text, 
    Getreideart, Kurzbezeichnung
    FROM DBSpezial_Getr_SD.Getrsorte as Stammdate 
    WHERE Getreideart->Mandant = :MandantOid AND ArtSortenNr LIKE :Nummer
    ORDER BY ArtSortenNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.GewichtRabattAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62256,49332.198366</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>GewichtRabattOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, CAST(Rabatt AS DEC) AS Rabatt,
CAST(element_key AS DEC) AS Gewicht
FROM DBSpezial_Getr_SD.GewichtRabatt_Rabatt
WHERE GewichtRabatt = :GewichtRabattOid
ORDER BY element_key</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.GewichtRabatt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.GewichtRabatt
WHERE Mandant = :MandantOid AND Nummer = :Nr
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeGesamt2">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.GewichtRabatt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.GewichtRabatt
WHERE Mandant = :MandantOid
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonGew:%Decimal,BisGew:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, CAST(Rabatt AS DEC) AS Grundgebuehr,
	CAST(element_key AS DEC) AS BisAnnahmegewicht,
	GewichtRabatt->Nummer AS Nr,
	DBSpezial_Getr_SD.GewichtRabatt_GetTextClass(GewichtRabatt->%ID, :MandantOid, :Lang) As Text,
	GewichtRabatt->Bemerkung AS Bemerkung
	FROM DBSpezial_Getr_SD.GewichtRabatt_Rabatt
	WHERE GewichtRabatt->Mandant = :MandantOid
	AND CAST(element_key AS DEC) >= :VonGew
	AND CAST(element_key AS DEC) <= :BisGew
	AND CAST(Rabatt AS DEC) > 0
	ORDER BY GewichtRabatt->Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.HektLiterZuschlagAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62227,49977.307236</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>GewichtOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, CAST(Tabelle AS DEC) AS ZuschlagAbzug, CAST(element_key AS DEC) AS Hektolitergewicht
FROM DBSpezial_Getr_SD.HektLiterZuschlag_Tabelle
WHERE HektLiterZuschlag = :GewichtOid
ORDER BY Hektolitergewicht</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.HektLiterZuschlag_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.HektLiterZuschlag
WHERE Mandant = :MandantOid AND PositionsNr = :Nr
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeGesamt2">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.HektLiterZuschlag_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.HektLiterZuschlag
WHERE Mandant = :MandantOid
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonHektoGew:%Decimal,BisHektoGew:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, CAST(Tabelle AS DEC) AS ZuschlagAbzug,
	CAST(element_key AS DEC) AS Hektolitergewicht,
	HektLiterZuschlag->PositionsNr AS Nr,
	DBSpezial_Getr_SD.HektLiterZuschlag_GetTextClass(HektLiterZuschlag->%ID, :MandantOid, :Lang) As Text,
	HektLiterZuschlag->Bemerkung AS Bemerking
	FROM DBSpezial_Getr_SD.HektLiterZuschlag_Tabelle
	WHERE HektLiterZuschlag->Mandant = :MandantOid
	AND CAST(element_key AS DEC) >= :VonHektoGew
	AND CAST(element_key AS DEC) <= :BisHektoGew
	AND CAST(Tabelle AS DEC) > 0
	ORDER BY HektLiterZuschlag->PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.LoserrabattAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62263,33217.357586</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.Loserrabatt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Loserrabatt
WHERE Mandant = :MandantOid
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeGesamtGrid">
<Type>%SQLQuery</Type>
<FormalSpec>GewichtOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID,
CAST(element_key AS DEC) AS Gewicht,
CAST(TRabatt_RabattFr AS DEC) AS RabattFr,
CAST(TRabatt_RabattProzent AS DEC) AS RabattProzent
FROM DBSpezial_Getr_SD.Loserrabatt_TRabatt
WHERE Loserrabatt = :GewichtOid
ORDER BY Loserrabatt</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.Loserrabatt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Loserrabatt
WHERE Mandant = :MandantOid AND Nummer = :Nummer
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonGew:%Decimal,BisGew:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, 
CAST(element_key AS DEC) AS BisGewicht,
CAST(TRabatt_RabattFr AS DEC) AS RabattFr,
CAST(TRabatt_RabattProzent AS DEC) AS RabattProzent,
Loserrabatt->Nummer AS Nummer,
DBSpezial_Getr_SD.Loserrabatt_GetTextClass(Loserrabatt->%ID, :MandantOid, :Lang) As Text,
Loserrabatt->Bemerkung AS Bemerkung
FROM DBSpezial_Getr_SD.Loserrabatt_TRabatt
WHERE Loserrabatt->Mandant = :MandantOid
AND CAST(element_key AS DEC) >= :VonGew
AND CAST(element_key AS DEC) <= :BisGew
AND CAST(TRabatt_RabattFr AS DEC) > 0
AND CAST(TRabatt_RabattProzent AS DEC) > 0
ORDER BY Loserrabatt->Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.MengenrabattAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62263,33062.322067</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.Mengenrabatt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Mengenrabatt
WHERE Mandant = :MandantOid
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeGesamtGrid">
<Type>%SQLQuery</Type>
<FormalSpec>GewichtOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID,
CAST(element_key AS DEC) AS Gewicht,
CAST(TRabatt_RabattFr AS DEC) AS RabattFr,
CAST(TRabatt_RabattProzent AS DEC) AS RabattProzent
FROM DBSpezial_Getr_SD.Mengenrabatt_TRabatt
WHERE Mengenrabatt = :GewichtOid
ORDER BY Mengenrabatt</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.Mengenrabatt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Mengenrabatt
WHERE Mandant = :MandantOid AND Nummer = :Nummer
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonGew:%Decimal,BisGew:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, 
CAST(element_key AS DEC) AS BisGewicht,
CAST(TRabatt_RabattFr AS DEC) AS RabattFr,
CAST(TRabatt_RabattProzent AS DEC) AS RabattProzent,
Mengenrabatt->Nummer AS Nummer,
DBSpezial_Getr_SD.Mengenrabatt_GetTextClass(Mengenrabatt->%ID, :MandantOid, :Lang) As Text,
Mengenrabatt->Bemerkung AS Bemerkung
FROM DBSpezial_Getr_SD.Mengenrabatt_TRabatt
WHERE Mengenrabatt->Mandant = :MandantOid
AND CAST(element_key AS DEC) >= :VonGew
AND CAST(element_key AS DEC) <= :BisGew
AND CAST(TRabatt_RabattFr AS DEC) > 0
AND CAST(TRabatt_RabattProzent AS DEC) > 0
ORDER BY Mengenrabatt->Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.PreiseTSAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62242,59345.736019</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>PreisTSOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, CAST(Tabelle AS DEC) AS Preis, CAST(element_key AS DEC) AS ProzentTS
FROM DBSpezial_Getr_SD.PreiseTS_Tabelle
WHERE PreiseTS = :PreisTSOid
ORDER BY ProzentTS</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.PreiseTS_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.PreiseTS
WHERE Mandant = :MandantOid AND PositionsNr = :Nr
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeGesamt2">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.PreiseTS_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.PreiseTS
WHERE Mandant = :MandantOid
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonTS:%Decimal,BisTS:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, CAST(Tabelle AS DEC) AS Preis,
	CAST(element_key AS DEC) AS ProzentTS,
	PreiseTS->PositionsNr AS Nr,
	DBSpezial_Getr_SD.PreiseTS_GetTextClass(PreiseTS->%ID, :MandantOid, :Lang) As Text,
	PreiseTS->Bemerkung AS Bemerkung
	FROM DBSpezial_Getr_SD.PreiseTS_Tabelle
	WHERE PreiseTS->Mandant = :MandantOid
	AND CAST(element_key AS DEC) >= :VonTS
	AND CAST(element_key AS DEC) <= :BisTS
	AND CAST(Tabelle AS DEC) > 0
	ORDER BY PreiseTS->PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.ProbergewAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62215,36943.388026</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>ProbergewOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, CAST(Tabelle AS DEC) AS Hektolitergewicht, CAST(element_key AS DEC) AS Probergewicht
FROM DBSpezial_Getr_SD.Probergew_Tabelle
WHERE Probergew = :ProbergewOid
ORDER BY Probergewicht</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.Probergew_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Probergew
WHERE Mandant = :MandantOid AND PositionsNr = :Nr
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeGesamt2">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Getr_SD.Probergew_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Probergew
WHERE Mandant = :MandantOid
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonProberGew:%Decimal,BisProberGew:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, CAST(Tabelle AS DEC) AS Hektolitergewicht,
	CAST(element_key AS DEC) AS Probergewicht,
	Probergew->PositionsNr AS Nr, DBSpezial_Getr_SD.Probergew_GetTextClass(Probergew->%ID, :MandantOid, :Lang) As Text,
	Probergew->Bemerkung AS Bemerking
	FROM DBSpezial_Getr_SD.Probergew_Tabelle
	WHERE Probergew->Mandant = :MandantOid
	AND CAST(element_key AS DEC) >= :VonProberGew
	AND CAST(element_key AS DEC) <= :BisProberGew
	AND CAST(Tabelle AS DEC) > 0
	ORDER BY Probergew->PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.RabattSumArtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62264,41298.27594</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Getr_SD.RabattSumArt_GetTextClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
	Mandant
	FROM DBSpezial_Getr_SD.RabattSumArt
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, ' ' As wert2,DBSpezial_Getr_SD.RabattSumArt_GetTextClass(%ID, :MandantOid, :Lang) As wert1, 
	Mandant
	FROM DBSpezial_Getr_SD.RabattSumArt as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.AF.SD.RabattgruppeAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62325,52673.75697</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.Rabattgruppe_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Rabattgruppe
WHERE Mandant = :MandantOid
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeGesamtGrid">
<Type>%SQLQuery</Type>
<FormalSpec>GewichtOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID,
CAST(element_key AS DEC) AS Gewicht,
CAST(TRabatt_RabattFr AS DEC) AS RabattFr,
CAST(TRabatt_RabattProzent AS DEC) AS RabattProzent
FROM DBSpezial_Getr_SD.Rabattgruppe_TRabatt
WHERE Rabattgruppe = :GewichtOid
ORDER BY Rabattgruppe</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nummer, DBSpezial_Getr_SD.Rabattgruppe_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Getr_SD.Rabattgruppe
WHERE Mandant = :MandantOid AND Nummer = :Nummer
ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonGew:%Decimal,BisGew:%Decimal</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, 
CAST(element_key AS DEC) AS BisGewicht,
CAST(TRabatt_RabattFr AS DEC) AS RabattFr,
CAST(TRabatt_RabattProzent AS DEC) AS RabattProzent,
Rabattgruppe->Nummer AS Nummer,
DBSpezial_Getr_SD.Rabattgruppe_GetTextClass(Rabattgruppe->%ID, :MandantOid, :Lang) As Text,
Rabattgruppe->Bemerkung AS Bemerkung
FROM DBSpezial_Getr_SD.Rabattgruppe_TRabatt
WHERE Rabattgruppe->Mandant = :MandantOid
AND CAST(element_key AS DEC) >= :VonGew
AND CAST(element_key AS DEC) <= :BisGew
AND CAST(TRabatt_RabattFr AS DEC) > 0
AND CAST(TRabatt_RabattProzent AS DEC) > 0
ORDER BY Rabattgruppe->Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Getr.Annahme">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57230.416119</TimeChanged>
<TimeCreated>62249,31701.199769</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="Getreidesorte">
<Type>DBSpezial.Getr.SD.Getrsorte</Type>
<Cardinality>one</Cardinality>
<Inverse>Annahme</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

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

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

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

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

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

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

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

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

<Property name="BestellPos">
<Type>DBAgrofreshEK.Bestellungspos</Type>
<Cardinality>many</Cardinality>
<Inverse>GetrAnnahme</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Musternummer">
<Type>%BigInt</Type>
</Property>

<Property name="Detail">
<Type>DBSpezial.Getr.AnnahmeDet</Type>
<Cardinality>children</Cardinality>
<Inverse>Annahme</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

<Method name="GetLagerortId">
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set myId = ..%Id()
	&sql(SELECT Lagerort INTO :id from DBAgrofreshEK.Bestellungspos WHERE GetrAnnahme = :myId AND Lagerort IS NOT NULL)
	if (SQLCODE '= 0) {
		QUIT ""
	} else {
		QUIT id	
	}
]]></Implementation>
</Method>

<Method name="DeleteDetails">
<ClassMethod>1</ClassMethod>
<FormalSpec>Oid:%String</FormalSpec>
<Implementation><![CDATA[	&sql(DELETE FROM DBSpezial_Getr.AnnahmeDet WHERE Annahme = :Oid)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Getr.AnnahmeD</DataLocation>
<DefaultData>AnnahmeDefaultData</DefaultData>
<IdLocation>^DBSpezial.Getr.AnnahmeD</IdLocation>
<IndexLocation>^DBSpezial.Getr.AnnahmeI</IndexLocation>
<StreamLocation>^DBSpezial.Getr.AnnahmeS</StreamLocation>
<Data name="AnnahmeDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Getreidesorte</Value>
</Value>
<Value name="3">
<Value>Fallzahl</Value>
</Value>
<Value name="4">
<Value>Propergewicht</Value>
</Value>
<Value name="5">
<Value>FeuchtigkeitProzent</Value>
</Value>
<Value name="6">
<Value>Eingangsgewicht</Value>
</Value>
<Value name="7">
<Value>AbzugAuswuchs</Value>
</Value>
<Value name="8">
<Value>HLGewicht</Value>
</Value>
<Value name="9">
<Value>GewichtsverlustProzent</Value>
</Value>
<Value name="10">
<Value>Grundpreis</Value>
</Value>
<Value name="11">
<Value>Grundgebuehr</Value>
</Value>
<Value name="12">
<Value>ZuschlagHLGewicht</Value>
</Value>
<Value name="13">
<Value>Trocknungskosten</Value>
</Value>
<Value name="14">
<Value>Ruecknahme</Value>
</Value>
<Value name="15">
<Value>Produzentenlager</Value>
</Value>
<Value name="16">
<Value>Musternummer</Value>
</Value>
<Value name="17">
<Value>Trocknungsverlust</Value>
</Value>
<Value name="18">
<Value>Rueckbehalt</Value>
</Value>
<Value name="19">
<Value>RabattGrundgebuehr</Value>
</Value>
</Data>
<Property name="AbzugAuswuchs"/>
<Property name="Eingangsgewicht"/>
<Property name="Fallzahl"/>
<Property name="FeuchtigkeitProzent"/>
<Property name="Getreidesorte"/>
<Property name="GewichtsverlustProzent"/>
<Property name="Grundgebuehr"/>
<Property name="Grundpreis"/>
<Property name="HLGewicht"/>
<Property name="Musternummer"/>
<Property name="Produzentenlager"/>
<Property name="Propergewicht"/>
<Property name="RabattGrundgebuehr"/>
<Property name="Rueckbehalt"/>
<Property name="Ruecknahme"/>
<Property name="Trocknungskosten"/>
<Property name="Trocknungsverlust"/>
<Property name="ZuschlagHLGewicht"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.AnnahmeDet">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57288.450709</TimeChanged>
<TimeCreated>62259,51868.842441</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="Annahme">
<Type>DBSpezial.Getr.Annahme</Type>
<Cardinality>parent</Cardinality>
<Inverse>Detail</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

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

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

<Property name="AbzugEinheit">
<Type>%String</Type>
<Parameter name="MAXLEN" value="20"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Abzug">
<Type>DBSpezial.Getr.SD.Abzug</Type>
<Cardinality>one</Cardinality>
<Inverse>AnnahmeDet</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Detail")</DataLocation>
<DefaultData>AnnahmeDetDefaultData</DefaultData>
<IdLocation>^DBSpezial.Getr.AnnahmeC("Detail")</IdLocation>
<IndexLocation>^DBSpezial.Getr.AnnahmeDetI</IndexLocation>
<StreamLocation>^DBSpezial.Getr.AnnahmeDetS</StreamLocation>
<Data name="AnnahmeDetDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Text</Value>
</Value>
<Value name="4">
<Value>Abzugsart</Value>
</Value>
<Value name="5">
<Value>Menge</Value>
</Value>
<Value name="6">
<Value>Prozent</Value>
</Value>
<Value name="7">
<Value>AbzugMenge</Value>
</Value>
<Value name="8">
<Value>Einheit</Value>
</Value>
<Value name="9">
<Value>AbzugEinheit</Value>
</Value>
<Value name="10">
<Value>Abzug</Value>
</Value>
<Value name="11">
<Value>Text2</Value>
</Value>
</Data>
<Property name="Abzug"/>
<Property name="AbzugEinheit"/>
<Property name="AbzugMenge"/>
<Property name="Abzugsart"/>
<Property name="Annahme"/>
<Property name="Einheit"/>
<Property name="Menge"/>
<Property name="PositionsNr"/>
<Property name="Prozent"/>
<Property name="Text"/>
<Property name="Text2"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Abholrabatt">
<Description>
</Description>
<Super>DBSpezial.Getr.SD.Rabatt,%XML.Adaptor</Super>
<TimeChanged>62264,51671.704198</TimeChanged>
<TimeCreated>62262,34111.519241</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="Artikel">
<Type>DBAgrofresh.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>MuehleAbholrabatt</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetNextFreeCode">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set code = 0
	&sql(SELECT TOP 1 Nummer INTO :code FROM DBSpezial_Getr_SD.Abholrabatt
	     WHERE Mandant = :MandantOid ORDER BY Nummer DESC)
	set code = code + 1	     
	Quit code
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Abzug">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57230.58211</TimeChanged>
<TimeCreated>62242,61804.225457</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</Description>
<Type>%Integer</Type>
</Property>

<Property name="Text">
<Description>
Text</Description>
<Type>%String</Type>
<Collection>array</Collection>
<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="MandantNrIdx">
<Properties>Mandant,PositionsNr</Properties>
</Index>

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

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

<Property name="GetrartAbzug">
<Type>DBSpezial.Getr.SD.GetrartAbzug</Type>
<Cardinality>many</Cardinality>
<Inverse>Abzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Artikel">
<Type>DBAgrofresh.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>GetrAbzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="AnnahmeDet">
<Type>DBSpezial.Getr.AnnahmeDet</Type>
<Cardinality>many</Cardinality>
<Inverse>Abzug</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Getr.SD.Abzug).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

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

<Method name="GetText2Class">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Getr.SD.Abzug).%OpenId(myID)
		set text = rs.GetText2(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByPosNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.Abzug
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Getr.SD.AbzugD</DataLocation>
<DefaultData>AbzugDefaultData</DefaultData>
<IdLocation>^DBSpezial.Getr.SD.AbzugD</IdLocation>
<IndexLocation>^DBSpezial.Getr.SD.AbzugI</IndexLocation>
<StreamLocation>^DBSpezial.Getr.SD.AbzugS</StreamLocation>
<Data name="AbzugDefaultData">
<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>
<Value name="4">
<Value>Typ</Value>
</Value>
<Value name="5">
<Value>ProzentBesatz</Value>
</Value>
<Value name="6">
<Value>BetragMutierbar</Value>
</Value>
<Value name="7">
<Value>AbzugEinheit</Value>
</Value>
<Value name="8">
<Value>Abzugsart</Value>
</Value>
<Value name="9">
<Value>Einheit</Value>
</Value>
<Value name="10">
<Value>Druckbereich</Value>
</Value>
<Value name="11">
<Value>Konto</Value>
</Value>
<Value name="12">
<Value>Artikel</Value>
</Value>
<Value name="13">
<Value>DruckFett</Value>
</Value>
<Value name="14">
<Value>DruckGroesse</Value>
</Value>
<Value name="15">
<Value>DruckVorschub</Value>
</Value>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Data name="Text2">
<Attribute>Text2</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text2"</Subscript>
</Data>
<Property name="AbzugEinheit"/>
<Property name="Abzugsart"/>
<Property name="Artikel"/>
<Property name="BetragMutierbar"/>
<Property name="DruckFett"/>
<Property name="DruckGroesse"/>
<Property name="DruckVorschub"/>
<Property name="Druckbereich"/>
<Property name="Einheit"/>
<Property name="Konto"/>
<Property name="Mandant"/>
<Property name="PositionsNr"/>
<Property name="Typ"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.COFeuchte">
<Super>%SerialObject</Super>
<TimeChanged>62214,38062.036112</TimeChanged>
<TimeCreated>62214,38061.681017</TimeCreated>

<Property name="Feuchtigkeit">
<Description>
Feuchtigkeit in Prozent</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Trocknungsverlust">
<Description>
Trocknungsverlust in Prozent</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Trocknungskosten">
<Description>
Trocknungskosten in Fr je 100 kg</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<State>COFeuchteState</State>
<StreamLocation>^DBSpezial.Getr.SD.COFeuchteS</StreamLocation>
<Data name="COFeuchteState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>Feuchtigkeit</Value>
</Value>
<Value name="2">
<Value>Trocknungsverlust</Value>
</Value>
<Value name="3">
<Value>Trocknungskosten</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.CORabatt">
<Super>%SerialObject</Super>
<TimeChanged>62262,33360.416573</TimeChanged>
<TimeCreated>62262,32248.845141</TimeCreated>

<Property name="RabattFr">
<Description>
Rabatt in Fr</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="RabattProzent">
<Description>
Rabatt in Prozent</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Storage name="Default">
<Type>%Library.CacheSerialState</Type>
<State>CORabattState</State>
<StreamLocation>^DBSpezial.Getr.SD.CORabattS</StreamLocation>
<Data name="CORabattState">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>Gewicht</Value>
</Value>
<Value name="2">
<Value>RabattFr</Value>
</Value>
<Value name="3">
<Value>RabattProzent</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Feuchtigkeit">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57288.57824</TimeChanged>
<TimeCreated>62214,37155.020439</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</Description>
<Type>%Integer</Type>
</Property>

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

<Property name="Bemerkung">
<Type>%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="BereichFeuchtigkeitVon">
<Description>
BereichFeuchtigkeitVon</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

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

<Property name="Zwischenschritte">
<Description>
Grösse der Zwischenschritte</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Tabelle">
<Description>
Probergew zuordnungstabelle, Prober in G als Index und Hektorlitergewicht als Value</Description>
<Type>DBSpezial.Getr.SD.COFeuchte</Type>
<Collection>array</Collection>
</Property>

<Property name="GetreideArt">
<Type>DBSpezial.Getr.SD.Getrart</Type>
<Cardinality>many</Cardinality>
<Inverse>Feuchtigkeit</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Getr.SD.Feuchtigkeit).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByPosNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.Feuchtigkeit
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>HilfstextOid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
	set obj = ##class(DBSpezial.Getr.SD.Feuchtigkeit).%OpenId(HilfstextOid)
	if (obj '= "") {
		set val = obj.Text.GetAt(Lang)
		if (val '= "") {
			Do ##class(DBUtils.StringUtils).SetText(obj.Text, "", Lang, obj.Mandant)
			do obj.%Save()
		}
	}
]]></Implementation>
</Method>

<Method name="GetFeuchte">
<FormalSpec>Feuchtigkeit:%Decimal</FormalSpec>
<ReturnType>DBSpezial.Getr.SD.COFeuchte</ReturnType>
<Implementation><![CDATA[
	if (+Feuchtigkeit = 0) {
		Quit 0
	} 
	quit ..Tabelle.GetAt(Feuchtigkeit)
]]></Implementation>
</Method>

<Method name="GetNextFeuchte">
<FormalSpec>Feuchtigkeit:%Decimal</FormalSpec>
<ReturnType>DBSpezial.Getr.SD.COFeuchte</ReturnType>
<Implementation><![CDATA[
	set fid = 0
	set id = ..%Id()
	&sql(SELECT TOP 1 element_key into :fid FROM DBSpezial_Getr_SD.Feuchtigkeit_Tabelle WHERE Feuchtigkeit = :id AND element_key < :Feuchtigkeit ORDER BY element_key DESC)
	Quit:(SQLCODE '= 0) ""
	Quit:(..Tabelle.IsDefined(fid) = 0) ""
	quit ..Tabelle.GetAt(fid)
]]></Implementation>
</Method>

<Method name="SetFeuchte">
<FormalSpec>Feuchtigkeit:%Decimal,value:DBSpezial.Getr.SD.COFeuchte</FormalSpec>
<Implementation><![CDATA[	d ..Tabelle.SetAt(value, Feuchtigkeit)
]]></Implementation>
</Method>

<Method name="DeleteById">
<ClassMethod>1</ClassMethod>
<FormalSpec>FeuchtigkeitOid:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.Feuchtigkeit_Tabelle
		WHERE ID = :FeuchtigkeitOid)
]]></Implementation>
</Method>

<Method name="DeleteAllById">
<ClassMethod>1</ClassMethod>
<FormalSpec>FeuchtigkeitOid:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.Feuchtigkeit_Tabelle
		WHERE Feuchtigkeit = :FeuchtigkeitOid)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.GetF340.FeuchtigkeitD</DataLocation>
<DefaultData>FeuchtigkeitDefaultData</DefaultData>
<IdLocation>^DBSpezial.GetF340.FeuchtigkeitD</IdLocation>
<IndexLocation>^DBSpezial.GetF340.FeuchtigkeitI</IndexLocation>
<StreamLocation>^DBSpezial.GetF340.FeuchtigkeitS</StreamLocation>
<Data name="FeuchtigkeitDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Bemerkung</Value>
</Value>
<Value name="4">
<Value>Mandant</Value>
</Value>
<Value name="5">
<Value>BereichFeuchtigkeitVon</Value>
</Value>
<Value name="6">
<Value>BereichFeuchtigkeitBis</Value>
</Value>
<Value name="7">
<Value>Zwischenschritte</Value>
</Value>
</Data>
<Data name="Tabelle">
<Attribute>Tabelle</Attribute>
<Structure>subnode</Structure>
<Subscript>"Tabelle"</Subscript>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="Bemerkung"/>
<Property name="BereichFeuchtigkeitBis"/>
<Property name="BereichFeuchtigkeitVon"/>
<Property name="Mandant"/>
<Property name="PositionsNr"/>
<Property name="Zwischenschritte"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Getrart">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57288.725442</TimeChanged>
<TimeCreated>62214,30899.42742</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</Description>
<Type>%Integer</Type>
</Property>

<Property name="Text">
<Description>
Text</Description>
<Type>%String</Type>
<Collection>array</Collection>
<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="Hektorlitergewicht">
<Type>DBSpezial.Getr.SD.HektLiterZuschlag</Type>
<Cardinality>one</Cardinality>
<Inverse>GetreideArt</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Feuchtigkeit">
<Type>DBSpezial.Getr.SD.Feuchtigkeit</Type>
<Cardinality>one</Cardinality>
<Inverse>GetreideArt</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Probergewicht">
<Type>DBSpezial.Getr.SD.Probergew</Type>
<Cardinality>one</Cardinality>
<Inverse>GetreideArt</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Sorte">
<Type>DBSpezial.Getr.SD.Getrsorte</Type>
<Cardinality>children</Cardinality>
<Inverse>Getreideart</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Property name="Fusstext">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="GetrartAbzug">
<Type>DBSpezial.Getr.SD.GetrartAbzug</Type>
<Cardinality>many</Cardinality>
<Inverse>Getreideart</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="GewichtRabatt">
<Type>DBSpezial.Getr.SD.GewichtRabatt</Type>
<Cardinality>one</Cardinality>
<Inverse>Getreideart</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Abrechnungstyp">
<Type>DBAgrofreshEK.SD.Abrechnungstyp</Type>
<Cardinality>one</Cardinality>
<Inverse>Getreideart</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Getr.SD.Getrart).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByPosNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.Getrart
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>Oid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
	set obj = ##class(DBSpezial.Getr.SD.Getrart).%OpenId(Oid)
	if (obj '= "") {
		set val = obj.Text.GetAt(Lang)
		if (val '= "") {
			Do ##class(DBUtils.StringUtils).SetText(obj.Text, "", Lang, obj.Mandant)
			do obj.%Save()
		}
	}
]]></Implementation>
</Method>

<Method name="GetPosNrById">
<ClassMethod>1</ClassMethod>
<FormalSpec>Oid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set obj = ##class(DBSpezial.Getr.SD.Getrart).%OpenId(HilfstextOid)
	if (obj '= "") {
		QUIT obj.PositionsNr
	}
	set obj = ""
	QUIT 0
]]></Implementation>
</Method>

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

	set id = ""
	&sql(SELECT Hektorlitergewicht INTO :id FROM DBSpezial_Getr_SD.Getrart
		 WHERE Mandant = :MandantOid AND Hektorlitergewicht = :HektOid)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

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

	set id = ""
	&sql(SELECT Probergewicht INTO :id FROM DBSpezial_Getr_SD.Getrart
		 WHERE Mandant = :MandantOid AND Probergewicht = :ProberOid)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Getr.SD.GetrartD</DataLocation>
<DefaultData>GetrartDefaultData</DefaultData>
<IdLocation>^DBSpezial.Getr.SD.GetrartD</IdLocation>
<IndexLocation>^DBSpezial.Getr.SD.GetrartI</IndexLocation>
<StreamLocation>^DBSpezial.Getr.SD.GetrartS</StreamLocation>
<Data name="GetrartDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Mandant</Value>
</Value>
<Value name="4">
<Value>Hektorlitergewicht</Value>
</Value>
<Value name="5">
<Value>Feuchtigkeit</Value>
</Value>
<Value name="6">
<Value>Probergewicht</Value>
</Value>
<Value name="7">
<Value>Abrechnungsart</Value>
</Value>
<Value name="8">
<Value>Fusstext</Value>
</Value>
<Value name="9">
<Value>RabattGrundG</Value>
</Value>
<Value name="10">
<Value>GewichtRabatt</Value>
</Value>
<Value name="11">
<Value>Abrechnungstyp</Value>
</Value>
<Value name="12">
<Value>Grundgebühr</Value>
</Value>
<Value name="13">
<Value>Rueckbehalt</Value>
</Value>
<Value name="14">
<Value>NachzahlungRueckbehalt</Value>
</Value>
<Value name="15">
<Value>Grundgebuehr</Value>
</Value>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="Abrechnungsart"/>
<Property name="Abrechnungstyp"/>
<Property name="Feuchtigkeit"/>
<Property name="Fusstext"/>
<Property name="GewichtRabatt"/>
<Property name="Grundgebuehr"/>
<Property name="Hektorlitergewicht"/>
<Property name="Mandant"/>
<Property name="NachzahlungRueckbehalt"/>
<Property name="PositionsNr"/>
<Property name="Probergewicht"/>
<Property name="RabattGrundG"/>
<Property name="Rueckbehalt"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.GetrartAbzug">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57230.758745</TimeChanged>
<TimeCreated>62248,53059.991577</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="Abzug">
<Type>DBSpezial.Getr.SD.Abzug</Type>
<Cardinality>one</Cardinality>
<Inverse>GetrartAbzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Getreideart">
<Type>DBSpezial.Getr.SD.Getrart</Type>
<Cardinality>one</Cardinality>
<Inverse>GetrartAbzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="GetreideartIndex">
<Properties>Getreideart</Properties>
</Index>

<Index name="GetrartAbzugIndex">
<Properties>Getreideart,Abzug</Properties>
</Index>

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.GetF340.GetrartAbzugD</DataLocation>
<DefaultData>GetrartAbzugDefaultData</DefaultData>
<IdLocation>^DBSpezial.GetF340.GetrartAbzugD</IdLocation>
<IndexLocation>^DBSpezial.GetF340.GetrartAbzugI</IndexLocation>
<StreamLocation>^DBSpezial.GetF340.GetrartAbzugS</StreamLocation>
<Data name="GetrartAbzugDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Abzug</Value>
</Value>
<Value name="3">
<Value>Getreideart</Value>
</Value>
<Value name="4">
<Value>MengeBetrag</Value>
</Value>
</Data>
<Property name="Abzug"/>
<Property name="Getreideart"/>
<Property name="MengeBetrag"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Getrsorte">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57332.689805</TimeChanged>
<TimeCreated>62214,31246.34408</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</Description>
<Type>%Integer</Type>
</Property>

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

<Property name="Getreideart">
<Type>DBSpezial.Getr.SD.Getrart</Type>
<Cardinality>parent</Cardinality>
<Inverse>Sorte</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Produktionsart">
<Type>DBAgrofresh.SD.Produktionsart</Type>
<Cardinality>one</Cardinality>
<Inverse>Getreidesorte</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="FutterSorte">
<Type>DBSpezial.Getr.SD.Getrsorte</Type>
<Cardinality>one</Cardinality>
<Inverse>AlternativSorte</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="AlternativSorte">
<Type>DBSpezial.Getr.SD.Getrsorte</Type>
<Cardinality>many</Cardinality>
<Inverse>FutterSorte</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

<Property name="ArtikelLager">
<Type>DBAgrofresh.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>GetreideArtikelLager</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="PreistabelleTS">
<Type>DBSpezial.Getr.SD.PreiseTS</Type>
<Cardinality>one</Cardinality>
<Inverse>GetreideSorte</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

<Property name="Annahme">
<Type>DBSpezial.Getr.Annahme</Type>
<Cardinality>many</Cardinality>
<Inverse>Getreidesorte</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

<Property name="ArtSortenNr">
<Type>%String</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {ArtSortenNr}=##class(DBSpezial.Getr.SD.Getrsorte).GetArtSorteNr({GetreideArtNr},{PositionsNr}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
</Property>

<Index name="ArtSortenNrIdx">
<Data>%%ID,GetreideArtNr,PositionsNr,ArtSortenNr,Getreideart,Kurzbezeichnung</Data>
<Properties>Mandant,ArtSortenNr</Properties>
</Index>

<Index name="KurzbezIndex">
<Data>%%ID,GetreideArtNr,PositionsNr,ArtSortenNr,Getreideart,Kurzbezeichnung</Data>
<Properties>Mandant:Exact,Kurzbezeichnung:Exact</Properties>
</Index>

<Property name="VorschlagLagerort">
<Type>DBAgrofresh.SD.Lagerort</Type>
<Cardinality>one</Cardinality>
<Inverse>GetrSorteLagerort</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Getr.SD.Getrsorte).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByPosNrOnArt">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.Getrsorte
		 WHERE Getreideart = :ArtOid AND PositionsNr = :PosNr)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByKurzbezOnArt">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtOid:%String,Kurzbez:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.Getrsorte
		 WHERE Getreideart = :ArtOid AND Kurzbezeichnung LIKE :Kurzbez)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>HilfstextOid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
	set obj = ##class(DBSpezial.Getr.SD.Getrsorte).%OpenId(HilfstextOid)
	if (obj '= "") {
		set val = obj.Text.GetAt(Lang)
		if (val '= "") {
			Do ##class(DBUtils.StringUtils).SetText(obj.Text, "", Lang, obj.Mandant)
			do obj.%Save()
		}
	}
]]></Implementation>
</Method>

<Method name="GetArtSorteNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>GetrArtNr:%Integer,SortenNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set retval = ""
	if (GetrArtNr < 10) {
		set retval = "0"
	}
	set retval = retval_GetrArtNr_"-"
	
	if (SortenNr < 10) {
		set retval = retval_"0"
	}
	set retval = retval_SortenNr
	quit retval
]]></Implementation>
</Method>

<Method name="%OnBeforeSave">
<FormalSpec>Insert:%Boolean</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	w "SAVE1",!
	set ..Mandant = ..Getreideart.Mandant
	set ..GetreideArtNr = ..Getreideart.PositionsNr
	

	w "SAVE:"_..Getreideart.Mandant_..Getreideart.PositionsNr,!
	
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="MoveFirstOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
    set list = $ListBuild()
    set MandantOid = " "_MandantOid
    set grp = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,""),1)
    if (grp '= ""){
       set pid = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,grp,""),1)
       set cid = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,grp,pid,""),1)
       set list = $Get(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,grp,pid,cid))
    } else {
       Quit ""  
    }
    w "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 grp = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,""),-1)
    if (grp '= ""){
       set pid = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,grp,""),-1)
       set cid = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,grp,pid,""),-1)
       set list = $Get(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,grp,pid,cid))
    } else {
       Quit ""  
    }
    Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,ArtSortNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
    set list = $ListBuild()
    set MandantOid = " "_MandantOid
    set ArtSortNr = " "_ArtSortNr
    set nextNr = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,ArtSortNr))
    if (nextNr '= "") {
       set pid = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,nextNr,""),1)
       set cid = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,nextNr,pid,""),1)
       set list = $Get(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,nextNr,pid,cid))
    } else {
       set list = ##class(DBSpezial.Getr.SD.Getrsorte).MoveLastOnNr(MandantOid)
    }
    
    Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,ArtSortNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
	set ArtSortNr = " "_ArtSortNr
	set nextNr = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,ArtSortNr),-1)
	if (nextNr '= "") {
	   set pid = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,nextNr,""),-1)
	   set cid = $Order(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,nextNr,pid,""),-1)
	   set list = $Get(^DBSpezial.Getr.SD.GetrsorteI("ArtSortenNrIdx",MandantOid,nextNr,pid,cid))

	} else {
	   set list = ##class(DBSpezial.Getr.SD.Getrsorte).MoveFirstOnNr(MandantOid)
	}

	Quit list
]]></Implementation>
</Method>

<Method name="MoveFirstOnKurzbez">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
	set grp = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,""),1)
	if (grp '= "") {
	   set pid = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,grp,""),1)
	   set cid = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,grp,pid,""),1)
	   set list = $Get(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,grp,pid,cid))
	} else {
	   Quit ""
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveLastOnKurzbez">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
	set grp = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,""),-1)
	if (grp '= "") {
	   set pid = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,grp,""),-1)
	   set cid = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,grp,pid,""),-1)
	   set list = $Get(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,grp,pid,cid))
	} else {
	   Quit ""
	}

	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnKurzbez">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Kurzbez:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
	set nextNr = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,Kurzbez))
	if (nextNr '= "") {
		 set pid = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,nextNr,""),1)
		 set cid = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,nextNr,pid,""),1)
		 set list = $Get(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,nextNr,pid,cid))
	} else {
		 set list = ##class(DBSpezial.Getr.SD.Getrsorte).MoveLastOnKurzbez(MandantOid)
	}

	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnKurzbez">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Kurzbez:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
	set nextNr = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,Kurzbez),-1)
	if (nextNr '= "") {
       set pid = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,nextNr,""),-1)
       set cid = $Order(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,nextNr,pid,""),-1)
       set list = $Get(^DBSpezial.Getr.SD.GetrsorteI("KurzbezIndex",MandantOid,nextNr,pid,cid))
	} else {
       set list = ##class(DBSpezial.Getr.SD.Getrsorte).MoveFirstOnKurzbez(MandantOid)
	}

	Quit list
]]></Implementation>
</Method>

<Method name="GetIdByKurzbez">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Kurzbez:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set bez = Kurzbez_"%"
	&sql(SELECT TOP 1 ID INTO :id 
		 FROM DBIntrap_SD.Projekt 
		 WHERE Mandant = :MandantOid
		 AND Kurzbezeichnung LIKE :bez)
	
	if (id '= "") {
		Quit id
		
		// keine Daten gefunden
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

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

	set id = ""
	&sql(SELECT PreistabelleTS INTO :id FROM DBSpezial_Getr_SD.Getrsorte
		 WHERE Mandant = :MandantOid AND PreistabelleTS = :TSOid)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="CopyGetrsorte">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String,dstNr:%Integer,dstBez:%String,dstKurzBez:%String,mandOid:%String,sprache:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    Set srcSorte = ##class(DBSpezial.Getr.SD.Getrsorte).%OpenId(oid)
    Set newObj = srcSorte.%ConstructClone(-1)
    Set newObj.Getreideart = srcSorte.Getreideart
    Set newObj.PositionsNr = dstNr
    Set newObj.Kurzbezeichnung = dstKurzBez
    if ((mandOid '= "") && (mandOid '= $c(0))) {
    	set newObj.Mandant = mandOid
    }
    DO newObj.SetText(mandOid, sprache, dstBez)
   	w newObj.%Save()
    set srcSorte = ""
    set id = newObj.%Id()
    set newObj = ""
    Quit id
]]></Implementation>
</Method>

<Method name="DeleteSorteId">
<ClassMethod>1</ClassMethod>
<FormalSpec>Id:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.Getrsorte
		WHERE ID = :Id)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Sorte")</DataLocation>
<DefaultData>GetrsorteDefaultData</DefaultData>
<IdLocation>^DBSpezial.Getr.SD.GetrartC("Sorte")</IdLocation>
<IndexLocation>^DBSpezial.Getr.SD.GetrsorteI</IndexLocation>
<StreamLocation>^DBSpezial.Getr.SD.GetrsorteS</StreamLocation>
<Data name="GetrsorteDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Produktionsart</Value>
</Value>
<Value name="4">
<Value>FutterSorte</Value>
</Value>
<Value name="5">
<Value>Kurzbezeichnung</Value>
</Value>
<Value name="6">
<Value>Grundpreis</Value>
</Value>
<Value name="7">
<Value>Rueckbehalt</Value>
</Value>
<Value name="8">
<Value>NachzahlungRueckbehalt</Value>
</Value>
<Value name="9">
<Value>UnteresHLGewicht</Value>
</Value>
<Value name="10">
<Value>UnterFallzahlIPS</Value>
</Value>
<Value name="11">
<Value>ArtikelLager</Value>
</Value>
<Value name="12">
<Value>PreistabelleTS</Value>
</Value>
<Value name="13">
<Value>FallzahlPreisabzug</Value>
</Value>
<Value name="14">
<Value>FallzahlProzentabzug</Value>
</Value>
<Value name="15">
<Value>Preisabzug</Value>
</Value>
<Value name="16">
<Value>Prozentabzug</Value>
</Value>
<Value name="17">
<Value>ProzentSchwund</Value>
</Value>
<Value name="18">
<Value>FallzahlFuttergetreide</Value>
</Value>
<Value name="19">
<Value>Mandant</Value>
</Value>
<Value name="20">
<Value>GetreideArtNr</Value>
</Value>
<Value name="21">
<Value>VorschlagLagerort</Value>
</Value>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="ArtSortenNr"/>
<Property name="ArtikelLager"/>
<Property name="FallzahlFuttergetreide"/>
<Property name="FallzahlPreisabzug"/>
<Property name="FallzahlProzentabzug"/>
<Property name="FutterSorte"/>
<Property name="GetreideArtNr"/>
<Property name="Getreideart"/>
<Property name="Grundpreis"/>
<Property name="Kurzbezeichnung"/>
<Property name="Mandant"/>
<Property name="NachzahlungRueckbehalt"/>
<Property name="PositionsNr"/>
<Property name="Preisabzug"/>
<Property name="PreistabelleTS"/>
<Property name="Produktionsart"/>
<Property name="ProzentSchwund"/>
<Property name="Prozentabzug"/>
<Property name="Rueckbehalt"/>
<Property name="UnterFallzahlIPS"/>
<Property name="UnteresHLGewicht"/>
<Property name="VorschlagLagerort"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.GewichtRabatt">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57288.874151</TimeChanged>
<TimeCreated>62256,49375.134522</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">
<Description>
Nummer</Description>
<Type>%Integer</Type>
</Property>

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

<Property name="Bemerkung">
<Type>%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="Rabatt">
<Description>
RabattGrundG zuordnungstabelle</Description>
<Type>%Decimal</Type>
<Collection>array</Collection>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Getreideart">
<Type>DBSpezial.Getr.SD.Getrart</Type>
<Cardinality>many</Cardinality>
<Inverse>GewichtRabatt</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
    set text = ""
    if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
                   Set rs=##Class(DBSpezial.Getr.SD.GewichtRabatt).%OpenId(myID)
                   set text = rs.GetText(MandOid, Lang)
    }
    Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    set id = ""
    &sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.GewichtRabatt
                    WHERE Mandant = :MandantOid AND Nummer = :Nummer)
    Quit:(SQLCODE '= 0) ""
    Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>HilfstextOid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
    set obj = ##class(DBSpezial.Getr.SD.GewichtRabatt).%OpenId(HilfstextOid)
    if (obj '= "") {
       set val = obj.Text.GetAt(Lang)
       if (val '= "") {
           Do ##class(DBUtils.StringUtils).SetText(obj.Text, "", Lang, obj.Mandant)
           do obj.%Save()
       }
    }
]]></Implementation>
</Method>

<Method name="GetBisAnnahmegew">
<FormalSpec>Gewicht:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
    if (+Gewicht = 0) {
                   Quit 0
    } 
    quit ..Rabatt.GetAt(Gewicht)
]]></Implementation>
</Method>

<Method name="SetBisAnnahmegew">
<FormalSpec>Gewicht:%Decimal,value:%Decimal</FormalSpec>
<Implementation><![CDATA[    d ..Rabatt.SetAt(value, Gewicht)
]]></Implementation>
</Method>

<Method name="GetBisAnnahmegewClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>ID:%String,gewicht:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
    set rabatt = 0
    set maxGewicht = 0
    &sql(SELECT MAX(element_key) into :maxGewicht FROM DBSpezial_Getr_SD.GewichtRabatt_Rabatt WHERE GewichtRabatt = :ID)
    if (maxGewicht < gewicht) {
		set gewicht =  maxGewicht
    }    
    &sql(SELECT TOP 1 Rabatt into :rabatt FROM DBSpezial_Getr_SD.GewichtRabatt_Rabatt WHERE GewichtRabatt = :ID AND element_key >= :gewicht ORDER BY element_key ASC)
    quit:(SQLCODE '= 0) 0    
    quit rabatt
]]></Implementation>
</Method>

<Method name="DeleteById">
<ClassMethod>1</ClassMethod>
<FormalSpec>Oid:%String</FormalSpec>
<Implementation><![CDATA[
                &sql(DELETE FROM DBSpezial_Getr_SD.GewichtRabatt_Rabatt
                                WHERE ID = :Oid)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.GeF340.GewichtRabattD</DataLocation>
<DefaultData>GewichtRabattDefaultData</DefaultData>
<IdLocation>^DBSpezial.GeF340.GewichtRabattD</IdLocation>
<IndexLocation>^DBSpezial.GeF340.GewichtRabattI</IndexLocation>
<StreamLocation>^DBSpezial.GeF340.GewichtRabattS</StreamLocation>
<Data name="GewichtRabattDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Bemerkung</Value>
</Value>
<Value name="4">
<Value>Mandant</Value>
</Value>
</Data>
<Data name="Rabatt">
<Attribute>Rabatt</Attribute>
<Structure>subnode</Structure>
<Subscript>"Rabatt"</Subscript>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="Bemerkung"/>
<Property name="Mandant"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.HektLiterZuschlag">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57289.001251</TimeChanged>
<TimeCreated>62214,39089.387063</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</Description>
<Type>%Integer</Type>
</Property>

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

<Property name="Bemerkung">
<Type>%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="BereichGrammVon">
<Description>
BereichGrammVon</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

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

<Property name="Zwischenschritte">
<Description>
Grösse der Zwischenschritte</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Tabelle">
<Description>
HektLiterZuschlag zuordnungstabelle, Prober in G als Index und Hektorlitergewicht als Value</Description>
<Type>%Decimal</Type>
<Collection>array</Collection>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="GetreideArt">
<Type>DBSpezial.Getr.SD.Getrart</Type>
<Cardinality>many</Cardinality>
<Inverse>Hektorlitergewicht</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetHektLiterZuschlag">
<FormalSpec>Gewicht:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
	if (+Gewicht = 0) {
		Quit 0
	} 
	quit ..Tabelle.GetAt(Gewicht)
]]></Implementation>
</Method>

<Method name="SetHektLiterZuschlag">
<FormalSpec>Gewicht:%Decimal,value:%Decimal</FormalSpec>
<Implementation><![CDATA[	d ..Tabelle.SetAt(value, Gewicht)
]]></Implementation>
</Method>

<Method name="GetHektLiterZuschlagClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>ID:%String,Gewicht:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
	set zuschalg = 0
	&sql(SELECT TOP 1 Tabelle into :zuschalg FROM DBSpezial_Getr_SD.HektLiterZuschlag_Tabelle WHERE HektLiterZuschlag = :ID AND element_key < :Gewicht ORDER BY element_key DESC)
	quit:(SQLCODE '= 0) 0
	quit zuschalg
]]></Implementation>
</Method>

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Getr.SD.HektLiterZuschlag).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByPosNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.HektLiterZuschlag
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>HilfstextOid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
	set obj = ##class(DBSpezial.Getr.SD.HektLiterZuschlag).%OpenId(HilfstextOid)
	if (obj '= "") {
		set val = obj.Text.GetAt(Lang)
		if (val '= "") {
			Do ##class(DBUtils.StringUtils).SetText(obj.Text, "", Lang, obj.Mandant)
			do obj.%Save()
		}
	}
]]></Implementation>
</Method>

<Method name="DeleteById">
<ClassMethod>1</ClassMethod>
<FormalSpec>GewichtOid:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.HektLiterZuschlag_Tabelle
		WHERE ID = :GewichtOid)
]]></Implementation>
</Method>

<Method name="CopyHektolitergewichte">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String,dstNr:%Integer,dstBez:%String,mandOid:%String,sprache:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    Set srcHektolitergewichte = ##class(DBSpezial.Getr.SD.HektLiterZuschlag).%OpenId(oid)
    Set newObj = srcHektolitergewichte.%ConstructClone(-1)
    Set newObj.PositionsNr = dstNr
    if ((mandOid '= "") && (mandOid '= $c(0))) {
       set newObj.Mandant = mandOid
    }
    DO newObj.SetText(mandOid, sprache, dstBez)
    Do newObj.%Save()
    set srcHektolitergewichte = ""
    set id = newObj.%Id()
    set newObj = ""
    Quit id
]]></Implementation>
</Method>

<Method name="DeleteHektId">
<ClassMethod>1</ClassMethod>
<FormalSpec>Id:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.HektLiterZuschlag
		WHERE ID = :Id)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezialF340.HektLiterZuD37BD</DataLocation>
<DefaultData>HektLiterZuschlagDefaultData</DefaultData>
<IdLocation>^DBSpezialF340.HektLiterZuD37BD</IdLocation>
<IndexLocation>^DBSpezialF340.HektLiterZuD37BI</IndexLocation>
<StreamLocation>^DBSpezialF340.HektLiterZuD37BS</StreamLocation>
<Data name="HektLiterZuschlagDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Bemerkung</Value>
</Value>
<Value name="4">
<Value>Mandant</Value>
</Value>
<Value name="5">
<Value>BereichGrammVon</Value>
</Value>
<Value name="6">
<Value>BereichGrammBis</Value>
</Value>
<Value name="7">
<Value>Zwischenschritte</Value>
</Value>
</Data>
<Data name="Tabelle">
<Attribute>Tabelle</Attribute>
<Structure>subnode</Structure>
<Subscript>"Tabelle"</Subscript>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="Bemerkung"/>
<Property name="BereichGrammBis"/>
<Property name="BereichGrammVon"/>
<Property name="Mandant"/>
<Property name="PositionsNr"/>
<Property name="Zwischenschritte"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Loserrabatt">
<Description>
</Description>
<Super>DBSpezial.Getr.SD.Rabatt,%XML.Adaptor</Super>
<TimeChanged>62264,51639.571811</TimeChanged>
<TimeCreated>62262,34212.375553</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="Artikel">
<Type>DBAgrofresh.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>MuehleLoserrabatt</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetNextFreeCode">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set code = 0
	&sql(SELECT TOP 1 Nummer INTO :code FROM DBSpezial_Getr_SD.Loserrabatt
	     WHERE Mandant = :MandantOid ORDER BY Nummer DESC)
	set code = code + 1	     
	Quit code
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Mengenrabatt">
<Description>
</Description>
<Super>DBSpezial.Getr.SD.Rabatt,%XML.Adaptor</Super>
<TimeChanged>62264,50466.536725</TimeChanged>
<TimeCreated>62262,33950.51207</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="Artikel">
<Type>DBAgrofresh.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>MuehleMengenrabatt</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetNextFreeCode">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set code = 0
	&sql(SELECT TOP 1 Nummer INTO :code FROM DBSpezial_Getr_SD.Mengenrabatt
	     WHERE Mandant = :MandantOid ORDER BY Nummer DESC)
	set code = code + 1	     
	Quit code
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.PreiseTS">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57289.14606</TimeChanged>
<TimeCreated>62242,50030.77955</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</Description>
<Type>%Integer</Type>
</Property>

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

<Property name="Bemerkung">
<Type>%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="Tabelle">
<Type>%Decimal</Type>
<Collection>array</Collection>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="GetreideSorte">
<Type>DBSpezial.Getr.SD.Getrsorte</Type>
<Cardinality>many</Cardinality>
<Inverse>PreistabelleTS</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetPreis">
<FormalSpec>ProzentTS:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
	if (+ProzentTS = 0) {
		Quit 0
	} 
	quit ..Tabelle.GetAt(ProzentTS)
]]></Implementation>
</Method>

<Method name="SetPreis">
<FormalSpec>ProzentTS:%Decimal,Preis:%Decimal</FormalSpec>
<Implementation><![CDATA[	d ..Tabelle.SetAt(Preis, ProzentTS)
]]></Implementation>
</Method>

<Method name="GetPreisClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>ID:%String,ProzentTS:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
	set preis = 0
	&sql(SELECT Tabelle into :preis FROM DBSpezial_Getr_SD.PreiseTS_Tabelle WHERE PreiseTS = :ID AND element_key = :ProzentTS)
	quit:(SQLCODE '= 0) 0
	quit preis
]]></Implementation>
</Method>

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Getr.SD.PreiseTS).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByPosNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.PreiseTS
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>HilfstextOid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
	set obj = ##class(DBSpezial.Getr.SD.PreiseTS).%OpenId(HilfstextOid)
	if (obj '= "") {
		set val = obj.Text.GetAt(Lang)
		if (val '= "") {
			Do ##class(DBUtils.StringUtils).SetText(obj.Text, "", Lang, obj.Mandant)
			do obj.%Save()
		}
	}
]]></Implementation>
</Method>

<Method name="DeleteById">
<ClassMethod>1</ClassMethod>
<FormalSpec>PreisTabOid:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.PreiseTS_Tabelle
		WHERE ID = :PreisTabOid)
]]></Implementation>
</Method>

<Method name="CopyTrocknungskosten">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String,dstNr:%Integer,dstBez:%String,mandOid:%String,sprache:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    Set srcTs = ##class(DBSpezial.Getr.SD.PreiseTS).%OpenId(oid)
    Set newObj = srcTs.%ConstructClone(-1)
    Set newObj.PositionsNr = dstNr
    if ((mandOid '= "") && (mandOid '= $c(0))) {
       set newObj.Mandant = mandOid
    }
    DO newObj.SetText(mandOid, sprache, dstBez)
    Do newObj.%Save()
    set srcTs = ""
    set id = newObj.%Id()
    set newObj = ""
    Quit id
]]></Implementation>
</Method>

<Method name="DeleteTSId">
<ClassMethod>1</ClassMethod>
<FormalSpec>Id:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.PreiseTS
		WHERE ID = :Id)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Getr.SD.PreiseTSD</DataLocation>
<DefaultData>PreiseTSDefaultData</DefaultData>
<IdLocation>^DBSpezial.Getr.SD.PreiseTSD</IdLocation>
<IndexLocation>^DBSpezial.Getr.SD.PreiseTSI</IndexLocation>
<StreamLocation>^DBSpezial.Getr.SD.PreiseTSS</StreamLocation>
<Data name="PreiseTSDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Bemerkung</Value>
</Value>
<Value name="4">
<Value>Mandant</Value>
</Value>
<Value name="5">
<Value>BereichGrammVon</Value>
</Value>
<Value name="6">
<Value>BereichGrammBis</Value>
</Value>
<Value name="7">
<Value>Zwischenschritte</Value>
</Value>
</Data>
<Data name="Tabelle">
<Attribute>Tabelle</Attribute>
<Structure>subnode</Structure>
<Subscript>"Tabelle"</Subscript>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="Bemerkung"/>
<Property name="Mandant"/>
<Property name="PositionsNr"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Probergew">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57289.521834</TimeChanged>
<TimeCreated>62214,35410.174265</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</Description>
<Type>%Integer</Type>
</Property>

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

<Property name="Bemerkung">
<Type>%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="BereichGrammVon">
<Description>
BereichGrammVon</Description>
<Type>%Integer</Type>
</Property>

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

<Property name="Zwischenschritte">
<Description>
Grösse der Zwischenschritte</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Tabelle">
<Description>
Probergew zuordnungstabelle, Prober in G als Index und Hektorlitergewicht als Value</Description>
<Type>%Decimal</Type>
<Collection>array</Collection>
<Parameter name="SCALE" value="5"/>
</Property>

<Method name="GetHlGewicht">
<FormalSpec>ProberG:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
	if (+ProberG = 0) {
		Quit 0
	} 
	quit ..Tabelle.GetAt(ProberG)
]]></Implementation>
</Method>

<Method name="SetProbergewicht">
<FormalSpec>ProberG:%Decimal,value:%Decimal</FormalSpec>
<Implementation><![CDATA[	d ..Tabelle.SetAt(value, ProberG)
]]></Implementation>
</Method>

<Method name="GetHlGewichtClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>ID:%String,ProberG:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set gewicht = 0
	&sql(SELECT TOP 1 Tabelle into :gewicht FROM DBSpezial_Getr_SD.Probergew_Tabelle WHERE Probergew = :ID AND element_key < :ProberG ORDER BY element_key DESC)
	quit:(SQLCODE '= 0) 0
	quit gewicht
]]></Implementation>
</Method>

<Method name="GetProbergewichtClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>ID:%String,HlGewicht:%Decimal</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set gewicht = 0
	&sql(SELECT TOP 1 element_key into :gewicht FROM DBSpezial_Getr_SD.Probergew_Tabelle WHERE Probergew = :ID AND Tabelle > :HlGewicht ORDER BY Tabelle ASC)
	quit:(SQLCODE '= 0) 0
	quit gewicht
]]></Implementation>
</Method>

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Getr.SD.Probergew).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByPosNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.Probergew
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>HilfstextOid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
	set obj = ##class(DBSpezial.Getr.SD.Probergew).%OpenId(HilfstextOid)
	if (obj '= "") {
		set val = obj.Text.GetAt(Lang)
		if (val '= "") {
			Do ##class(DBUtils.StringUtils).SetText(obj.Text, "", Lang, obj.Mandant)
			do obj.%Save()
		}
	}
]]></Implementation>
</Method>

<Property name="GetreideArt">
<Type>DBSpezial.Getr.SD.Getrart</Type>
<Cardinality>many</Cardinality>
<Inverse>Probergewicht</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="DeleteById">
<ClassMethod>1</ClassMethod>
<FormalSpec>ProberGOid:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.Probergew_Tabelle
		WHERE ID = :ProberGOid)
]]></Implementation>
</Method>

<Method name="DeleteAllById">
<ClassMethod>1</ClassMethod>
<FormalSpec>ProberOid:%String</FormalSpec>
<Implementation><![CDATA[
    &sql(DELETE FROM DBSpezial_Getr_SD.Probergew_Tabelle
         WHERE Probergew = :ProberOid)
]]></Implementation>
</Method>

<Method name="CopyProbertabelle">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String,dstNr:%Integer,dstBez:%String,mandOid:%String,sprache:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    Set srcProber = ##class(DBSpezial.Getr.SD.Probergew).%OpenId(oid)
    Set newObj = srcProber.%ConstructClone(-1)
    Set newObj.PositionsNr = dstNr
    if ((mandOid '= "") && (mandOid '= $c(0))) {
                   set newObj.Mandant = mandOid
    }
    DO newObj.SetText(mandOid, sprache, dstBez)
    Do newObj.%Save()
    set srcProber = ""
    set id = newObj.%Id()
    set newObj = ""
    Quit id
]]></Implementation>
</Method>

<Method name="DeleteProberId">
<ClassMethod>1</ClassMethod>
<FormalSpec>Id:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.Probergew
		WHERE ID = :Id)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Getr.SD.ProbergewD</DataLocation>
<DefaultData>ProbergewDefaultData</DefaultData>
<IdLocation>^DBSpezial.Getr.SD.ProbergewD</IdLocation>
<IndexLocation>^DBSpezial.Getr.SD.ProbergewI</IndexLocation>
<StreamLocation>^DBSpezial.Getr.SD.ProbergewS</StreamLocation>
<Data name="Probergew">
<Attribute>Probergew</Attribute>
<Structure>subnode</Structure>
<Subscript>"Probergew"</Subscript>
</Data>
<Data name="ProbergewDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Bemerkung</Value>
</Value>
<Value name="4">
<Value>Mandant</Value>
</Value>
<Value name="5">
<Value>BereichGrammVon</Value>
</Value>
<Value name="6">
<Value>BereichGrammBis</Value>
</Value>
<Value name="7">
<Value>Zwischenschritte</Value>
</Value>
</Data>
<Data name="Tabelle">
<Attribute>Tabelle</Attribute>
<Structure>subnode</Structure>
<Subscript>"Tabelle"</Subscript>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="Bemerkung"/>
<Property name="BereichGrammBis"/>
<Property name="BereichGrammVon"/>
<Property name="Mandant"/>
<Property name="PositionsNr"/>
<Property name="Zwischenschritte"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Rabatt">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57289.707111</TimeChanged>
<TimeCreated>62262,31769.162571</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">
<Description>
Nummer</Description>
<Type>%Integer</Type>
</Property>

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

<Property name="Bemerkung">
<Type>%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="TRabatt">
<Description>
Tabelle Rabatt</Description>
<Type>DBSpezial.Getr.SD.CORabatt</Type>
<Collection>array</Collection>
</Property>

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

<Method name="GetTextClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
    set text = ""
    if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
                   Set rs=##Class(DBSpezial.Getr.SD.Rabatt).%OpenId(myID)
                   set text = rs.GetText(MandOid, Lang)
    }
    Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    set id = ""
    &sql(SELECT ID INTO :id FROM DBSpezial_Getr_SD.Rabatt
                    WHERE Mandant = :MandantOid AND Nummer = :Nummer)
    Quit:(SQLCODE '= 0) ""
    Quit id
]]></Implementation>
</Method>

<Method name="DeleteTextFromId">
<ClassMethod>1</ClassMethod>
<FormalSpec>HilfstextOid:%String,Lang:%String</FormalSpec>
<Implementation><![CDATA[
    set obj = ##class(DBSpezial.Getr.SD.Rabatt).%OpenId(HilfstextOid)
    if (obj '= "") {
       set val = obj.Text.GetAt(Lang)
       if (val '= "") {
           Do ##class(DBUtils.StringUtils).SetText(obj.Text, "", Lang, obj.Mandant)
           do obj.%Save()
       }
    }
]]></Implementation>
</Method>

<Method name="DeleteById">
<ClassMethod>1</ClassMethod>
<FormalSpec>Oid:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Getr_SD.Rabatt_TRabatt
	WHERE ID = :Oid)
]]></Implementation>
</Method>

<Method name="GetRabatt">
<FormalSpec>Gewicht:%Decimal</FormalSpec>
<ReturnType>DBSpezial.Getr.SD.CORabatt</ReturnType>
<Implementation><![CDATA[
	if (+Gewicht = 0) {
		Quit 0
	} 
	quit ..TRabatt.GetAt(Gewicht)
]]></Implementation>
</Method>

<Method name="GetNextRabatt">
<FormalSpec>Gewicht:%Decimal</FormalSpec>
<ReturnType>DBSpezial.Getr.SD.CORabatt</ReturnType>
<Implementation><![CDATA[
	set rid = 0
	set id = ..%Id()
	&sql(SELECT TOP 1 element_key into :rid FROM DBSpezial_Getr_SD.Rabatt_TRabatt
	WHERE Rabatt = :id AND element_key < :Gewicht
	ORDER BY element_key DESC)
	Quit:(SQLCODE '= 0) ""
	Quit:(..TRabatt.IsDefined(rid) = 0) ""
	quit ..TRabatt.GetAt(rid)
]]></Implementation>
</Method>

<Method name="SetRabatt">
<FormalSpec>Gewicht:%Decimal,value:DBSpezial.Getr.SD.CORabatt</FormalSpec>
<Implementation><![CDATA[	d ..TRabatt.SetAt(value, Gewicht)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Getr.SD.RabattD</DataLocation>
<DefaultData>RabattDefaultData</DefaultData>
<IdLocation>^DBSpezial.Getr.SD.RabattD</IdLocation>
<IndexLocation>^DBSpezial.Getr.SD.RabattI</IndexLocation>
<StreamLocation>^DBSpezial.Getr.SD.RabattS</StreamLocation>
<Data name="RabattDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Bemerkung</Value>
</Value>
<Value name="4">
<Value>Mandant</Value>
</Value>
</Data>
<Data name="TRabatt">
<Attribute>TRabatt</Attribute>
<Structure>subnode</Structure>
<Subscript>"TRabatt"</Subscript>
</Data>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Property name="Bemerkung"/>
<Property name="Mandant"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.RabattSumArt">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57289.810885</TimeChanged>
<TimeCreated>62264,41186.983346</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="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="Artikel">
<Type>DBAgrofresh.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>MuehleRabattSumArt</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Getr.SD.RabattSumArt).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Getr_SD.RabattSumArt
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.GetF340.RabattSumArtD</DataLocation>
<DefaultData>RabattSumArtDefaultData</DefaultData>
<IdLocation>^DBSpezial.GetF340.RabattSumArtD</IdLocation>
<IndexLocation>^DBSpezial.GetF340.RabattSumArtI</IndexLocation>
<StreamLocation>^DBSpezial.GetF340.RabattSumArtS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="RabattSumArtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Getr.SD.Rabattgruppe">
<Description>
</Description>
<Super>DBSpezial.Getr.SD.Rabatt,%XML.Adaptor</Super>
<TimeChanged>62325,52220.771576</TimeChanged>
<TimeCreated>62325,52160.963454</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="Artikel">
<Type>DBAgrofresh.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>MuehleRabattgruppe</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetNextFreeCode">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set code = 0
	&sql(SELECT TOP 1 Nummer INTO :code FROM DBSpezial_Getr_SD.Rabattgruppe
	     WHERE Mandant = :MandantOid ORDER BY Nummer DESC)
	set code = code + 1	     
	Quit code
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
</Storage>
</Class>


<Class name="DBSpezial.Label.AF.KontrolleDetailAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62011,55619.683491</TimeCreated>

<Query name="ListeByKopf">
<Type>%SQLQuery</Type>
<FormalSpec>KopfOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PositionNr, Text, Preis, Betrag, Kontrolle, Abmeldung,
	Kontrolleur1, Kontrolleur1->Name AS Kontrolleur1Name,
	TO_CHAR(Kontrolldatum1, 'DD.MM.YYYY') as Kontrolldatum1Str,
	TO_CHAR(Erfassungsdatum, 'DD.MM.YYYY') as ErfassungsdatumStr,
	Erfassungsdatum, Kontrolldatum1, Artikel AS ArtikelId
	FROM DBSpezial_Label.KontrollDetail
	WHERE Kopf = :KopfOid ORDER BY PositionNr]]></SqlQuery>
</Query>

<Query name="ListeByAdresseJahr">
<Type>%SQLQuery</Type>
<FormalSpec>AdressOid:%String,Jahr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, Kopf as KopfID, PositionNr, Text, Preis, Betrag, Kontrolle, Abmeldung,
	Kontrolleur1, Kontrolleur1->Name AS Kontrolleur1Name, Artikel AS ArtikelId,
	TO_CHAR(Kontrolldatum1, 'DD.MM.YYYY') as Kontrolldatum1Str,
	TO_CHAR(Erfassungsdatum, 'DD.MM.YYYY') as ErfassungsdatumStr,
	Erfassungsdatum, Kontrolldatum1, Artikel, CONVERT(BIT, NVL(Verrechnet,0)) AS Verrechnet,
	CASE WHEN Artikel->Artikelcode = 0 THEN NVL(DBFakturierung.Artikel_GetPreisstaffelClass(Artikel, 0),0.0) ELSE 0.0 END AS MinBetrag,
	CASE WHEN Artikel->Artikelcode = 0 THEN NVL(DBFakturierung.Artikel_GetPreisstaffelClass(Artikel, 1),0.0) ELSE 0.0 END AS MaxBetrag
	FROM DBSpezial_Label.KontrollDetail
	WHERE Kopf->Adresse = :AdressOid AND Kopf->Jahr = :Jahr ORDER BY PositionNr]]></SqlQuery>
</Query>

<Query name="ListeNichtVerrechnete">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonAdrNr:%Integer,BisAdrNr:%Integer,Jahr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, Kopf as KopfID, PositionNr, Text, Preis, Betrag, Kontrolle, Abmeldung,
	Kontrolleur1, Kontrolleur1->Name AS Kontrolleur1Name,
	Erfassungsdatum, Kontrolldatum1, Artikel, Kopf->Adresse
	FROM DBSpezial_Label.KontrollDetail
	WHERE Kopf->Adresse->Adressnummer BETWEEN :VonAdrNr AND :BisAdrNr 
	AND Kopf->Jahr = :Jahr 
	AND NVL(Verrechnet,0) = 0
	ORDER BY Kopf->Adresse->Adressnummer, PositionNr ASC]]></SqlQuery>
</Query>

<Query name="ListeVerrechnete">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonAdrNr:%Integer,BisAdrNr:%Integer,Jahr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID
	FROM DBSpezial_Label.KontrollDetail
	WHERE Kopf->Adresse->Adressnummer BETWEEN :VonAdrNr AND :BisAdrNr 
	AND Kopf->Adresse->Mandant = :MandantOid
	AND Kopf->Jahr = :Jahr 
	AND NVL(Verrechnet,0) = 1
	ORDER BY Kopf->Adresse->Adressnummer]]></SqlQuery>
</Query>

<Query name="ListeArtikel">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Artikel
	FROM DBSpezial_Label.KontrollDetail
	WHERE Kopf->Adresse->Mandant = :MandantOid
	AND Artikel IS NOT NULL
	ORDER BY Artikel->ArtikelNr]]></SqlQuery>
</Query>

<Query name="ListeDruckKontrolle">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonDatum:%Date,BisDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PositionNr, Text, Preis, Betrag, Kontrolle, Abmeldung,
	Kontrolleur1, Kontrolleur1->Name AS Kontrolleur1Name, Verrechnet,
	Erfassungsdatum, Kontrolldatum1, Artikel, Kopf->Adresse->AdressNrAlt AS AdressNrAlt,
	Kopf->Adresse AS Adresse, Kopf->Adresse->Adressnummer AS Adressnummer, Kopf->Betriebsnummer
	FROM DBSpezial_Label.KontrollDetail
	WHERE Kopf->Adresse->Mandant = :MandantOid
	AND Erfassungsdatum BETWEEN {d :VonDatum} AND {d :BisDatum}
	ORDER BY Kopf->Adresse->Name, Kopf->Adresse->VornameZusatz1, Kopf->Adresse->Ort, PositionNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Label.AF.KontrolleKopfAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61982,49401.076479</TimeCreated>

<Query name="ListeByAdresse">
<Type>%SQLQuery</Type>
<FormalSpec>AdressOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, Betriebsnummer, Jahr, 
	Kontrolleur1, Kontrolleur2, Kontrolleur1->Name AS Kontrolleur1Name, Kontrolleur2->Name AS Kontrolleur2Name,
	TO_CHAR(Kontrolldatum1, 'DD.MM.YYYY') as Kontrolldatum1Str, TO_CHAR(Kontrolldatum2, 'DD.MM.YYYY') as Kontrolldatum2Str,
	Kontrolldatum1, Kontrolldatum2, Adresse
	FROM DBSpezial_Label.KontrollKopf
	WHERE Adresse = :AdressOid ORDER BY Jahr, Betriebsnummer]]></SqlQuery>
</Query>

<Query name="ListeJahreByAdresse">
<Type>%SQLQuery</Type>
<FormalSpec>AdressOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT DISTINCT Jahr
	FROM DBSpezial_Label.KontrollKopf
	WHERE Adresse = :AdressOid ORDER BY Jahr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Label.AF.SD.KontrolleurAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61982,49006.068028</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, Name, 
	Mandant
	FROM DBSpezial_Label_SD.Kontrolleur
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr,Name As wert1,'' As wert2, 
	Mandant
	FROM DBSpezial_Label_SD.Kontrolleur as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Label.KontrollDetail">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57290.010499</TimeChanged>
<TimeCreated>62011,54926.783368</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="Kopf">
<Type>DBSpezial.Label.KontrollKopf</Type>
<Cardinality>parent</Cardinality>
<Inverse>Detail</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

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

<Property name="Kontrolleur1">
<Type>DBSpezial.Label.SD.Kontrolleur</Type>
<Cardinality>one</Cardinality>
<Inverse>Kontrolle1Detail</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Kontrolleur1"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>KontrollArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Artikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

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

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

<Method name="GetMaxImportNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>Mandant:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(SELECT MAX(ImportNr) INTO :nr FROM DBSpezial_Label.KontrollDetail where Kopf->Adresse->Mandant = :Mandant)
	quit (nr + 1)
]]></Implementation>
</Method>

<Method name="KontrolleHasArtikel">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfOid:%String,ArtOid:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set found = 0
	&sql(SELECT COUNT(ID) INTO :found FROM DBSpezial_Label.KontrollDetail where Kopf = :KopfOid AND Artikel = :ArtOid)
	if (found = 0) {
		quit 0	
	} else {
		quit 1
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Detail")</DataLocation>
<DefaultData>KontrollDetailDefaultData</DefaultData>
<IdLocation>^DBSpezial.Label.KontrollKopfC("Detail")</IdLocation>
<IndexLocation>^DBSpezial.L3464.KontrollDetailI</IndexLocation>
<StreamLocation>^DBSpezial.L3464.KontrollDetailS</StreamLocation>
<Data name="KontrollDetailDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionNr</Value>
</Value>
<Value name="3">
<Value>Text</Value>
</Value>
<Value name="4">
<Value>Kontrolle</Value>
</Value>
<Value name="5">
<Value>Abmeldung</Value>
</Value>
<Value name="6">
<Value>Preis</Value>
</Value>
<Value name="7">
<Value>Kontrolldatum1</Value>
</Value>
<Value name="8">
<Value>Kontrolldatum2</Value>
</Value>
<Value name="9">
<Value>Kontrolleur1</Value>
</Value>
<Value name="10">
<Value>Kontrolleur2</Value>
</Value>
<Value name="11">
<Value>Artikel</Value>
</Value>
<Value name="12">
<Value>Organisation</Value>
</Value>
<Value name="13">
<Value>Typ</Value>
</Value>
<Value name="14">
<Value>Tierart</Value>
</Value>
<Value name="15">
<Value>ImportNr</Value>
</Value>
<Value name="16">
<Value>Betrag</Value>
</Value>
<Value name="17">
<Value>Verrechnet</Value>
</Value>
<Value name="18">
<Value>Erfassungsdatum</Value>
</Value>
</Data>
<Property name="Abmeldung"/>
<Property name="Artikel"/>
<Property name="Betrag"/>
<Property name="Erfassungsdatum"/>
<Property name="ImportNr"/>
<Property name="Kontrolldatum1"/>
<Property name="Kontrolldatum2"/>
<Property name="Kontrolle"/>
<Property name="Kontrolleur1"/>
<Property name="Kontrolleur2"/>
<Property name="Kopf"/>
<Property name="Organisation"/>
<Property name="PositionNr"/>
<Property name="Preis"/>
<Property name="Text"/>
<Property name="Tierart"/>
<Property name="Typ"/>
<Property name="Verrechnet"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Label.KontrollKopf">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57230.945892</TimeChanged>
<TimeCreated>61982,48969.114387</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="Jahr">
<Type>%Integer</Type>
</Property>

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

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

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

<Property name="Kontrolleur1">
<Type>DBSpezial.Label.SD.Kontrolleur</Type>
<Cardinality>one</Cardinality>
<Inverse>Kontrolle1</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Kontrolleur1"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Kontrolleur2">
<Type>DBSpezial.Label.SD.Kontrolleur</Type>
<Cardinality>one</Cardinality>
<Inverse>Kontrolle2</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Kontrolleur2"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Adresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>Kontrolle</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Adresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Detail">
<Type>DBSpezial.Label.KontrollDetail</Type>
<Cardinality>children</Cardinality>
<Inverse>Kopf</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

<Method name="GetIdByAdrIdJahr">
<ClassMethod>1</ClassMethod>
<FormalSpec>AdrId:%String,Jahr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT ID INTO :oid FROM DBSpezial_Label.KontrollKopf where Adresse = :AdrId AND Jahr = :Jahr )
	quit oid
]]></Implementation>
</Method>

<Method name="GetNextPosNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfOid:%String,AbNummer:%Integer,BisNumber:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = AbNummer
	&sql(SELECT MAX(PositionNr) INTO :nr FROM DBSpezial_Label.KontrollDetail where Kopf = :KopfOid AND PositionNr BETWEEN :AbNummer AND :BisNumber )
	if (nr < AbNummer) {
		quit AbNummer
	} else {
		quit (nr+1)
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Label.KontrollKopfD</DataLocation>
<DefaultData>KontrollKopfDefaultData</DefaultData>
<IdLocation>^DBSpezial.Label.KontrollKopfD</IdLocation>
<IndexLocation>^DBSpezial.Label.KontrollKopfI</IndexLocation>
<StreamLocation>^DBSpezial.Label.KontrollKopfS</StreamLocation>
<Data name="KontrollKopfDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Jahr</Value>
</Value>
<Value name="3">
<Value>Betriebsnummer</Value>
</Value>
<Value name="4">
<Value>Kontrolldatum1</Value>
</Value>
<Value name="5">
<Value>Kontrolldatum2</Value>
</Value>
<Value name="6">
<Value>Kontrolleur1</Value>
</Value>
<Value name="7">
<Value>Kontrolleur2</Value>
</Value>
<Value name="8">
<Value>Adresse</Value>
</Value>
<Value name="9">
<Value>OelnBeantragt</Value>
</Value>
<Value name="10">
<Value>OelnBewiligt</Value>
</Value>
<Value name="11">
<Value>Anmeldedatum</Value>
</Value>
<Value name="12">
<Value>Organistaion</Value>
</Value>
<Value name="13">
<Value>TotalNutflaeche</Value>
</Value>
<Value name="14">
<Value>TotalNutzflaeche</Value>
</Value>
</Data>
<Property name="Adresse"/>
<Property name="Anmeldedatum"/>
<Property name="Betriebsnummer"/>
<Property name="Jahr"/>
<Property name="Kontrolldatum1"/>
<Property name="Kontrolldatum2"/>
<Property name="Kontrolleur1"/>
<Property name="Kontrolleur2"/>
<Property name="OelnBeantragt"/>
<Property name="OelnBewiligt"/>
<Property name="Organistaion"/>
<Property name="TotalNutzflaeche"/>
</Storage>
</Class>


<Class name="DBSpezial.Label.SD.Kontrolleur">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57290.159804</TimeChanged>
<TimeCreated>61982,48965.367545</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="Nr">
<Type>%Integer</Type>
</Property>

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

<Property name="Kontrolle1">
<Type>DBSpezial.Label.KontrollKopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Kontrolleur1</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Kontrolle2">
<Type>DBSpezial.Label.KontrollKopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Kontrolleur2</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Kontrolle1Detail">
<Type>DBSpezial.Label.KontrollDetail</Type>
<Cardinality>many</Cardinality>
<Inverse>Kontrolleur1</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<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 DBSpezial_Label_SD.Kontrolleur
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.LabeD50B.KontrolleurD</DataLocation>
<DefaultData>KontrolleurDefaultData</DefaultData>
<IdLocation>^DBSpezial.LabeD50B.KontrolleurD</IdLocation>
<IndexLocation>^DBSpezial.LabeD50B.KontrolleurI</IndexLocation>
<StreamLocation>^DBSpezial.LabeD50B.KontrolleurS</StreamLocation>
<Data name="KontrolleurDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
<Value name="4">
<Value>Name</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Name"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Logistik.AF.MuldeAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62178,53583.816007</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer, DBSpezial_Logistik.Mulde_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
	Mandant
	FROM DBSpezial_Logistik.Mulde
	WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Logistik.AF.MuldenPreisAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62178,54570.067882</TimeCreated>

<Query name="ListeByMulde">
<Type>%SQLQuery</Type>
<FormalSpec>MuldeOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, Plz, PlzInklZusatz, Ort, Preis, 
	DBSpezial_Logistik_SD.LeistArt_GetBezeichnungClass(Leistungsart, Mulde->Mandant, :Lang) As GrpBezeichnung
	FROM DBSpezial_Logistik.MuldenPreis
	WHERE Mulde = :MuldeOid ORDER BY Leistungsart->Nummer]]></SqlQuery>
</Query>

<Query name="ListeOrteByMulde">
<Type>%SQLQuery</Type>
<FormalSpec>MuldeOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT PlzInklZusatz , Plz, Ort
	FROM DBSpezial_Logistik.MuldenPreis
	WHERE Mulde = :MuldeOid
	GROUP BY PlzInklZusatz
	ORDER BY Ort</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Logistik.AF.SD.ChauffeurAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62179,56052.053539</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer, Name, Vorname, Telefon,	Mandant
	FROM DBSpezial_Logistik_SD.Chauffeur
	WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Logistik.AF.SD.LeistArtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62187,36056.80834</TimeCreated>

<Query name="ListeByMuldenart">
<Type>%SQLQuery</Type>
<FormalSpec>MuldenartOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, Nummer, DBSpezial_Logistik_SD.LeistArt_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung,
	DBFakturierung.Artikel_GetArtikeltextClass(Artikel, Artikel->Mandant, :Lang) As Artikeltext, 
	Artikel->ArtikelNr AS ArtikelNr
	FROM DBSpezial_Logistik_SD.LeistArt
	WHERE Muldenart = :MuldenartOid ORDER BY Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Logistik.AF.SD.MuldenartAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62187,36009.261289</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer, DBSpezial_Logistik_SD.Muldenart_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
	Mandant
	FROM DBSpezial_Logistik_SD.Muldenart
	WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Logistik.AF.TAPositionAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62187,50274.933622</TimeCreated>

<Query name="ListeByAuftrag">
<Type>%SQLQuery</Type>
<FormalSpec>AuftragOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT PositionsNr, Preis, Menge, Betrag, Text
	FROM DBSpezial_Logistik.TAPosition
	WHERE Auftrag = :AuftragOid
	ORDER BY PositionsNr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Logistik.AF.TransAuftragAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62180,37918.696226</TimeCreated>

<Query name="ListeBaum">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT DISTINCT EffektivDatum
	FROM DBSpezial_Logistik.TransAuftrag
	WHERE Mandant = :MandantOid 
	ORDER BY EffektivDatum</SqlQuery>
</Query>

<Query name="ListeByDatum">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Datum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, AuftragsNr, Mandant, EffektivDatum, Kunde
	FROM DBSpezial_Logistik.TransAuftrag
	WHERE Mandant = :MandantOid AND EffektivDatum = {d :Datum} 
	ORDER BY AuftragsNr DESC</SqlQuery>
</Query>

<Query name="ListeByAdresse">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,AdressOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, AuftragsNr, Mandant, EffektivDatum, Kunde
	FROM DBSpezial_Logistik.TransAuftrag
	WHERE Mandant = :MandantOid AND Kunde = :AdressOid
	ORDER BY AuftragsNr DESC</SqlQuery>
</Query>

<Query name="ListeEinzelDruck">
<Type>%SQLQuery</Type>
<FormalSpec>AuftragOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT LadestelleName, LadestelleStrasse, LadestellePlz, LadestellePlzZusatz ,LadestelleOrt, LadestelleBemerkung,
	AbladestelleName, AbladestelleStrasse, AbladestellePlz, AbladestellePlzZusatz, AbladestelleOrt,
	AbladestelleBemerkung, MaterialBemerkung, SollGewicht,SollDatum,SollAnkuftszeit,
	Chauffeur->Name || ' ' || Chauffeur->Vorname AS Chaffeur,
	DBSpezial_Logistik.Mulde_GetBezeichnungClass(Mulde, Mandant, :Lang) As Mulde,
	SollZeitbedarf,SollDistanz,EffektivGewicht,EffektivDatum,EffektivAnkuftszeit,EffektivZeitbedarf,
	EffektivDistanz,Stellen,Tauschen,Wegnehmen, SollAnzFuhren, EffektivAnzFuhren, WaagscheinNr,
	DBFakturierung.Artikel_GetArtikeltextClass(Fahrzeug, Mandant, :Lang) AS Fahrzeug, 
	Material->ArtikelNr AS MaterialNr,
	DBFakturierung.Artikel_GetArtikeltextClass(Material, Mandant, :Lang) AS Material, 
	DBFakturierung.Artikel_GetArtikeltextClass(Anhaenger, Mandant, :Lang) AS Anhaenger, 
	DBSpezial_Logistik_SD.LeistArt_GetBezeichnungClass(Leistungsart, Mandant, :Lang) As Leistungsart,
	AuftragsNr, Kunde, LadestelleAdresse->Telefon1 AS LadestelleTelefon, AbladestelleAdresse->Telefon1 AS AbladestelleTelefon, 
	Kunde->Telefon1 AS KundeTelefon, Kunde->Mobil AS KundeMobil
	FROM DBSpezial_Logistik.TransAuftrag
	WHERE ID = :AuftragOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Logistik.Mulde">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57290.339615</TimeChanged>
<TimeCreated>62178,53267.336295</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>%String</Type>
<Parameter name="MAXLEN" value="15"/>
<Parameter name="TRUNCATE" 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="LaengeMm">
<Type>%Integer</Type>
</Property>

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

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

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

<Property name="Beschreibung2">
<Type>%String</Type>
<Collection>array</Collection>
<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="Preis">
<Type>DBSpezial.Logistik.MuldenPreis</Type>
<Cardinality>many</Cardinality>
<Inverse>Mulde</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Transportauftrag">
<Type>DBSpezial.Logistik.TransAuftrag</Type>
<Cardinality>many</Cardinality>
<Inverse>Mulde</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Muldenart">
<Type>DBSpezial.Logistik.SD.Muldenart</Type>
<Cardinality>one</Cardinality>
<Inverse>MuldeTab</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Muldenart"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</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(DBSpezial.Logistik.Mulde).%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="GetBeschreibung1">
<FormalSpec>MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Quit ##Class(DBUtils.StringUtils).GetText(..Beschreibung1, Lang, MandOid)
]]></Implementation>
</Method>

<Method name="GetBeschreibung1Class">
<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(DBSpezial.Logistik.Mulde).%OpenId(myID)
		set text = rs.GetBeschreibung1(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

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

<Method name="GetBeschreibung2Class">
<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(DBSpezial.Logistik.Mulde).%OpenId(myID)
		set text = rs.GetBeschreibung2(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

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

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Logistik.Mulde
		 WHERE Mandant = :MandantOid AND Nummer = :Nr)
	if (SQLCODE '= 0) {
		QUIT ""
	} else {
		QUIT 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)
	&sql(DELETE FROM DBSpezial_Logistik.MuldenPreis WHERE Mulde = :myId)
	Quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Logistik.MuldeD</DataLocation>
<DefaultData>MuldeDefaultData</DefaultData>
<IdLocation>^DBSpezial.Logistik.MuldeD</IdLocation>
<IndexLocation>^DBSpezial.Logistik.MuldeI</IndexLocation>
<StreamLocation>^DBSpezial.Logistik.MuldeS</StreamLocation>
<Data name="Beschreibung1">
<Attribute>Beschreibung1</Attribute>
<Structure>subnode</Structure>
<Subscript>"Beschreibung1"</Subscript>
</Data>
<Data name="Beschreibung2">
<Attribute>Beschreibung2</Attribute>
<Structure>subnode</Structure>
<Subscript>"Beschreibung2"</Subscript>
</Data>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="MuldeDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>LaengeMm</Value>
</Value>
<Value name="4">
<Value>BreiteMm</Value>
</Value>
<Value name="5">
<Value>HoeheMm</Value>
</Value>
<Value name="6">
<Value>Mandant</Value>
</Value>
<Value name="7">
<Value>PreisTabelle</Value>
</Value>
<Value name="8">
<Value>Muldenart</Value>
</Value>
</Data>
<Property name="BreiteMm"/>
<Property name="HoeheMm"/>
<Property name="LaengeMm"/>
<Property name="Mandant"/>
<Property name="Nummer"/>
<Property name="PreisTabelle"/>
</Storage>
</Class>


<Class name="DBSpezial.Logistik.MuldenPreis">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57231.226416</TimeChanged>
<TimeCreated>62178,54409.02685</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="Mulde">
<Type>DBSpezial.Logistik.Mulde</Type>
<Cardinality>one</Cardinality>
<Inverse>Preis</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Mulde"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="MuldeIndex">
<Properties>Mulde</Properties>
</Index>

<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="Preis">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Leistungsart">
<Type>DBSpezial.Logistik.SD.LeistArt</Type>
<Cardinality>one</Cardinality>
<Inverse>Mulde</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Leistungsart"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="LeistungsartIndex">
<Properties>Leistungsart</Properties>
</Index>

<Method name="GetPreisByMuldeOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MuldeOid:%String,LeisungsartOid:%String,PlzInklZusatz:%String</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
	set preis = 0
	&sql(SELECT Preis INTO :preis FROM DBSpezial_Logistik.MuldenPreis
		 WHERE Mulde = :MuldeOid AND Leistungsart = :LeisungsartOid AND PlzInklZusatz = :PlzInklZusatz)
	if (SQLCODE '= 0) {
		QUIT 0
	} else {
		QUIT preis
	}
]]></Implementation>
</Method>

<Method name="GetIdByMuldeOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MuldeOid:%String,LeisungsartOid:%String,PlzInklZusatz:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Logistik.MuldenPreis
		 WHERE Mulde = :MuldeOid AND Leistungsart = :LeisungsartOid AND PlzInklZusatz = :PlzInklZusatz)
	if (SQLCODE '= 0) {
		QUIT ""
	} else {
		QUIT id
	}
]]></Implementation>
</Method>

<Method name="HasMuldePreis">
<ClassMethod>1</ClassMethod>
<FormalSpec>MuldeOid:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set count = 0
	&sql(SELECT COUNT(ID) INTO :count FROM DBSpezial_Logistik.MuldenPreis
		 WHERE Mulde = :MuldeOid)
	
	if (SQLCODE '= 0) {
		QUIT 0
	} elseif (count > 0) {
		QUIT 1
	} else{
		QUIT 0
	}
]]></Implementation>
</Method>

<Method name="HasMuldeOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MuldeOid:%String,PlzInklZusatz:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set count = 0
	&sql(SELECT COUNT(ID) INTO :count FROM DBSpezial_Logistik.MuldenPreis
		 WHERE Mulde = :MuldeOid AND PlzInklZusatz = :PlzInklZusatz)
	
	if (SQLCODE '= 0) {
		QUIT 0
	} elseif (count > 0) {
		QUIT 1
	} else{
		QUIT 0
	}
]]></Implementation>
</Method>

<Method name="DeleteByMulde">
<ClassMethod>1</ClassMethod>
<FormalSpec>MuldeOid:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Logistik.MuldenPreis
		 WHERE Mulde = :MuldeOid)
]]></Implementation>
</Method>

<Method name="DeleteByMuldeOrt">
<ClassMethod>1</ClassMethod>
<FormalSpec>MuldeOid:%String,PlzInklZusatz:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Logistik.MuldenPreis
		 WHERE Mulde = :MuldeOid AND PlzInklZusatz = :PlzInklZusatz)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.LogiFA80.MuldenPreisD</DataLocation>
<DefaultData>MuldenPreisDefaultData</DefaultData>
<IdLocation>^DBSpezial.LogiFA80.MuldenPreisD</IdLocation>
<IndexLocation>^DBSpezial.LogiFA80.MuldenPreisI</IndexLocation>
<StreamLocation>^DBSpezial.LogiFA80.MuldenPreisS</StreamLocation>
<Data name="MuldenPreisDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mulde</Value>
</Value>
<Value name="3">
<Value>PreisGrp</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>Preis</Value>
</Value>
<Value name="8">
<Value>Leistungsart</Value>
</Value>
</Data>
<Property name="Mulde"/>
<Property name="Ort"/>
<Property name="Plz"/>
<Property name="PlzInklZusatz"/>
<Property name="Preis"/>
<Property name="PreisGrp"/>
</Storage>
</Class>


<Class name="DBSpezial.Logistik.SD.Chauffeur">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57290.528039</TimeChanged>
<TimeCreated>62179,56008.836994</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>%Integer</Type>
</Property>

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

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

<Property name="Telefon">
<Type>%String</Type>
<Parameter name="MAXLEN" value="50"/>
<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="Transportauftrag">
<Type>DBSpezial.Logistik.TransAuftrag</Type>
<Cardinality>many</Cardinality>
<Inverse>Chauffeur</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Method name="GetIdByNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Logistik_SD.Chauffeur
		 WHERE Mandant = :MandantOid AND Nummer = :Nr)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Logist821F.ChauffeurD</DataLocation>
<DefaultData>ChauffeurDefaultData</DefaultData>
<IdLocation>^DBSpezial.Logist821F.ChauffeurD</IdLocation>
<IndexLocation>^DBSpezial.Logist821F.ChauffeurI</IndexLocation>
<StreamLocation>^DBSpezial.Logist821F.ChauffeurS</StreamLocation>
<Data name="ChauffeurDefaultData">
<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>Vorname</Value>
</Value>
<Value name="5">
<Value>Telefon</Value>
</Value>
<Value name="6">
<Value>Mandant</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Name"/>
<Property name="Nummer"/>
<Property name="Telefon"/>
<Property name="Vorname"/>
</Storage>
</Class>


<Class name="DBSpezial.Logistik.SD.LeistArt">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57333.20154</TimeChanged>
<TimeCreated>62187,35734.322738</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>%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="Muldenart">
<Type>DBSpezial.Logistik.SD.Muldenart</Type>
<Cardinality>parent</Cardinality>
<Inverse>Leistungsart</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Muldenart"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Mulde">
<Type>DBSpezial.Logistik.MuldenPreis</Type>
<Cardinality>many</Cardinality>
<Inverse>Leistungsart</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="TransportLeistung">
<Type>DBSpezial.Logistik.TransAuftrag</Type>
<Cardinality>many</Cardinality>
<Inverse>Leistungsart</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>SpezLeistungsart</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Artikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</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(DBSpezial.Logistik.SD.LeistArt).%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="GetIdByNrOnMuldenart">
<ClassMethod>1</ClassMethod>
<FormalSpec>MuldenartOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Logistik_SD.LeistArt
		 WHERE Muldenart = :MuldenartOid AND Nummer = :Nr)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Leistungsart")</DataLocation>
<DefaultData>LeistArtDefaultData</DefaultData>
<IdLocation>^DBSpezial.Logist821F.MuldenartC("Leistungsart")</IdLocation>
<IndexLocation>^DBSpezial.Logisti821F.LeistArtI</IndexLocation>
<StreamLocation>^DBSpezial.Logisti821F.LeistArtS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="LeistArtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Nummer</Value>
</Value>
<Value name="3">
<Value>Artikel</Value>
</Value>
</Data>
<Property name="Artikel"/>
<Property name="Muldenart"/>
<Property name="Nummer"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Logistik.SD.Muldenart">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57291.353033</TimeChanged>
<TimeCreated>62187,35471.851769</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>%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="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="Leistungsart">
<Type>DBSpezial.Logistik.SD.LeistArt</Type>
<Cardinality>children</Cardinality>
<Inverse>Muldenart</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="MuldeTab">
<Type>DBSpezial.Logistik.Mulde</Type>
<Cardinality>many</Cardinality>
<Inverse>Muldenart</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(DBSpezial.Logistik.SD.Muldenart).%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="GetIdByNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Logistik_SD.Muldenart
		 WHERE Mandant = :MandantOid AND Nummer = :Nr)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Logist821F.MuldenartD</DataLocation>
<DefaultData>MuldenartDefaultData</DefaultData>
<IdLocation>^DBSpezial.Logist821F.MuldenartD</IdLocation>
<IndexLocation>^DBSpezial.Logist821F.MuldenartI</IndexLocation>
<StreamLocation>^DBSpezial.Logist821F.MuldenartS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="MuldenartDefaultData">
<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>
</Data>
<Property name="Mandant"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBSpezial.Logistik.TAPosition">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57333.319166</TimeChanged>
<TimeCreated>62187,50059.628322</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="Auftrag">
<Type>DBSpezial.Logistik.TransAuftrag</Type>
<Cardinality>parent</Cardinality>
<Inverse>Position</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Auftrag"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

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

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

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

<Method name="GetIdByAuftragPosNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>AuftragOid:%String,PositionsNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Logistik.TAPosition
		 WHERE Auftrag = :AuftragOid
		 AND PositionsNr = :PositionsNr)
	if (SQLCODE = 0) {
		Quit id
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Position")</DataLocation>
<DefaultData>TAPositionDefaultData</DefaultData>
<IdLocation>^DBSpezial.LogFA80.TransAuftragC("Position")</IdLocation>
<IndexLocation>^DBSpezial.Logistik.TAPositionI</IndexLocation>
<StreamLocation>^DBSpezial.Logistik.TAPositionS</StreamLocation>
<Data name="TAPositionDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Preis</Value>
</Value>
<Value name="4">
<Value>Menge</Value>
</Value>
<Value name="5">
<Value>Betrag</Value>
</Value>
<Value name="6">
<Value>Text</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Logistik.TransAuftrag">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57291.559382</TimeChanged>
<TimeCreated>62179,57415.225876</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="AuftragsNr">
<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,AuftragsNr</Properties>
<Unique>1</Unique>
</Index>

<Property name="Kunde">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>Transportauftrag</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Kunde"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

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

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

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

<Property name="LadestelleBemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

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

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

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

<Property name="AbladestelleBemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Chauffeur">
<Type>DBSpezial.Logistik.SD.Chauffeur</Type>
<Cardinality>one</Cardinality>
<Inverse>Transportauftrag</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Chauffeur"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Mulde">
<Type>DBSpezial.Logistik.Mulde</Type>
<Cardinality>one</Cardinality>
<Inverse>Transportauftrag</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Mulde"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="MaterialBemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

<Property name="SollAnkuftszeit">
<Type>%Time</Type>
</Property>

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

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

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

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

<Property name="EffektivAnkuftszeit">
<Type>%Time</Type>
</Property>

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

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

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

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

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

<Property name="LadestelleAdresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>TransportLadestelle</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="LadestelleAdresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="AbladestelleAdresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>TransportAbladestelle</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="AbladestelleAdresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Fahrzeug">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>TransportFahrzeug</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Fahrzeug"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Material">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>TransportMaterial</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Material"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

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

<Property name="Anhaenger">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>TransportAnhaenger</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Anhaenger"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Leistungsart">
<Type>DBSpezial.Logistik.SD.LeistArt</Type>
<Cardinality>one</Cardinality>
<Inverse>TransportLeistung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Leistungsart"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Position">
<Type>DBSpezial.Logistik.TAPosition</Type>
<Cardinality>children</Cardinality>
<Inverse>Auftrag</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Method name="GetIdByAuftragNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,AuftragNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Logistik.TransAuftrag WHERE Mandant = :MandantOid
		 AND AuftragsNr = :AuftragNr)
	if (SQLCODE = 0) {
		Quit id
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Method name="GetDatumByOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>AuftragOid:%String</FormalSpec>
<ReturnType>%Date</ReturnType>
<Implementation><![CDATA[
	set datum = ""
	&sql(SELECT EffektivDatum INTO :datum FROM DBSpezial_Logistik.TransAuftrag WHERE ID = :AuftragOid)
	if (SQLCODE = 0) {
		Quit datum
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Method name="GetNewstOidByDatum">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Datum:%Date</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Logistik.TransAuftrag WHERE Mandant = :MandantOid
		 AND EffektivDatum = :Datum ORDER BY AuftragsNr DESC)
		
	if ((SQLCODE =' 0) || (id = "")) {
		&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Logistik.TransAuftrag WHERE Mandant = :MandantOid
		ORDER BY AuftragsNr DESC)
	}
		 
	if (SQLCODE = 0) {
		Quit id
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Method name="GetNextAuftragsNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	// Falls Global noch nicht gesetzt höchste vorhanden Nummer setzen
	if ($GET(^TransportAuftragsNr(MandantOid)) = "") {
		&sql(SELECT MAX(AuftragsNr) into :nr FROM DBSpezial_Logistik.TransAuftrag WHERE Mandant = :MandantOid)
		if (SQLCODE = 0) {
			SET ^TransportAuftragsNr(MandantOid) = nr	
		}
	}
	// Neue Nummer auslessen
	SET nr=$INCREMENT(^TransportAuftragsNr(MandantOid))
	// Prüfen ob noch keine RG mit Nummer vorhanden
	while (##class(DBSpezial.Logistik.TransAuftrag).GetIdByAuftragNr(MandantOid, nr) '= "") {
		SET nr=$INCREMENT(^TransportAuftragsNr(MandantOid))
	}
		
	Quit nr
]]></Implementation>
</Method>

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

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.LogFA80.TransAuftragD</DataLocation>
<DefaultData>TransAuftragDefaultData</DefaultData>
<IdLocation>^DBSpezial.LogFA80.TransAuftragD</IdLocation>
<IndexLocation>^DBSpezial.LogFA80.TransAuftragI</IndexLocation>
<StreamLocation>^DBSpezial.LogFA80.TransAuftragS</StreamLocation>
<Data name="TransAuftragDefaultData">
<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>Kunde</Value>
</Value>
<Value name="5">
<Value>LadestelleName</Value>
</Value>
<Value name="6">
<Value>LadestelleStrasse</Value>
</Value>
<Value name="7">
<Value>LadestellePlz</Value>
</Value>
<Value name="8">
<Value>LadestellePlzZusatz</Value>
</Value>
<Value name="9">
<Value>LadestelleBemerkung</Value>
</Value>
<Value name="10">
<Value>AbladestelleName</Value>
</Value>
<Value name="11">
<Value>AblLadestelleStrasse</Value>
</Value>
<Value name="12">
<Value>AbladestellePlz</Value>
</Value>
<Value name="13">
<Value>AbladestellePlzZusatz</Value>
</Value>
<Value name="14">
<Value>AbladestelleBemerkung</Value>
</Value>
<Value name="15">
<Value>Chauffeur</Value>
</Value>
<Value name="16">
<Value>Mulde</Value>
</Value>
<Value name="17">
<Value>MaterialBemerkung</Value>
</Value>
<Value name="18">
<Value>SollGewicht</Value>
</Value>
<Value name="19">
<Value>SollDatum</Value>
</Value>
<Value name="20">
<Value>SollAnkuftszeit</Value>
</Value>
<Value name="21">
<Value>SollZeitbedarf</Value>
</Value>
<Value name="22">
<Value>SollDistanz</Value>
</Value>
<Value name="23">
<Value>EffektivGewicht</Value>
</Value>
<Value name="24">
<Value>EffektivDatum</Value>
</Value>
<Value name="25">
<Value>EffektivAnkuftszeit</Value>
</Value>
<Value name="26">
<Value>EffektivZeitbedarf</Value>
</Value>
<Value name="27">
<Value>EffektivDistanz</Value>
</Value>
<Value name="28">
<Value>Stellen</Value>
</Value>
<Value name="29">
<Value>Tauschen</Value>
</Value>
<Value name="30">
<Value>Wegnehmen</Value>
</Value>
<Value name="31">
<Value>LadestelleAdresse</Value>
</Value>
<Value name="32">
<Value>AbladestelleAdresse</Value>
</Value>
<Value name="33">
<Value>Fahrzeug</Value>
</Value>
<Value name="34">
<Value>Material</Value>
</Value>
<Value name="35">
<Value>AuftragsNr</Value>
</Value>
<Value name="36">
<Value>AbladestelleStrasse</Value>
</Value>
<Value name="37">
<Value>LadestelleOrt</Value>
</Value>
<Value name="38">
<Value>AbladestelleOrt</Value>
</Value>
<Value name="39">
<Value>SollAnzFuhren</Value>
</Value>
<Value name="40">
<Value>EffektivAnzFuhren</Value>
</Value>
<Value name="41">
<Value>WaagscheinNr</Value>
</Value>
<Value name="42">
<Value>Anhaenger</Value>
</Value>
<Value name="43">
<Value>Leistungsart</Value>
</Value>
</Data>
<Property name="AbladestelleAdresse"/>
<Property name="AbladestelleBemerkung"/>
<Property name="AbladestelleName"/>
<Property name="AbladestelleOrt"/>
<Property name="AbladestellePlz"/>
<Property name="AbladestellePlzZusatz"/>
<Property name="AbladestelleStrasse"/>
<Property name="AuftragsNr"/>
<Property name="Chauffeur"/>
<Property name="EffektivAnkuftszeit"/>
<Property name="EffektivDatum"/>
<Property name="EffektivDistanz"/>
<Property name="EffektivGewicht"/>
<Property name="EffektivZeitbedarf"/>
<Property name="Fahrzeug"/>
<Property name="Kunde"/>
<Property name="LadestelleAdresse"/>
<Property name="LadestelleBemerkung"/>
<Property name="LadestelleName"/>
<Property name="LadestelleOrt"/>
<Property name="LadestellePlz"/>
<Property name="LadestellePlzZusatz"/>
<Property name="LadestelleStrasse"/>
<Property name="Mandant"/>
<Property name="Material"/>
<Property name="MaterialBemerkung"/>
<Property name="Mulde"/>
<Property name="SollAnkuftszeit"/>
<Property name="SollDatum"/>
<Property name="SollDistanz"/>
<Property name="SollGewicht"/>
<Property name="SollZeitbedarf"/>
<Property name="Stellen"/>
<Property name="Tauschen"/>
<Property name="Wegnehmen"/>
</Storage>
</Class>


<Class name="DBSpezial.Lohn.AF.EinsatzPosAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62306,56572.86255</TimeCreated>

<Query name="ListeByAdresse">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,AdressOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	ID,
			Auftragsdatum,
			Anzahl,
			ZeitProEinheit,
			Zeitbedarf,
			Wegzeit,
			Einsatzort,
			Einsatzbeginn,
			EinsatzArtikel->FaktArtikel->ArtikelNr As "ArtikelNr",
			DBFakturierung.Artikel_GetArtikeltextClass(EinsatzArtikel->FaktArtikel->ID, :MandantOid, :Lang) As "Bezeichnung",
			Maschinist->NameVorname As "MaschinistNameVorname",
			DBFakturierung_SD.Mengencode_GetTextClass(EinsatzArtikel->FaktArtikel->Mengeneinheit, :MandantOid, :Lang) As "Mengeneinheit"
	FROM DBSpezial_Lohn.EinsatzPos
	WHERE Adresse->Mandant = :MandantOid
	AND Adresse->ID = :AdressOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Lohn.AF.SD.TraktorfuehrerAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62272,56592.26608</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, HandyNr, Mandant, NameVorname
	FROM DBSpezial_Lohn_SD.Traktorfuehrer
	WHERE Mandant = :MandantOid
	ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr , NameVorname, HandyNr, Mandant
	FROM DBSpezial_Lohn_SD.Traktorfuehrer as Stammdate 
	WHERE Mandant = :MandantOid
	ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Lohn.AF.StuecklisteAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62326,38221.008961</TimeCreated>

<Query name="ListeByArtikel">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,LohnArtikelOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	ID,
			PosNr,
			Anzahl,
			DBFakturierung.Artikel_GetArtikeltextClass(UnterArtikel->FaktArtikel->ID, :MandantOid, :Lang) As "Bezeichnung",
			UnterArtikel->FaktArtikel->ArtikelNr As "ArtikelNr",
			UnterArtikel->FaktArtikel->Basispreis As "Preis"
	FROM DBSpezial_Lohn.Stueckliste
	WHERE UnterArtikel->FaktArtikel->Mandant = :MandantOid
	AND HauptArtikel->ID = :LohnArtikelOid
	ORDER BY PosNr]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonArtikelNr:%String,BisArtikelNr:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	ID As "StkListe.ID",
			PosNr As "StkListe.PosNr",
			Anzahl As "StkListe.Anzahl",
			UnterArtikel->FaktArtikel->ArtikelNr As "UnterArtikel.ArtikelNr",
			DBFakturierung.Artikel_GetArtikeltextClass(UnterArtikel->FaktArtikel->ID, :MandantOid, :Lang) As "UnterArtikel.Bezeichnung",
			UnterArtikel->FaktArtikel->Basispreis As "UnterArtikel.Basispreis",
			HauptArtikel->FaktArtikel->ArtikelNr As "HauptArtikel.ArtikelNr",
			DBFakturierung.Artikel_GetArtikeltextClass(HauptArtikel->FaktArtikel->ID, :MandantOid, :Lang) As "HauptArtikel.Bezeichnung",
			DBFakturierung_SD.Mengencode_GetTextClass(UnterArtikel->FaktArtikel->Mengeneinheit, :MandantOid, :Lang) AS "UnterArtikel.Mengeneinheit"
	FROM DBSpezial_Lohn.Stueckliste
	WHERE UnterArtikel->FaktArtikel->Mandant = :MandantOid
	AND HauptArtikel->FaktArtikel->ArtikelNr BETWEEN :VonArtikelNr AND :BisArtikelNr
	ORDER BY HauptArtikel->FaktArtikel->ArtikelNr, PosNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Lohn.Artikel">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57333.428897</TimeChanged>
<TimeCreated>62305,55082.354032</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="EinsatzPos">
<Type>DBSpezial.Lohn.EinsatzPos</Type>
<Cardinality>many</Cardinality>
<Inverse>EinsatzArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="FaktArtikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>parent</Cardinality>
<Inverse>EinsatzArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="FaktArtikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FaktArtikelIdx">
<Properties>FaktArtikel</Properties>
<Unique>1</Unique>
</Index>

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

<Method name="GetOidByArtOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtikelOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set retval = ""
	Set strSQL="SELECT ID FROM DBSpezial_Lohn.Artikel WHERE FaktArtikel ='"_ArtikelOid_"'"
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
	IF $$$ISOK(sc) {
		If (rs.Next(.sc)) {
			set retval = rs.Data("ID")		
		}
	}
	Quit retval
]]></Implementation>
</Method>

<Property name="StkListeHauptArtikel">
<Type>DBSpezial.Lohn.Stueckliste</Type>
<Cardinality>many</Cardinality>
<Inverse>HauptArtikel</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="StkListeUnterArtikel">
<Type>DBSpezial.Lohn.Stueckliste</Type>
<Cardinality>many</Cardinality>
<Inverse>UnterArtikel</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="WegzeitArtikel">
<Description>
Relation auf sich selbst.</Description>
<Type>DBSpezial.Lohn.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>LohnArtikel</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="WegzeitArtikelIndex">
<Properties>WegzeitArtikel</Properties>
</Index>

<Property name="LohnArtikel">
<Type>DBSpezial.Lohn.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>WegzeitArtikel</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("EinsatzArtikel")</DataLocation>
<DefaultData>ArtikelDefaultData</DefaultData>
<IdLocation>^DBFakturierung.ArtikelC("EinsatzArtikel")</IdLocation>
<IndexLocation>^DBSpezial.Lohn.ArtikelI</IndexLocation>
<StreamLocation>^DBSpezial.Lohn.ArtikelS</StreamLocation>
<Data name="ArtikelDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Zeitbedarf</Value>
</Value>
<Value name="3">
<Value>WegzeitArtikel</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Lohn.EinsatzPos">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57231.444418</TimeChanged>
<TimeCreated>62305,55048.742474</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="Adresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>EinsatzPos</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="AdresseIndex">
<Properties>Adresse</Properties>
</Index>

<Property name="EinsatzArtikel">
<Type>DBSpezial.Lohn.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>EinsatzPos</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="EinsatzArtikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="EinsatzArtikelIndex">
<Properties>EinsatzArtikel</Properties>
</Index>

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

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

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

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

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

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

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

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

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

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

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

<Property name="Einsatzbeginn">
<Type>%Time</Type>
</Property>

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

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

<Property name="Maschinist">
<Type>DBSpezial.Lohn.SD.Traktorfuehrer</Type>
<Cardinality>one</Cardinality>
<Inverse>EinsatzPosMaschinist</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="MaschinistIndex">
<Properties>Maschinist</Properties>
</Index>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Lohn.EinsatzPosD</DataLocation>
<DefaultData>EinsatzPosDefaultData</DefaultData>
<IdLocation>^DBSpezial.Lohn.EinsatzPosD</IdLocation>
<IndexLocation>^DBSpezial.Lohn.EinsatzPosI</IndexLocation>
<StreamLocation>^DBSpezial.Lohn.EinsatzPosS</StreamLocation>
<Data name="EinsatzPosDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Adresse</Value>
</Value>
<Value name="3">
<Value>EinsatzArtikel</Value>
</Value>
<Value name="4">
<Value>Auftragsdatum</Value>
</Value>
<Value name="5">
<Value>Anzahl</Value>
</Value>
<Value name="6">
<Value>AnzahlEffektiv</Value>
</Value>
<Value name="7">
<Value>OffenerAuftrag</Value>
</Value>
<Value name="8">
<Value>Zeitbedarf</Value>
</Value>
<Value name="9">
<Value>ZeitbedarfEffektiv</Value>
</Value>
<Value name="10">
<Value>Wegzeit</Value>
</Value>
<Value name="11">
<Value>WegzeitEffektiv</Value>
</Value>
<Value name="12">
<Value>Einsatzort</Value>
</Value>
<Value name="13">
<Value>Einsatzbeginn</Value>
</Value>
<Value name="14">
<Value>Abgerechnet</Value>
</Value>
<Value name="15">
<Value>Verfallen</Value>
</Value>
<Value name="16">
<Value>Maschinist</Value>
</Value>
<Value name="17">
<Value>ZeitProEinheit</Value>
</Value>
<Value name="18">
<Value>ZeitProEinheitEffektiv</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Lohn.SD.Traktorfuehrer">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57291.768633</TimeChanged>
<TimeCreated>62272,55271.545852</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="Nr">
<Type>%Integer</Type>
</Property>

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

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

<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 DBSpezial_Lohn_SD.Traktorfuehrer
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Property name="EinsatzPosMaschinist">
<Type>DBSpezial.Lohn.EinsatzPos</Type>
<Cardinality>many</Cardinality>
<Inverse>Maschinist</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.LCB2C.TraktorfuehrerD</DataLocation>
<DefaultData>TraktorfuehrerDefaultData</DefaultData>
<IdLocation>^DBSpezial.LCB2C.TraktorfuehrerD</IdLocation>
<IndexLocation>^DBSpezial.LCB2C.TraktorfuehrerI</IndexLocation>
<StreamLocation>^DBSpezial.LCB2C.TraktorfuehrerS</StreamLocation>
<Data name="TraktorfuehrerDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
<Value name="4">
<Value>NameVorname</Value>
</Value>
<Value name="5">
<Value>HandyNr</Value>
</Value>
</Data>
<Property name="HandyNr"/>
<Property name="Mandant"/>
<Property name="NameVorname"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Lohn.Stueckliste">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57231.575894</TimeChanged>
<TimeCreated>62312,40798.329804</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="HauptArtikel">
<Type>DBSpezial.Lohn.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>StkListeHauptArtikel</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="HauptArtikelIndex">
<Properties>HauptArtikel</Properties>
</Index>

<Property name="UnterArtikel">
<Type>DBSpezial.Lohn.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>StkListeUnterArtikel</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="UnterArtikelIndex">
<Properties>UnterArtikel</Properties>
</Index>

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

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

<Method name="GetNextPosNrByArtikel">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtikelOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set aktPosNr = ""
	&sql(SELECT MAX(PosNr) INTO :aktPosNr
		     	FROM DBSpezial_Lohn.Stueckliste
		     	WHERE HauptArtikel = :ArtikelOid)
	quit aktPosNr +1
]]></Implementation>
</Method>

<Method name="InsertInStkListeByIndex">
<ClassMethod>1</ClassMethod>
<FormalSpec>LohnArtikelOid:%String,PosNr:%Integer,StkListeOid:%String</FormalSpec>
<Implementation><![CDATA[
	set BisPosNr = 0
	// Dem Tourdetail welches zu verschieben ist wird temporär die 0 zugewiesen, damit es keine Konflikte gibt
	set tourDet = ##class(DBSpezial.Lohn.Stueckliste).%OpenId(StkListeOid)
	set DetPosNr = tourDet.PosNr
	set tourDet.PosNr = 0
	d tourDet.%Save()
	
	set AktMaxPosNr = (##class(DBSpezial.Lohn.Stueckliste).GetNextPosNrByArtikel(LohnArtikelOid) - 1)
	
	Set strSQL = "SELECT ID FROM DBSpezial_Lohn.Stueckliste WHERE HauptArtikel->ID = '"_LohnArtikelOid_"' "
	if (DetPosNr < PosNr) {
		set strSQL = strSQL_" AND PosNr between "_DetPosNr_" AND "_PosNr_" Order By PosNr"
	} else {
		set strSQL = strSQL_" AND PosNr between "_PosNr_" AND "_DetPosNr_" Order By PosNr"
	}
	write strSQL, !
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
    IF $$$ISOK(sc) {
		While rs.Next(.sc) {
			set id = rs.Data("ID")
			w id, !
			set tmpTourDet = ##class(DBSpezial.Lohn.Stueckliste).%OpenId(id)
			w "Alte PosNr: ", tmpTourDet,!
			if (tmpTourDet '= "") {
				// Wenn jetzige Nummer tiefer als neue müssen alle zwichen der jetzigen und der neuen
				// um eins vermindert werden bevor die neue eingefügt werden kann
				if (DetPosNr < PosNr) {
					set tmpTourDet = ##class(DBSpezial.Lohn.Stueckliste).%OpenId(id)
					if (tmpTourDet '= "") {
						set tmpTourDet.PosNr = tmpTourDet.PosNr - 1
					}
				} else {
					// Wenn jetzige Nummer höher als neue müssen alle zwichen der jetzigen und der neuen
					// um eins erhöht werden bevor die neue eingefügt werden kann
					set tmpTourDet.PosNr = tmpTourDet.PosNr + 1
				}
				set state = tmpTourDet.%Save()
				If $$$ISERR(state) {
					w "Fehler beim speichern ", state, !
				}
			}
		}
	}
	
	// Nach dem alle Verschoben worden sind kann num die gewünschte Positionsnummer zugeteilt werden
	set tourDet = ##class(DBSpezial.Lohn.Stueckliste).%OpenId(StkListeOid)
	set tourDet.PosNr = PosNr
	d tourDet.%Save()
]]></Implementation>
</Method>

<Method name="RenumberStkListe">
<ClassMethod>1</ClassMethod>
<FormalSpec>LohnArtikelOid:%String</FormalSpec>
<Implementation><![CDATA[
	Set strSQL = "SELECT ID FROM DBSpezial_Lohn.Stueckliste WHERE HauptArtikel->ID = '"_LohnArtikelOid_"' Order By PosNr"
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
	Set posNr = 1
	
	IF $$$ISOK(sc) {
		While rs.Next(.sc) {
			Set currId =rs.Data("ID")
			set tourDet = ##class(DBSpezial.Lohn.Stueckliste).%OpenId(currId)
			if (tourDet '= "") {
				if (tourDet.PosNr '= posNr) {
					set tourDet.PosNr = posNr
					set state = tourDet.%Save()
				}
				k tourDet
				set posNr = posNr +1
			}
		}
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Lohn.StuecklisteD</DataLocation>
<DefaultData>StuecklisteDefaultData</DefaultData>
<IdLocation>^DBSpezial.Lohn.StuecklisteD</IdLocation>
<IndexLocation>^DBSpezial.Lohn.StuecklisteI</IndexLocation>
<StreamLocation>^DBSpezial.Lohn.StuecklisteS</StreamLocation>
<Data name="StuecklisteDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>HauptArtikel</Value>
</Value>
<Value name="3">
<Value>UnterArtikel</Value>
</Value>
<Value name="4">
<Value>PositionsNr</Value>
</Value>
<Value name="5">
<Value>Anzahl</Value>
</Value>
<Value name="6">
<Value>PosNr</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Mecano.AF.ArtikelAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62409,63497.905621</TimeCreated>

<Query name="ListArtGrpBaumSortArtNr">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,ArtGrpOid:%String,Lang:%String,NurAkt:%Boolean,Kunde:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT  FaktArtikel->ID, 
    FaktArtikel->ArtikelNr, 
    FaktArtikel->Kurztext, 
    DBFakturierung.Artikel_GetArtikeltextClass(FaktArtikel->ID, :MandantOid, :Lang) As Artikeltext
    FROM DBSpezial_Mecano.Artikel
    WHERE  FaktArtikel->Mandant = :MandantOid 
    AND FaktArtikel->Artikelgruppe = :ArtGrpOid
    AND Kunde = :Kunde
    AND ((:NurAkt = 0) OR ( FaktArtikel->ArtikelAktiv = :NurAkt))
    ORDER BY  FaktArtikel->ArtikelNr]]></SqlQuery>
</Query>

<Query name="ListArtGrpBaumSortKurz">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,ArtGrpOid:%String,Lang:%String,NurAkt:%Boolean,Kunde:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT FaktArtikel->ID, 
    FaktArtikel->ArtikelNr, 
    FaktArtikel->Kurztext, 
    DBFakturierung.Artikel_GetArtikeltextClass(FaktArtikel->ID, :MandantOid, :Lang) As Artikeltext
    FROM DBSpezial_Mecano.Artikel
    WHERE FaktArtikel->Mandant = :MandantOid 
    AND FaktArtikel->Artikelgruppe = :ArtGrpOid 
    AND Kunde = :Kunde
    AND ((:NurAkt = 0) OR (FaktArtikel->ArtikelAktiv = :NurAkt))
    ORDER BY FaktArtikel->Kurztext]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Mecano.AF.SD.MaschintypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62045,29947.083868</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Mecano_SD.Maschintyp_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Mecano_SD.Maschintyp
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, ' ' As wert1,DBSpezial_Mecano_SD.Maschintyp_GetTextClass(%ID, :MandantOid, :Lang) As wert2, 
	Mandant
	FROM DBSpezial_Mecano_SD.Maschintyp as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Mecano.AF.SD.WerkzeugArtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62207,31040.12408</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Mecano_SD.WerkzeugArt_GetTextClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
	Mandant
	FROM DBSpezial_Mecano_SD.WerkzeugArt
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, ' ' As wert1,DBSpezial_Mecano_SD.WerkzeugArt_GetTextClass(%ID, :MandantOid, :Lang) As wert2, 
	Mandant
	FROM DBSpezial_Mecano_SD.WerkzeugArt as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Mecano.AF.VorkalkAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62074,41565.158395</TimeCreated>

<Query name="ListeByArtikel">
<Type>%SQLQuery</Type>
<FormalSpec>ArtikelOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID,Nummer
	FROM DBSpezial_Mecano.Vorkalk
	WHERE Artikel = :ArtikelOid ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Mecano.AF.VorkalkPosAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62074,43921.819741</TimeCreated>

<Query name="ListeByKalkulation">
<Type>%SQLQuery</Type>
<FormalSpec>KalkOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PositionsNr,  NVL(DBIntrap_SD.Arbeitsposition_GetBezeichnungClass(Arbeitsposition, Arbeitsposition->Mandant, :Lang),'') As Arbeitsposition,
	 Bezeichnung, SollZeit, EinrichtZeit, Ansatz, DBFakturierung_SD.Hilfstexte_GetTextClass(Einheit, Einheit->Mandant, :Lang) AS Einheit
	FROM DBSpezial_Mecano.VorkalkPos
	WHERE Vorkalkulation = :KalkOid ORDER BY PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Mecano.AF.WerkzeugAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62207,49407.441803</TimeCreated>

<Query name="ListeByWerkzeugArt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,WerkzeugArtOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, WerkzeugNr, WerkzeugArt->Nr AS WerkzeugartNr,
	DBSpezial_Mecano.Werkzeug_GetBezeichnung1Class(%ID, :MandantOid, :Lang) AS Bezeichnung
	FROM DBSpezial_Mecano.Werkzeug
	WHERE Mandant = :MandantOid AND WerkzeugArt = :WerkzeugArtOid
	ORDER BY WerkzeugNr]]></SqlQuery>
</Query>

<Query name="GetEntryByArtNr">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,ArtNr:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, WerkzeugNr, WerkzeugArt->Nr AS WerkzeugartNr,
	ArtNrCalc AS ArtNr,
	DBSpezial_Mecano.Werkzeug_GetBezeichnung1Class(%ID, :MandantOid, :Lang) AS Bezeichnung
	FROM DBSpezial_Mecano.Werkzeug
	WHERE Mandant = :MandantOid AND ArtNrCalc LIKE :ArtNr
	ORDER BY ArtNrCalc]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonArtNr:%String,BisArtNr:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, WerkzeugNr, WerkzeugArt->Nr AS WerkzeugartNr, ArtNrCalc,
	Freigabe, Pruefdatum, Pruefungsintervall, Freigabedatum,
	DBSpezial_Mecano_SD.WerkzeugArt_GetTextClass(WerkzeugArt, :MandantOid, :Lang) As WerkzeugArt,
	DBSpezial_Mecano.Werkzeug_GetBezeichnung1Class(%ID, :MandantOid, :Lang) AS Bezeichnung
	FROM DBSpezial_Mecano.Werkzeug
	WHERE Mandant = :MandantOid 
	AND ArtNrCalc BETWEEN :VonArtNr AND :BisArtNr
	ORDER BY ArtNrCalc]]></SqlQuery>
</Query>

<Query name="ListeInventar">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonArtNr:%String,BisArtNr:%String,NurMitBestand:%Boolean,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, WerkzeugNr, WerkzeugArt->Nr AS WerkzeugartNr, ArtNrCalc, NVL(DurchschnittlicherEKP*Lagerbestand,0) AS Betrag,
	NVL(Lagerbestand,0) AS Lagerbestand, NVL(DurchschnittlicherEKP,0) AS DurchschnittlicherEKP, LetzterEKP, 
	NVL(VerfuegbarMenge,0) AS VerfuegbarMenge, NVL(Mindestbestand,0) AS Mindestbestand, NVL(Reservation,0) AS Reservation, 
	LieferantBestellt,
	DBFakturierung_SD.Mengencode_GetTextClass(Einheit, :MandantOid, :Lang) AS Einheit,
	DBSpezial_Mecano_SD.WerkzeugArt_GetTextClass(WerkzeugArt, :MandantOid, :Lang) As WerkzeugArt,
	DBSpezial_Mecano.Werkzeug_GetBezeichnung1Class(%ID, :MandantOid, :Lang) AS Bezeichnung1,
	DBSpezial_Mecano.Werkzeug_GetBezeichnung2Class(%ID, :MandantOid, :Lang) AS Bezeichnung2
	FROM DBSpezial_Mecano.Werkzeug
	WHERE Mandant = :MandantOid 
	AND ArtNrCalc BETWEEN :VonArtNr AND :BisArtNr
	AND ((:NurMitBestand = 0) OR (Lagerbestand > 0))
	ORDER BY ArtNrCalc]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Mecano.Artikel">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57333.586497</TimeChanged>
<TimeCreated>62040,59530.26418</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="FaktArtikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>parent</Cardinality>
<Inverse>MecanoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="FaktArtikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FaktArtikelIdx">
<Properties>FaktArtikel</Properties>
<Unique>1</Unique>
</Index>

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

<Property name="ZeichnungsNr">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="ArtikelNrKunde">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

<Property name="Kunde">
<Type>DBDebiKredi.Debitor</Type>
<Cardinality>one</Cardinality>
<Inverse>MecanoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Kunde"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

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

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

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

<Property name="Zusatzinfo">
<Type>%String</Type>
<Parameter name="MAXLEN" value="6500"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

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

<Property name="EinzelkalkulationPreis">
<Type>%Decimal</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {EinzelkalkulationPreis}=##class(DBSpezial.Mecano.Artikel).GetEinzelkalkulationPreisClass({ID}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="EinzelkalkulationBetrag">
<Type>%Decimal</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {EinzelkalkulationBetrag}=##class(DBSpezial.Mecano.Artikel).GetEinzelkalkulationBetragClass({ID}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Vorkalkulation">
<Type>DBSpezial.Mecano.Vorkalk</Type>
<Cardinality>many</Cardinality>
<Inverse>Artikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Method name="GetNextLaufNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>Kunde:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set Nummer = 0
	&sql(SELECT MAX(Laufnummer) INTO :Nummer FROM DBSpezial_Mecano.Artikel WHERE Kunde = :Kunde)
	Quit:(SQLCODE'=0) 1
	Quit (Nummer+1)
]]></Implementation>
</Method>

<Method name="GetArtikelNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>AdressNr:%Integer,Laufnummer:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set artNr = AdressNr
	set laufNrStr = Laufnummer
	while(Len(laufNrStr) < 5) {
		set laufNrStr = " "_laufNrStr
	}
	set artNr = artNr_"-"_laufNrStr
	quit artNr
]]></Implementation>
</Method>

<Method name="GetOidByArtOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtikelOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set retval = ""
	Set strSQL="SELECT ID FROM DBSpezial_Mecano.Artikel WHERE FaktArtikel ='"_ArtikelOid_"'"
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
	IF $$$ISOK(sc) {
		If (rs.Next(.sc)) {
			set retval = rs.Data("ID")		
		}
	}
	Quit retval
]]></Implementation>
</Method>

<Method name="GetIdByZeichnungsNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>ZeichnungsNr:%String,MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	
	Set strSQL="SELECT FaktArtikel->ID AS ID FROM DBSpezial_Mecano.Artikel WHERE FaktArtikel->Mandant='"_MandOid_"' "
	set strSQL=strSQL_"AND ZeichnungsNr='"_ZeichnungsNr_"'"
	
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
	IF $$$ISOK(sc) {
		if (rs.Next(.sc)) {
			Set id=rs.Data("ID")
		}
	}
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByArtNrKunde">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtikelNrKunde:%String,MandOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	
	Set strSQL="SELECT FaktArtikel->ID AS ID FROM DBSpezial_Mecano.Artikel WHERE FaktArtikel->Mandant='"_MandOid_"' "
	set strSQL=strSQL_"AND ArtikelNrKunde='"_ArtikelNrKunde_"'"
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
	IF $$$ISOK(sc) {
		if (rs.Next(.sc)) {
			Set id=rs.Data("ID")
		}
	}
	Quit id
]]></Implementation>
</Method>

<Method name="GetEinzelkalkulationPreisClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>ID:%String</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set preis = 0
	set art = ##class(DBSpezial.Mecano.Artikel).%OpenId(ID)
	if (art '= "" && +art.EinzelkalkulationAnzahl '= 0) {
		set preis = (art.Einrichtungskosten/art.EinzelkalkulationAnzahl) + art.NachkalkulationVP
	}
	quit preis
]]></Implementation>
</Method>

<Method name="GetEinzelkalkulationBetragClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>ID:%String</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set preis = 0
	set art = ##class(DBSpezial.Mecano.Artikel).%OpenId(ID)
	if (art '= "" && +art.EinzelkalkulationAnzahl '= 0) {
		set preis = art.Einrichtungskosten + (art.NachkalkulationVP*art.EinzelkalkulationAnzahl)
	}
	quit preis
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("MecanoArtikel")</DataLocation>
<DefaultData>ArtikelDefaultData</DefaultData>
<IdLocation>^DBFakturierung.ArtikelC("MecanoArtikel")</IdLocation>
<IndexLocation>^DBSpezial.Mecano.ArtikelI</IndexLocation>
<StreamLocation>^DBSpezial.Mecano.ArtikelS</StreamLocation>
<Data name="ArtikelDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Laufnummer</Value>
</Value>
<Value name="3">
<Value>ZeichnungsNr</Value>
</Value>
<Value name="4">
<Value>ArtikelNrKunde</Value>
</Value>
<Value name="5">
<Value>Bemerkung2</Value>
</Value>
<Value name="6">
<Value>Kunde</Value>
</Value>
<Value name="7">
<Value>ErsteKalkulation</Value>
</Value>
<Value name="8">
<Value>Einrichtungskosten</Value>
</Value>
<Value name="9">
<Value>VorkalkulationVP</Value>
</Value>
<Value name="10">
<Value>NachkalkulationVP</Value>
</Value>
<Value name="11">
<Value>KalkulierterVPV</Value>
</Value>
<Value name="12">
<Value>Zusatzinfo</Value>
</Value>
<Value name="13">
<Value>LetzteKalkulation</Value>
</Value>
<Value name="14">
<Value>EinzelkalkulationDatum</Value>
</Value>
<Value name="15">
<Value>EinzelkalkulationAnzahl</Value>
</Value>
</Data>
<Property name="ArtikelNrKunde"/>
<Property name="Bemerkung2"/>
<Property name="Einrichtungskosten"/>
<Property name="EinzelkalkulationAnzahl"/>
<Property name="EinzelkalkulationBetrag"/>
<Property name="EinzelkalkulationDatum"/>
<Property name="EinzelkalkulationPreis"/>
<Property name="ErsteKalkulation"/>
<Property name="FaktArtikel"/>
<Property name="KalkulierterVPV"/>
<Property name="Kunde"/>
<Property name="Laufnummer"/>
<Property name="LetzteKalkulation"/>
<Property name="NachkalkulationVP"/>
<Property name="VorkalkulationVP"/>
<Property name="ZeichnungsNr"/>
<Property name="Zusatzinfo"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Mecano.SD.Maschintyp">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57291.869639</TimeChanged>
<TimeCreated>62040,59716.729119</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="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>

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

<Method name="GetTextClass">
<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(DBSpezial.Mecano.SD.Maschintyp).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Mecano_SD.Maschintyp
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.MecanC77B.MaschintypD</DataLocation>
<DefaultData>MaschintypDefaultData</DefaultData>
<IdLocation>^DBSpezial.MecanC77B.MaschintypD</IdLocation>
<IndexLocation>^DBSpezial.MecanC77B.MaschintypI</IndexLocation>
<StreamLocation>^DBSpezial.MecanC77B.MaschintypS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="MaschintypDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Mecano.SD.WerkzeugArt">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57291.966978</TimeChanged>
<TimeCreated>62207,30951.834454</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="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="Werkzeug">
<Type>DBSpezial.Mecano.Werkzeug</Type>
<Cardinality>many</Cardinality>
<Inverse>WerkzeugArt</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Mecano.SD.WerkzeugArt).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Mecano_SD.WerkzeugArt
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.MecaC77B.WerkzeugArtD</DataLocation>
<DefaultData>WerkzeugArtDefaultData</DefaultData>
<IdLocation>^DBSpezial.MecaC77B.WerkzeugArtD</IdLocation>
<IndexLocation>^DBSpezial.MecaC77B.WerkzeugArtI</IndexLocation>
<StreamLocation>^DBSpezial.MecaC77B.WerkzeugArtS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="WerkzeugArtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Mecano.Vorkalk">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57231.816156</TimeChanged>
<TimeCreated>62074,40157.554237</TimeCreated>
<Inheritance>right</Inheritance>

<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="Artikel">
<Type>DBSpezial.Mecano.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>Vorkalkulation</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Artikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="ArtikelIndex">
<Properties>Artikel</Properties>
</Index>

<Property name="Position">
<Type>DBSpezial.Mecano.VorkalkPos</Type>
<Cardinality>children</Cardinality>
<Inverse>Vorkalkulation</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Method name="GetNextFreeNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtikelOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBSpezial_Mecano.Vorkalk WHERE Artikel = :ArtikelOid)
	Quit +nr+1
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Mecano.VorkalkD</DataLocation>
<DefaultData>VorkalkDefaultData</DefaultData>
<IdLocation>^DBSpezial.Mecano.VorkalkD</IdLocation>
<IndexLocation>^DBSpezial.Mecano.VorkalkI</IndexLocation>
<StreamLocation>^DBSpezial.Mecano.VorkalkS</StreamLocation>
<Data name="VorkalkDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Artikel</Value>
</Value>
<Value name="3">
<Value>PositionsNr</Value>
</Value>
<Value name="4">
<Value>Arbeitsposition</Value>
</Value>
<Value name="5">
<Value>SollZeit</Value>
</Value>
<Value name="6">
<Value>EinrichtZeit</Value>
</Value>
<Value name="7">
<Value>Ansatz</Value>
</Value>
<Value name="8">
<Value>Einheit</Value>
</Value>
<Value name="9">
<Value>Nummer</Value>
</Value>
</Data>
<Property name="Artikel"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBSpezial.Mecano.VorkalkPos">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57292.06062</TimeChanged>
<TimeCreated>62074,42966.832919</TimeCreated>
<Inheritance>right</Inheritance>

<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">
<Type>%String</Type>
<Parameter name="MAXLEN" value="3"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

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

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

<Property name="Einheit">
<Type>DBFakturierung.SD.Mengencode</Type>
<Cardinality>one</Cardinality>
<Inverse>VorkalkEinheit</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Einheit"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Vorkalkulation">
<Type>DBSpezial.Mecano.Vorkalk</Type>
<Cardinality>parent</Cardinality>
<Inverse>Position</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Method name="GetNextFreeNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>KalkOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(PositionsNr) into :nr From DBSpezial_Mecano.VorkalkPos WHERE Vorkalkulation = :KalkOid)
	Quit +nr+1
]]></Implementation>
</Method>

<Method name="GetIdByArtikelPosNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtikelOid:%String,KalkNr:%Integer,PosNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	Set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Mecano.VorkalkPos WHERE Vorkalkulation->Artikel = :ArtikelOid AND Vorkalkulation->Nummer = :KalkNr AND PositionsNr = :PosNr)
	quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Position")</DataLocation>
<DefaultData>VorkalkPosDefaultData</DefaultData>
<IdLocation>^DBSpezial.Mecano.VorkalkC("Position")</IdLocation>
<IndexLocation>^DBSpezial.Mecano.VorkalkPosI</IndexLocation>
<StreamLocation>^DBSpezial.Mecano.VorkalkPosS</StreamLocation>
<Data name="VorkalkPosDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Arbeitsposition</Value>
</Value>
<Value name="4">
<Value>SollZeit</Value>
</Value>
<Value name="5">
<Value>EinrichtZeit</Value>
</Value>
<Value name="6">
<Value>Ansatz</Value>
</Value>
<Value name="7">
<Value>Einheit</Value>
</Value>
<Value name="8">
<Value>Bezeichnung</Value>
</Value>
</Data>
<Property name="Ansatz"/>
<Property name="Arbeitsposition"/>
<Property name="Bezeichnung"/>
<Property name="Einheit"/>
<Property name="EinrichtZeit"/>
<Property name="PositionsNr"/>
<Property name="SollZeit"/>
<Property name="Vorkalkulation"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Mecano.Werkzeug">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57292.243766</TimeChanged>
<TimeCreated>62207,31178.705128</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>

<Index name="MandantArtNrIdx">
<Properties>Mandant,WerkzeugArt,WerkzeugNr</Properties>
</Index>

<Index name="MandantNrIdx">
<Properties>Mandant,WerkzeugNr</Properties>
</Index>

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

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

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

<Property name="WerkzeugArt">
<Type>DBSpezial.Mecano.SD.WerkzeugArt</Type>
<Cardinality>one</Cardinality>
<Inverse>Werkzeug</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="WerkzeugArt"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

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

<Property name="VerfuegbarMenge">
<Type>%Decimal</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {VerfuegbarMenge}={Lagerbestand}-{Reservation} </SqlComputeCode>
<SqlComputed>1</SqlComputed>
</Property>

<Property name="LetzterEKP">
<Description>
Letzter EKspreis</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="DurchschnittlicherEKP">
<Description>
Durchschnittlicher EKP</Description>
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

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

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

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

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

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

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

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

<Property name="LieferantBestellt">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>WerkzeugBestellt</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="LieferantBestellt"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Lieferant1">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>WerkzeugLieferant1</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Lieferant1"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Lieferant2">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>WerkzeugLieferant2</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Lieferant2"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Lieferant3">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>WerkzeugLieferant3</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Lieferant3"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

<Property name="MwstEK">
<Type>DBFibu.SD.Mwst</Type>
<Cardinality>one</Cardinality>
<Inverse>WerkzeugEK</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="MwstEK"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Einheit">
<Type>DBFakturierung.SD.Mengencode</Type>
<Cardinality>one</Cardinality>
<Inverse>WerkzeugEinheit</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Einheit"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="ArtNrCalc">
<Type>%String</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {ArtNrCalc}=##class(DBSpezial.Mecano.Werkzeug).GetArtNrClass({WerkzeugArt},{WerkzeugNr}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
</Property>

<Index name="ArtNrMoveIndex">
<Data>%%ID,ArtNrCalc,WerkzeugNr,Bezeichnung1(ELEMENTS)</Data>
<Properties>Mandant:Exact,Bezeichnung1(KEYS),ArtNrCalc</Properties>
</Index>

<Method name="GetArtNrClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>WerkzeugArtOid:%String,WerkzeugNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set art = ##class(DBSpezial.Mecano.SD.WerkzeugArt).%OpenId(WerkzeugArtOid)
	if (art="") {
		Quit "000-"_WerkzeugNr
	} else {
		set retval = art.Nr
		while ($L(retval) '= 3) {
			set retval = "0"_retval
		}
		set retval = retval_"-"_WerkzeugNr
		Quit retval
	}
]]></Implementation>
</Method>

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

<Method name="GetBezeichnung1Class">
<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(DBSpezial.Mecano.Werkzeug).%OpenId(myID)
		set text = rs.GetBezeichnung1(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

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

<Method name="GetBezeichnung2Class">
<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(DBSpezial.Mecano.Werkzeug).%OpenId(myID)
		set text = rs.GetBezeichnung2(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

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

<Method name="GetIdByArtNrCalc">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,ArtNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Mecano.Werkzeug
	     WHERE ArtNrCalc = :ArtNr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

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

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

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

	set art = $Order(^DBSpezial.Mecano.WerkzeugI("ArtNrMoveIndex",MandantOid,Lang,""),1)
	if (art '= ""){
		set id = $Order(^DBSpezial.Mecano.WerkzeugI("ArtNrMoveIndex",MandantOid,Lang,art,""),1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

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

	set art = $Order(^DBSpezial.Mecano.WerkzeugI("ArtNrMoveIndex",MandantOid,Lang,""),-1)
	if (art '= ""){
		set id = $Order(^DBSpezial.Mecano.WerkzeugI("ArtNrMoveIndex",MandantOid,Lang,art,""),-1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnArtNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Lang:%String,aktArtikelNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set nextArt = $Order(^DBSpezial.Mecano.WerkzeugI("ArtNrMoveIndex",MandantOid,Lang," "_aktArtikelNr))
	if (nextArt '= "") {
		set res = $Order(^DBSpezial.Mecano.WerkzeugI("ArtNrMoveIndex",MandantOid,Lang,nextArt,""),1,list)
	} else {
		set list = ##class(DBSpezial.Mecano.Werkzeug).MoveLastOnArtNr(MandantOid,Lang)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnArtNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Lang:%String,aktArtikelNr:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set prevArt = $Order(^DBSpezial.Mecano.WerkzeugI("ArtNrMoveIndex",MandantOid,Lang," "_aktArtikelNr),-1)
	if (prevArt '= "") {
		set res = $Order(^DBSpezial.Mecano.WerkzeugI("ArtNrMoveIndex",MandantOid,Lang,prevArt,""),-1,list)
	} else {
		set list = ##class(DBSpezial.Mecano.Werkzeug).MoveFirstOnArtNr(MandantOid,Lang)
	}
	
	Quit list
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Mecano.WerkzeugD</DataLocation>
<DefaultData>WerkzeugDefaultData</DefaultData>
<IdLocation>^DBSpezial.Mecano.WerkzeugD</IdLocation>
<IndexLocation>^DBSpezial.Mecano.WerkzeugI</IndexLocation>
<StreamLocation>^DBSpezial.Mecano.WerkzeugS</StreamLocation>
<Data name="Bezeichnung1">
<Attribute>Bezeichnung1</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung1"</Subscript>
</Data>
<Data name="Bezeichnung2">
<Attribute>Bezeichnung2</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung2"</Subscript>
</Data>
<Data name="WerkzeugDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>ArtikelNr</Value>
</Value>
<Value name="4">
<Value>WerkzeugArt</Value>
</Value>
<Value name="5">
<Value>Lagerbestand</Value>
</Value>
<Value name="6">
<Value>Mindestbestand</Value>
</Value>
<Value name="7">
<Value>Reservation</Value>
</Value>
<Value name="8">
<Value>LetzterEKP</Value>
</Value>
<Value name="9">
<Value>DurchschnittlicherEKP</Value>
</Value>
<Value name="10">
<Value>Bestellt</Value>
</Value>
<Value name="11">
<Value>Bestelldatum</Value>
</Value>
<Value name="12">
<Value>Barcode</Value>
</Value>
<Value name="13">
<Value>Pruefdatum</Value>
</Value>
<Value name="14">
<Value>Pruefungsintervall</Value>
</Value>
<Value name="15">
<Value>Freigabedatum</Value>
</Value>
<Value name="16">
<Value>Freigabe</Value>
</Value>
<Value name="17">
<Value>LieferantBestellt</Value>
</Value>
<Value name="18">
<Value>Lieferant1</Value>
</Value>
<Value name="19">
<Value>Lieferant2</Value>
</Value>
<Value name="20">
<Value>Lieferant3</Value>
</Value>
<Value name="21">
<Value>FibuKontoEK</Value>
</Value>
<Value name="22">
<Value>MwstEK</Value>
</Value>
<Value name="23">
<Value>Einheit</Value>
</Value>
<Value name="24">
<Value>WerkzeugNr</Value>
</Value>
</Data>
<Property name="ArtNrCalc"/>
<Property name="Barcode"/>
<Property name="Bestelldatum"/>
<Property name="Bestellt"/>
<Property name="DurchschnittlicherEKP"/>
<Property name="Einheit"/>
<Property name="FibuKontoEK"/>
<Property name="Freigabe"/>
<Property name="Freigabedatum"/>
<Property name="Lagerbestand"/>
<Property name="LetzterEKP"/>
<Property name="Lieferant1"/>
<Property name="Lieferant2"/>
<Property name="Lieferant3"/>
<Property name="LieferantBestellt"/>
<Property name="Mandant"/>
<Property name="Mindestbestand"/>
<Property name="MwstEK"/>
<Property name="Pruefdatum"/>
<Property name="Pruefungsintervall"/>
<Property name="Reservation"/>
<Property name="VerfuegbarMenge"/>
<Property name="WerkzeugArt"/>
<Property name="WerkzeugNr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.AF.AdresseAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62252,51700.415515</TimeChanged>
<TimeCreated>62252,51153.609423</TimeCreated>

<Query name="ListeAlleOid">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID
	FROM DBSpezial_Ortho.Adresse
	WHERE AdresseAdresse->Mandant = :MandOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.ArtikelAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62139,36002.294104</TimeCreated>

<Query name="ListeArtGrpNurAktBaumSortEan">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,ArtGrpOid:%String,Lang:%String,NurAkt:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT FaktArtikel->%ID, FaktArtikel->ArtikelNr, FaktArtikel->Kurztext, DBFakturierung.Artikel_GetArtikeltextClass(FaktArtikel->%ID, :MandantOid, :Lang) As Artikeltext
    FROM DBSpezial_Ortho.Artikel
    WHERE FaktArtikel->Mandant = :MandantOid AND FaktArtikel->Artikelgruppe = :ArtGrpOid AND FaktArtikel->ArtikelAktiv = 1 
    AND ((:NurAkt = 0) OR (FaktArtikel->ArtikelAktiv = :NurAkt)) AND
    EANLaufnummer <> 0
    ORDER BY EANLaufnummer]]></SqlQuery>
</Query>

<Query name="ListArtGrpBaumSortEan">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,ArtGrpOid:%String,Lang:%String,NurAkt:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT FaktArtikel->%ID, FaktArtikel->ArtikelNr, FaktArtikel->Kurztext, DBFakturierung.Artikel_GetArtikeltextClass(FaktArtikel->%ID, :MandantOid, :Lang) As Artikeltext
    FROM DBSpezial_Ortho.Artikel
    WHERE FaktArtikel->Mandant = :MandantOid AND FaktArtikel->Artikelgruppe = :ArtGrpOid 
    AND ((:NurAkt = 0) OR (FaktArtikel->ArtikelAktiv = :NurAkt)) AND
    EANLaufnummer <> 0
    ORDER BY EANLaufnummer]]></SqlQuery>
</Query>

<Query name="ListeSchuhe">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,ArtikelcodeSchuhe:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT FaktArtikel->ID As ID, 
           FaktArtikel->ArtikelNr, 
           FaktArtikel->Kurztext,
           FaktArtikel->Lieferant1 As "Lieferant.ID",
           FaktArtikel->Lieferant1->Kurzname As "Lieferant.Kurzname",
           FaktArtikel->Lieferant1->Adressnummer As "Lieferant.Adressnummer",
           EANLaufnummer,
		   Schuhgroessentyp,
           Absatz, 
           Weite,
           Leiste,
           Geschlecht As "Geschlecht.ID",
           Geschlecht->Nr As "Geschlecht.Nr",
           DBSpezial_Ortho_SD.Geschlecht_GetTextClass(Geschlecht, :MandantOid, :Lang) As "Geschlecht.Text", 
           Farbe As "Farbe.ID",
           Farbe->Nr As "Farbe.Nr",
           Farbe->FarbNr As "Farbe.FarbNr",
           DBSpezial_Ortho_SD.Farbe_GetTextClass(Farbe, :MandantOid, :Lang) As "Farbe.Text", 
           Form As "Form.ID",
           Form->Nr As "Form.Nr",
           DBSpezial_Ortho_SD.Form_GetTextClass(Form, :MandantOid, :Lang) As "Form.Text", 
           Obermaterial As "Obermaterial.ID",
           Obermaterial->Nr As "Obermaterial.Nr",
           DBSpezial_Ortho_SD.Obermaterial_GetTextClass(Obermaterial, :MandantOid, :Lang) As "Obermaterial.Text", 
           Futter As "Futter.ID",
           Futter->Nr As "Futter.Nr",
           DBSpezial_Ortho_SD.Futter_GetTextClass(Futter, :MandantOid, :Lang) As "Futter.Text", 
           Saison As "Saison.ID",
           Saison->Nr As "Saison.Nr",
           DBSpezial_Ortho_SD.Saison_GetTextClass(Saison, :MandantOid, :Lang) As "Saison.Text", 
           Sohle As "Sohle.ID",
           Sohle->Nr As "Sohle.Nr",
		   DBSpezial_Ortho_SD.Sohle_GetTextClass(Sohle, :MandantOid, :Lang) As "Sohle.Text", 
           Schuhtyp As "Schuhtyp.ID",
		   Schuhtyp->Nr As "Schuhtyp.Nr",
		   DBSpezial_Ortho_SD.Schuhtyp_GetTextClass(Schuhtyp, :MandantOid, :Lang) As "Schuhtyp.Text" 
           
    FROM DBSpezial_Ortho.Artikel
    WHERE FaktArtikel->Mandant = :MandantOid AND 
    		FaktArtikel->Artikelcode = :ArtikelcodeSchuhe
    ORDER BY Schuhgroessentyp->Nr]]></SqlQuery>
</Query>

<Query name="ListeSchuheBySuchkrit">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,ArtikelcodeSchuhe:%Integer,LieferantOid:%String,SchuhtypOid:%String,GeschlechtOid:%String,Leisten:%String,FarbeOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	FaktArtikel->ID As "FaktOid",
			EANLaufnummer,
			FaktArtikel->Kurztext As "Kurztext", 
			FaktArtikel->Lieferant1->Kurzname As "Lieferant",
			DBSpezial_Ortho_SD.Schuhtyp_GetTextClass(Schuhtyp, :MandantOid, :Lang) As "Schuhtyp",
			DBSpezial_Ortho_SD.Geschlecht_GetTextClass(Geschlecht, :MandantOid, :Lang) As "Geschlecht", 
			Leiste As "Leisten",
			DBSpezial_Ortho_SD.Farbe_GetTextClass(Farbe, :MandantOid, :Lang) As "Farbe"
	FROM DBSpezial_Ortho.Artikel
	WHERE	FaktArtikel->Mandant = :MandantOid
	AND		FaktArtikel->Artikelcode = :ArtikelcodeSchuhe
	AND		(NVL(:LieferantOid, '') = '' OR FaktArtikel->Lieferant1 = :LieferantOid)
	AND		(NVL(:SchuhtypOid, '') = '' OR Schuhtyp = :SchuhtypOid)
	AND		(NVL(:GeschlechtOid, '') = '' OR Geschlecht = :GeschlechtOid)
	AND		(NVL(:Leisten, '') = '' OR Leiste = :Leisten)
	AND		(NVL(:FarbeOid, '') = '' OR Farbe = :FarbeOid)
	ORDER BY EANLaufnummer]]></SqlQuery>
</Query>

<Query name="ListeSchuheBySuchkrit2">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,ArtikelcodeSchuhe:%Integer,LieferantOid:%String,SchuhtypOid:%String,GeschlechtOid:%String,Leisten:%String,FarbeOid:%String,LetztesVKDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 	FaktArtikel->ID As ID, 
			FaktArtikel->ArtikelNr, 
			FaktArtikel->Kurztext,
			FaktArtikel->Lieferant1 As "Lieferant.ID",
			FaktArtikel->Lieferant1->Kurzname As "Lieferant.Kurzname",
			FaktArtikel->Lieferant1->Adressnummer As "Lieferant.Adressnummer",
			EANLaufnummer,
			Schuhgroessentyp,
			Absatz, 
			Weite,
			Leiste,
			Geschlecht As "Geschlecht.ID",
			Geschlecht->Nr As "Geschlecht.Nr",
			DBSpezial_Ortho_SD.Geschlecht_GetTextClass(Geschlecht, :MandantOid, :Lang) As "Geschlecht.Text", 
			Farbe As "Farbe.ID",
			Farbe->Nr As "Farbe.Nr",
			Farbe->FarbNr As "Farbe.FarbNr",
			DBSpezial_Ortho_SD.Farbe_GetTextClass(Farbe, :MandantOid, :Lang) As "Farbe.Text", 
			Form As "Form.ID",
			Form->Nr As "Form.Nr",
			DBSpezial_Ortho_SD.Form_GetTextClass(Form, :MandantOid, :Lang) As "Form.Text", 
			Obermaterial As "Obermaterial.ID",
			Obermaterial->Nr As "Obermaterial.Nr",
			DBSpezial_Ortho_SD.Obermaterial_GetTextClass(Obermaterial, :MandantOid, :Lang) As "Obermaterial.Text", 
			Futter As "Futter.ID",
			Futter->Nr As "Futter.Nr",
			DBSpezial_Ortho_SD.Futter_GetTextClass(Futter, :MandantOid, :Lang) As "Futter.Text", 
			Saison As "Saison.ID",
			Saison->Nr As "Saison.Nr",
			DBSpezial_Ortho_SD.Saison_GetTextClass(Saison, :MandantOid, :Lang) As "Saison.Text", 
			Sohle As "Sohle.ID",
			Sohle->Nr As "Sohle.Nr",
			DBSpezial_Ortho_SD.Sohle_GetTextClass(Sohle, :MandantOid, :Lang) As "Sohle.Text", 
			Schuhtyp As "Schuhtyp.ID",
			Schuhtyp->Nr As "Schuhtyp.Nr",
			DBSpezial_Ortho_SD.Schuhtyp_GetTextClass(Schuhtyp, :MandantOid, :Lang) As "Schuhtyp.Text" 
	FROM DBSpezial_Ortho.Artikel art
	WHERE FaktArtikel->Mandant = :MandantOid AND FaktArtikel->Artikelcode = :ArtikelcodeSchuhe
	AND (NVL(:LieferantOid, '') = '' OR FaktArtikel->Lieferant1 = :LieferantOid)
	AND (NVL(:SchuhtypOid, '') = '' OR Schuhtyp = :SchuhtypOid)
	AND (NVL(:GeschlechtOid, '') = '' OR Geschlecht = :GeschlechtOid)
	AND (NVL(:Leisten, '') = '' OR Leiste = :Leisten)
	AND (NVL(:FarbeOid, '') = '' OR Farbe = :FarbeOid)
	AND (SELECT MAX(Buchungsdatum) FROM DBFakturierung.Lagerbew WHERE Artikel = art.FaktArtikel->ID) >= {d :LetztesVKDatum}
	ORDER BY Schuhgroessentyp->Nr]]></SqlQuery>
</Query>

<Query name="GetArtikelOidByArtNrLieferant">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,ArtNrLieferant:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[                SELECT FaktArtikel->ID As ID
                FROM DBSpezial_Ortho.Artikel
                WHERE FaktArtikel->Mandant = :MandantOid
                AND ArtikelNrLieferant = :ArtNrLieferant]]></SqlQuery>
</Query>

<Query name="ListeArtikelKarteiKarte">
<Type>%SQLQuery</Type>
<FormalSpec>VonArtikelNr:%String,BisArtikelNr:%String,MandantOid:%String,Lang:%String,ArtCodeSchuh:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT  ID As "Artikel.ID",
			FaktArtikel->ArtikelNr As "Artikel.Artikelnummer",
			FaktArtikel->Kurztext As "Artikel.Kurztext",
			ArtikelNrLieferant As "Artikel.Lieferant.ArtikelNr",
			FaktArtikel->Lieferant1->Kurzname As "Artikel.Lieferant.Kurzname",
			FaktArtikel->Lieferant1->Adressnummer As "Artikel.Lieferant.Adressnummer",
			DBFakturierung.Artikel_GetArtikeltextClass(FaktArtikel->%ID, :MandantOid, :Lang) As "Artikel.Artikeltext",
			DBFakturierung.Artikel_GetArtikeltext2Class(FaktArtikel->%ID, :MandantOid, :Lang) As "Artikel.Artikeltext2",
			DBFakturierung_SD.Artikelgrp_GetBezeichnungClass(FaktArtikel->Artikelgruppe, :MandantOid, :Lang) As "Artikel.Artikelgruppe",
			FaktArtikel->Basispreis As "Artikel.Verkaufspreis",
			FaktArtikel->LetzterEKP As "Artikel.LetzterEKP",
			FaktArtikel->DurchschnittlicherEKP As "Artikel.DurchschnittlicherEKP",
			FaktArtikel->Bemerkung As "Artikel.Bemerkung",
			DBSpezial_Ortho_SD.Schuhtyp_GetTextClass(Schuhtyp, :MandantOid, :Lang) As "Artikel.Schuhtyp",
			DBSpezial_Ortho_SD.Geschlecht_GetTextClass(Geschlecht, :MandantOid, :Lang) As "Artikel.Geschlecht",
			DBSpezial_Ortho_SD.Form_GetTextClass(Form, :MandantOid, :Lang) As "Artikel.Form",
			DBSpezial_Ortho_SD.Farbe_GetTextClass(Farbe, :MandantOid, :Lang) As "Artikel.Farbe",
			DBSpezial_Ortho_SD.Obermaterial_GetTextClass(Obermaterial, :MandantOid, :Lang) As "Artikel.Obermaterial",
			DBSpezial_Ortho_SD.Futter_GetTextClass(Futter, :MandantOid, :Lang) As "Artikel.Futter",
			DBSpezial_Ortho_SD.Sohle_GetTextClass(Sohle, :MandantOid, :Lang) As "Artikel.Sohle",
			DBSpezial_Ortho_SD.Saison_GetTextClass(Saison, :MandantOid, :Lang) As "Artikel.Saison",
			DBSpezial_Ortho_SD.Schuhgroessentyp_GetTextClass(Schuhgroessentyp, :MandantOid, :Lang) As "Artikel.Schuhgroessentyp",
			Absatz As "Artikel.Absatz",
			Weite As "Artikel.Weite",
			Leiste As "Artikel.Leisten",
			EANLaufnummer As "Artikel.EanLaufnummer"
	FROM DBSpezial_Ortho.Artikel
	WHERE FaktArtikel->ArtikelNr >= :VonArtikelNr AND FaktArtikel->ArtikelNr <= :BisArtikelNr
	AND FaktArtikel->Mandant = :MandantOid
	AND FaktArtikel->Artikelcode = :ArtCodeSchuh]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.BestGroesseAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62075,59673.132489</TimeCreated>

<Query name="ListeByBestPos">
<Type>%SQLQuery</Type>
<FormalSpec>BestPosOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT  ID,
	   Groesse,
	   Menge,
	   (SELECT SUM(NVL(Menge,0)) 
	   		FROM DBSpezial_Ortho.EingangGroesse
	   		WHERE EingangPos->BestPos=:BestPosOid AND 
	   			Groesse=bg.Groesse
	   	) As MengeEingang, 
	   	BestPos->OrthoArtikel As "OrthoOid"
	FROM DBSpezial_Ortho.BestGroesse bg
	WHERE BestPos = :BestPosOid
	ORDER BY Groesse->Nr]]></SqlQuery>
</Query>

<Query name="ListeByBestellschein">
<Type>%SQLQuery</Type>
<FormalSpec>BestOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	BestPos->ID As "Position.ID",
			Groesse->Nr As "Groesse.Nr", 
			Menge As "Groesse.Menge",
			BestPos->OrthoArtikel->FaktArtikel->ArtikelNr As "Position.ArtikelNr",
			BestPos->OrthoArtikel->FaktArtikel->Kurztext As "Position.Kurztext",
			BestPos->OrthoArtikel->ArtikelNrLieferant As "Position.ArtNrLieferant",
			DBSpezial_Ortho_SD.Farbe_GetTextClass(BestPos->OrthoArtikel->Farbe, BestPos->OrthoArtikel->FaktArtikel->Mandant, 'de') As "Position.Farbe",
			BestPos->OrthoArtikel->Leiste As "Position.Leisten",
			BestPos->OrthoArtikel->Weite As "Position.Weite"

	FROM DBSpezial_Ortho.BestGroesse 
	WHERE (BestPos->BestKopf = :BestOid) AND (Menge <> 0)
	ORDER BY BestPos->ID]]></SqlQuery>
</Query>

<Query name="ListeGroesseByKopf">
<Type>%SQLQuery</Type>
<FormalSpec>kopfOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	ID,
			BestPos->OrthoArtikel As "OrthoOid",
			Groesse As "GroesseOid",
			Menge
	FROM DBSpezial_Ortho.BestGroesse
	WHERE (BestPos->BestKopf = :kopfOid) AND (Menge <> 0) AND (LagerinfoOk = 1)]]></SqlQuery>
</Query>

<Query name="ListeOffeneBestUnverbucht">
<Type>%SQLQuery</Type>
<FormalSpec>BestOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	ID, Groesse->ID As "GroesseOid", 
			Menge, 
			BestPos->OrthoArtikel As "OrthoArtikelOid"
	FROM DBSpezial_Ortho.BestGroesse
	WHERE (BestPos->BestKopf->ID = :BestOid) AND (Menge <> 0) AND (LagerInfoOk <> 1)]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.BestKopfAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62042,58742.563698</TimeCreated>

<Query name="ListeByLieferant">
<Type>%SQLQuery</Type>
<FormalSpec>LieferantID:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	%ID,
			Bestelldatum,
			BestellungsNr,
			Lieferant->PLZ As LieferantPLZ,
			Lieferant->Ort As LieferantOrt,
			Lieferant->Name As LieferantName
	FROM DBSpezial_Ortho.BestKopf
	WHERE Lieferant = :LieferantID
	ORDER BY Bestelldatum]]></SqlQuery>
</Query>

<Query name="ListeAlle">
<Type>%SQLQuery</Type>
<FormalSpec>MandantID:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	%ID,
			Bestelldatum,
			BestellungsNr,
			Lieferant->PLZ As LieferantPLZ,
			Lieferant->Ort As LieferantOrt,
			Lieferant->Name As LieferantName,
			Liefertermin,
			Annahmedatum, 
			Status,
			BestellungsTyp
	FROM DBSpezial_Ortho.BestKopf
	WHERE Lieferant->Mandant = :MandantID
	ORDER BY Bestelldatum]]></SqlQuery>
</Query>

<Query name="ListeAlleNachArtikel">
<Type>%SQLQuery</Type>
<FormalSpec>MandantID:%String,OrthoArtikelOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	%ID,
			Bestelldatum,
			BestellungsNr,
			Lieferant->PLZ As LieferantPLZ,
			Lieferant->Ort As LieferantOrt,
			Lieferant->Name As LieferantName,
			Liefertermin,
			Annahmedatum, 
			Status,
			BestellungsTyp
	FROM DBSpezial_Ortho.BestKopf k
	WHERE Lieferant->Mandant = :MandantID AND (ID IN 
			(SELECT BestKopf 
				FROM DBSpezial_Ortho.BestPos
				WHERE OrthoArtikel=:OrthoArtikelOid)
		) OR (
			(SELECT Count(p.ID) 
				FROM DBSpezial_Ortho.BestPos p
				WHERE p.BestKopf=k.ID) <= 0
			)
	ORDER BY Bestelldatum]]></SqlQuery>
</Query>

<Query name="ListeEinzel">
<Type>%SQLQuery</Type>
<FormalSpec>BestellungID:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	Bestelldatum As "a.Bestellung.Bestelldatum",
			BestellungsNr As "a.Bestellung.BestellungsNr",
			Liefertermin  As "a.Bestellung.Liefertermin",
			Annahmedatum  As "a.Bestellung.Annahmedatum",
			Status  As "a.Bestellung.Status",
			
			Lieferant->Anrede As "a.Lieferant.Anrede",
			Lieferant->Name As "a.Lieferant.Name",
			Lieferant->Strasse As "a.Lieferant.Strasse",
			Lieferant->PLZ As "a.Lieferant.PLZ",
			Lieferant->Ort As "a.Lieferant.Ort"
	FROM DBSpezial_Ortho.BestKopf
	WHERE %ID = :BestellungID]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.BestPosAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62042,61546.462218</TimeCreated>

<Query name="ListeByBestellung">
<Type>%SQLQuery</Type>
<FormalSpec>bestkopfOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[                SELECT  ID,
                       OrthoArtikel->FaktArtikel->ArtikelNr As "ArtikelNr",
                       OrthoArtikel->FaktArtikel->Kurztext As "ArtikelKurztext",
                       OrthoArtikel->FaktArtikel As "ArtikelOid",
                       (
                        SELECT SUM(bg.Menge) 
                        FROM DBSpezial_Ortho.BestGroesse As bg
                        WHERE BestPos = bp.ID
                       ) As "Anzahl",
                       OrthoArtikel->EANLaufnummer As "EANLaufnummer"
                FROM DBSpezial_Ortho.BestPos As bp
                WHERE BestKopf = :bestkopfOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.EingangGroesseAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62081,36398.10942</TimeCreated>

<Query name="ListeByEingangPos">
<Type>%SQLQuery</Type>
<FormalSpec>EingangPosOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID,
	   Groesse,
	   Menge,
	   EingangPos->BestPos->OrthoArtikel As "OrthoOid"
	FROM DBSpezial_Ortho.EingangGroesse
	WHERE EingangPos = :EingangPosOid
	ORDER BY Groesse->Nr]]></SqlQuery>
</Query>

<Query name="ListeUnverbuchtByBestKopf">
<Type>%SQLQuery</Type>
<FormalSpec>bestKopfOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	ID,
			Menge,
			Groesse,
			EingangPos->BestPos->OrthoArtikel->Faktartikel As "ArtikelOid",
			EingangPos->Annahmedatum As "Annahmedatum",
			EingangPos->BestPos->OrthoArtikel As "OrthoOid",
			EingangPos As "EingangPosOid"
	FROM DBSpezial_Ortho.EingangGroesse
	WHERE (EingangPos->BestPos->BestKopf = :bestKopfOid) AND (EingangPos->EingangVerbucht <> 1) AND (Menge <> 0)]]></SqlQuery>
</Query>

<Query name="ListeDruckByBestKopf">
<Type>%SQLQuery</Type>
<FormalSpec>BestOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	EingangPos->ID As "Position.ID",
			Groesse->Nr As "Groesse.Nr", 
			Menge As "Groesse.Menge",
			EingangPos->BestPos->OrthoArtikel->FaktArtikel->ArtikelNr As "Position.ArtikelNr",
			EingangPos->BestPos->OrthoArtikel->FaktArtikel->Kurztext As "Position.Kurztext",
			EingangPos->BestPos->OrthoArtikel->ArtikelNrLieferant As "Position.ArtNrLieferant",
			DBSpezial_Ortho_SD.Farbe_GetTextClass(EingangPos->BestPos->OrthoArtikel->Farbe, EingangPos->BestPos->OrthoArtikel->FaktArtikel->Mandant, 'de') As "Position.Farbe",
			EingangPos->BestPos->OrthoArtikel->Leiste As "Position.Leisten",
			EingangPos->BestPos->OrthoArtikel->Weite As "Position.Weite",
			EingangPos->Annahmedatum As "Position.Annahmedatum"
			
	FROM DBSpezial_Ortho.EingangGroesse
	WHERE (EingangPos->BestPos->BestKopf = :BestOid) AND (Menge <> 0) AND (EingangPos->EingangVerbucht <> 1)
	ORDER BY EingangPos->ID]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.EingangPosAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62081,37527.817491</TimeCreated>

<Query name="ListeByBestPos">
<Type>%SQLQuery</Type>
<FormalSpec>bestPosOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT  ID,
	       	Annahmedatum
	FROM DBSpezial_Ortho.EingangPos
	WHERE BestPos=:bestPosOid</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.LagerInfoAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61958,58848.877172</TimeCreated>

<Query name="ListeByOrthoArtikel">
<Type>%SQLQuery</Type>
<FormalSpec>ArtikelOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT	%ID,
			Lagerbestand,
			Reserviert,
			Verfuegbar,
			Mindestbestand,
			Bestellvorschlag,
			OffeneBestellung,
			Groesse,
			Vorbestellung,
			Nachbestellung,
			Umsatz, Groesse->Nr AS GroesseNr
	FROM DBSpezial_Ortho.LagerInfo
	WHERE OrthoArtikel = :ArtikelOid ORDER BY Groesse->Nr]]></SqlQuery>
</Query>

<Query name="ListeAlle">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT  ID,
           Lagerbestand,
           Reserviert,
           Verfuegbar,
           Mindestbestand,
           Bestellvorschlag,
           OffeneBestellung,
           Groesse->ID As GroesseID,
           Vorbestellung,
           Nachbestellung,
           Umsatz,
           OrthoArtikel->FaktArtikel->ID As FaktArtikelID,
           OrthoArtikel->Schuhgroessentyp
    FROM DBSpezial_Ortho.LagerInfo
    WHERE OrthoArtikel->FaktArtikel->Mandant = :MandantOid 
    ORDER BY Groesse->Nr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.FarbeAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61930,60846.897128</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Farbe_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant, FarbNr
	FROM DBSpezial_Ortho_SD.Farbe
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Farbe_GetTextClass(%ID, :MandantOid, :Lang) As wert1,FarbNr As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Farbe as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.FormAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61930,62229.532579</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Form_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.Form
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Form_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Form as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.FutterAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61930,62230.238834</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Futter_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.Futter
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Futter_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Futter as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.GeschlechtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61930,62230.784548</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Geschlecht_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.Geschlecht
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Geschlecht_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Geschlecht as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.GroesseAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61930,62231.178318</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr As Schuhgroesse, Schuhgroessentyp, DBSpezial_Ortho_SD.Schuhgroessentyp_GetTextClass(Schuhgroessentyp, :MandantOid, :Lang) AS SchuhgroessentypBez,
	Mandant
	FROM DBSpezial_Ortho_SD.Groesse
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, '' As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Groesse as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="GroessenBySchuhtypOid">
<Type>%SQLQuery</Type>
<FormalSpec>SchuhtypOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr
	FROM DBSpezial_Ortho_SD.Groesse 
	WHERE Schuhgroessentyp = :SchuhtypOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeAlleNachSchuhtyp">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, 
			Nr,
			Schuhgroessentyp
	FROM DBSpezial_Ortho_SD.Groesse
	WHERE Mandant = :MandantOid
	ORDER BY Schuhgroessentyp, Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.ObermaterialAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61930,62231.564365</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Obermaterial_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.Obermaterial
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Obermaterial_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Obermaterial as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.SaisonAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61930,62231.972346</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Saison_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.Saison
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Saison_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Saison as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.SchuhgroessentypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61986,54394.391129</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Schuhgroessentyp_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.Schuhgroessentyp
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Schuhgroessentyp_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Schuhgroessentyp as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.SchuhtypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61986,60438.45921</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Schuhtyp_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.Schuhtyp
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Schuhtyp_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Schuhtyp as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.SohleAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61930,62232.689847</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.Sohle_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.Sohle
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.Sohle_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.Sohle as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.SD.VerfuegTypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62151,31785.461846</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Ortho_SD.VerfuegTyp_GetTextClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant
	FROM DBSpezial_Ortho_SD.VerfuegTyp
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr AS Nr, DBSpezial_Ortho_SD.VerfuegTyp_GetTextClass(%ID, :MandantOid, :Lang) As wert1, '' As wert2, 
	Mandant
	FROM DBSpezial_Ortho_SD.VerfuegTyp as Stammdate 
	WHERE Mandant = :MandantOid ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.AF.VerfuegungAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62199,51786.62433</TimeCreated>

<Query name="ListeAlle">
<Type>%SQLQuery</Type>
<FormalSpec>MandOid:%String,Lang:%String,OrthoAdressOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT  ID,
           Verfuegungsdatum,
           VerfuegungsdatumAblauf,
           Verfuegungsnr,
           Verfuegungstyp,
           Verfuegungstyp->Nr As VerfuegungstypNr,
           DBSpezial_Ortho_SD.VerfuegTyp_GetTextClass(Verfuegungstyp, :MandOid, :Lang) As "VerfuegungstypBezeichnung"
    FROM DBSpezial_Ortho.Verfuegung
    WHERE Adresse = :OrthoAdressOid 
    ORDER BY Verfuegungstyp->Nr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Ortho.Adresse">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57333.740932</TimeChanged>
<TimeCreated>62045,49218.460464</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="AdresseAdresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>parent</Cardinality>
<Inverse>OrthoAdresse</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="AdresseAdresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="AdresseAdresseIdx">
<Properties>AdresseAdresse</Properties>
<Unique>1</Unique>
</Index>

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

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

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

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

<Method name="GetOidByAdressOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>AdressOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT ID INTO :oid FROM DBSpezial_Ortho.Adresse WHERE AdresseAdresse=:AdressOid)
	if (SQLCODE=0) {
		Quit oid
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Property name="Verfuegung">
<Type>DBSpezial.Ortho.Verfuegung</Type>
<Cardinality>many</Cardinality>
<Inverse>Adresse</Inverse>
<Relationship>1</Relationship>
</Property>

<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 adrOid = $lg(oid,1)
    
	set verfuegungOid = ""
	&sql(DECLARE OrthoAdrDelVerfuegung CURSOR FOR
		 SELECT ID INTO :verfuegungOid 
	     FROM DBSpezial_Ortho.Verfuegung
	     WHERE Adresse = :adrOid)
	
	
	&sql(OPEN OrthoAdrDelVerfuegung)
	&sql(FETCH OrthoAdrDelVerfuegung)
	while (SQLCODE = 0) {
		set s = ##class(DBSpezial.Ortho.Verfuegung).%DeleteId(verfuegungOid)	
		if ($$$ISERR(s)) {
			w "Error: ", s, !
		}
		&sql(FETCH OrthoAdrDelVerfuegung)
	}
	&sql(CLOSE OrthoAdrDelVerfuegung)
	
	Quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("OrthoAdresse")</DataLocation>
<DefaultData>AdresseDefaultData</DefaultData>
<IdLocation>^DBAdressen.AdresseC("OrthoAdresse")</IdLocation>
<IndexLocation>^DBSpezial.Ortho.AdresseI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.AdresseS</StreamLocation>
<Data name="AdresseDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Absatz</Value>
</Value>
<Value name="3">
<Value>Weite</Value>
</Value>
<Value name="4">
<Value>Leiste</Value>
</Value>
<Value name="5">
<Value>FarbNr</Value>
</Value>
<Value name="6">
<Value>Geburtsdatum</Value>
</Value>
<Value name="7">
<Value>Trittspurdatum</Value>
</Value>
<Value name="8">
<Value>Versicherungsnr</Value>
</Value>
<Value name="9">
<Value>Verfuegungsdatum1</Value>
</Value>
<Value name="10">
<Value>VerfuegungsdatumAblauf1</Value>
</Value>
<Value name="11">
<Value>Verfuegungsnr1</Value>
</Value>
<Value name="12">
<Value>VerfuegungFuer1</Value>
</Value>
<Value name="13">
<Value>Verfuegungsdatum2</Value>
</Value>
<Value name="14">
<Value>VerfuegungsdatumAblauf2</Value>
</Value>
<Value name="15">
<Value>Verfuegungsnr2</Value>
</Value>
<Value name="16">
<Value>VerfuegungFuer2</Value>
</Value>
<Value name="17">
<Value>ZusatztextStream</Value>
</Value>
<Value name="18">
<Value>Verfuegungstyp</Value>
</Value>
</Data>
<Property name="AdresseAdresse"/>
<Property name="Geburtsdatum"/>
<Property name="Trittspurdatum"/>
<Property name="VerfuegungFuer1"/>
<Property name="VerfuegungFuer2"/>
<Property name="Verfuegungsdatum1"/>
<Property name="Verfuegungsdatum2"/>
<Property name="VerfuegungsdatumAblauf1"/>
<Property name="VerfuegungsdatumAblauf2"/>
<Property name="Verfuegungsnr1"/>
<Property name="Verfuegungsnr2"/>
<Property name="Verfuegungstyp"/>
<Property name="Versicherungsnr"/>
<Property name="ZusatztextStream"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.Artikel">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57333.997938</TimeChanged>
<TimeCreated>61928,60283.636223</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="FaktArtikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>parent</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="FaktArtikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FaktArtikelIdx">
<Properties>FaktArtikel</Properties>
<Unique>1</Unique>
</Index>

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

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

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

<Property name="Schuhgroessentyp">
<Type>DBSpezial.Ortho.SD.Schuhgroessentyp</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Schuhtyp"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="SchuhgroessentypIndex">
<Properties>Schuhgroessentyp</Properties>
</Index>

<Property name="Geschlecht">
<Type>DBSpezial.Ortho.SD.Geschlecht</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Geschlecht"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="GeschlechtIndex">
<Properties>Geschlecht</Properties>
</Index>

<Property name="Form">
<Type>DBSpezial.Ortho.SD.Form</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Form"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FormIndex">
<Properties>Form</Properties>
</Index>

<Property name="Farbe">
<Type>DBSpezial.Ortho.SD.Farbe</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Farbe"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FarbeIndex">
<Properties>Farbe</Properties>
</Index>

<Property name="Obermaterial">
<Type>DBSpezial.Ortho.SD.Obermaterial</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Obermaterial"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="ObermaterialIndex">
<Properties>Obermaterial</Properties>
</Index>

<Property name="Futter">
<Type>DBSpezial.Ortho.SD.Futter</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Futter"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="FutterIndex">
<Properties>Futter</Properties>
</Index>

<Property name="Saison">
<Type>DBSpezial.Ortho.SD.Saison</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Saison"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="SaisonIndex">
<Properties>Saison</Properties>
</Index>

<Property name="Sohle">
<Type>DBSpezial.Ortho.SD.Sohle</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Sohle"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="SohleIndex">
<Properties>Sohle</Properties>
</Index>

<Property name="Foto">
<Type>DBSpezial.Ortho.Foto</Type>
<Cardinality>children</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="LagerInfo">
<Type>DBSpezial.Ortho.LagerInfo</Type>
<Cardinality>many</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetOidByArtOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtikelOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set retval = ""
	Set strSQL="SELECT ID FROM DBSpezial_Ortho.Artikel WHERE FaktArtikel ='"_ArtikelOid_"'"
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
	IF $$$ISOK(sc) {
		If (rs.Next(.sc)) {
			set retval = rs.Data("ID")		
		}
	}
	Quit retval
]]></Implementation>
</Method>

<Method name="InputFotoStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	Set res=0
	Set myId = ..%Id()
	Set sID = ""
	If (myId'="") {
		Set Cnt=0
		
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBSpezial_Ortho.Foto
		     WHERE OrthoArtikel->ID=:myId)
		
		If (Cnt=0) {
			Set myId=..%Id()			
			Set n=##Class(DBSpezial.Ortho.Foto).%New()
			Set n.OrthoArtikel = ##Class(DBSpezial.Ortho.Artikel).%OpenId(myId)
			Set Ret=n.%Save()
			Set n=""
			Set res=(Ret=1)
			Quit:'res res
		}
		&sql(SELECT %ID INTO :sID 
		     	 FROM DBSpezial_Ortho.Foto
		         WHERE OrthoArtikel->ID=:myId)
		Set s=##Class(DBSpezial.Ortho.Foto).%OpenId(sID)
		Set Ret=s.FotoStream.CopyFromAndSave(Stream)
		Set RetS = s.%Save()
		
		Set res=((Ret=1) && (RetS=1))
	}
	Quit res
]]></Implementation>
</Method>

<Method name="OutputFotoStream">
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set myId = ..%Id()
	Set sID = ""
	Set Ret=""
		&sql(SELECT count(*) As Cnt INTO :Cnt
		     FROM DBSpezial_Ortho.Foto
		     WHERE OrthoArtikel->ID=:myId)
		If (Cnt>0) {
			&sql(SELECT %ID INTO :sID 
		     	 FROM DBSpezial_Ortho.Foto
		         WHERE OrthoArtikel->ID=:myId)
			Set s=##Class(DBSpezial.Ortho.Foto).%OpenId(sID)
			Set Size=s.FotoStream.Size
			Set Ret=tmpStream.CopyFromAndSave(s.FotoStream)
		}
	Quit tmpStream
]]></Implementation>
</Method>

<Method name="GetFotoStream">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String</FormalSpec>
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set stream = ##class(%Library.GlobalBinaryStream).%New()
	if (oid '= "") {
		Set rs = ##Class(DBSpezial.Ortho.Artikel).%OpenId(oid)
		set Ret = stream.CopyFromAndSave(rs.OutputFotoStream())	
	}	
	quit stream
]]></Implementation>
</Method>

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

<Property name="Schuhtyp">
<Type>DBSpezial.Ortho.SD.Schuhtyp</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Schuhtyp"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="SchuhtypIndex">
<Properties>Schuhtyp</Properties>
</Index>

<Property name="BestPos">
<Type>DBSpezial.Ortho.BestPos</Type>
<Cardinality>many</Cardinality>
<Inverse>OrthoArtikel</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

<Property name="KapitelBeschreibung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32765"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Unterkapitel1Beschreibung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32765"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Unterkapitel2Beschreibung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32765"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

<Property name="Unterkapitel3Beschreibung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="32765"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

<Method name="GetNextLaufnummer">
<ClassMethod>1</ClassMethod>
<FormalSpec>Lieferant:%Integer,Geschlecht:%Integer,Schuhtyp:%Integer,Form:%Integer,Farbe:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr=-1
	&sql(SELECT TOP 1 Laufnummer InTo :nr
			FROM DBSpezial_Ortho.Artikel
			WHERE FaktArtikel->Lieferant1->Adressnummer=:Lieferant AND
				Geschlecht->Nr=:Geschlecht AND
				Schuhtyp->Nr=:Schuhtyp AND
				Form->Nr=:Form AND
				Farbe->Nr=:Farbe
			ORDER BY Laufnummer DESC)
			
	if (SQLCODE'=0) {
		set nr=-1
	}
	
	quit (nr + 1)
]]></Implementation>
</Method>

<Method name="GetNextEanLaufnr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	set typ = ##class(DBCore.FormularNr).EanLaufnrOrthoArtikel()
	// Falls Global noch nicht gesetzt höchste vorhanden Nummer setzen
	if ($GET(^FormularNr(MandantOid, typ)) = "") {
		&sql(SELECT MAX(EANLaufnummer) into :nr FROM DBSpezial_Ortho.Artikel WHERE FaktArtikel->Mandant = :MandantOid)
		if (SQLCODE = 0) {
			SET ^FormularNr(MandantOid, typ) = nr	
		}
	}
	// Neue Nummer auslessen
	SET nr=$INCREMENT(^FormularNr(MandantOid, typ))
	Quit nr
]]></Implementation>
</Method>

<Method name="GetOidByEanLaufnummer">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,EanLaufnummer:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT ID INTO :oid FROM DBSpezial_Ortho.Artikel WHERE FaktArtikel->Mandant=:MandantOid AND EANLaufnummer=:EanLaufnummer)
	if (SQLCODE'=0) {
		set oid=""
	}
	Quit oid
]]></Implementation>
</Method>

<Method name="GetEanLaufnrByFaktArtikelOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>FaktArtikelOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set ean = 0
	&sql(SELECT EanLaufnummer INTO :ean FROM DBSpezial_Ortho.Artikel WHERE FaktArtikel=:FaktArtikelOid)
	if (SQLCODE'=0) {
		set ean=0
	}
	Quit ean
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.ArtikelD</DataLocation>
<DefaultData>ArtikelDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.ArtikelD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.ArtikelI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.ArtikelS</StreamLocation>
<Data name="ArtikelDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Absatz</Value>
</Value>
<Value name="3">
<Value>Weite</Value>
</Value>
<Value name="4">
<Value>Leiste</Value>
</Value>
<Value name="5">
<Value>Schuhtyp</Value>
</Value>
<Value name="6">
<Value>Geschlecht</Value>
</Value>
<Value name="7">
<Value>Form</Value>
</Value>
<Value name="8">
<Value>Farbe</Value>
</Value>
<Value name="9">
<Value>Obermaterial</Value>
</Value>
<Value name="10">
<Value>Futter</Value>
</Value>
<Value name="11">
<Value>Saison</Value>
</Value>
<Value name="12">
<Value>Sohle</Value>
</Value>
<Value name="13">
<Value>FarbNr</Value>
</Value>
<Value name="14">
<Value>ArtikelNrLieferant</Value>
</Value>
<Value name="15">
<Value>ErfassungsDatum</Value>
</Value>
<Value name="16">
<Value>Schuhgroessentyp</Value>
</Value>
<Value name="17">
<Value>Laufnummer</Value>
</Value>
<Value name="18">
<Value>Beschreibung</Value>
</Value>
<Value name="19">
<Value>KapitelTitel</Value>
</Value>
<Value name="20">
<Value>KapitelBeschreibung</Value>
</Value>
<Value name="21">
<Value>Unterkapitel1Beschreibung</Value>
</Value>
<Value name="22">
<Value>Unterkapitel2Beschreibung</Value>
</Value>
<Value name="23">
<Value>Unterkapitel3Titel</Value>
</Value>
<Value name="24">
<Value>Unterkapitel3Beschreibung</Value>
</Value>
<Value name="25">
<Value>Positionstext</Value>
</Value>
<Value name="26">
<Value>EANLaufnummer</Value>
</Value>
</Data>
<Property name="Absatz"/>
<Property name="ArtikelNrLieferant"/>
<Property name="Beschreibung"/>
<Property name="EANLaufnummer"/>
<Property name="ErfassungsDatum"/>
<Property name="FaktArtikel"/>
<Property name="FarbNr"/>
<Property name="Farbe"/>
<Property name="Form"/>
<Property name="Futter"/>
<Property name="Geschlecht"/>
<Property name="KapitelBeschreibung"/>
<Property name="KapitelTitel"/>
<Property name="Laufnummer"/>
<Property name="Leiste"/>
<Property name="Obermaterial"/>
<Property name="Positionstext"/>
<Property name="Saison"/>
<Property name="Schuhgroessentyp"/>
<Property name="Schuhtyp"/>
<Property name="Sohle"/>
<Property name="Unterkapitel1Beschreibung"/>
<Property name="Unterkapitel2Beschreibung"/>
<Property name="Unterkapitel3Beschreibung"/>
<Property name="Unterkapitel3Titel"/>
<Property name="Weite"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.BestGroesse">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57232.411557</TimeChanged>
<TimeCreated>61999,34871.465528</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="BestPos">
<Type>DBSpezial.Ortho.BestPos</Type>
<Cardinality>one</Cardinality>
<Inverse>BestGroesse</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="BestPosIndex">
<Properties>BestPos</Properties>
</Index>

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

<Property name="Groesse">
<Type>DBSpezial.Ortho.SD.Groesse</Type>
<Cardinality>one</Cardinality>
<Inverse>BestGroesse</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="GroesseIndex">
<Properties>Groesse</Properties>
</Index>

<Property name="LagerInfoOk">
<Description>
Offene Bestellung in der LagerInfo nachgeführt</Description>
<Type>%Integer</Type>
</Property>

<Method name="GetOidByBestposGroesse">
<ClassMethod>1</ClassMethod>
<FormalSpec>BestPosOid:%String,GroesseOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
                
	set retval = ""

	&sql(SELECT ID InTo :retval 
	FROM DBSpezial_Ortho.BestGroesse 
	WHERE BestPos=:BestPosOid AND Groesse=:GroesseOid)
                              
	if (SQLCODE'=0) {
		set retval=""
	}

	Quit retval
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.BestGroesseD</DataLocation>
<DefaultData>BestGroesseDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.BestGroesseD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.BestGroesseI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.BestGroesseS</StreamLocation>
<Data name="BestGroesseDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>BestPos</Value>
</Value>
<Value name="3">
<Value>Menge</Value>
</Value>
<Value name="4">
<Value>Groesse</Value>
</Value>
<Value name="5">
<Value>LagerInfo</Value>
</Value>
<Value name="6">
<Value>LagerInfoOk</Value>
</Value>
</Data>
<Property name="BestPos"/>
<Property name="Groesse"/>
<Property name="LagerInfoOk"/>
<Property name="Menge"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.BestKopf">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57232.529677</TimeChanged>
<TimeCreated>61999,32920.497661</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="BestPos">
<Type>DBSpezial.Ortho.BestPos</Type>
<Cardinality>children</Cardinality>
<Inverse>BestKopf</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Lieferant">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>OrthoBestKopf</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="LieferantIndex">
<Properties>Lieferant</Properties>
</Index>

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

<Property name="Bestelldatum">
<Description>
Bestelldatum</Description>
<Type>%Date</Type>
</Property>

<Property name="Liefertermin">
<Description>
erwartetes Lieferdatum</Description>
<Type>%Date</Type>
</Property>

<Property name="Annahmedatum">
<Description>
effektives Lieferdatum</Description>
<Type>%Date</Type>
</Property>

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

<Property name="BestellungGedruckt">
<Description>
Bestellung gedruckt</Description>
<Type>%Integer</Type>
</Property>

<Property name="BestellungsTyp">
<Description>
Bestellungstyp</Description>
<Type>%Integer</Type>
</Property>

<Method name="GetNextBestellungsNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0

	&sql(SELECT TOP 1 BestellungsNr InTo :nr 
			FROM DBSpezial_Ortho.BestKopf 
			WHERE Lieferant->Mandant=:MandantOid
			ORDER BY BestellungsNr DESC)
                              
	if (SQLCODE'=0) {
		set nr=0
	}

	Quit (nr+1)
]]></Implementation>
</Method>

<Method name="GetBestellungByBestellungsNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>BestellungsNr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	
	&sql(SELECT TOP 1 ID InTo :id
			FROM DBSpezial_Ortho.BestKopf
			WHERE BestellungsNr = :BestellungsNr)
	
	if (SQLCODE '= 0) {
		set id = ""
	}
	
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.BestKopfD</DataLocation>
<DefaultData>BestKopfDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.BestKopfD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.BestKopfI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.BestKopfS</StreamLocation>
<Data name="BestKopfDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Lieferant</Value>
</Value>
<Value name="3">
<Value>BestellungsNr</Value>
</Value>
<Value name="4">
<Value>Bestelldatum</Value>
</Value>
<Value name="5">
<Value>ErwartetesLieferdatum</Value>
</Value>
<Value name="6">
<Value>EffektivesLieferdatum</Value>
</Value>
<Value name="7">
<Value>Status</Value>
</Value>
<Value name="8">
<Value>Liefertermin</Value>
</Value>
<Value name="9">
<Value>Annahmedatum</Value>
</Value>
<Value name="10">
<Value>BestellungGedruckt</Value>
</Value>
<Value name="11">
<Value>BestellungsTyp</Value>
</Value>
</Data>
<Property name="Annahmedatum"/>
<Property name="Bestelldatum"/>
<Property name="BestellungGedruckt"/>
<Property name="BestellungsNr"/>
<Property name="BestellungsTyp"/>
<Property name="Lieferant"/>
<Property name="Liefertermin"/>
<Property name="Status"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.BestPos">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57292.408019</TimeChanged>
<TimeCreated>61999,32932.447037</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="BestKopf">
<Type>DBSpezial.Ortho.BestKopf</Type>
<Cardinality>parent</Cardinality>
<Inverse>BestPos</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="BestGroesse">
<Type>DBSpezial.Ortho.BestGroesse</Type>
<Cardinality>many</Cardinality>
<Inverse>BestPos</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>BestPos</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="OrthoArtikelIndex">
<Properties>OrthoArtikel</Properties>
</Index>

<Property name="EingangPos">
<Type>DBSpezial.Ortho.EingangPos</Type>
<Cardinality>many</Cardinality>
<Inverse>BestPos</Inverse>
<Relationship>1</Relationship>
</Property>

<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 delId = ""
	&sql(DECLARE C1 CURSOR FOR
	               SELECT ID InTo :delId
	               FROM DBSpezial_Ortho.BestGroesse 
	               WHERE BestPos=:myId)
               
	&sql(OPEN C1)
	&sql(FETCH C1)
	While (SQLCODE = 0) {
                
	                do ##class(DBSpezial.Ortho.BestGroesse).%DeleteId(delId)

	&sql(FETCH C1)
	}

	&sql(CLOSE C1)

	Quit $$$OK
]]></Implementation>
</Method>

<Method name="HasEingangPos">
<ClassMethod>1</ClassMethod>
<FormalSpec>oid:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set count = 0
	
	&sql(SELECT COUNT(ID) INTO :count FROM DBSpezial_Ortho.EingangPos WHERE BestPos = :oid)
	if (SQLCODE '= 0) {
		set count = 0
	} 
		
	Quit (count '= 0)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("BestPos")</DataLocation>
<DefaultData>BestPosDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.BestKopfC("BestPos")</IdLocation>
<IndexLocation>^DBSpezial.Ortho.BestPosI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.BestPosS</StreamLocation>
<Data name="BestPosDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>OrhoArtikel</Value>
</Value>
<Value name="3">
<Value>Annahmedatum</Value>
</Value>
<Value name="4">
<Value>OrthoArtikel</Value>
</Value>
</Data>
<Property name="BestKopf"/>
<Property name="OrhoArtikel"/>
<Property name="OrthoArtikel"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.EingangGroesse">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57232.653682</TimeChanged>
<TimeCreated>62081,36139.055915</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="EingangPos">
<Type>DBSpezial.Ortho.EingangPos</Type>
<Cardinality>one</Cardinality>
<Inverse>EingangGroesse</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="EingangPosIndex">
<Properties>EingangPos</Properties>
</Index>

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

<Property name="Groesse">
<Type>DBSpezial.Ortho.SD.Groesse</Type>
<Cardinality>one</Cardinality>
<Inverse>EingangGroesse</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="GroesseIndex">
<Properties>Groesse</Properties>
</Index>

<Method name="GetOidByEingangposGroesse">
<ClassMethod>1</ClassMethod>
<FormalSpec>EingangPosOid:%String,GroesseOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
                
	set retval = ""

	&sql(SELECT ID InTo :retval 
			FROM DBSpezial_Ortho.EingangGroesse 
			WHERE EingangPos=:EingangPosOid AND 
					Groesse=:GroesseOid)
                              
	if (SQLCODE'=0) {
		set retval=""
	}

	Quit retval
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.OE581.EingangGroesseD</DataLocation>
<DefaultData>EingangGroesseDefaultData</DefaultData>
<IdLocation>^DBSpezial.OE581.EingangGroesseD</IdLocation>
<IndexLocation>^DBSpezial.OE581.EingangGroesseI</IndexLocation>
<StreamLocation>^DBSpezial.OE581.EingangGroesseS</StreamLocation>
<Data name="EingangGroesseDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>EingangPos</Value>
</Value>
<Value name="3">
<Value>Menge</Value>
</Value>
<Value name="4">
<Value>Groesse</Value>
</Value>
<Value name="5">
<Value>EingangVerbucht</Value>
</Value>
</Data>
<Property name="EingangPos"/>
<Property name="Groesse"/>
<Property name="Menge"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.EingangPos">
<Super>%Persistent</Super>
<TimeChanged>62416,57232.729624</TimeChanged>
<TimeCreated>62081,36451.491671</TimeCreated>

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

<Property name="BestPos">
<Type>DBSpezial.Ortho.BestPos</Type>
<Cardinality>one</Cardinality>
<Inverse>EingangPos</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="EingangGroesse">
<Type>DBSpezial.Ortho.EingangGroesse</Type>
<Cardinality>many</Cardinality>
<Inverse>EingangPos</Inverse>
<Relationship>1</Relationship>
</Property>

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

<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 delId = ""
	&sql(DECLARE C1 CURSOR FOR
	               SELECT ID InTo :delId
	               FROM DBSpezial_Ortho.EingangGroesse 
	               WHERE EingangPos=:myId)
               
	&sql(OPEN C1)
	&sql(FETCH C1)
	While (SQLCODE = 0) {
		do ##class(DBSpezial.Ortho.EingangGroesse).%DeleteId(delId)
		&sql(FETCH C1)
	}

	&sql(CLOSE C1)

	Quit $$$OK
]]></Implementation>
</Method>

<Method name="IsEingangVerbucht">
<ClassMethod>1</ClassMethod>
<FormalSpec>posOid:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set count = 0
	
	&sql(SELECT COUNT(ID) INTO :count FROM DBSpezial_Ortho.EingangPos WHERE ID = :posOid AND EingangVerbucht = 1)
	if (SQLCODE '= 0) {
		set count = 0
	} 
		
	Quit (count '= 0)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.EingangPosD</DataLocation>
<DefaultData>EingangPosDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.EingangPosD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.EingangPosI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.EingangPosS</StreamLocation>
<Data name="EingangPosDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Annahmedatum</Value>
</Value>
<Value name="3">
<Value>BestPos</Value>
</Value>
<Value name="4">
<Value>EingangVerbucht</Value>
</Value>
</Data>
<Property name="Annahmedatum"/>
<Property name="BestPos"/>
<Property name="EingangVerbucht"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.Foto">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57335.080837</TimeChanged>
<TimeCreated>61928,60315.082893</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="FotoStream">
<Type>%GlobalBinaryStream</Type>
</Property>

<Property name="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>parent</Cardinality>
<Inverse>Foto</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="OrthoArtikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="OrthoArtikelIndex">
<Properties>OrthoArtikel</Properties>
</Index>

<Method name="GetOidByArtOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>ArtikelOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set retval = ""
	Set strSQL="SELECT ID FROM DBSpezial_Ortho.Foto WHERE OrthoArtikel ='"_ArtikelOid_"'"
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
	IF $$$ISOK(sc) {
		If (rs.Next(.sc)) {
			set retval = rs.Data("ID")		
		}
	}
	Quit retval
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.FotoD</DataLocation>
<DefaultData>FotoDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.FotoD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.FotoI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.FotoS</StreamLocation>
<Data name="FotoDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>FotoStream</Value>
</Value>
</Data>
<Property name="FotoStream"/>
<Property name="OrthoArtikel"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.LagerInfo">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57232.828014</TimeChanged>
<TimeCreated>61928,60685.784694</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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>LagerInfo</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="OrthoArtikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="OrthoArtikelIndex">
<Properties>OrthoArtikel</Properties>
</Index>

<Property name="Groesse">
<Type>DBSpezial.Ortho.SD.Groesse</Type>
<Cardinality>one</Cardinality>
<Inverse>LagerInfo</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Groesse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="GroesseIndex">
<Properties>Groesse</Properties>
</Index>

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

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

<Property name="Verfuegbar">
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {Verfuegbar}=##class(DBSpezial.Ortho.LagerInfo).GetVerfuegbarClass({Lagerbestand},{Reserviert}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
</Property>

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

<Property name="Bestellvorschlag">
<Type>%Integer</Type>
<Calculated>1</Calculated>
<SqlComputeCode> Set {Bestellvorschlag}=##class(DBSpezial.Ortho.LagerInfo).GetBestellvorschlagClass({Lagerbestand},{Reserviert},{Mindestbestand}) </SqlComputeCode>
<SqlComputed>1</SqlComputed>
</Property>

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

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

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

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

<Method name="GetVerfuegbarClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>Lagerbestand:%Integer,Reserviert:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit (Lagerbestand - Reserviert)
]]></Implementation>
</Method>

<Method name="GetBestellvorschlagClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>Lagerbestand:%Integer,Reserviert:%Integer,Mindestbest:%Integer</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	Quit ((Lagerbestand - Reserviert) + Mindestbest)
]]></Implementation>
</Method>

<Method name="GetLagerinfoOid">
<ClassMethod>1</ClassMethod>
<FormalSpec>OrthoArtikelOid:%String,GroesseOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""

	&sql(SELECT ID INTO :id
			FROM DBSpezial_Ortho.LagerInfo 
			WHERE OrthoArtikel= :OrthoArtikelOid AND Groesse= :GroesseOid)
                              
	if (SQLCODE '= 0) {
		w "SQL Code nicht erfolgreich"
		set id = ""
	}

	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.LagerInfoD</DataLocation>
<DefaultData>LagerInfoDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.LagerInfoD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.LagerInfoI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.LagerInfoS</StreamLocation>
<Data name="LagerInfoDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>OrthoArtikel</Value>
</Value>
<Value name="3">
<Value>Groesse</Value>
</Value>
<Value name="4">
<Value>Lagerbestand</Value>
</Value>
<Value name="5">
<Value>Reserviert</Value>
</Value>
<Value name="6">
<Value>Verfuegbar</Value>
</Value>
<Value name="7">
<Value>Mindesbestand</Value>
</Value>
<Value name="8">
<Value>Bestellvorschlag</Value>
</Value>
<Value name="9">
<Value>OffeneBestellung</Value>
</Value>
<Value name="10">
<Value>Mindestbestand</Value>
</Value>
<Value name="11">
<Value>Vorbestellung</Value>
</Value>
<Value name="12">
<Value>Nachbestellung</Value>
</Value>
<Value name="13">
<Value>Umsatz</Value>
</Value>
</Data>
<Property name="Bestellvorschlag"/>
<Property name="Groesse"/>
<Property name="Lagerbestand"/>
<Property name="Mindestbestand"/>
<Property name="Nachbestellung"/>
<Property name="OffeneBestellung"/>
<Property name="OrthoArtikel"/>
<Property name="Reserviert"/>
<Property name="Umsatz"/>
<Property name="Verfuegbar"/>
<Property name="Vorbestellung"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Farbe">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57292.52579</TimeChanged>
<TimeCreated>61928,60365.803742</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="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="FarbNr">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Farbe</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Farbe).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Farbe
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.FarbeD</DataLocation>
<DefaultData>FarbeDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.FarbeD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.FarbeI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.FarbeS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="FarbeDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
<Value name="4">
<Value>FarbNr</Value>
</Value>
</Data>
<Property name="FarbNr"/>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Form">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57292.626735</TimeChanged>
<TimeCreated>61928,60349.19472</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="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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Form</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Form).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Form
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.FormD</DataLocation>
<DefaultData>FormDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.FormD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.FormI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.FormS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="FormDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Futter">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57292.724872</TimeChanged>
<TimeCreated>61928,60399.866701</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="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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Futter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Futter).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Futter
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.FutterD</DataLocation>
<DefaultData>FutterDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.FutterD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.FutterI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.FutterS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="FutterDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Geschlecht">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57292.823949</TimeChanged>
<TimeCreated>61928,60335.022472</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="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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Geschlecht</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Geschlecht).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Geschlecht
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.GeschlechtD</DataLocation>
<DefaultData>GeschlechtDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.GeschlechtD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.GeschlechtI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.GeschlechtS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="GeschlechtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Groesse">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57292.944497</TimeChanged>
<TimeCreated>61928,60437.242425</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="Nr">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Schuhgroessentyp">
<Type>DBSpezial.Ortho.SD.Schuhgroessentyp</Type>
<Cardinality>one</Cardinality>
<Inverse>Groesse</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Schuhtyp"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="SchuhgroessentypIndex">
<Properties>Schuhgroessentyp</Properties>
</Index>

<Property name="LagerInfo">
<Type>DBSpezial.Ortho.LagerInfo</Type>
<Cardinality>many</Cardinality>
<Inverse>Groesse</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Method name="GetIdByNrTyp">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,SchuhtypOid:%String,Nr:%Decimal</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
    &sql(SELECT ID INTO :id 
    	 FROM DBSpezial_Ortho_SD.Groesse 
    	 WHERE Nr=:Nr AND Schuhgroessentyp=:SchuhtypOid AND Mandant=:MandantOid)
                                               
    if (SQLCODE'=0) {
    	set id = ""
    }
    
    Quit id
]]></Implementation>
</Method>

<Property name="Lagerbewegung">
<Type>DBFakturierung.Lagerbew</Type>
<Cardinality>many</Cardinality>
<Inverse>Schuhgroesse</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="BestGroesse">
<Type>DBSpezial.Ortho.BestGroesse</Type>
<Cardinality>many</Cardinality>
<Inverse>Groesse</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="EingangGroesse">
<Type>DBSpezial.Ortho.EingangGroesse</Type>
<Cardinality>many</Cardinality>
<Inverse>Groesse</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.GroesseD</DataLocation>
<DefaultData>GroesseDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.GroesseD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.GroesseI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.GroesseS</StreamLocation>
<Data name="GroesseDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Groesse</Value>
</Value>
<Value name="4">
<Value>Schuhtyp</Value>
</Value>
<Value name="5">
<Value>Nr</Value>
</Value>
<Value name="6">
<Value>Lagerbewegung</Value>
</Value>
<Value name="7">
<Value>Schuhgroessentyp</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
<Property name="Schuhgroessentyp"/>
<Property name="Schuhtyp"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Obermaterial">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57293.058261</TimeChanged>
<TimeCreated>61928,60387.180249</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="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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Obermaterial</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Obermaterial).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Obermaterial
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ort7246.ObermaterialD</DataLocation>
<DefaultData>ObermaterialDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ort7246.ObermaterialD</IdLocation>
<IndexLocation>^DBSpezial.Ort7246.ObermaterialI</IndexLocation>
<StreamLocation>^DBSpezial.Ort7246.ObermaterialS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="ObermaterialDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Saison">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57293.157992</TimeChanged>
<TimeCreated>61928,60416.362128</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="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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Saison</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Saison).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Saison
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.SaisonD</DataLocation>
<DefaultData>SaisonDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.SaisonD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.SaisonI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.SaisonS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="SaisonDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Schuhgroessentyp">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57293.259413</TimeChanged>
<TimeCreated>61986,54040.592897</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="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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Schuhgroessentyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Groesse">
<Type>DBSpezial.Ortho.SD.Groesse</Type>
<Cardinality>many</Cardinality>
<Inverse>Schuhgroessentyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Schuhgroessentyp).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Schuhgroessentyp
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial7246.Schuhgroess1DF7D</DataLocation>
<DefaultData>SchuhgroessentypDefaultData</DefaultData>
<IdLocation>^DBSpezial7246.Schuhgroess1DF7D</IdLocation>
<IndexLocation>^DBSpezial7246.Schuhgroess1DF7I</IndexLocation>
<StreamLocation>^DBSpezial7246.Schuhgroess1DF7S</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="SchuhgroessentypDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Schuhtyp">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57293.383602</TimeChanged>
<TimeCreated>61986,60077.510115</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="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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Schuhtyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Schuhtyp).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Schuhtyp
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.SchuhtypD</DataLocation>
<DefaultData>SchuhtypDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.SchuhtypD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.SchuhtypI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.SchuhtypS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="SchuhtypDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.Sohle">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57293.482665</TimeChanged>
<TimeCreated>61928,62059.273797</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="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="OrthoArtikel">
<Type>DBSpezial.Ortho.Artikel</Type>
<Cardinality>many</Cardinality>
<Inverse>Sohle</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.Sohle).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.Sohle
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.SohleD</DataLocation>
<DefaultData>SohleDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.SohleD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.SohleI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.SohleS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="SohleDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.SD.VerfuegTyp">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57232.953909</TimeChanged>
<TimeCreated>62151,31720.332387</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="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="TypVerfuegung">
<Type>DBSpezial.Ortho.Verfuegung</Type>
<Cardinality>many</Cardinality>
<Inverse>Verfuegungstyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Ortho.SD.VerfuegTyp).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Ortho_SD.VerfuegTyp
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.SD.VerfuegTypD</DataLocation>
<DefaultData>VerfuegTypDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.SD.VerfuegTypD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.SD.VerfuegTypI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.SD.VerfuegTypS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="VerfuegTypDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Ortho.Verfuegung">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57233.057708</TimeChanged>
<TimeCreated>62199,42185.455416</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="Verfuegungsdatum">
<Type>%Date</Type>
</Property>

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

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

<Property name="Verfuegungstyp">
<Type>DBSpezial.Ortho.SD.VerfuegTyp</Type>
<Cardinality>one</Cardinality>
<Inverse>TypVerfuegung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Verfuegungstyp"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="VerfuegungstypIndex">
<Properties>Verfuegungstyp</Properties>
</Index>

<Property name="Adresse">
<Type>DBSpezial.Ortho.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>Verfuegung</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="AdresseIndex">
<Properties>Adresse</Properties>
</Index>

<Property name="FaktAuftragskopf">
<Type>DBFakturierung.Auftragskopf</Type>
<Cardinality>many</Cardinality>
<Inverse>OrthoVerfuegung</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Ortho.VerfuegungD</DataLocation>
<DefaultData>VerfuegungDefaultData</DefaultData>
<IdLocation>^DBSpezial.Ortho.VerfuegungD</IdLocation>
<IndexLocation>^DBSpezial.Ortho.VerfuegungI</IndexLocation>
<StreamLocation>^DBSpezial.Ortho.VerfuegungS</StreamLocation>
<Data name="VerfuegungDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Verfuegungsdatum</Value>
</Value>
<Value name="3">
<Value>VerfuegungsdatumAblauf</Value>
</Value>
<Value name="4">
<Value>Verfuegungsnr</Value>
</Value>
<Value name="5">
<Value>VerfuegungFuer</Value>
</Value>
<Value name="6">
<Value>Verfuegungstyp</Value>
</Value>
<Value name="7">
<Value>Adresse</Value>
</Value>
</Data>
<Property name="Adresse"/>
<Property name="VerfuegungFuer"/>
<Property name="Verfuegungsdatum"/>
<Property name="VerfuegungsdatumAblauf"/>
<Property name="Verfuegungsnr"/>
<Property name="Verfuegungstyp"/>
</Storage>
</Class>


<Project name="DBSpezial">
  <Items>
    <ProjectItem name="DBSpezial.Eier.Vorbestellung" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Eier.VorbestellungKopf" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.AF.AufbereitDetAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.AF.SD.PosBerArtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.AF.SD.RueckerstAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.AF.SD.ZuweisTabAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.AufbereitDet" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.AufbereitKopf" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.SD.PosBerArt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.SD.Rueckerst" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fakt.SD.ZuweisTab" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.AF.FahrzeugAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.AF.SD.AufbauArtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.AF.SD.AufbauTypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.AF.SD.FahrzeugTypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.AF.SD.ServiceArtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.AF.STKopfAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.AF.ServiceTypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.Fahrzeug" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.SD.AufbauArt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.SD.AufbauTyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.SD.FahrzeugTyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.SD.ServiceArt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.STKopf" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Fzv.ServiceTyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.AnnahmeDetAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.AbholrabattAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.AbzugAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.FeutigkeitAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.GetrartAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.GetrartAbzugAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.GetrsorteAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.GewichtRabattAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.HektLiterZuschlagAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.LoserrabattAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.MengenrabattAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.PreiseTSAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.ProbergewAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.RabattSumArtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AF.SD.RabattgruppeAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.Annahme" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.AnnahmeDet" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Abholrabatt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Abzug" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.COFeuchte" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.CORabatt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Feuchtigkeit" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Getrart" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.GetrartAbzug" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Getrsorte" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.GewichtRabatt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.HektLiterZuschlag" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Loserrabatt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Mengenrabatt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.PreiseTS" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Probergew" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Rabatt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.RabattSumArt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Getr.SD.Rabattgruppe" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Label.AF.KontrolleDetailAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Label.AF.KontrolleKopfAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Label.AF.SD.KontrolleurAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Label.KontrollDetail" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Label.KontrollKopf" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Label.SD.Kontrolleur" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.AF.MuldeAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.AF.MuldenPreisAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.AF.SD.ChauffeurAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.AF.SD.LeistArtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.AF.SD.MuldenartAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.AF.TAPositionAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.AF.TransAuftragAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.Mulde" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.MuldenPreis" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.SD.Chauffeur" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.SD.LeistArt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.SD.Muldenart" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.TAPosition" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Logistik.TransAuftrag" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Lohn.AF.EinsatzPosAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Lohn.AF.SD.TraktorfuehrerAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Lohn.AF.StuecklisteAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Lohn.Artikel" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Lohn.EinsatzPos" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Lohn.SD.Traktorfuehrer" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Lohn.Stueckliste" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.AF.ArtikelAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.AF.SD.MaschintypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.AF.SD.WerkzeugArtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.AF.VorkalkAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.AF.VorkalkPosAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.AF.WerkzeugAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.Artikel" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.SD.Maschintyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.SD.WerkzeugArt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.Vorkalk" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.VorkalkPos" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Mecano.Werkzeug" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.AdresseAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.ArtikelAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.BestGroesseAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.BestKopfAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.BestPosAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.EingangGroesseAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.EingangPosAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.LagerInfoAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.FarbeAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.FormAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.FutterAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.GeschlechtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.GroesseAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.ObermaterialAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.SaisonAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.SchuhgroessentypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.SchuhtypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.SohleAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.SD.VerfuegTypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.AF.VerfuegungAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.Adresse" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.Artikel" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.BestGroesse" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.BestKopf" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.BestPos" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.EingangGroesse" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.EingangPos" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.Foto" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.LagerInfo" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Farbe" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Form" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Futter" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Geschlecht" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Groesse" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Obermaterial" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Saison" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Schuhgroessentyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Schuhtyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.Sohle" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.SD.VerfuegTyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Ortho.Verfuegung" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.AF.AntragAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.AF.DokStreamAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.AF.DossierAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.AF.OfferteAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.AF.PoliceAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.AF.SD.DossiertypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.AF.SD.VersichArtAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.Antrag" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.DokStream" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.Dokument" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.Dossier" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.Offerte" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.Police" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.SD.Dossiertyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.SD.VersichArt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Versich.VersichObjekt" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.AF.AuftragAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.AF.AuftragPosAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.AF.SD.AbzugZuschlagAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.AF.SD.KundeAbzugAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.AF.SD.ReferenzpreisAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.AF.SD.TierartAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.AF.SD.TierartAbzugAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.Auftrag" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.AuftragPos" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.SD.AbzugZuschlag" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.SD.KundeAbzug" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.SD.Referenzpreis" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.SD.Tierart" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Vieh.SD.TierartAbzug" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wartung.AF.DetailAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wartung.AF.KopfAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wartung.AF.SD.VetragAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wartung.Detail" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wartung.Kopf" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wartung.SD.Vertrag" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wasser.AF.SD.GebTypAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wasser.AF.StandAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wasser.AF.ZaehlerAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wasser.Konst" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wasser.SD.Gebaeudetyp" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wasser.Stand" type="CLS"></ProjectItem>
    <ProjectItem name="DBSpezial.Wasser.Zaehler" type="CLS"></ProjectItem>
  </Items>
</Project>


<Class name="DBSpezial.Versich.AF.AntragAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62406,57586.911306</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>DossierOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 	ID, VersichObjekt->Bezeichnung, VersichObjekt->Versicherer,
			AntragAnVersicherung
	FROM DBSpezial_Versich.Antrag
	WHERE VersichObjekt->Dossier = :DossierOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Versich.AF.DokStreamAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62409,43070.236765</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>DokumentOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT 	ID, Bezeichnung, DateiEndung, Datum, Mitarbeiter
	FROM DBSpezial_Versich.DokStream
	WHERE Dokument = :DokumentOid</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Versich.AF.DossierAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62391,41257.832018</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,AdressOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 	ID, DossierNr, Dossiertyp,
			DBSpezial_Versich_SD.Dossiertyp_GetTextClass(Dossiertyp, :MandantOid, :Lang) As Bezeichnung, 
			Anfragedatum, Berater, (Berater->Vorname || ' ' || Berater->Name) As BeraterStr
	FROM DBSpezial_Versich.Dossier
	WHERE Adresse = :AdressOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Versich.AF.OfferteAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62405,32096.288927</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>DossierOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 	ID, VersichObjekt->Bezeichnung, VersichObjekt->Versicherer,
			Zugestellt, AntragZurueck, KeinAbschluss
	FROM DBSpezial_Versich.Offerte
	WHERE VersichObjekt->Dossier = :DossierOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Versich.AF.PoliceAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62406,60059.401247</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>DossierOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 	ID, VersichObjekt->Bezeichnung, VersichObjekt->Versicherer,
			PolicenNr, PoliceAnKunde, Beginn, Ablauf, KuendigungJaehrlich,
			Praemie, Bemerkung, EntschaedigungVersich, VersichArt
	FROM DBSpezial_Versich.Police
	WHERE VersichObjekt->Dossier = :DossierOid]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Versich.AF.SD.DossiertypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62391,36006.147018</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBSpezial_Versich_SD.Dossiertyp_GetTextClass(%ID, :MandantOid, :Lang) As Text,
	   Bemerkung
FROM DBSpezial_Versich_SD.Dossiertyp
WHERE Mandant = :MandantOid
ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBSpezial_Versich_SD.Dossiertyp_GetTextClass(%ID, :MandantOid, :Lang) AS wert1, Bemerkung AS wert2
FROM DBSpezial_Versich_SD.Dossiertyp
WHERE Mandant = :MandantOid
ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Code:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBSpezial_Versich_SD.Dossiertyp_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Versich_SD.Dossiertyp
WHERE Mandant = :MandantOid AND Nr = :Code
ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Versich.AF.SD.VersichArtAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62391,30855.925149</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBSpezial_Versich_SD.VersichArt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Versich_SD.VersichArt
WHERE Mandant = :MandantOid
ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBSpezial_Versich_SD.VersichArt_GetTextClass(%ID, :MandantOid, :Lang) AS wert1, "" AS wert2
FROM DBSpezial_Versich_SD.VersichArt
WHERE Mandant = :MandantOid
ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Code:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Nr, DBSpezial_Versich_SD.VersichArt_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBSpezial_Versich_SD.VersichArt
WHERE Mandant = :MandantOid AND Nr = :Code
ORDER BY Nr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Versich.Antrag">
<Super>DBSpezial.Versich.Dokument</Super>
<TimeChanged>62406,57607.745787</TimeChanged>
<TimeCreated>62389,37384.375045</TimeCreated>

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>AntragDefaultData</DefaultData>
<Data name="AntragDefaultData">
<Structure>listnode</Structure>
<Subscript>"Antrag"</Subscript>
<Value name="1">
<Value>AntragAnVersicherung</Value>
</Value>
<Value name="2">
<Value>PolicenAnKunde</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Versich.DokStream">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57233.304716</TimeChanged>
<TimeCreated>62389,35721.62951</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="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

<Property name="Dokument">
<Type>DBSpezial.Versich.Dokument</Type>
<Cardinality>one</Cardinality>
<Inverse>DokumentStream</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Dokument"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="DokumentIndex">
<Properties>Dokument</Properties>
</Index>

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

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

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

<Index name="MitarbeiterIndex">
<Properties>Mitarbeiter</Properties>
</Index>

<Method name="InputStream">
<FormalSpec>Stream:%Library.GlobalBinaryStream</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[	Quit ..DataStream.CopyFrom(Stream)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Versich.DokStreamD</DataLocation>
<DefaultData>DokStreamDefaultData</DefaultData>
<IdLocation>^DBSpezial.Versich.DokStreamD</IdLocation>
<IndexLocation>^DBSpezial.Versich.DokStreamI</IndexLocation>
<StreamLocation>^DBSpezial.Versich.DokStreamS</StreamLocation>
<Data name="DokStreamDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>DataStream</Value>
</Value>
<Value name="3">
<Value>Dokument</Value>
</Value>
<Value name="4">
<Value>DateiEndung</Value>
</Value>
<Value name="5">
<Value>Datum</Value>
</Value>
<Value name="6">
<Value>Mitarbeiter</Value>
</Value>
<Value name="7">
<Value>Bezeichnung</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Versich.Dokument">
<Abstract>1</Abstract>
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57233.405481</TimeChanged>
<TimeCreated>62389,41114.430105</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="DokumentStream">
<Type>DBSpezial.Versich.DokStream</Type>
<Cardinality>many</Cardinality>
<Inverse>Dokument</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="VersichObjekt">
<Type>DBSpezial.Versich.VersichObjekt</Type>
<Cardinality>one</Cardinality>
<Inverse>Dokument</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="VersichObjekt"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="VersichObjektIndex">
<Properties>VersichObjekt</Properties>
</Index>

<Method name="OutputFirstStream">
<ReturnType>%Library.GlobalBinaryStream</ReturnType>
<Implementation><![CDATA[
	Set tmpStream=##class(%Library.GlobalBinaryStream).%New()
	Set f = ..DokumentStream
	
	Set key = ""
 	Set dokStream = ..DokumentStream.GetNext(.key)
    If (dokStream '= "") {
		do tmpStream.CopyFromAndSave(dokStream.DataStream)   	
	}

	Quit tmpStream
]]></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[
	
	
	Quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Versich.DokumentD</DataLocation>
<DefaultData>DokumentDefaultData</DefaultData>
<IdLocation>^DBSpezial.Versich.DokumentD</IdLocation>
<IndexLocation>^DBSpezial.Versich.DokumentI</IndexLocation>
<StreamLocation>^DBSpezial.Versich.DokumentS</StreamLocation>
<Data name="DokumentDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>VersichObjekt</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Versich.Dossier">
<Super>%Persistent,%Populate,%XML.Adaptor</Super>
<TimeChanged>62423,58478</TimeChanged>
<TimeCreated>62389,34633.573832</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="DossierNr">
<Type>%Integer</Type>
<Required>1</Required>
</Property>

<Property name="Adresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>Dossier</Inverse>
<Relationship>1</Relationship>
<Required>1</Required>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Adresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="AdresseIndex">
<Properties>Adresse</Properties>
</Index>

<Index name="DossierIdx">
<Properties>DossierNr,Adresse</Properties>
<Unique>1</Unique>
</Index>

<Property name="Berater">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>one</Cardinality>
<Inverse>Dossier</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Berater"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="BeraterIndex">
<Properties>Berater</Properties>
</Index>

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

<Property name="Versicherungsobjekte">
<Type>DBSpezial.Versich.VersichObjekt</Type>
<Cardinality>children</Cardinality>
<Inverse>Dossier</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Dossiertyp">
<Type>DBSpezial.Versich.SD.Dossiertyp</Type>
<Cardinality>one</Cardinality>
<Inverse>Dossier</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Dossiertyp"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="DossiertypIndex">
<Properties>Dossiertyp</Properties>
</Index>

<Method name="%OnAddToSaveSet">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%AddToSaveSet</METHOD> method to 
provide notification that the current object is being included in a SaveSet, either
because %Save() was invoked on this object or an object that references this object.

<P>If this method returns an error status then %Save() will fail and the transaction
will be rolled back.]]></Description>
<FormalSpec>depth:%Integer=3,insert:%Integer=0,callcount:%Integer=0</FormalSpec>
<Private>1</Private>
<ProcedureBlock>1</ProcedureBlock>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
	if (insert) {
		set nr = ..GenerateDossierNr()
	
		//falls DossierNr bereits existieren würde 
		//-> nächste generieren und erneut überprüfen
		do {
			set exists = 0
			set found = 0
			&sql(SELECT 1 INTO :found FROM DBSpezial_Versich.Dossier WHERE DossierNr = :nr)
			if ((SQLCODE = 0) && (found = 1)) {
				//found	
				set nr = ..GenerateDossierNr()
				set exists = 1
			}
	
		} while(exists = 1)
	
		set ..DossierNr = nr
	}
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="GenerateDossierNr">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	quit $I(^DBSpezial.Versich.DossierNr("DossierNr"))
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Versich.DossierD</DataLocation>
<DefaultData>DossierDefaultData</DefaultData>
<IdLocation>^DBSpezial.Versich.DossierD</IdLocation>
<IndexLocation>^DBSpezial.Versich.DossierI</IndexLocation>
<StreamLocation>^DBSpezial.Versich.DossierS</StreamLocation>
<Data name="DossierDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>DossierNr</Value>
</Value>
<Value name="3">
<Value>Adresse</Value>
</Value>
<Value name="4">
<Value>Berater</Value>
</Value>
<Value name="5">
<Value>Anfragedatum</Value>
</Value>
<Value name="6">
<Value>Dossiertyp</Value>
</Value>
</Data>
<Property name="%%CLASSNAME"/>
<Property name="Adresse"/>
<Property name="Anfragedatum"/>
<Property name="Berater"/>
<Property name="DossierNr"/>
<Property name="Dossiertyp"/>
</Storage>
</Class>


<Class name="DBSpezial.Versich.Offerte">
<Super>DBSpezial.Versich.Dokument</Super>
<TimeChanged>62389,48949.059505</TimeChanged>
<TimeCreated>62389,37340.393332</TimeCreated>

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

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

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>OfferteDefaultData</DefaultData>
<Data name="OfferteDefaultData">
<Structure>listnode</Structure>
<Subscript>"Offerte"</Subscript>
<Value name="1">
<Value>Zugestellt</Value>
</Value>
<Value name="2">
<Value>AntragZurueck</Value>
</Value>
<Value name="3">
<Value>KeinAbschluss</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Versich.Police">
<Super>DBSpezial.Versich.Dokument</Super>
<TimeChanged>62406,60624.359138</TimeChanged>
<TimeCreated>62389,37415.941687</TimeCreated>

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

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

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

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

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

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

<Property name="Bemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="2048"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

<Property name="VersichArt">
<Type>DBSpezial.Versich.SD.VersichArt</Type>
<Cardinality>one</Cardinality>
<Inverse>Police</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="VersichArt"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="VersichArtIndex">
<Properties>VersichArt</Properties>
</Index>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DefaultData>PoliceDefaultData</DefaultData>
<Data name="PoliceDefaultData">
<Structure>listnode</Structure>
<Subscript>"Police"</Subscript>
<Value name="1">
<Value>PolicenNr</Value>
</Value>
<Value name="2">
<Value>Beginn</Value>
</Value>
<Value name="3">
<Value>Ablauf</Value>
</Value>
<Value name="4">
<Value>KuendigungJaehrlich</Value>
</Value>
<Value name="5">
<Value>Praemie</Value>
</Value>
<Value name="6">
<Value>Bemerkung</Value>
</Value>
<Value name="7">
<Value>EntschaedigungVersich</Value>
</Value>
<Value name="8">
<Value>VersichArt</Value>
</Value>
<Value name="9">
<Value>PoliceAnKunde</Value>
</Value>
</Data>
</Storage>
</Class>


<Class name="DBSpezial.Versich.SD.Dossiertyp">
<Super>%Persistent,%Populate,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62423,58478</TimeChanged>
<TimeCreated>62389,42567.254985</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="MandantNrIdx">
<Properties>Mandant,Nr</Properties>
<Unique>1</Unique>
</Index>

<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="Dossier">
<Type>DBSpezial.Versich.Dossier</Type>
<Cardinality>many</Cardinality>
<Inverse>Dossiertyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

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

<Method name="GetTextClass">
<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(DBSpezial.Versich.SD.Dossiertyp).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Versich_SD.Dossiertyp
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.VersiB79E.DossiertypD</DataLocation>
<DefaultData>DossiertypDefaultData</DefaultData>
<IdLocation>^DBSpezial.VersiB79E.DossiertypD</IdLocation>
<IndexLocation>^DBSpezial.VersiB79E.DossiertypI</IndexLocation>
<StreamLocation>^DBSpezial.VersiB79E.DossiertypS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="DossiertypDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
<Value name="4">
<Value>Bemerkung</Value>
</Value>
</Data>
<Property name="%%CLASSNAME"/>
<Property name="Bemerkung"/>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Versich.SD.VersichArt">
<Super>%Persistent,%Populate,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57294.059059</TimeChanged>
<TimeCreated>62389,42393.752934</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="MandantNrIdx">
<Properties>Mandant,Nr</Properties>
<Unique>1</Unique>
</Index>

<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="Police">
<Type>DBSpezial.Versich.Police</Type>
<Cardinality>many</Cardinality>
<Inverse>VersichArt</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

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

<Method name="GetTextClass">
<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(DBSpezial.Versich.SD.VersichArt).%OpenId(myID)
		set text = rs.GetText(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

<Method name="SetText">
<FormalSpec>MandOid:%String,Lang:%String,Value:%String</FormalSpec>
<Implementation><![CDATA[	Do ##class(DBUtils.StringUtils).SetText(..Bezeichnung, Value, Lang, MandOid)
]]></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 DBSpezial_Versich_SD.VersichArt
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.VersiB79E.VersichArtD</DataLocation>
<DefaultData>VersichArtDefaultData</DefaultData>
<IdLocation>^DBSpezial.VersiB79E.VersichArtD</IdLocation>
<IndexLocation>^DBSpezial.VersiB79E.VersichArtI</IndexLocation>
<StreamLocation>^DBSpezial.VersiB79E.VersichArtS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="VersichArtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nr"/>
</Storage>
</Class>


<Class name="DBSpezial.Versich.VersichObjekt">
<Super>%Library.Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57294.177659</TimeChanged>
<TimeCreated>62389,41537.456838</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="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="255"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="Versicherer">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>VersichObjekt</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Versicherer"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="VersichererIndex">
<Properties>Versicherer</Properties>
</Index>

<Property name="Dossier">
<Type>DBSpezial.Versich.Dossier</Type>
<Cardinality>parent</Cardinality>
<Inverse>Versicherungsobjekte</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Dossier"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Dokument">
<Type>DBSpezial.Versich.Dokument</Type>
<Cardinality>many</Cardinality>
<Inverse>VersichObjekt</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Versicherungsobjekte")</DataLocation>
<DefaultData>VersichObjektDefaultData</DefaultData>
<IdLocation>^DBSpezial.Versich.DossierC("Versicherungsobjekte")</IdLocation>
<IndexLocation>^DBSpezial.VeC66D.VersichObjektI</IndexLocation>
<StreamLocation>^DBSpezial.VeC66D.VersichObjektS</StreamLocation>
<Data name="VersichObjektDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Bezeichnung</Value>
</Value>
<Value name="3">
<Value>Versicherer</Value>
</Value>
</Data>
<Property name="Bezeichnung"/>
<Property name="Dossier"/>
<Property name="Versicherer"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Vieh.AF.AuftragAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62431,61074.434363</TimeChanged>
<TimeCreated>62411,51288.450079</TimeCreated>

<Query name="ListeAnkaufAdressen">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT DISTINCT AnkaufAdresse, 
	AnkaufAdresse->Adressnummer,
	AnkaufAdresse->Name,
	AnkaufAdresse->Plz,
	AnkaufAdresse->Ort
	FROM DBSpezial_Vieh.Auftrag
	WHERE Mandant = :MandantOid
	ORDER BY AnkaufAdresse->Name]]></SqlQuery>
</Query>

<Query name="ListeAnkaeufeByAdresse">
<Type>%SQLQuery</Type>
<FormalSpec>AdressOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, AuftragsNr, AnnahmeNr, RechnungsNr,
	AuftragsDatum, AnnahmeDatum, 
	AuslieferungsDatum, RechnungsDatum
	FROM DBSpezial_Vieh.Auftrag
	WHERE AnkaufAdresse = :AdressOid
	ORDER BY RechnungsNr, AnnahmeNr, AuftragsNr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Vieh.AF.AuftragPosAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62432,59662.149022</TimeChanged>
<TimeCreated>62432,56103.730738</TimeCreated>

<Query name="ListeAnkaufByAuftrag">
<Type>%SQLQuery</Type>
<FormalSpec>AuftragOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT PositionsNr, Text,
	Menge, Preis, Betrag,
	AbzugZuschlag,
	Berechnungscode,
	Preiscode
	FROM DBSpezial_Vieh.AuftragPos
	WHERE Auftrag = :AuftragOid
	AND NVL(IsVerkaufPos,0) = 0
	ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeVerkaufByAuftrag">
<Type>%SQLQuery</Type>
<FormalSpec>AuftragOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT PositionsNr, Text,
	Menge, Preis, Betrag,
	AbzugZuschlag, 
	Berechnungscode,
	Preiscode
	FROM DBSpezial_Vieh.AuftragPos
	WHERE Auftrag = :AuftragOid
	AND NVL(IsVerkaufPos,0) = 1
	ORDER BY PositionsNr</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Vieh.AF.SD.AbzugZuschlagAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62432,43776.356076</TimeChanged>
<TimeCreated>62353,33451.209042</TimeCreated>

<Query name="ListeNachCode">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, PositionsNr, DBSpezial_Vieh_SD.AbzugZuschlag_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung,
DBSpezial_Vieh_SD.AbzugZuschlag_GetKurzBezClass(%ID, :MandantOid, :Lang) As KurzBez
FROM DBSpezial_Vieh_SD.AbzugZuschlag
WHERE Mandant = :MandantOid AND PositionsNr = :Nr
ORDER BY PositionsNr</SqlQuery>
</Query>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,MandantJahrOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, PositionsNr,
DBSpezial_Vieh_SD.AbzugZuschlag_GetKurzBezClass(%ID, :MandantOid, :Lang) As KurzBez,
DBSpezial_Vieh_SD.AbzugZuschlag_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung,
Artikel->ArtikelNr AS ArtikelNr,
DBFakturierung.Artikel_GetArtikeltextClass(Artikel, Artikel->Mandant, :Lang) As Artikeltext, 
Berechnungscode, Preiscode, Soll, Betrag, CodeAbzug, AnzNachkommastellen
FROM DBSpezial_Vieh_SD.AbzugZuschlag
WHERE Mandant = :MandantOid
ORDER BY PositionsNr]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,MandantJahrOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, PositionsNr, DBSpezial_Vieh_SD.AbzugZuschlag_GetKurzBezClass(%ID, :MandantOid, :Lang) As KurzBez,
DBSpezial_Vieh_SD.AbzugZuschlag_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung,
Berechnungscode, Preiscode, Soll, Betrag, CodeAbzug, AnzNachkommastellen, 
Artikel->ArtikelNr AS ArtikelNr,
DBFakturierung.Artikel_GetArtikeltextClass(Artikel, Artikel->Mandant, :Lang) As Artikeltext
FROM DBSpezial_Vieh_SD.AbzugZuschlag
WHERE Mandant = :MandantOid
ORDER BY PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Vieh.AF.SD.KundeAbzugAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62432,43624.496137</TimeChanged>
<TimeCreated>62376,40948.661364</TimeCreated>

<Query name="ListeNachTierart">
<Type>%SQLQuery</Type>
<FormalSpec>TierartOid:%String,Lang:%String,MandantJahrOid:%String,AdressOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, Abzug, Abzug->PositionsNr,
DBSpezial_Vieh_SD.AbzugZuschlag_GetKurzBezClass(Abzug, :MandantOid, :Lang) As KurzBez,
DBSpezial_Vieh_SD.AbzugZuschlag_GetBezeichnungClass(Abzug, :MandantOid, :Lang) As Bezeichnung,
Abzug->Berechnungscode AS Berechnungsart, Abzug->Preiscode AS Preiscode, Abzug->Soll AS SollHaben,
Abzug->Artikel->ArtikelNr AS ArtikelNr,
DBFakturierung.Artikel_GetArtikeltextClass(Abzug->Artikel, Abzug->Artikel->Mandant, :Lang) As Artikeltext, 
Abzug->CodeAbzug, PNr, Abzug->Betrag
FROM DBSpezial_Vieh_SD.KundeAbzug
WHERE Tierart = :TierartOid AND KundeLieferant = :AdressOid
ORDER BY PNr]]></SqlQuery>
</Query>

<Query name="ListeNachKunde">
<Type>%SQLQuery</Type>
<FormalSpec>KundeLieferant:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Abzug, PNr, Tierart
FROM DBSpezial_Vieh_SD.KundeAbzug
WHERE KundeLieferant = :KundeLieferant</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>Lang:%String,MandantJahrOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, Abzug, PNr, Tierart, Tierart -> Nr AS TierartNr, KundeLieferant,
DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(Tierart, Tierart -> Mandant, :Lang) As TierartBez,
Abzug -> PositionsNr,
DBSpezial_Vieh_SD.AbzugZuschlag_GetKurzBezClass(Abzug, Abzug -> Mandant, :Lang) As AbzugKurzBez,
DBSpezial_Vieh_SD.AbzugZuschlag_GetBezeichnungClass(Abzug, Abzug -> Mandant, :Lang) As AbzugBez,
Abzug->Berechnungscode AS Berechnungsart, Abzug->Preiscode AS Preiscode, Abzug->Soll AS SollHaben,
Abzug->Artikel->ArtikelNr AS ArtikelNr,
DBFakturierung.Artikel_GetArtikeltextClass(Abzug->Artikel, Abzug->Artikel->Mandant, :Lang) As Artikeltext, 
Abzug->CodeAbzug, Abzug->Betrag, KundeLieferant -> Adressnummer
FROM DBSpezial_Vieh_SD.KundeAbzug
ORDER BY KundeLieferant, Tierart -> Nr, PNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Vieh.AF.SD.ReferenzpreisAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62432,37723.087356</TimeChanged>
<TimeCreated>62360,53689.859932</TimeCreated>

<Query name="ListeNachTierart">
<Type>%SQLQuery</Type>
<FormalSpec>TierartOid:%String,Jahr:%Integer,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Tierart, Woche, KgPreis
	FROM DBSpezial_Vieh_SD.Referenzpreis
	WHERE Tierart = :TierartOid
	AND Jahr = :Jahr
	ORDER BY Woche</SqlQuery>
</Query>

<Query name="ListeNachJahr">
<Type>%SQLQuery</Type>
<FormalSpec>Mandant:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Jahr
	FROM DBSpezial_Vieh_SD.Referenzpreis
	WHERE Tierart->Mandant = :Mandant
	ORDER BY Jahr DESC]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>Mandant:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT ID, Jahr, Woche, KgPreis, Tierart,
	DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(Tierart, :Mandant, :Lang) As TierartBez,
	Tierart -> Nr
	FROM DBSpezial_Vieh_SD.Referenzpreis
	WHERE Tierart->Mandant = :Mandant
	ORDER BY Jahr DESC, Tierart -> Nr, Woche]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Vieh.AF.SD.TierartAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62432,32203.720704</TimeChanged>
<TimeCreated>62350,42475.145519</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr, DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
	Mandant, Gewicht, EingewEinkauf, EingewVerkauf
	FROM DBSpezial_Vieh_SD.Tierart
	WHERE Mandant = :MandantOid
	ORDER BY Nr</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nr,
	DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung, 
	Mandant, Gewicht, EingewEinkauf, EingewVerkauf
	FROM DBSpezial_Vieh_SD.Tierart 
	WHERE Mandant = :MandantOid
	ORDER BY Nr</SqlQuery>
</Query>

<Query name="GetEntryByNr">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Nr:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nr, DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung
	FROM DBSpezial_Vieh_SD.Tierart 
	WHERE Mandant = :MandantOid
	AND Nr %StartsWith :Nr</SqlQuery>
</Query>

<Query name="GetEntryByBezeichnung">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,Bezeichnung:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT TOP 1 ID, Nr, DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Bezeichnung
	FROM DBSpezial_Vieh_SD.Tierart 
	WHERE Mandant = :MandantOid
	AND DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(%ID, :MandantOid, :Lang) LIKE :Bezeichnung
	ORDER BY Bezeichnung</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Vieh.AF.SD.TierartAbzugAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62432,54619.722992</TimeChanged>
<TimeCreated>62356,52381.857594</TimeCreated>

<Query name="ListeNachTierart">
<Type>%SQLQuery</Type>
<FormalSpec>TierartOid:%String,Lang:%String,MandantJahrOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT ID, AbzugZuschlag, MengeBetrag, AbzugZuschlag->PositionsNr,
DBSpezial_Vieh_SD.AbzugZuschlag_GetKurzBezClass(AbzugZuschlag, :MandantOid, :Lang) As KurzBez,
DBSpezial_Vieh_SD.AbzugZuschlag_GetBezeichnungClass(AbzugZuschlag, :MandantOid, :Lang) As Bezeichnung,
AbzugZuschlag->Berechnungscode AS Berechnungsart, AbzugZuschlag->AnzNachkommastellen, AbzugZuschlag->Preiscode AS Preiscode, AbzugZuschlag->Soll AS SollHaben,
AbzugZuschlag->Artikel->ArtikelNr AS ArtikelNr,
DBFakturierung.Artikel_GetArtikeltextClass(AbzugZuschlag->Artikel, AbzugZuschlag->Artikel->Mandant, :Lang) As Artikeltext, 
AbzugZuschlag->CodeAbzug
FROM DBSpezial_Vieh_SD.TierartAbzug
WHERE Tierart = :TierartOid
ORDER BY AbzugZuschlag->PositionsNr]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,MandantJahrOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT ID, MengeBetrag, Tierart->Nr,
    DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(Tierart, :MandantOid, :Lang) As Bezeichnung,
    Tierart->Gewicht, Tierart->EingewEinkauf, Tierart->EingewVerkauf, AbzugZuschlag->PositionsNr,
    DBSpezial_Vieh_SD.AbzugZuschlag_GetBezeichnungClass(AbzugZuschlag, :MandantOid, :Lang) As AbzugBezeichnung,
	DBSpezial_Vieh_SD.AbzugZuschlag_GetKurzBezClass(AbzugZuschlag, :MandantOid, :Lang) As KurzBez,
	AbzugZuschlag->Artikel->ArtikelNr AS ArtikelNr,
	DBFakturierung.Artikel_GetArtikeltextClass(AbzugZuschlag->Artikel, AbzugZuschlag->Artikel->Mandant, :Lang) As Artikeltext, 
	AbzugZuschlag->Berechnungscode, AbzugZuschlag->Preiscode, AbzugZuschlag->Soll, AbzugZuschlag->CodeAbzug,
	AbzugZuschlag->AnzNachkommastellen, Tierart
	FROM DBSpezial_Vieh_SD.TierartAbzug
	WHERE AbzugZuschlag->Mandant = :MandantOid
	ORDER BY Tierart->Nr, AbzugZuschlag->PositionsNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Vieh.Auftrag">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62439,53137.939846</TimeChanged>
<TimeCreated>62411,50129.639992</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="AuftragsNr">
<Type>%Integer</Type>
</Property>

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

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

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

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

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

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

<Property name="AnkaufAdresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>ViehhandelAnkauf</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="VerkaufAdresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>ViehhandelVerkauf</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Tierart">
<Type>DBSpezial.Vieh.SD.Tierart</Type>
<Cardinality>one</Cardinality>
<Inverse>Auftrag</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

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

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

<Property name="Positions">
<Type>DBSpezial.Vieh.AuftragPos</Type>
<Cardinality>children</Cardinality>
<Inverse>Auftrag</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

<Index name="MandantAuftragsNr">
<Properties>Mandant,AuftragsNr</Properties>
<Unique>1</Unique>
</Index>

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

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

<Method name="GetIdByAuftragNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,AuftragsNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Vieh.Auftrag WHERE Mandant = :MandantOid
		 AND AuftragsNr = :AuftragsNr)
	if (SQLCODE = 0) {
		Quit id
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Method name="GetNextAuftragsNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	// Falls Global noch nicht gesetzt höchste vorhanden Nummer setzen
	if ($GET(^ViehAuftragsNr(MandantOid)) = "") {
		&sql(SELECT MAX(AuftragsNr) into :nr FROM DBSpezial_Vieh.Auftrag WHERE Mandant = :MandantOid)
		if (SQLCODE = 0) {
			SET ^ViehAuftragsNr(MandantOid) = nr	
		}
	}
	// Neue Nummer auslessen
	SET nr=$INCREMENT(^ViehAuftragsNr(MandantOid))
	// Prüfen ob noch keine RG mit Nummer vorhanden
	while (##class(DBSpezial.Vieh.Auftrag).GetIdByAuftragNr(MandantOid, nr) '= "") {
		SET nr=$INCREMENT(^ViehAuftragsNr(MandantOid))
	}
		
	Quit nr
]]></Implementation>
</Method>

<Method name="GetNewsetId">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Vieh.Auftrag
		 ORDER BY AuftragsNr DESC)
	if (SQLCODE = 0) {
		Quit id
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Vieh.AuftragD</DataLocation>
<DefaultData>AuftragDefaultData</DefaultData>
<IdLocation>^DBSpezial.Vieh.AuftragD</IdLocation>
<IndexLocation>^DBSpezial.Vieh.AuftragI</IndexLocation>
<StreamLocation>^DBSpezial.Vieh.AuftragS</StreamLocation>
<Data name="AuftragDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>AuftragsNr</Value>
</Value>
<Value name="3">
<Value>AnnahmeNr</Value>
</Value>
<Value name="4">
<Value>RechnungsNr</Value>
</Value>
<Value name="5">
<Value>AuftragsDatum</Value>
</Value>
<Value name="6">
<Value>AnnahmeDatum</Value>
</Value>
<Value name="7">
<Value>AuslieferungsDatum</Value>
</Value>
<Value name="8">
<Value>RechnungsDatum</Value>
</Value>
<Value name="9">
<Value>AnkaufAdresse</Value>
</Value>
<Value name="10">
<Value>VerkaufAdresse</Value>
</Value>
<Value name="11">
<Value>Tierart</Value>
</Value>
<Value name="12">
<Value>AnzahlTiere</Value>
</Value>
<Value name="13">
<Value>AnkaufGewichtBrutto</Value>
</Value>
<Value name="14">
<Value>AnkaufEingewichtProzent</Value>
</Value>
<Value name="15">
<Value>AnkaufGewichtNetto</Value>
</Value>
<Value name="16">
<Value>VerkaufGewichtBrutto</Value>
</Value>
<Value name="17">
<Value>VerkaufEingewichtProzent</Value>
</Value>
<Value name="18">
<Value>VerkaufGewichtNetto</Value>
</Value>
<Value name="19">
<Value>Ohrmarke</Value>
</Value>
<Value name="20">
<Value>AnkaufPreis</Value>
</Value>
<Value name="21">
<Value>AnkaufBetrag</Value>
</Value>
<Value name="22">
<Value>Mandant</Value>
</Value>
<Value name="23">
<Value>VerkaufPreis</Value>
</Value>
<Value name="24">
<Value>VerkaufBetrag</Value>
</Value>
<Value name="25">
<Value>GewichtBrutto</Value>
</Value>
<Value name="26">
<Value>EingewichtProzent</Value>
</Value>
<Value name="27">
<Value>GewichtNetto</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="AnkaufAdresse">
</Property>
<Property name="AnkaufBetrag">
</Property>
<Property name="AnkaufEingewichtProzent">
</Property>
<Property name="AnkaufGewichtBrutto">
</Property>
<Property name="AnkaufGewichtNetto">
</Property>
<Property name="AnkaufPreis">
</Property>
<Property name="AnnahmeDatum">
</Property>
<Property name="AnnahmeNr">
</Property>
<Property name="AnzahlTiere">
</Property>
<Property name="AuftragsDatum">
</Property>
<Property name="AuftragsNr">
</Property>
<Property name="AuslieferungsDatum">
</Property>
<Property name="Mandant">
</Property>
<Property name="Ohrmarke">
</Property>
<Property name="RechnungsDatum">
</Property>
<Property name="RechnungsNr">
</Property>
<Property name="Tierart">
</Property>
<Property name="VerkaufAdresse">
</Property>
<Property name="VerkaufBetrag">
</Property>
<Property name="VerkaufEingewichtProzent">
</Property>
<Property name="VerkaufGewichtBrutto">
</Property>
<Property name="VerkaufGewichtNetto">
</Property>
<Property name="VerkaufPreis">
</Property>
</Storage>
</Class>


<Class name="DBSpezial.Vieh.AuftragPos">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62432,63176</TimeChanged>
<TimeCreated>62411,51074.431954</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">
<Type>%Integer</Type>
</Property>

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

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

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

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

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

<Property name="Auftrag">
<Type>DBSpezial.Vieh.Auftrag</Type>
<Cardinality>parent</Cardinality>
<Inverse>Positions</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="AbzugZuschlag">
<Type>DBSpezial.Vieh.SD.AbzugZuschlag</Type>
<Cardinality>one</Cardinality>
<Inverse>AuftragPos</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

<Method name="DeleteAnkaufAllByAuftrag">
<ClassMethod>1</ClassMethod>
<FormalSpec>AuftragOid:%String</FormalSpec>
<Implementation><![CDATA[	&sql(DELETE DBSpezial_Vieh.AuftragPos WHERE Auftrag = :AuftragOid AND NVL(IsVerkaufPos,0) = 0)
]]></Implementation>
</Method>

<Method name="DeleteVerkaufAllByAuftrag">
<ClassMethod>1</ClassMethod>
<FormalSpec>AuftragOid:%String</FormalSpec>
<Implementation><![CDATA[	&sql(DELETE DBSpezial_Vieh.AuftragPos WHERE Auftrag = :AuftragOid AND NVL(IsVerkaufPos,0) = 1)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Positions")</DataLocation>
<DefaultData>AuftragPosDefaultData</DefaultData>
<IdLocation>^DBSpezial.Vieh.AuftragC("Positions")</IdLocation>
<IndexLocation>^DBSpezial.Vieh.AuftragPosI</IndexLocation>
<StreamLocation>^DBSpezial.Vieh.AuftragPosS</StreamLocation>
<Data name="AuftragPosDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Text</Value>
</Value>
<Value name="4">
<Value>Menge</Value>
</Value>
<Value name="5">
<Value>Preis</Value>
</Value>
<Value name="6">
<Value>Betrag</Value>
</Value>
<Value name="7">
<Value>IsVerkaufPos</Value>
</Value>
<Value name="8">
<Value>AbzugZuschlag</Value>
</Value>
<Value name="9">
<Value>Berechnungscode</Value>
</Value>
<Value name="10">
<Value>Preiscode</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="AbzugZuschlag">
</Property>
<Property name="Auftrag">
</Property>
<Property name="Berechnungscode">
</Property>
<Property name="Betrag">
</Property>
<Property name="IsVerkaufPos">
</Property>
<Property name="Menge">
</Property>
<Property name="PositionsNr">
</Property>
<Property name="Preis">
</Property>
<Property name="Preiscode">
</Property>
<Property name="Text">
</Property>
<Property name="childsub">
</Property>
</Storage>
</Class>


<Class name="DBSpezial.Vieh.SD.AbzugZuschlag">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62432,47896.90036</TimeChanged>
<TimeCreated>62353,33212.309436</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">
<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="Mandant">
<Type>%String</Type>
</Property>

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

<Index name="MandantNrIdx">
<Properties>Mandant,PositionsNr</Properties>
</Index>

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

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

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

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

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

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

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

<Property name="TierartAbzug">
<Type>DBSpezial.Vieh.SD.TierartAbzug</Type>
<Cardinality>many</Cardinality>
<Inverse>AbzugZuschlag</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="KundeAbzug">
<Type>DBSpezial.Vieh.SD.KundeAbzug</Type>
<Cardinality>many</Cardinality>
<Inverse>Abzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>ViehAbzugZuschlag</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="AuftragPos">
<Type>DBSpezial.Vieh.AuftragPos</Type>
<Cardinality>many</Cardinality>
<Inverse>AbzugZuschlag</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetBez">
<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 '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Vieh.SD.AbzugZuschlag).%OpenId(myID)
		set text = rs.GetBez(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

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

<Method name="GetKurzBezClass">
<ClassMethod>1</ClassMethod>
<FormalSpec>myID:%String,MandOid:%String,Lang:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set text = ""
	if ((myID '= "") && (myID '= $c(0)) && (myID '= "0")) {
		Set rs=##Class(DBSpezial.Vieh.SD.AbzugZuschlag).%OpenId(myID)
		set text = rs.GetKurzBez(MandOid, Lang)
	}
	Quit text
]]></Implementation>
</Method>

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

<Method name="GetIdByPosNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,PosNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Vieh_SD.AbzugZuschlag
		 WHERE Mandant = :MandantOid AND PositionsNr = :PosNr)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Vi25BA.AbzugZuschlagD</DataLocation>
<DefaultData>AbzugZuschlagDefaultData</DefaultData>
<IdLocation>^DBSpezial.Vi25BA.AbzugZuschlagD</IdLocation>
<IndexLocation>^DBSpezial.Vi25BA.AbzugZuschlagI</IndexLocation>
<StreamLocation>^DBSpezial.Vi25BA.AbzugZuschlagS</StreamLocation>
<Data name="AbzugZuschlagDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PositionsNr</Value>
</Value>
<Value name="3">
<Value>Mandant</Value>
</Value>
<Value name="4">
<Value>Berechnungscode</Value>
</Value>
<Value name="5">
<Value>AnzNachkommastellen</Value>
</Value>
<Value name="6">
<Value>CodeAbzug</Value>
</Value>
<Value name="7">
<Value>Soll</Value>
</Value>
<Value name="8">
<Value>Betrag</Value>
</Value>
<Value name="9">
<Value>FibuKonto</Value>
</Value>
<Value name="10">
<Value>Preiscode</Value>
</Value>
<Value name="11">
<Value>Artikel</Value>
</Value>
</Data>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="KurzBez">
<Attribute>KurzBez</Attribute>
<Structure>subnode</Structure>
<Subscript>"KurzBez"</Subscript>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="AnzNachkommastellen">
</Property>
<Property name="Artikel">
</Property>
<Property name="Berechnungscode">
</Property>
<Property name="Betrag">
</Property>
<Property name="CodeAbzug">
</Property>
<Property name="Einkauf"/>
<Property name="FibuKonto"/>
<Property name="Mandant">
</Property>
<Property name="PositionsNr">
</Property>
<Property name="Preiscode">
</Property>
<Property name="Soll">
</Property>
</Storage>
</Class>


<Class name="DBSpezial.Vieh.SD.KundeAbzug">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57234.025977</TimeChanged>
<TimeCreated>62376,34407.725825</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="PNr">
<Type>%Integer</Type>
</Property>

<Property name="Abzug">
<Type>DBSpezial.Vieh.SD.AbzugZuschlag</Type>
<Cardinality>one</Cardinality>
<Inverse>KundeAbzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="AbzugIndex">
<Properties>Abzug</Properties>
</Index>

<Property name="KundeLieferant">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>KundeAbzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="KundeLieferantIndex">
<Properties>KundeLieferant</Properties>
</Index>

<Property name="Tierart">
<Type>DBSpezial.Vieh.SD.Tierart</Type>
<Cardinality>one</Cardinality>
<Inverse>KundeAbzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="TierartIndex">
<Properties>Tierart</Properties>
</Index>

<Method name="GetLastAdressId">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT KundeLieferant INTO :id
	FROM DBSpezial_Vieh_SD.KundeAbzug
	ORDER BY ID DESC)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByPosNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>PosNr:%Integer,AdressOid:%String,TierartOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id
	FROM DBSpezial_Vieh_SD.KundeAbzug
		 WHERE PNr = :PosNr
		 AND KundeLieferant = :AdressOid
		 AND Tierart = :TierartOid)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByAdresse">
<ClassMethod>1</ClassMethod>
<FormalSpec>AdressOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id
	FROM DBSpezial_Vieh_SD.KundeAbzug
	WHERE KundeLieferant = :AdressOid)
	Quit:(SQLCODE '= 0) ""
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Vieh.SD.KundeAbzugD</DataLocation>
<DefaultData>KundeAbzugDefaultData</DefaultData>
<IdLocation>^DBSpezial.Vieh.SD.KundeAbzugD</IdLocation>
<IndexLocation>^DBSpezial.Vieh.SD.KundeAbzugI</IndexLocation>
<StreamLocation>^DBSpezial.Vieh.SD.KundeAbzugS</StreamLocation>
<Data name="KundeAbzugDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PNr</Value>
</Value>
<Value name="3">
<Value>Abzug</Value>
</Value>
<Value name="4">
<Value>KundeLieferant</Value>
</Value>
<Value name="5">
<Value>Tierart</Value>
</Value>
</Data>
<Property name="Abzug"/>
<Property name="KundeLieferant"/>
<Property name="PNr"/>
<Property name="Tierart"/>
</Storage>
</Class>


<Class name="DBSpezial.Vieh.SD.Referenzpreis">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62432,63176</TimeChanged>
<TimeCreated>62360,49069.867104</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="KgPreis">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Tierart">
<Type>DBSpezial.Vieh.SD.Tierart</Type>
<Cardinality>one</Cardinality>
<Inverse>Referenzpreis</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

<Index name="PreisIdx">
<Properties>Tierart,Jahr,Woche</Properties>
</Index>

<Method name="GetIdByWoche">
<ClassMethod>1</ClassMethod>
<FormalSpec>Woche:%Integer,Tierart:%String,Jahr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Vieh_SD.Referenzpreis
	     WHERE  Woche = :Woche
	     AND Tierart = :Tierart
	     AND  Jahr = :Jahr)
	     
	      if (SQLCODE'=0) {
    		set id = ""
   		  }
   		  
	Quit id
]]></Implementation>
</Method>

<Method name="GetPreisByWoche">
<ClassMethod>1</ClassMethod>
<FormalSpec>Woche:%Integer,Tierart:%String,Jahr:%Integer</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<Implementation><![CDATA[
	
	set preis = 0
	&sql(SELECT KgPreis INTO :preis FROM DBSpezial_Vieh_SD.Referenzpreis
	     WHERE  Woche = :Woche
	     AND Tierart = :Tierart
	     AND Jahr = :Jahr)
	     
	      if (SQLCODE'=0) {
    		set preis = 0
   		  }
   		  
	Quit preis
]]></Implementation>
</Method>

<Method name="JahrExistsOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>Mandant:%String,Jahr:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	
	set count = 0
	&sql(SELECT COUNT(ID) INTO :count 
		 FROM DBSpezial_Vieh_SD.Referenzpreis 
		 WHERE Tierart->Mandant = :Mandant
	      AND Jahr = :Jahr)
	     
	      if (SQLCODE'=0) {
    		set count = 0
   		  }
   		  
	if (count > 0) {
		QUIT 1
	} else {
		QUIT 0	
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Vi25BA.ReferenzpreisD</DataLocation>
<DefaultData>ReferenzpreisDefaultData</DefaultData>
<IdLocation>^DBSpezial.Vi25BA.ReferenzpreisD</IdLocation>
<IndexLocation>^DBSpezial.Vi25BA.ReferenzpreisI</IndexLocation>
<StreamLocation>^DBSpezial.Vi25BA.ReferenzpreisS</StreamLocation>
<Data name="ReferenzpreisDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Jahr</Value>
</Value>
<Value name="3">
<Value>Woche</Value>
</Value>
<Value name="4">
<Value>KgPreis</Value>
</Value>
<Value name="5">
<Value>Tierart</Value>
</Value>
<Value name="6">
<Value>JahrWoche</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="Jahr">
</Property>
<Property name="JahrWoche"/>
<Property name="KgPreis">
</Property>
<Property name="Tierart">
</Property>
<Property name="Woche">
</Property>
</Storage>
</Class>


<Class name="DBSpezial.Vieh.SD.Tierart">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62439,57082.378348</TimeChanged>
<TimeCreated>62350,42347.894927</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="Nr">
<Type>%Integer</Type>
</Property>

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

<Property name="TierartAbzug">
<Type>DBSpezial.Vieh.SD.TierartAbzug</Type>
<Cardinality>many</Cardinality>
<Inverse>Tierart</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

<Property name="Referenzpreis">
<Type>DBSpezial.Vieh.SD.Referenzpreis</Type>
<Cardinality>many</Cardinality>
<Inverse>Tierart</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="KundeAbzug">
<Type>DBSpezial.Vieh.SD.KundeAbzug</Type>
<Cardinality>many</Cardinality>
<Inverse>Tierart</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Auftrag">
<Type>DBSpezial.Vieh.Auftrag</Type>
<Cardinality>many</Cardinality>
<Inverse>Tierart</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="TierartNrIndex">
<Data>%%ID,Nr</Data>
<Properties>Mandant,Nr</Properties>
<Unique>1</Unique>
</Index>

<Index name="BezeichnungIndex">
<Data>%%ID,Nr,Bezeichnung(KEYS),Bezeichnung(ELEMENTS)</Data>
<Properties>Mandant:Exact,Bezeichnung(KEYS):Exact,Bezeichnung(ELEMENTS):Exact</Properties>
</Index>

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>ViehTierart</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="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(DBSpezial.Vieh.SD.Tierart).%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="GetIdByNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Vieh_SD.Tierart
	     WHERE Nr = :Nr AND Mandant = :MandantOid)
	Quit id
]]></Implementation>
</Method>

<Method name="MoveFirstOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
	set grp = $Order(^DBSpezial.Vieh.SD.TierartI("TierartNrIndex",MandantOid,""),1)
	if (grp '= ""){
		set id = $Order(^DBSpezial.Vieh.SD.TierartI("TierartNrIndex",MandantOid,grp,""),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 grp = $Order(^DBSpezial.Vieh.SD.TierartI("TierartNrIndex",MandantOid,""),-1)
	if (grp '= ""){
		set id = $Order(^DBSpezial.Vieh.SD.TierartI("TierartNrIndex",MandantOid,grp,""),-1,list)
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,AdrNr:%Integer</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
    set nextNr = $Order(^DBSpezial.Vieh.SD.TierartI("TierartNrIndex",MandantOid,AdrNr))
	if (nextNr '= "") {
		set res = $Order(^DBSpezial.Vieh.SD.TierartI("TierartNrIndex",MandantOid,nextNr,""),1,list)
	} else {
		set list = ##class(DBSpezial.Vieh.SD.Tierart).MoveLastOnNr(MandantOid)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,AdrNr:%Integer</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
	set MandantOid = " "_MandantOid
    set nextNr = $Order(^DBSpezial.Vieh.SD.TierartI("TierartNrIndex",MandantOid,AdrNr),-1)
	if (nextNr '= "") {
		set res = $Order(^DBSpezial.Vieh.SD.TierartI("TierartNrIndex",MandantOid,nextNr,""),-1,list)
	} else {
		set list = ##class(DBSpezial.Vieh.SD.Tierart).MoveFirstOnNr(MandantOid)
	}
	
	Quit list
]]></Implementation>
</Method>

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

	set lang = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,""),1)
	if (lang '= ""){
		set grp = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,Lang,""),1)
		if (grp '= "") {
			set id = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,Lang,grp,""),1,list)
		} else {
			Quit ""
		}
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

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

	set lang = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,""),1)
	if (lang '= ""){
		set grp = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,Lang,""),-1)
		if (grp '= "") {
			set id = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,Lang,grp,""),-1,list)
		} else {
			Quit ""
		}
	} else {
		Quit ""	
	}
	Quit list
]]></Implementation>
</Method>

<Method name="MoveNextOnBezeichnung">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Lang:%String,Kurzname:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set nextNr = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,Lang,Kurzname))
	if (nextNr '= "") {
		set res = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,Lang,nextNr,""),1,list)
	} else {
		set list = ##class(DBSpezial.Vieh.SD.Tierart).MoveLastOnBezeichnung(MandantOid,Lang)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="MovePrevOnBezeichnung">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Lang:%String,Kurzname:%String</FormalSpec>
<ReturnType>%List</ReturnType>
<Implementation><![CDATA[
	set list = $ListBuild()
    set nextNr = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,Lang,Kurzname),-1)
	if (nextNr '= "") {
		set res = $Order(^DBSpezial.Vieh.SD.TierartI("BezeichnungIndex",MandantOid,Lang,nextNr,""),-1,list)
	} else {
		set list = ##class(DBSpezial.Vieh.SD.Tierart).MoveFirstOnBezeichnung(MandantOid,Lang)
	}
	
	Quit list
]]></Implementation>
</Method>

<Method name="GetIdByBezeichnung">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Lang:%String,Bezeichnung:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	set bez = Bezeichnung_"%"
	&sql(SELECT TOP 1 ID INTO :id 
		 FROM DBSpezial_Vieh_SD.Tierart 
		 WHERE Mandant = :MandantOid
		 AND DBSpezial_Vieh_SD.Tierart_GetBezeichnungClass(%ID, :MandantOid, :Lang) LIKE :bez)
	
	if (id '= "") {
		Quit id
		
		// keine Daten gefunden
	} else {
		Quit ""
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Vieh.SD.TierartD</DataLocation>
<DefaultData>TierartDefaultData</DefaultData>
<IdLocation>^DBSpezial.Vieh.SD.TierartD</IdLocation>
<IndexLocation>^DBSpezial.Vieh.SD.TierartI</IndexLocation>
<StreamLocation>^DBSpezial.Vieh.SD.TierartS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="TierartDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Mandant</Value>
</Value>
<Value name="3">
<Value>Nr</Value>
</Value>
<Value name="4">
<Value>Gewicht</Value>
</Value>
<Value name="5">
<Value>EingewEinkauf</Value>
</Value>
<Value name="6">
<Value>EingewVerkauf</Value>
</Value>
<Value name="7">
<Value>Artikel</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="EingewEinkauf">
</Property>
<Property name="EingewVerkauf">
</Property>
<Property name="Gewicht">
</Property>
<Property name="Mandant">
</Property>
<Property name="Nr">
</Property>
</Storage>
</Class>


<Class name="DBSpezial.Vieh.SD.TierartAbzug">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57234.2287</TimeChanged>
<TimeCreated>62356,43422.228108</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="MengeBetrag">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Tierart">
<Type>DBSpezial.Vieh.SD.Tierart</Type>
<Cardinality>one</Cardinality>
<Inverse>TierartAbzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="TierartIndex">
<Properties>Tierart</Properties>
</Index>

<Property name="AbzugZuschlag">
<Type>DBSpezial.Vieh.SD.AbzugZuschlag</Type>
<Cardinality>one</Cardinality>
<Inverse>TierartAbzug</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="AbzugZuschlagIndex">
<Properties>AbzugZuschlag</Properties>
</Index>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Vie25BA.TierartAbzugD</DataLocation>
<DefaultData>TierartAbzugDefaultData</DefaultData>
<IdLocation>^DBSpezial.Vie25BA.TierartAbzugD</IdLocation>
<IndexLocation>^DBSpezial.Vie25BA.TierartAbzugI</IndexLocation>
<StreamLocation>^DBSpezial.Vie25BA.TierartAbzugS</StreamLocation>
<Data name="TierartAbzugDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>MengeBetrag</Value>
</Value>
<Value name="3">
<Value>Tierart</Value>
</Value>
<Value name="4">
<Value>AbzugZuschlag</Value>
</Value>
</Data>
<Property name="%%CLASSNAME">
</Property>
<Property name="AbzugZuschlag">
</Property>
<Property name="MengeBetrag">
</Property>
<Property name="Tierart">
</Property>
</Storage>
</Class>


<Class name="DBSpezial.Wartung.AF.DetailAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62067,54481.669367</TimeCreated>

<Query name="ListeByAdresse">
<Type>%SQLQuery</Type>
<FormalSpec>KopfOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Bezeichnung, Bemerkung, Kaufpreis, WartungProzent, WartungBetrag,
	VonDatum, BisDatum, Nummer, Artikel
	FROM DBSpezial_Wartung.Detail
	WHERE Kopf = :KopfOid
	ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VetragsArt:%String,Status:%Integer,Periode:%Integer,VonAdrNr:%Integer,BisAdrNr:%Integer,ZahlAdrOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, Bezeichnung, Bemerkung, Kaufpreis, WartungProzent, WartungBetrag,
	VonDatum, BisDatum, Nummer, Kopf, DBFakturierung.Artikel_GetArtikeltextClass(Artikel, :MandantOid, :Lang) As Artikeltext
	FROM DBSpezial_Wartung.Detail
	WHERE Kopf->Adresse->Mandant = :MandantOid 
	AND ((:VetragsArt = "") OR (Kopf->Vertragsart = :VetragsArt))
	AND ((:Status = -1) OR (Kopf->Status = :Status))
	AND ((:Periode = -1) OR (Kopf->Verrechnungsperiode = :Periode))
	AND Kopf->Adresse->Adressnummer BETWEEN :VonAdrNr AND :BisAdrNr
	AND ((:ZahlAdrOid = '') OR (Kopf->Zahladresse = :ZahlAdrOid))
	ORDER BY Nummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Wartung.AF.KopfAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62437,53712.426686</TimeChanged>
<TimeCreated>62067,35711.118033</TimeCreated>

<Query name="ListeByAdresse">
<Type>%SQLQuery</Type>
<FormalSpec>AdresseOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, VertragsNr, GueltigAb, LetzteVerrechnung, VerrechnetBis, Status, 
	DBSpezial_Wartung_SD.Vertrag_GetBezeichnungClass(Vertragsart, Adresse->Mandant, :Lang) As Vertragsart
	FROM DBSpezial_Wartung.Kopf
	WHERE Adresse = :AdresseOid ORDER BY VertragsNr]]></SqlQuery>
</Query>

<Query name="ListeRootEintraegeStandard">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[SELECT DISTINCT {fn LEFT({fn UCASE(Adresse->Name)},1)} As Ziffer FROM DBSpezial_Wartung.Kopf WHERE Adresse->Mandant = :MandantOid
AND (({fn ASCII({fn UCASE(Adresse->Name)})} > 47 AND {fn ASCII({fn UCASE(Adresse->Name)})} < 58) 
OR ({fn ASCII({fn UCASE(Adresse->Name)})} >= 65 AND {fn ASCII({fn UCASE(Adresse->Name)})} <= 90)) ORDER BY Ziffer]]></SqlQuery>
</Query>

<Query name="ListeNachNormalBuchstaben">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Letter:%String,OnlyAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Adresse->ID, Adresse->Adresscode, Adresse->Name, Adresse->VornameZusatz1, Adresse->Plz, Adresse->Ort FROM DBSpezial_Wartung.Kopf WHERE Adresse->Mandant = :MandantOid AND {fn LEFT({fn UCASE(Adresse->Name)},1)} = :Letter AND (:OnlyAktive = 0 OR Status = 1) ORDER By Name]]></SqlQuery>
</Query>

<Query name="ListeNachLetterA">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,OnlyAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Adresse->ID, Adresse->Adresscode, Adresse->Name, Adresse->VornameZusatz1, Adresse->Plz, Adresse->Ort FROM DBSpezial_Wartung.Kopf WHERE Adresse->Mandant = :MandantOid 
	AND (ASCII({fn UCASE(Adresse->Name)}) = 65 OR (ASCII({fn UCASE(Adresse->Name)}) >=192 AND ASCII({fn UCASE(Adresse->Name)}) <=198)) AND (:OnlyAktive = 0 OR Adresse->Aktiv = 1) ORDER BY NAME]]></SqlQuery>
</Query>

<Query name="ListeNachLetterE">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,OnlyAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Adresse->ID, Adresse->Adresscode, Adresse->Name, Adresse->VornameZusatz1, Adresse->Plz, Adresse->Ort FROM DBSpezial_Wartung.Kopf WHERE Adresse->Mandant = :MandantOid 
	AND ({fn ASCII({fn UCASE(Adresse->Name)})} = 69 OR (ASCII({fn UCASE(Adresse->Name)}) >=200 AND ASCII({fn UCASE(Adresse->Name)}) <=203)) AND (:OnlyAktive = 0 OR Adresse->Aktiv = 1) ORDER BY NAME]]></SqlQuery>
</Query>

<Query name="ListeNachLetterI">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,OnlyAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Adresse->ID, Adresse->Adresscode, Adresse->Name, Adresse->VornameZusatz1, Adresse->Plz, Adresse->Ort FROM DBSpezial_Wartung.Kopf WHERE Adresse->Mandant = :MandantOid 
	AND ({fn ASCII({fn UCASE(Adresse->Name)})} = 73 OR (ASCII({fn UCASE(Adresse->Name)}) >=204 AND ASCII({fn UCASE(Adresse->Name)}) <=207)) AND (:OnlyAktive = 0 OR Adresse->Aktiv = 1) ORDER BY NAME]]></SqlQuery>
</Query>

<Query name="ListeNachLetterO">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,OnlyAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Adresse->ID, Adresse->Adresscode, Adresse->Name, Adresse->VornameZusatz1, Adresse->Plz, Adresse->Ort FROM DBSpezial_Wartung.Kopf WHERE Adresse->Mandant = :MandantOid 
	AND ({fn ASCII({fn UCASE(Adresse->Name)})} = 79 OR (ASCII({fn UCASE(Adresse->Name)}) >=210 AND ASCII({fn UCASE(Adresse->Name)}) <=214)) AND (:OnlyAktive = 0 OR Adresse->Aktiv = 1) ORDER BY NAME]]></SqlQuery>
</Query>

<Query name="ListeNachLetterU">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,OnlyAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Adresse->ID, Adresse->Adresscode, Adresse->Name, Adresse->VornameZusatz1, Adresse->Plz, Adresse->Ort FROM DBSpezial_Wartung.Kopf WHERE Adresse->Mandant = :MandantOid 
	AND ({fn ASCII({fn UCASE(Adresse->Name)})} = 85 OR (ASCII({fn UCASE(Adresse->Name)}) >=217 AND ASCII({fn UCASE(Adresse->Name)}) <=220)) AND (:OnlyAktive = 0 OR Adresse->Aktiv = 1) ORDER BY NAME]]></SqlQuery>
</Query>

<Query name="ListeNachNummern">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,OnlyAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Adresse->ID, Adresse->Adresscode, Adresse->Name, Adresse->VornameZusatz1, Adresse->Plz, Adresse->Ort FROM DBSpezial_Wartung.Kopf WHERE Adresse->Mandant = :MandantOid 
	AND ({fn ASCII({fn UCASE(Adresse->Name)})} > 47 AND {fn ASCII({fn UCASE(Adresse->Name)})} < 58) AND (:OnlyAktive = 0 OR Adresse->Aktiv = 1) ORDER BY NAME]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VetragsArt:%String,Status:%Integer,Periode:%Integer,VonAdrNr:%Integer,BisAdrNr:%Integer,ZahlAdrOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, VertragsNr, GueltigAb, LetzteVerrechnung, VerrechnetBis, Status, Vertragsart AS VertragsartId,
	DBSpezial_Wartung_SD.Vertrag_GetBezeichnungClass(Vertragsart, Adresse->Mandant, :Lang) As Vertragsart,
	Adresse, 
	(SELECT SUM(WartungBetrag) FROM DBSpezial_Wartung.Detail d WHERE d.Kopf = k.ID) AS WartungBetrag	
	FROM DBSpezial_Wartung.Kopf k
	WHERE Adresse->Mandant = :MandantOid 
	AND ((:VetragsArt = "") OR (Vertragsart = :VetragsArt))
	AND ((:Status = -1) OR (Status = :Status))
	AND ((:Periode = -1) OR (Verrechnungsperiode = :Periode))
	AND Adresse->Adressnummer BETWEEN :VonAdrNr AND :BisAdrNr
	AND ((:ZahlAdrOid = '') OR (Zahladresse = :ZahlAdrOid))
	ORDER BY Adresse->Adressnummer, VertragsNr]]></SqlQuery>
</Query>

<Query name="ListeVerrechnen">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VetragsArt:%String,Status:%Integer,Periode:%Integer,VonAdrNr:%Integer,BisAdrNr:%Integer,ZahlAdrOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID
	FROM DBSpezial_Wartung.Kopf
	WHERE Adresse->Mandant = :MandantOid 
	AND ((:VetragsArt = "") OR (Vertragsart = :VetragsArt))
	AND ((:Status = -1) OR (Status = :Status))
	AND ((:Periode = -1) OR (Verrechnungsperiode = :Periode))
	AND Adresse->Adressnummer BETWEEN :VonAdrNr AND :BisAdrNr
	AND Zahladresse = :ZahlAdrOid
	ORDER BY Adresse->Adressnummer, VertragsNr]]></SqlQuery>
</Query>

<Query name="ListeZahladressen">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT DISTINCT Zahladresse
	FROM DBSpezial_Wartung.Kopf
	WHERE Adresse->Mandant = :MandantOid 
	ORDER BY Zahladresse->Adressnummer]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Wartung.AF.SD.VetragAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>62066,32741.809871</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer, DBSpezial_Wartung_SD.Vertrag_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant, Prozentsatz
	FROM DBSpezial_Wartung_SD.Vertrag
	WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer As Nr, DBSpezial_Wartung_SD.Vertrag_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Wert1,STR(Prozentsatz,5,1) As Wert2, 
	Mandant
	FROM DBSpezial_Wartung_SD.Vertrag as Stammdate
	WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeVonBisNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonNummer:%Integer,BisNummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer, DBSpezial_Wartung_SD.Vertrag_GetBezeichnungClass(%ID, :MandantOid, :Lang), Prozentsatz, 
	Mandant
	FROM DBSpezial_Wartung_SD.Vertrag
	WHERE Mandant = :MandantOid AND Nummer BETWEEN :VonNummer AND :BisNummer ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Wartung.Detail">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57294.666976</TimeChanged>
<TimeCreated>62066,32452.300886</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="Kopf">
<Type>DBSpezial.Wartung.Kopf</Type>
<Cardinality>parent</Cardinality>
<Inverse>Detail</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Property name="Bemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="60"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

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

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

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

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>WartungArtikel</Inverse>
<Relationship>1</Relationship>
</Property>

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

<Method name="GetNextFreeNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>KopfOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBSpezial_Wartung.Detail WHERE Kopf=:KopfOid)
	Quit +nr+1
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Detail")</DataLocation>
<DefaultData>DetailDefaultData</DefaultData>
<IdLocation>^DBSpezial.Wartung.KopfC("Detail")</IdLocation>
<IndexLocation>^DBSpezial.Wartung.DetailI</IndexLocation>
<StreamLocation>^DBSpezial.Wartung.DetailS</StreamLocation>
<Data name="DetailDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Bezeichnung</Value>
</Value>
<Value name="3">
<Value>Bemerkung</Value>
</Value>
<Value name="4">
<Value>Kaufpreis</Value>
</Value>
<Value name="5">
<Value>WartungProzent</Value>
</Value>
<Value name="6">
<Value>WartungBetrag</Value>
</Value>
<Value name="7">
<Value>VonDatum</Value>
</Value>
<Value name="8">
<Value>BisDatum</Value>
</Value>
<Value name="9">
<Value>Artikel</Value>
</Value>
<Value name="10">
<Value>Nummer</Value>
</Value>
</Data>
<Property name="Artikel"/>
<Property name="Bemerkung"/>
<Property name="Bezeichnung"/>
<Property name="BisDatum"/>
<Property name="Kaufpreis"/>
<Property name="Kopf"/>
<Property name="Nummer"/>
<Property name="VonDatum"/>
<Property name="WartungBetrag"/>
<Property name="WartungProzent"/>
<Property name="childsub"/>
</Storage>
</Class>


<Class name="DBSpezial.Wartung.Kopf">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57234.447102</TimeChanged>
<TimeCreated>62061,52148.490214</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="Adresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>Wartungsvertrag</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Adresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="AdresseIndex">
<Properties>Adresse</Properties>
</Index>

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

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

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

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

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

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

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

<Property name="Bemerkung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="1000"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

<Property name="Sachbearbeiter">
<Type>DBCore.Mitarbeiter</Type>
<Cardinality>one</Cardinality>
<Inverse>WartungsvertragBearbeiter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Sachbearbeiter"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Detail">
<Type>DBSpezial.Wartung.Detail</Type>
<Cardinality>children</Cardinality>
<Inverse>Kopf</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Vertragsart">
<Type>DBSpezial.Wartung.SD.Vertrag</Type>
<Cardinality>one</Cardinality>
<Inverse>Kopfvertrag</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Zahladresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>WartungZahladresse</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

<Method name="GetNextFreeVertragsNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(VertragsNr) into :nr From DBSpezial_Wartung.Kopf WHERE Adresse->Mandant=:MandOid)
	Quit +nr+1
]]></Implementation>
</Method>

<Method name="VertragsNrExists">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,VertragsNr:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	
	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Wartung.Kopf
	     WHERE VertragsNr = :VertragsNr AND Adresse->Mandant = :MandantOid)
	if (id = "") {
		Quit 0
	} else {
		Quit 1
	}
]]></Implementation>
</Method>

<Method name="GetIdByNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,VertragsNr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Wartung.Kopf
		 WHERE Adresse->Mandant = :MandantOid AND VertragsNr = :VertragsNr)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Wartung.KopfD</DataLocation>
<DefaultData>KopfDefaultData</DefaultData>
<IdLocation>^DBSpezial.Wartung.KopfD</IdLocation>
<IndexLocation>^DBSpezial.Wartung.KopfI</IndexLocation>
<StreamLocation>^DBSpezial.Wartung.KopfS</StreamLocation>
<Data name="KopfDefaultData">
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Adresse</Value>
</Value>
<Value name="3">
<Value>VertragsNr</Value>
</Value>
<Value name="4">
<Value>Erstellungsdatum</Value>
</Value>
<Value name="5">
<Value>Vertragseingang</Value>
</Value>
<Value name="6">
<Value>GueltigAb</Value>
</Value>
<Value name="7">
<Value>LetzteVerrechnung</Value>
</Value>
<Value name="8">
<Value>VerrechnetBis</Value>
</Value>
<Value name="9">
<Value>Verrechnungsperiode</Value>
</Value>
<Value name="10">
<Value>Bemerkung</Value>
</Value>
<Value name="11">
<Value>Status</Value>
</Value>
<Value name="12">
<Value>Statusaenderung</Value>
</Value>
<Value name="13">
<Value>Vertragsart</Value>
</Value>
<Value name="14">
<Value>Sachbearbeiter</Value>
</Value>
<Value name="15">
<Value>Zahladresse</Value>
</Value>
<Value name="16">
<Value>LetzteAuftragsNr</Value>
</Value>
<Value name="17">
<Value>AnzArbeitsplaetze</Value>
</Value>
</Data>
<Property name="Adresse"/>
<Property name="AnzArbeitsplaetze"/>
<Property name="Bemerkung"/>
<Property name="Erstellungsdatum"/>
<Property name="GueltigAb"/>
<Property name="LetzteAuftragsNr"/>
<Property name="LetzteVerrechnung"/>
<Property name="Sachbearbeiter"/>
<Property name="Status"/>
<Property name="Statusaenderung"/>
<Property name="VerrechnetBis"/>
<Property name="Verrechnungsperiode"/>
<Property name="VertragsNr"/>
<Property name="Vertragsart"/>
<Property name="Vertragseingang"/>
<Property name="Zahladresse"/>
</Storage>
</Class>


<Class name="DBSpezial.Wartung.SD.Vertrag">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57294.796359</TimeChanged>
<TimeCreated>62066,32625.109288</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>%Integer</Type>
<Required>1</Required>
</Property>

<Index name="NummerIndex">
<Properties>Nummer</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="MandantNrIndex">
<Properties>Mandant,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="Prozentsatz">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</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(DBSpezial.Wartung.SD.Vertrag).%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>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBSpezial_Wartung_SD.Vertrag WHERE Mandant=:MandOid)
	Quit +nr+1
]]></Implementation>
</Method>

<Method name="NrExists">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	
	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Wartung_SD.Vertrag
	     WHERE Nummer = :Nummer AND Mandant = :MandantOid)
	if (id = "") {
		Quit 0
	} else {
		Quit 1
	}
]]></Implementation>
</Method>

<Method name="GetIdByNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Wartung_SD.Vertrag
		 WHERE Mandant = :MandantOid AND Nummer = :Nr)
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByNameOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Name:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	Set strSQL="SELECT VetragA AS ID FROM DBSpezial_Wartung_SD.Vertrag_Bezeichnung WHERE Vertrag->Mandant = "_MandantOid_" AND Bezeichnung = '"_Name_"'"
   	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
    Do rs.Prepare(strSQL)
    Set sc=rs.Execute()
    if ($$$ISERR(sc)) {
       w "DBSpezial_Wartung_SD.Vertrag - Fehler bei SQL-Statement",!
    }
    if (rs.Next()) {
        Set id = rs.Data("ID")
    }
	Quit id
]]></Implementation>
</Method>

<Method name="GetLastIdOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Wartung_SD.Vertrag
		 WHERE Mandant = :MandantOid ORDER BY Nummer DESC)
	Quit id
]]></Implementation>
</Method>

<Method name="GetFirstIdOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Wartung_SD.Vertrag
		 WHERE Mandant = :MandantOid ORDER BY Nummer ASC)
	Quit id
]]></Implementation>
</Method>

<Property name="Kopfvertrag">
<Type>DBSpezial.Wartung.Kopf</Type>
<Cardinality>many</Cardinality>
<Inverse>Vertragsart</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Wartung.SD.VertragD</DataLocation>
<DefaultData>VertragDefaultData</DefaultData>
<IdLocation>^DBSpezial.Wartung.SD.VertragD</IdLocation>
<IndexLocation>^DBSpezial.Wartung.SD.VertragI</IndexLocation>
<StreamLocation>^DBSpezial.Wartung.SD.VertragS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="VertragDefaultData">
<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>Prozentsatz</Value>
</Value>
</Data>
<Property name="Mandant"/>
<Property name="Nummer"/>
<Property name="Prozentsatz"/>
</Storage>
</Class>


<Class name="DBSpezial.Wasser.AF.SD.GebTypAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61933,52911.045534</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer, DBSpezial_Wasser_SD.Gebaeudetyp_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Text, 
	Mandant, Betrag
	FROM DBSpezial_Wasser_SD.Gebaeudetyp
	WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer As Nr, DBSpezial_Wasser_SD.Gebaeudetyp_GetBezeichnungClass(%ID, :MandantOid, :Lang) As Wert1,STR(Betrag,7,2) As Wert2, 
	Mandant, Betrag
	FROM DBSpezial_Wasser_SD.Gebaeudetyp as Stammdate
	WHERE Mandant = :MandantOid ORDER BY Nummer</SqlQuery>
</Query>

<Query name="ListeVonBisNummer">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonNummer:%Integer,BisNummer:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, Nummer, DBSpezial_Wasser_SD.Gebaeudetyp_GetBezeichnungClass(%ID, :MandantOid, :Lang) ,Betrag, 
	Mandant
	FROM DBSpezial_Wasser_SD.Gebaeudetyp
	WHERE Mandant = :MandantOid AND Nummer BETWEEN :VonNummer AND :BisNummer ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Wasser.AF.StandAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61933,52765.346777</TimeCreated>

<Query name="ListeByZaehler">
<Type>%SQLQuery</Type>
<FormalSpec>ZaehlerOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT %ID, PerDatum, Bestand, Status,	AContoRechnung, ZaehlerNr, AbrechnungsCode
	FROM DBSpezial_Wasser.Stand
	WHERE Zaehler = :ZaehlerOid ORDER BY PerDatum</SqlQuery>
</Query>

<Query name="ListeByMandant">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,NurAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PerDatum, Bestand, Status,	AContoRechnung, ZaehlerNr, AbrechnungsCode, Zaehler
	FROM DBSpezial_Wasser.Stand
	WHERE Zaehler->Eigentuemer->Mandant = :MandantOid AND (:NurAktive = 0 OR Zaehler->Aktiv = 1) ORDER BY Zaehler,PerDatum]]></SqlQuery>
</Query>

<Query name="ListeByMandantPerDatum">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,PerDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PerDatum, Bestand, Status,	AContoRechnung, ZaehlerNr, AbrechnungsCode, Zaehler, Zaehler->Gebaeudetyp,
	DBSpezial_Wasser_SD.Gebaeudetyp_GetBezeichnungClass(Zaehler->Gebaeudetyp, :MandantOid, :Lang) as GebaeudetypText,
	NVL(Zaehler->Gebaeudetyp->Art,0) AS GebaeudeArt, NVL(Zaehler->Gebaeudetyp->Art,0) AS GebaeudeArtText
	FROM DBSpezial_Wasser.Stand
	WHERE Zaehler->Eigentuemer->Mandant = :MandantOid 
	AND PerDatum <= {d :PerDatum} 
	ORDER BY Zaehler,PerDatum]]></SqlQuery>
</Query>

<Query name="ListeByMandantVonBisDatum">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,VonDatum:%Date,BisDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, PerDatum, Bestand, Status,	AContoRechnung, ZaehlerNr, AbrechnungsCode, Zaehler, Zaehler->Gebaeudetyp,
	DBSpezial_Wasser_SD.Gebaeudetyp_GetBezeichnungClass(Zaehler->Gebaeudetyp, :MandantOid, :Lang) as GebaeudetypText,
	NVL(Zaehler->Gebaeudetyp->Art,0) AS GebaeudeArt, NVL(Zaehler->Gebaeudetyp->Art,0) AS GebaeudeArtText
	FROM DBSpezial_Wasser.Stand
	WHERE Zaehler->Eigentuemer->Mandant = :MandantOid 
	AND PerDatum BETWEEN {d :VonDatum} AND {d :BisDatum}
	ORDER BY Zaehler,PerDatum]]></SqlQuery>
</Query>

<Query name="ListeVerrechnen">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonAdresse:%Integer,BisAdresse:%Integer</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 
	ID,
	Zaehler->Rechnungsadresse AS Adresse,
	Zaehler,
	PerDatum,
	Bestand,
	Status,
	AContoRechnung, 
	ZaehlerNr, 
	AbrechnungsCode
	FROM DBSpezial_Wasser.Stand 
	WHERE Zaehler->Rechnungsadresse->Mandant = :MandantOid
	AND Zaehler->Rechnungsadresse->Adressnummer BETWEEN :VonAdresse AND :BisAdresse
	AND Zaehler->Aktiv = 1
	AND NVL(Status,0) <> DBSpezial_Wasser.Konst_StatusBestandVerrechnet()
	ORDER BY Zaehler->Rechnungsadresse, Zaehler->WasserzaehlerNr, PerDatum]]></SqlQuery>
</Query>

<Query name="ListeElektronischeVonBis">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonAdresse:%Integer,BisAdresse:%Integer,VonDatum:%Date,BisDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 
	ID
	FROM DBSpezial_Wasser.Stand 
	WHERE Zaehler->Rechnungsadresse->Mandant = :MandantOid
	AND Zaehler->Rechnungsadresse->Adressnummer BETWEEN :VonAdresse AND :BisAdresse
	AND PerDatum BETWEEN {d :VonDatum} AND {d :BisDatum}
	AND AbrechnungsCode = DBSpezial_Wasser.Konst_AbrCodeElektronisch()]]></SqlQuery>
</Query>

<Query name="ListeVerrechnetVonBis">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonAdresse:%Integer,BisAdresse:%Integer,VonDatum:%Date,BisDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 
	ID
	FROM DBSpezial_Wasser.Stand 
	WHERE Zaehler->Rechnungsadresse->Mandant = :MandantOid
	AND Zaehler->Rechnungsadresse->Adressnummer BETWEEN :VonAdresse AND :BisAdresse
	AND PerDatum BETWEEN {d :VonDatum} AND {d :BisDatum}
	AND NVL(Status,0) = DBSpezial_Wasser.Konst_StatusBestandVerrechnet()]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Wasser.AF.ZaehlerAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33677</TimeChanged>
<TimeCreated>61933,52840.338212</TimeCreated>

<Query name="ListeByEigentuemer">
<Type>%SQLQuery</Type>
<FormalSpec>AdressOid:%String,MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT %ID, Aktiv,PoliceNr, Strasse, Hausnummer, WasserzaehlerNr, BemerkungIntern, Gebaeudetyp, Mieteradresse,
	DBSpezial_Wasser_SD.Gebaeudetyp_GetBezeichnungClass(Gebaeudetyp, :MandantOid, :Lang) as GebaeudetypText,
	WasserzahlerAlt, Aktiv, Grundstuecknummer, GemeindeName, GemeindePLZ, Zaehlwerkschluessel, GemeindeNr,
	Rechnungsadresse->Name 			AS "RGdresse.Name",  
	Rechnungsadresse->Hausnummer 	AS "RGdresse.Hausnummer", 
	Rechnungsadresse->Strasse 		AS "RGdresse.Strasse", 
	Rechnungsadresse->Plz			AS "RGdresse.Plz", 
	Rechnungsadresse->Ort 			AS "RGdresse.Ort"
	FROM DBSpezial_Wasser.Zaehler
	WHERE Eigentuemer = :AdressOid ORDER BY PoliceNr]]></SqlQuery>
</Query>

<Query name="ListeExport">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 
	Eigentuemer->Adressnummer	 AS "KundenNr", 
	Eigentuemer->Name 			 AS "KundenName",  
	Eigentuemer->VornameZusatz1  AS "KundenVorname",  
	Strasse                      AS "GebaeudeStrasse",
	Hausnummer                   AS "GebaeudeNr",
	GemeindePLZ                  AS "GebaeudePLZ",
	GemeindeName                 AS "GebaeudeOrt",
	WasserzaehlerNr              AS "ZaehlerNr",
	BemerkungIntern				 AS "BemerkungInt",
	BemerkungRechnung		 	 AS "BemerkungExt",
	CASE WHEN Zaehlwerkschluessel IS NULL THEN 0 ELSE Zaehlwerkschluessel END AS "ZaehlerArt",
	DBSpezial_Wasser.Stand_GetNewestDatum(%ID) AS "AblDatumAlt",
	DBSpezial_Wasser.Stand_GetNewestBestand(%ID) AS "AblWertAlt",
	"" 							 AS "AblDatumAkt",
	0 							 AS "AblWertAkt"
	FROM DBSpezial_Wasser.Zaehler
	WHERE Eigentuemer->Mandant = :MandantOid AND
	Aktiv = 1 AND 
	WasserzaehlerNr <> ""]]></SqlQuery>
</Query>

<Query name="ListeDruck">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String,NurAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 
	ID,
	Eigentuemer->Adressnummer	 AS "Eigentuemer.AdressNr", 
	Eigentuemer->Name 			 AS "Eigentuemer.Name",  
	Eigentuemer->VornameZusatz1  AS "Eigentuemer.Vorname",  
	Eigentuemer->Strasse  		 AS "Eigentuemer.Strasse",  
	Eigentuemer->Hausnummer  	 AS "Eigentuemer.Hausnummer",  
	Eigentuemer->PLZ  			 AS "Eigentuemer.PLZ",   
	Eigentuemer->Ort 			 AS "Eigentuemer.Ort",  
	Strasse,
	Hausnummer,
	PoliceNr,
	Grundstuecknummer,
	GemeindePLZ,
	GemeindeName,
	WasserzaehlerNr,            
	WasserzahlerAlt, 
	GemeindeNr,
	Aktiv,
	Rechnungsadresse->Adressnummer	AS "RGdresse.AdressNr",  
	Rechnungsadresse->Name 			AS "RGdresse.Name",  
	Rechnungsadresse->VornameZusatz1 AS "RGdresse.Vorname",  
	Rechnungsadresse->Hausnummer 	AS "RGdresse.Hausnummer", 
	Rechnungsadresse->Strasse 		AS "RGdresse.Strasse", 
	Rechnungsadresse->Plz			AS "RGdresse.Plz", 
	Rechnungsadresse->Ort 			AS "RGdresse.Ort",
	Mieteradresse->Adressnummer		AS "Mieter.AdressNr",  
	Mieteradresse->Name 			AS "Mieter.Name",  
	Mieteradresse->VornameZusatz1	AS "Mieter.Vorname",  
	Mieteradresse->Hausnummer 		AS "Mieter.Hausnummer", 
	Mieteradresse->Strasse 			AS "Mieter.Strasse", 
	Mieteradresse->Plz				AS "Mieter.Plz", 
	Mieteradresse->Ort 				AS "Mieter.Ort",
	IndividualGebuehr,
	Grundgebuehr AS GrundgebuehrZ,
	Gebaeudetyp->Betrag AS GrundgebuehrG,
	DBSpezial_Wasser_SD.Gebaeudetyp_GetBezeichnungClass(Gebaeudetyp, :MandantOid, :Lang) as GebaeudetypText,
	CASE WHEN Zaehlwerkschluessel IS NULL THEN 0 ELSE Zaehlwerkschluessel END AS "ZaehlerArt"
	FROM DBSpezial_Wasser.Zaehler
	WHERE Eigentuemer->Mandant = :MandantOid
	AND (:NurAktive = 0 OR Aktiv = 1)
	ORDER BY Strasse, +Hausnummer]]></SqlQuery>
</Query>

<Query name="ListePolicen">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,NurAktive:%Boolean</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[
	SELECT
	ID, PoliceNr, GemeindeNr, Aktiv, Strasse, Hausnummer,
	WasserzaehlerNr, WasserzahlerAlt
	FROM DBSpezial_Wasser.Zaehler
	WHERE Eigentuemer->Mandant = :MandantOid
	AND (:NurAktive = 0 OR Aktiv = 1)
	ORDER BY GemeindeNr, PoliceNr]]></SqlQuery>
</Query>

<Query name="ListeEinzuege">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonDatum:%Date,BisDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT
    ID, PoliceNr, GemeindeNr, Aktiv, Strasse, Hausnummer,
    Rechnungsadresse->Adressnummer    AS "RGdresse.AdressNr", 
    Rechnungsadresse->Name                                       AS "RGdresse.Name", 
    Rechnungsadresse->VornameZusatz1 AS "RGdresse.Vorname", 
    Rechnungsadresse->Hausnummer        AS "RGdresse.Hausnummer", 
    Rechnungsadresse->Strasse                     AS "RGdresse.Strasse", 
    Rechnungsadresse->Plz                                              AS "RGdresse.Plz", 
    Rechnungsadresse->Ort                                             AS "RGdresse.Ort",
    WasserzaehlerNr, WasserzahlerAlt, DatumEinzug
    FROM DBSpezial_Wasser.Zaehler
    WHERE Eigentuemer->Mandant = :MandantOid
    AND DatumEinzug BETWEEN {d :VonDatum} AND {d :BisDatum}
    ORDER BY DatumEinzug, GemeindeNr, PoliceNr]]></SqlQuery>
</Query>

<Query name="ListeAuszuege">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonDatum:%Date,BisDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT
    ID, PoliceNr, GemeindeNr, Aktiv, Strasse, Hausnummer,
    Rechnungsadresse->Adressnummer    AS "RGdresse.AdressNr", 
    Rechnungsadresse->Name                                       AS "RGdresse.Name", 
    Rechnungsadresse->VornameZusatz1 AS "RGdresse.Vorname", 
    Rechnungsadresse->Hausnummer        AS "RGdresse.Hausnummer", 
    Rechnungsadresse->Strasse                     AS "RGdresse.Strasse", 
    Rechnungsadresse->Plz                                              AS "RGdresse.Plz", 
    Rechnungsadresse->Ort                                             AS "RGdresse.Ort",
    WasserzaehlerNr, WasserzahlerAlt, DatumAuszug
    FROM DBSpezial_Wasser.Zaehler
    WHERE Eigentuemer->Mandant = :MandantOid
    AND DatumAuszug BETWEEN {d :VonDatum} AND {d :BisDatum}
    ORDER BY DatumAuszug, GemeindeNr, PoliceNr]]></SqlQuery>
</Query>

<Query name="ListeMutationen">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,VonDatum:%Date,BisDatum:%Date</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[    SELECT
    ID, PoliceNr, GemeindeNr, Aktiv, Strasse, Hausnummer,
    Rechnungsadresse->Adressnummer    AS "RGdresse.AdressNr", 
    Rechnungsadresse->Name                                       AS "RGdresse.Name", 
    Rechnungsadresse->VornameZusatz1 AS "RGdresse.Vorname", 
    Rechnungsadresse->Hausnummer        AS "RGdresse.Hausnummer", 
    Rechnungsadresse->Strasse                     AS "RGdresse.Strasse", 
    Rechnungsadresse->Plz                                              AS "RGdresse.Plz", 
    Rechnungsadresse->Ort                                             AS "RGdresse.Ort",
    WasserzaehlerNr, WasserzahlerAlt, DatumMutation
    FROM DBSpezial_Wasser.Zaehler
    WHERE Eigentuemer->Mandant = :MandantOid
    AND DatumMutation BETWEEN {d :VonDatum} AND {d :BisDatum}
    ORDER BY DatumMutation, GemeindeNr, PoliceNr]]></SqlQuery>
</Query>

<Query name="ListeDoppelteZaehlerNr">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery><![CDATA[	SELECT 
	Eigentuemer->Adressnummer	 AS "KundenNr", 
	Eigentuemer->Name 			 AS "KundenName",  
	Eigentuemer->VornameZusatz1  AS "KundenVorname",  
	Strasse,
	Hausnummer,
	GemeindePLZ,
	GemeindeName,
	WasserzaehlerNr ,
	BemerkungIntern,
	BemerkungRechnung
	FROM DBSpezial_Wasser.Zaehler o
	WHERE Eigentuemer->Mandant = :MandantOid AND WasserzaehlerNr <> "" AND NVL(WasserzaehlerNr,0) <> 0 AND Aktiv = 1
	AND WasserzaehlerNr in (SELECT WasserzaehlerNr from DBSpezial_Wasser.Zaehler k WHERE o.ID<>k.ID AND Aktiv = 1) 
	ORDER BY WasserzaehlerNr]]></SqlQuery>
</Query>
</Class>


<Class name="DBSpezial.Wasser.Konst">
<Super>%RegisteredObject</Super>
<TimeChanged>61975,39610.027999</TimeChanged>
<TimeCreated>61975,39538.629179</TimeCreated>

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

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

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

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

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

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

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

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

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


<Class name="DBSpezial.Wasser.SD.Gebaeudetyp">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57294.932367</TimeChanged>
<TimeCreated>61933,52622.137363</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>%Integer</Type>
<Required>1</Required>
</Property>

<Index name="NummerIndex">
<Properties>Nummer</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="MandantNrIndex">
<Properties>Mandant,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="Betrag">
<Type>%Decimal</Type>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="Wasserzaehler">
<Type>DBSpezial.Wasser.Zaehler</Type>
<Cardinality>many</Cardinality>
<Inverse>Gebaeudetyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Artikel">
<Type>DBFakturierung.Artikel</Type>
<Cardinality>one</Cardinality>
<Inverse>Gebaeudetyp</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Artikel"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Art">
<Type>%Integer</Type>
</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(DBSpezial.Wasser.SD.Gebaeudetyp).%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>
<FormalSpec>MandOid:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	set nr = 0
	&sql(Select max(Nummer) into :nr From DBSpezial_Wasser_SD.Gebaeudetyp WHERE Mandant=:MandOid)
	Quit +nr+1
]]></Implementation>
</Method>

<Method name="NrExists">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nummer:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	
	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Wasser_SD.Gebaeudetyp
	     WHERE Nummer = :Nummer AND Mandant = :MandantOid)
	if (id = "") {
		Quit 0
	} else {
		Quit 1
	}
]]></Implementation>
</Method>

<Method name="GetIdByNrOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Nr:%Integer</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT ID INTO :id FROM DBSpezial_Wasser_SD.Gebaeudetyp
		 WHERE Mandant = :MandantOid AND Nummer = :Nr)
	Quit id
]]></Implementation>
</Method>

<Method name="GetIdByNameOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String,Name:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set id = ""
	Set strSQL="SELECT Gebaeudetyp AS ID FROM DBSpezial_Wasser_SD.Gebaeudetyp_Bezeichnung WHERE Gebaeudetyp->Mandant = "_MandantOid_" AND Bezeichnung = '"_Name_"'"
   	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
    Do rs.Prepare(strSQL)
    Set sc=rs.Execute()
    if ($$$ISERR(sc)) {
       w "DBSpezial.Wasser.SD.Gebaudetyp - Fehler bei SQL-Statement",!
    }
    if (rs.Next()) {
        Set id = rs.Data("ID")
    }
	Quit id
]]></Implementation>
</Method>

<Method name="GetLastIdOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Wasser_SD.Gebaeudetyp
		 WHERE Mandant = :MandantOid ORDER BY Nummer DESC)
	Quit id
]]></Implementation>
</Method>

<Method name="GetFirstIdOnMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[

	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Wasser_SD.Gebaeudetyp
		 WHERE Mandant = :MandantOid ORDER BY Nummer ASC)
	Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Wass4A78.GebaeudetypD</DataLocation>
<DefaultData>GebaeudetypDefaultData</DefaultData>
<IdLocation>^DBSpezial.Wass4A78.GebaeudetypD</IdLocation>
<IndexLocation>^DBSpezial.Wass4A78.GebaeudetypI</IndexLocation>
<StreamLocation>^DBSpezial.Wass4A78.GebaeudetypS</StreamLocation>
<Data name="Bezeichnung">
<Attribute>Bezeichnung</Attribute>
<Structure>subnode</Structure>
<Subscript>"Bezeichnung"</Subscript>
</Data>
<Data name="GebaeudetypDefaultData">
<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>Betrag</Value>
</Value>
<Value name="5">
<Value>Artikel</Value>
</Value>
<Value name="6">
<Value>Art</Value>
</Value>
</Data>
<Property name="Art"/>
<Property name="Artikel"/>
<Property name="Betrag"/>
<Property name="Mandant"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBSpezial.Wasser.Stand">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57234.700084</TimeChanged>
<TimeCreated>61933,52270.683236</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="PerDatum">
<Type>%Date</Type>
</Property>

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

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

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

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

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

<Property name="Zaehler">
<Type>DBSpezial.Wasser.Zaehler</Type>
<Cardinality>one</Cardinality>
<Inverse>Wasserstand</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Zaehler"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="ZaehlerIndex">
<Properties>Zaehler</Properties>
</Index>

<Method name="GetNewestBestand">
<ClassMethod>1</ClassMethod>
<FormalSpec>ZaehlertOid:%String</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set bestand = 0
	&sql(SELECT TOP 1 Bestand INTO :bestand FROM DBSpezial_Wasser.Stand
		 WHERE Zaehler = :ZaehlertOid AND Bestand > 0 ORDER BY PerDatum Desc)
	quit bestand
]]></Implementation>
</Method>

<Method name="GetNewestDatum">
<ClassMethod>1</ClassMethod>
<FormalSpec>ZaehlertOid:%String</FormalSpec>
<ReturnType>%Date</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set datum = ""
	&sql(SELECT TOP 1 PerDatum INTO :datum FROM DBSpezial_Wasser.Stand
		 WHERE Zaehler = :ZaehlertOid AND Bestand > 0 ORDER BY PerDatum Desc)
	quit datum
]]></Implementation>
</Method>

<Method name="BestandPerDatumExists">
<ClassMethod>1</ClassMethod>
<FormalSpec>ZaehlertOid:%String,Datum:%Date</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
	set id = ""
	&sql(SELECT TOP 1 ID INTO :id FROM DBSpezial_Wasser.Stand
		 WHERE Zaehler = :ZaehlertOid AND PerDatum = :Datum)
	
	if (id = "") {
		quit 0	
	} else {
		quit 1
	}
]]></Implementation>
</Method>

<Method name="GetNewestVerrechnetDatum">
<ClassMethod>1</ClassMethod>
<FormalSpec>ZaehlertOid:%String</FormalSpec>
<ReturnType>%Date</ReturnType>
<Implementation><![CDATA[
	set datum = ""
	&sql(SELECT TOP 1 PerDatum INTO :datum FROM DBSpezial_Wasser.Stand
		 WHERE Zaehler = :ZaehlertOid 
		 AND NVL(Status,0) = DBSpezial_Wasser.Konst_StatusBestandVerrechnet()
		 ORDER BY PerDatum Desc)
	quit datum
]]></Implementation>
</Method>

<Method name="GetNewestVerrechnetBestand">
<ClassMethod>1</ClassMethod>
<FormalSpec>ZaehlertOid:%String</FormalSpec>
<ReturnType>%Decimal</ReturnType>
<SqlProc>1</SqlProc>
<Implementation><![CDATA[
	set bestand = 0
	&sql(SELECT TOP 1 Bestand INTO :bestand FROM DBSpezial_Wasser.Stand
		 WHERE Zaehler = :ZaehlertOid
		 AND NVL(Status,0) = DBSpezial_Wasser.Konst_StatusBestandVerrechnet()
		 AND ((Bestand > 0) OR (AbrechnungsCode = DBSpezial_Wasser.Konst_AbrCodeElektronisch()) 
		 OR (AbrechnungsCode = DBSpezial_Wasser.Konst_AbrCodeManuell())
		 OR (AbrechnungsCode = DBSpezial_Wasser.Konst_AbrCodeNeuInstallation())) 
		 ORDER BY PerDatum Desc)
	quit bestand
]]></Implementation>
</Method>

<Method name="CopyStaende">
<ClassMethod>1</ClassMethod>
<FormalSpec>FromZaehlerOid:%String,ToZaehlerOid:%String</FormalSpec>
<Implementation><![CDATA[
	Set strSQL="SELECT ID FROM DBSpezial_Wasser.Stand WHERE Zaehler ='"_FromZaehlerOid_"'"
	Set rs = ##class(%Library.ResultSet).%New("%DynamicQuery:SQL")
	Do rs.Prepare(strSQL)
	Set sc=rs.Execute()
	IF $$$ISOK(sc) {
		set zaehler = ##class(DBSpezial.Wasser.Zaehler).%OpenId(ToZaehlerOid)
		While rs.Next(.sc) {
			Set id=rs.Data("ID")
			set oldPos = ##class(DBSpezial.Wasser.Stand).%OpenId(id)
	
			if (oldPos '= "") {
				set newPos = oldPos.%ConstructClone(-1)
				set newPos.Zaehler = zaehler
				w newPos.%Save()
				k oldPos
				k newPos
			}		
		}
		k zaehler
	}
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Wasser.StandD</DataLocation>
<DefaultData>StandDefaultData</DefaultData>
<IdLocation>^DBSpezial.Wasser.StandD</IdLocation>
<IndexLocation>^DBSpezial.Wasser.StandI</IndexLocation>
<StreamLocation>^DBSpezial.Wasser.StandS</StreamLocation>
<Data name="StandDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PerDatum</Value>
</Value>
<Value name="3">
<Value>Bestand</Value>
</Value>
<Value name="4">
<Value>AContoRechnung</Value>
</Value>
<Value name="5">
<Value>Status</Value>
</Value>
<Value name="6">
<Value>Zaehler</Value>
</Value>
<Value name="7">
<Value>AbrechnungsCode</Value>
</Value>
<Value name="8">
<Value>ZaehlerNr</Value>
</Value>
</Data>
<Property name="AContoRechnung"/>
<Property name="AbrechnungsCode"/>
<Property name="Bestand"/>
<Property name="PerDatum"/>
<Property name="Status"/>
<Property name="Zaehler"/>
<Property name="ZaehlerNr"/>
</Storage>
</Class>


<Class name="DBSpezial.Wasser.Zaehler">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57295.078631</TimeChanged>
<TimeCreated>61933,52561.290607</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="PoliceNr">
<Type>%String</Type>
<Parameter name="MAXLEN" value="10"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

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

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

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

<Property name="Grundstuecknummer">
<Type>%String</Type>
<Parameter name="MAXLEN" value="250"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="GemeindeName">
<Type>%String</Type>
<Parameter name="MAXLEN" value="250"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

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

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

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

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

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

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

<Property name="Wasserstand">
<Type>DBSpezial.Wasser.Stand</Type>
<Cardinality>many</Cardinality>
<Inverse>Zaehler</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLPROJECTION" value="NONE"/>
</Property>

<Property name="Gebaeudetyp">
<Type>DBSpezial.Wasser.SD.Gebaeudetyp</Type>
<Cardinality>one</Cardinality>
<Inverse>Wasserzaehler</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Gebaeudetyp"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Eigentuemer">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>WZaehlerEignetuemer</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Eigentuemer"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Index name="EigentuemerIndex">
<Properties>Eigentuemer</Properties>
</Index>

<Property name="Rechnungsadresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>WZaehlerRechnung</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Rechnungsadresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

<Property name="Mieteradresse">
<Type>DBAdressen.Adresse</Type>
<Cardinality>one</Cardinality>
<Inverse>WZaehlerMieter</Inverse>
<Relationship>1</Relationship>
<Parameter name="XMLELEMENTREF" value="1"/>
<Parameter name="XMLNAME" value="Mieteradresse"/>
<Parameter name="XMLPROJECTION" value="ATTRIBUTE"/>
<Parameter name="XMLREFERENCE" value="ID"/>
</Property>

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

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

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

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

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

<Method name="DeleteAll">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandantOid:%String</FormalSpec>
<Implementation><![CDATA[
	&sql(DELETE FROM DBSpezial_Wasser.Zaehler
		 WHERE Eigentuemer->Mandant = :MandantOid)
]]></Implementation>
</Method>

<Method name="GetZaehlerByZaehlerNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>ZaehlerNr:%String,MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT ID INTO :oid FROM DBSpezial_Wasser.Zaehler where Eigentuemer->Mandant = :MandantOid AND WasserzaehlerNr = :ZaehlerNr AND Aktiv = 1)
	quit oid
]]></Implementation>
</Method>

<Method name="GetZaehlerByPolicenNr">
<ClassMethod>1</ClassMethod>
<FormalSpec>PolicenNr:%String,GemeindeNr:%String,MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT ID INTO :oid FROM DBSpezial_Wasser.Zaehler where Eigentuemer->Mandant = :MandantOid AND PoliceNr = :PolicenNr AND GemeindeNr = :GemeindeNr)
	quit oid
]]></Implementation>
</Method>

<Method name="GetZaehlerByLage">
<ClassMethod>1</ClassMethod>
<FormalSpec>Strasse:%String,Hausnummer:%String,MandantOid:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	set oid = ""
	&sql(SELECT ID INTO :oid FROM DBSpezial_Wasser.Zaehler where Eigentuemer->Mandant = :MandantOid AND Strasse = :Strasse AND Hausnummer = :Hausnummer)
	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)
	do ##class(DBUtils.ClassHelper).DeleteManyRelations("DBSpezial.Wasser.Zaehler", myId)
	Quit $$$OK
]]></Implementation>
</Method>

<Method name="%OnAfterSave">
<Description><![CDATA[
This callback method is invoked by the <METHOD>%Save</METHOD> method to 
provide notification that the object is being saved. It is called after 
the object's data has been successfully written to disk.

<P><VAR>insert</VAR> will be set to 1 if this object is being saved for the first time.

<P>If this method returns an error then the call to <METHOD>%Save</METHOD> will fail.]]></Description>
<FormalSpec>Insert:%Boolean</FormalSpec>
<Private>1</Private>
<ReturnType>%Status</ReturnType>
<ServerOnly>1</ServerOnly>
<Implementation><![CDATA[
    set ..DatumMutation = +$H
    do ..%Save()
    Quit $$$OK
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBSpezial.Wasser.ZaehlerD</DataLocation>
<DefaultData>ZaehlerDefaultData</DefaultData>
<IdLocation>^DBSpezial.Wasser.ZaehlerD</IdLocation>
<IndexLocation>^DBSpezial.Wasser.ZaehlerI</IndexLocation>
<StreamLocation>^DBSpezial.Wasser.ZaehlerS</StreamLocation>
<Data name="ZaehlerDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>PoliceNr</Value>
</Value>
<Value name="3">
<Value>Strasse</Value>
</Value>
<Value name="4">
<Value>Hausnummer</Value>
</Value>
<Value name="5">
<Value>WasserzaehlerNr</Value>
</Value>
<Value name="6">
<Value>WasserzahlerAlt</Value>
</Value>
<Value name="7">
<Value>Aktiv</Value>
</Value>
<Value name="8">
<Value>Grundstuecknummer</Value>
</Value>
<Value name="9">
<Value>GemeindeName</Value>
</Value>
<Value name="10">
<Value>GemeindePLZ</Value>
</Value>
<Value name="11">
<Value>GemeindePLZZusatz</Value>
</Value>
<Value name="12">
<Value>GemeindeNr</Value>
</Value>
<Value name="13">
<Value>BemerkungIntern</Value>
</Value>
<Value name="14">
<Value>BemerkungRechnung</Value>
</Value>
<Value name="15">
<Value>Zaehlwerkschluessel</Value>
</Value>
<Value name="16">
<Value>Gebaeudetyp</Value>
</Value>
<Value name="17">
<Value>Eigentuemer</Value>
</Value>
<Value name="18">
<Value>Rechnungsadresse</Value>
</Value>
<Value name="19">
<Value>Mieteradresse</Value>
</Value>
<Value name="20">
<Value>IndividualGebuehr</Value>
</Value>
<Value name="21">
<Value>Grundgebuehr</Value>
</Value>
<Value name="22">
<Value>DatumEinzug</Value>
</Value>
<Value name="23">
<Value>DatumAuszug</Value>
</Value>
<Value name="24">
<Value>DatumMutation</Value>
</Value>
</Data>
<Property name="Aktiv"/>
<Property name="BemerkungIntern"/>
<Property name="BemerkungRechnung"/>
<Property name="DatumAuszug"/>
<Property name="DatumEinzug"/>
<Property name="DatumMutation"/>
<Property name="Eigentuemer"/>
<Property name="Gebaeudetyp"/>
<Property name="GemeindeName"/>
<Property name="GemeindeNr"/>
<Property name="GemeindePLZ"/>
<Property name="GemeindePLZZusatz"/>
<Property name="Grundgebuehr"/>
<Property name="Grundstuecknummer"/>
<Property name="Hausnummer"/>
<Property name="IndividualGebuehr"/>
<Property name="Mieteradresse"/>
<Property name="PoliceNr"/>
<Property name="Rechnungsadresse"/>
<Property name="Strasse"/>
<Property name="WasserzaehlerNr"/>
<Property name="WasserzahlerAlt"/>
<Property name="Zaehlwerkschluessel"/>
</Storage>
</Class>
</Export>
