<?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-06 08:28:32">
<Class name="DBKasse.AF.KasseAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33247</TimeChanged>
<TimeCreated>62276,41356.647484</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>	SELECT ID, Nummer, Bezeichnung FROM DBKasse.Kasse
	WHERE Mandant = :MandantOid 
	ORDER BY Nummer</SqlQuery>
</Query>
</Class>


<Class name="DBKasse.AF.SD.ZahlungsmittelAF">
<Super>%RegisteredObject</Super>
<TimeChanged>62417,33247</TimeChanged>
<TimeCreated>62276,56226.068249</TimeCreated>

<Query name="ListeGesamt">
<Type>%SQLQuery</Type>
<FormalSpec>MandantOid:%String,Lang:%String</FormalSpec>
<SqlProc>1</SqlProc>
<SqlQuery>SELECT ID, Code, DBKasse_SD.Zahlungsmittel_GetTextClass(%ID, :MandantOid, :Lang) As Text
FROM DBKasse_SD.Zahlungsmittel
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, DBKasse_SD.Zahlungsmittel_GetTextClass(%ID, :MandantOid, :Lang) AS wert1, "" AS wert2 FROM DBKasse_SD.Zahlungsmittel 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, DBKasse_SD.Zahlungsmittel_GetTextClass(%ID, :MandantOid, :Lang) As Text FROM DBKasse_SD.Zahlungsmittel WHERE AktMandant = :MandantOid AND Code = :Code ORDER BY Code</SqlQuery>
</Query>
</Class>


<Class name="DBKasse.Kasse">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57280.406323</TimeChanged>
<TimeCreated>62276,41025.037103</TimeCreated>
<Inheritance>right</Inheritance>

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

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

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

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

<Property name="Nummer">
<Type>%Library.Integer</Type>
<Required>1</Required>
</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="Bezeichnung">
<Type>%String</Type>
<Parameter name="MAXLEN" value="50"/>
<Parameter name="TRUNCATE" value="1"/>
</Property>

<Property name="StartBarStock">
<Type>%Decimal</Type>
<Collection>array</Collection>
<Parameter name="SCALE" value="5"/>
</Property>

<Property name="EndeBarStock">
<Type>%Decimal</Type>
<Collection>array</Collection>
<Parameter name="SCALE" value="5"/>
</Property>

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

<Property name="Bon">
<Type>DBKasse.KassenBon</Type>
<Cardinality>many</Cardinality>
<Inverse>Kasse</Inverse>
<Relationship>1</Relationship>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBKasse.KasseD</DataLocation>
<DefaultData>KasseDefaultData</DefaultData>
<IdLocation>^DBKasse.KasseD</IdLocation>
<IndexLocation>^DBKasse.KasseI</IndexLocation>
<StreamLocation>^DBKasse.KasseS</StreamLocation>
<Data name="EndeBarStock">
<Attribute>EndeBarStock</Attribute>
<Structure>subnode</Structure>
<Subscript>"EndeBarStock"</Subscript>
</Data>
<Data name="KasseDefaultData">
<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>Name</Value>
</Value>
<Value name="5">
<Value>Bezeichnung</Value>
</Value>
<Value name="6">
<Value>StartBarDatum</Value>
</Value>
</Data>
<Data name="StartBarStock">
<Attribute>StartBarStock</Attribute>
<Structure>subnode</Structure>
<Subscript>"StartBarStock"</Subscript>
</Data>
<Property name="Bezeichnung"/>
<Property name="Mandant"/>
<Property name="Nummer"/>
</Storage>
</Class>


<Class name="DBKasse.KassenBon">
<Super>%Persistent,%XML.Adaptor</Super>
<TimeChanged>62416,57225.955229</TimeChanged>
<TimeCreated>62283,38374.20984</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="Kasse">
<Type>DBKasse.Kasse</Type>
<Cardinality>one</Cardinality>
<Inverse>Bon</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="KasseIndex">
<Properties>Kasse</Properties>
</Index>

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

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

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

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

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

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

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

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

<Property name="FaktAuftrag">
<Type>DBFakturierung.Auftragskopf</Type>
<Cardinality>many</Cardinality>
<Inverse>KassenBon</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="AgrofreshAuftrag">
<Type>DBAgrofresh.Auftragskopf</Type>
<Cardinality>many</Cardinality>
<Inverse>KassenBon</Inverse>
<Relationship>1</Relationship>
</Property>

<Method name="GetNextBonNr">
<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(^KassenBonNr(MandantOid)) = "") {
		&sql(SELECT MAX(Nummer) into :nr FROM DBKasse.KassenBon WHERE Kasse->Mandant = :MandantOid)
		if (SQLCODE = 0) {
			SET ^KassenBonNr(MandantOid) = nr	
		}
	}
	// Neue Nummer auslessen
	SET nr=$INCREMENT(^KassenBonNr(MandantOid))
	// Prüfen ob noch keine RG mit Nummer vorhanden
	while (##class(DBKasse.KassenBon).GetIdByNummer(MandantOid) '= "") {
		SET nr=$INCREMENT(^KassenBonNr(MandantOid))
	}
		
	Quit nr
]]></Implementation>
</Method>

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBKasse.KassenBonD</DataLocation>
<DefaultData>KassenBonDefaultData</DefaultData>
<IdLocation>^DBKasse.KassenBonD</IdLocation>
<IndexLocation>^DBKasse.KassenBonI</IndexLocation>
<StreamLocation>^DBKasse.KassenBonS</StreamLocation>
<Data name="KassenBonDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Kasse</Value>
</Value>
<Value name="3">
<Value>BarBezahlt</Value>
</Value>
<Value name="4">
<Value>BarZurueck</Value>
</Value>
<Value name="5">
<Value>Nummer</Value>
</Value>
<Value name="6">
<Value>Zeitpunkt</Value>
</Value>
<Value name="7">
<Value>SachbearbeiterNr</Value>
</Value>
<Value name="8">
<Value>SachbearbeiterBenutzername</Value>
</Value>
<Value name="9">
<Value>SachbearbeiterVorname</Value>
</Value>
<Value name="10">
<Value>SachbearbeiterName</Value>
</Value>
<Value name="11">
<Value>AuftragNr</Value>
</Value>
</Data>
</Storage>
</Class>


<Project name="DBKasse">
  <Items>
    <ProjectItem name="DBKasse.AF.KasseAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBKasse.AF.SD.ZahlungsmittelAF" type="CLS"></ProjectItem>
    <ProjectItem name="DBKasse.Kasse" type="CLS"></ProjectItem>
    <ProjectItem name="DBKasse.KassenBon" type="CLS"></ProjectItem>
    <ProjectItem name="DBKasse.SD.Zahlungsmittel" type="CLS"></ProjectItem>
  </Items>
</Project>


<Class name="DBKasse.SD.Zahlungsmittel">
<Super>%Persistent,%XML.Adaptor,DBCore.MandantRel</Super>
<TimeChanged>62416,57280.526534</TimeChanged>
<TimeCreated>62276,56160.033104</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>

<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(DBKasse.SD.Zahlungsmittel).%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="GetLastCodeByMandant">
<ClassMethod>1</ClassMethod>
<FormalSpec>MandOid</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
    set id = ""
    &SQL(Select Top 1 ID into :id FROM DBKasse_SD.Zahlungsmittel WHERE AktMandant = :MandOid Order by Code DESC)
    Quit:(SQLCODE'=0) ""
    Quit id
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^DBKasse.SD.ZahlungsmittelD</DataLocation>
<DefaultData>ZahlungsmittelDefaultData</DefaultData>
<IdLocation>^DBKasse.SD.ZahlungsmittelD</IdLocation>
<IndexLocation>^DBKasse.SD.ZahlungsmittelI</IndexLocation>
<StreamLocation>^DBKasse.SD.ZahlungsmittelS</StreamLocation>
<Data name="Text">
<Attribute>Text</Attribute>
<Structure>subnode</Structure>
<Subscript>"Text"</Subscript>
</Data>
<Data name="ZahlungsmittelDefaultData">
<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>
</Storage>
</Class>
</Export>
