<?xml version="1.0" encoding="UTF-8"?>
<Export generator="Cache" version="9" zv="Cache for UNIX (Linux Intel/32-bit) 5.0.11 (Build 5401)" ts="2009-06-21 11:34:09">
<Class name="BM.KundFiltPar">
<Description>
Kundenfilter Parameter</Description>
<ClassType>persistent</ClassType>
<StorageStrategy>Global</StorageStrategy>
<Super>SP.BaumatWWS</Super>
<TimeChanged>59474,44968.46608</TimeChanged>
<TimeCreated>59440,44216</TimeCreated>

<Property name="AENDDAT">
<Description>
Aenderungsdatum</Description>
<Type>DT.DateTxt7</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="AKTIV">
<Description>
Aktiv J oder N</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1"/>
</Property>

<Property name="BKBEZ">
<Description>
Kurzbezeichnung Bis</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="DATLAU">
<Description>
Letzter Auftrag Am</Description>
<Type>DT.DateTxt7</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="ERSTDAT">
<Description>
Erstellungsdatum</Description>
<Type>DT.DateTxt7</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="FBEZ">
<Description>
Filterbezeichnung</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="25"/>
</Property>

<Property name="FILTER">
<Description>
Filternummer</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="999999"/>
</Property>

<Property name="FIRMA">
<Description>
Firma</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="99"/>
</Property>

<Property name="KGRP">
<Description>
Kundengruppe</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="2"/>
</Property>

<Property name="KKART">
<Description>
Kundenkarte J oder N</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1"/>
</Property>

<Property name="MAHN">
<Description>
Mahnstufe</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="9"/>
</Property>

<Property name="PCODE">
<Description>
Personalcode</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="3"/>
</Property>

<Property name="PCODE1">
<Description>
Personalcode Eins</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="3"/>
</Property>

<Property name="SORT">
<Description>
Sortierung</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1"/>
</Property>

<Property name="SPERRE">
<Description>
Sperre Kredit</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1"/>
</Property>

<Property name="STATUS">
<Description>
Status</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="9"/>
</Property>

<Property name="UMSBIS">
<Description>
Umsatz bis</Description>
<Type>DT.Currency</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="99999999.990000"/>
<Parameter name="SCALE" value="2"/>
</Property>

<Property name="UMSVON">
<Description>
Umsatz von</Description>
<Type>DT.Currency</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="99999999.990000"/>
<Parameter name="SCALE" value="2"/>
</Property>

<Property name="VKBEZ">
<Description>
Kurzbezeichnung Von</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Index name="ID">
<IdKey>1</IdKey>
<Properties>FIRMA,FILTER</Properties>
</Index>

<Storage name="Global">
<Type>%CacheSQLStorage</Type>
<StreamLocation>^BM.KundFiltParS</StreamLocation>
<SQLMap name="Nadlinger">
<Type>data</Type>
<Global>^BZF</Global>
<Structure>delimited</Structure>
<Subscript name="1">
<Expression>{FIRMA}</Expression>
</Subscript>
<Subscript name="2">
<Expression>"K"</Expression>
</Subscript>
<Subscript name="3">
<Expression>{FILTER}</Expression>
</Subscript>
<Subscript name="4">
<Expression>0</Expression>
</Subscript>
<Data name="AENDDAT">
<Delimiter>"`"</Delimiter>
<Piece>11</Piece>
</Data>
<Data name="AKTIV">
<Delimiter>"`"</Delimiter>
<Piece>6</Piece>
</Data>
<Data name="BKBEZ">
<Delimiter>"`"</Delimiter>
<Piece>5</Piece>
</Data>
<Data name="DATLAU">
<Delimiter>"`"</Delimiter>
<Piece>14</Piece>
</Data>
<Data name="ERSTDAT">
<Delimiter>"`"</Delimiter>
<Piece>12</Piece>
</Data>
<Data name="FBEZ">
<Delimiter>"`"</Delimiter>
<Piece>2</Piece>
</Data>
<Data name="KGRP">
<Delimiter>"`"</Delimiter>
<Piece>7</Piece>
</Data>
<Data name="KKART">
<Delimiter>"`"</Delimiter>
<Piece>10</Piece>
</Data>
<Data name="MAHN">
<Delimiter>"`"</Delimiter>
<Piece>8</Piece>
</Data>
<Data name="PCODE">
<Delimiter>"`"</Delimiter>
<Piece>13</Piece>
</Data>
<Data name="PCODE1">
<Delimiter>"`"</Delimiter>
<Piece>15</Piece>
</Data>
<Data name="SORT">
<Delimiter>"`"</Delimiter>
<Piece>3</Piece>
</Data>
<Data name="SPERRE">
<Delimiter>"`"</Delimiter>
<Piece>9</Piece>
</Data>
<Data name="STATUS">
<Delimiter>"`"</Delimiter>
<Piece>1</Piece>
</Data>
<Data name="UMSBIS">
<Delimiter>"`"</Delimiter>
<Piece>17</Piece>
</Data>
<Data name="UMSVON">
<Delimiter>"`"</Delimiter>
<Piece>16</Piece>
</Data>
<Data name="VKBEZ">
<Delimiter>"`"</Delimiter>
<Piece>4</Piece>
</Data>
</SQLMap>
</Storage>
</Class>
<Class name="BM.LiefFiltPar">
<Description>
Lieferantenfilter Parameter</Description>
<ClassType>persistent</ClassType>
<StorageStrategy>Global</StorageStrategy>
<Super>SP.BaumatWWS</Super>
<TimeChanged>59474,45091.82734</TimeChanged>
<TimeCreated>59440,44276</TimeCreated>

<Property name="AENDDAT">
<Description>
Aenderungsdatum</Description>
<Type>DT.DateTxt7</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="BKBEZ">
<Description>
Kurzbezeichnung Bis</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="DATEST">
<Description>
Datum letzter Einkauf</Description>
<Type>DT.DateTxt7</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="ERSTDAT">
<Description>
Erstellungsdatum</Description>
<Type>DT.DateTxt7</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="FBEZ">
<Description>
Filterbezeichnung</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="25"/>
</Property>

<Property name="FILTER">
<Description>
Filternummer Lieferant</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="999999"/>
</Property>

<Property name="FIRMA">
<Description>
Firma</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="99"/>
</Property>

<Property name="LAKTIV">
<Description>
Lieferant Aktiv J oder N</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1"/>
</Property>

<Property name="LCODE">
<Description>
Liefercode</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1"/>
</Property>

<Property name="LGELJN">
<Description>
Lieferant gelistet J oder N</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1"/>
</Property>

<Property name="PCODE">
<Description>
Personalcode</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="3"/>
</Property>

<Property name="SKTO">
<Description>
Sammelkonto</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="99"/>
</Property>

<Property name="SORT">
<Description>
Sortierung</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1"/>
</Property>

<Property name="STATUS">
<Description>
Status</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXVAL" value="9"/>
</Property>

<Property name="VKBEZ">
<Description>
Kurzbezeichnung Von</Description>
<Type>DT.String</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Index name="ID">
<IdKey>1</IdKey>
<Properties>FIRMA,FILTER</Properties>
</Index>

<Storage name="Global">
<Type>%CacheSQLStorage</Type>
<StreamLocation>^BM.LiefFiltParS</StreamLocation>
<SQLMap name="Nadlinger">
<Type>data</Type>
<Global>^BZF</Global>
<Structure>delimited</Structure>
<Subscript name="1">
<Expression>{FIRMA}</Expression>
</Subscript>
<Subscript name="2">
<Expression>"L"</Expression>
</Subscript>
<Subscript name="3">
<Expression>{FILTER}</Expression>
</Subscript>
<Subscript name="4">
<Expression>0</Expression>
</Subscript>
<Data name="AENDDAT">
<Delimiter>"`"</Delimiter>
<Piece>9</Piece>
</Data>
<Data name="BKBEZ">
<Delimiter>"`"</Delimiter>
<Piece>5</Piece>
</Data>
<Data name="DATEST">
<Delimiter>"`"</Delimiter>
<Piece>13</Piece>
</Data>
<Data name="ERSTDAT">
<Delimiter>"`"</Delimiter>
<Piece>10</Piece>
</Data>
<Data name="FBEZ">
<Delimiter>"`"</Delimiter>
<Piece>2</Piece>
</Data>
<Data name="LAKTIV">
<Delimiter>"`"</Delimiter>
<Piece>6</Piece>
</Data>
<Data name="LCODE">
<Delimiter>"`"</Delimiter>
<Piece>8</Piece>
</Data>
<Data name="LGELJN">
<Delimiter>"`"</Delimiter>
<Piece>7</Piece>
</Data>
<Data name="PCODE">
<Delimiter>"`"</Delimiter>
<Piece>11</Piece>
</Data>
<Data name="SKTO">
<Delimiter>"`"</Delimiter>
<Piece>12</Piece>
</Data>
<Data name="SORT">
<Delimiter>"`"</Delimiter>
<Piece>3</Piece>
</Data>
<Data name="STATUS">
<Delimiter>"`"</Delimiter>
<Piece>1</Piece>
</Data>
<Data name="VKBEZ">
<Delimiter>"`"</Delimiter>
<Piece>4</Piece>
</Data>
</SQLMap>
</Storage>
</Class>
<Routine name="BMHGEDI" type="INT" languagemode="0" timestamp="60977,81924"><![CDATA[
BMHGEDI	;KRA;EDI-Hagebau-Routinen
 
	Q
	
Bestellung(FIRMA,id)
 
	N (FIRMA,id)
	d ^%XTT
	s fil=0
	
	I $D(^PA(FIRMA,110,fil))#2 S gesnr=$P(^(fil),%,21),gesgln=$P(^(fil),%,23)
	e  q -4_"|"_-4
 
	s ftpurl=$$GET^BMXOBJ("HGEDI","FtpOrders")
	s ofile="/tmp/hagebau.orders.out.txt"
 	
	s dir="/tmp/"
	s fname="edi.ordersa4000-"_gesnr_"."_$ZD($H,8)_"."_$TR($ZT($P($H,",",2)),":","")
 
 
	s obj=##class(MiniFax.Doks).%OpenId(id)
	i obj="" q -1_"|"_-1
	
	s file=##class(%File).%New(dir_fname)
 	d file.Open("WN")
 	d obj.Dokument.Rewind()
 	d file.CopyFrom(obj.Dokument)
 	d file.%Close()
 	k file
 	i obj.Status'=2 d obj.%Close() k obj q -2_"|"_-2
 
	d JOBWAIT^%HOSTCMD("rm "_ofile)
		
 	o ofile:"WA" u ofile
 	d obj.Bericht.Rewind()
	F  s buff=obj.Bericht.Read(1) q:buff=""  u ofile s:buff=$C(10) buff=$C(13,10) w buff
	
 	w "Start Orders ftp-Übertragung Bestellung "_obj.Betreff_" "_$ZDT($H,3),!
 	w "-----------------------------------------------------------------------------",!!
 	w "Erzeugen gepacktes Tar-Archiv",!
	c ofile
	
	s erg=$$JOBWAIT^%HOSTCMD("cd /tmp/; tar -cvzf "_fname_".tar.gz "_fname_" --totals >>"_ofile)
 	o ofile:"WA" u ofile w ! c ofile
 	i +erg=0 G S1
 	
 	o ofile:"WA" u ofile
	w !,"Orders Fehler beim erstellen des tar-archives Fehlercode="_erg_"  am/um "_$ZDT($H,3),!
 	w "-----------------------------------------------------------------------------",!!
 	c ofile
 	o ofile
 	d obj.Bericht.Rewind()
 	S OZT=$ZT
 	S $ZT="EOF1^BMHGEDI"
 	f  u ofile r zeile d obj.Bericht.Write($TR(zeile,$C(13,10),"")_$C(13,10))
EOF1
 	c ofile
 	S $ZT=OZT
 	Q -3_"|"_-3
 	
S1
 	s obj.Status=3
 	s betreff=obj.Betreff
 	d obj.%Save()
 	d obj.%Close()
 	k obj
 
	s ftpuser=$P(ftpurl,"@",1)
 	s ftpserver=$P(ftpurl,"@",2)
 	s ftpuser=$P(ftpuser,"ftp://",2)
 	s ftppassw=$P(ftpuser,":",2)
 	s ftpuser=$P(ftpuser,":",1)
 	
 	s ftpfile="/tmp/hagebau.orders.ftp"
 	o ftpfile:"WN"
 	u ftpfile
 	w "user "_ftpuser_" "_ftppassw,!
 	w "cd CI",!
 	w "cd UP",!
 	w "bin",!
 	w "put "_dir_fname_".tar.gz "_fname_".tar.gz",!
 	w "get "_fname_".tar.gz "_dir_fname_".tar.gz.test",!
 	c ftpfile
 
	d JOBWAIT^%HOSTCMD("touch "_dir_fname_".tar.gz.ok")
 	d JOBWAIT^%HOSTCMD("ftp -v -n "_ftpserver_" <"_ftpfile_" >>"_ofile)
 	s erg=$$JOBWAIT^%HOSTCMD("diff -s "_dir_fname_".tar.gz "_dir_fname_".tar.gz.test  >>"_ofile)
 	o ofile:"WA" u ofile
 	s erg1=1
 	i +erg=0 d
 	. w !,"Orders ftp-Übertragung ohne Fehler verifiziert "_$ZDT($H,3),!
 	. w "-----------------------------------------------------------------------------",!!
 	. c ofile
 	. o ftpfile:"WN"
 	. u ftpfile
 	. w "user "_ftpuser_" "_ftppassw,!
 	. w "cd CI",!
 	. w "cd UP",!
 	. w "bin",!
 	. w "put "_dir_fname_".tar.gz.ok "_fname_".tar.gz.ok",!
 	. c ftpfile
 	. s erg1=$$JOBWAIT^%HOSTCMD("ftp -v -n "_ftpserver_" <"_ftpfile_" >>"_ofile)
 	. o ofile:"WA" u ofile
 	. i +erg1=0 w !,"Orders ftp-Übertragung OK-Datei ohne Fehler gesendet am/um "_$ZDT($H,3),!
 	. i +erg1 w !,"Orders ftp-Übertragung OK-Datei mit Fehler "_erg1_" gesendet am/um "_$ZDT($H,3),!
 	. w "==============================================================================",!
 	. c ofile
 	e  d
	. o ofile:"WA" u ofile
 	. w !,"Orders ftp-Übertragung mit Fehler "_erg_" verifiziert am/um "_$ZDT($H,3),!
 	. w "==============================================================================",!!
 	. c ofile
	
	s obj=##class(MiniFax.Doks).%OpenId(id)
	i +erg=0 s obj.Status=5
	i +erg s obj.Status=4
 
 	o ofile
 	d obj.Bericht.Rewind()
 	S OZT=$ZT
 	S $ZT="EOF2^BMHGEDI"
 	f  u ofile r zeile d obj.Bericht.Write($TR(zeile,$C(13,10),"")_$C(13,10))
EOF2
 	c ofile
 	S $ZT=OZT
 
	d obj.%Save()
	d obj.%Close()
	k obj	
 
 
 	d JOBWAIT^%HOSTCMD("rm "_dir_fname)
 	d JOBWAIT^%HOSTCMD("rm "_dir_fname_".tar.gz")
 	d JOBWAIT^%HOSTCMD("rm "_dir_fname_".tar.gz.test")
 	d JOBWAIT^%HOSTCMD("rm "_dir_fname_".tar.gz.ok")
 	
	q erg_"|"_erg1
]]></Routine>
<Class name="MiniFax.Aend">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60320,78406.626544</TimeChanged>
<TimeCreated>60428,38080.973672</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

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

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

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

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

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

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

<Index name="index">
<Properties>id,datum,zeit</Properties>
</Index>

<Query name="liste">
<Type>%SQLQuery</Type>
<FormalSpec>id:%String</FormalSpec>
<SqlQuery>SELECT %ID,Datum,Zeit,personal,text,verkn FROM Aend
 WHERE (id = :id)
 ORDER BY %ID</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.AendD</DataLocation>
<DefaultData>AendDefaultData</DefaultData>
<IdLocation>^MiniFax.AendD</IdLocation>
<IndexLocation>^MiniFax.AendI</IndexLocation>
<StreamLocation>^MiniFax.AendS</StreamLocation>
<Data name="AendDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>datum</Value>
</Value>
<Value name="3">
<Value>id</Value>
</Value>
<Value name="4">
<Value>personal</Value>
</Value>
<Value name="5">
<Value>text</Value>
</Value>
<Value name="6">
<Value>verkn</Value>
</Value>
<Value name="7">
<Value>zeit</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Anhaenge">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60492,54215.450743</TimeChanged>
<TimeCreated>60428,38080.980611</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="Doks">
<Type>MiniFax.Doks</Type>
<Cardinality>parent</Cardinality>
<Inverse>Anhaenge</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

<Property name="Anhang">
<Type>%Stream</Type>
<Collection>binarystream</Collection>
</Property>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Anhaenge")</DataLocation>
<DefaultData>AnhaengeDefaultData</DefaultData>
<IdLocation>^MiniFax.DoksC("Anhaenge")</IdLocation>
<IndexLocation>^MiniFax.AnhaengeI</IndexLocation>
<StreamLocation>^MiniFax.AnhaengeS</StreamLocation>
<Data name="AnhaengeDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Anhang</Value>
</Value>
<Value name="3">
<Value>Name</Value>
</Value>
<Value name="4">
<Value>Typ</Value>
</Value>
<Value name="5">
<Value>Filetyp</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Baumat">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>61392,75269.453213</TimeChanged>
<TimeCreated>59658,45031.414821</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Method name="ReklHagebau">
<ClassMethod>1</ClassMethod>
<FormalSpec>firma:%String,rnr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Q $$REKLHAGEBAU^BMKMU1(firma,rnr)
]]></Implementation>
</Method>

<Method name="BaumAng">
<ClassMethod>1</ClassMethod>
<FormalSpec>firma:%String,offnr:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Q $$BAUMANG^BMKMU1(firma,offnr)
]]></Implementation>
</Method>

<Method name="GenFilter">
<ClassMethod>1</ClassMethod>
<FormalSpec>firma,kkr,filter,typ</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s job=$O(^XW(""),-1)+1
	s cnt=0
	s sort="" f  s sort=$O(^BZF(firma,kkr,filter,1,sort)) q:sort=""  d
	. s nr="" f  s nr=$O(^BZF(firma,kkr,filter,1,sort,nr)) q:nr=""  d
	.. s cnt=cnt+1,^XW(job,cnt)=..GetKonto(firma,kkr,nr,typ)
	
	q job_"|"_cnt
]]></Implementation>
</Method>

<Method name="GetKonto">
<ClassMethod>1</ClassMethod>
<FormalSpec>firma,kkr,konto,typ</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	i konto="" q ""
	i kkr="" q ""
	
	s kkr=$ZCONVERT(kkr,"U")
	i $L(kkr),+konto,$D(^B(firma,kkr,+konto,1))#2 s ad=$$ASCIANSI^%UML(^(1))
	e  q ""
	
	s addr=""
	i typ="F" d
	. i kkr="L",$D(^BZ(firma,"L",+konto,3,1,0))#2 s addr=$P(^(0),"`",11) ;Aus 1.Lager
	. i addr="",$D(^B(firma,kkr,+konto,1))#2 s addr=$P(^(1),"`",10)
	 
	i typ="M" d
	. i kkr="L",$D(^BZ(firma,"L",+konto,3,1,0))#2 s addr=$P(^(0),"`",10) ;Aus 1.Lager
	. i addr="",$D(^B(firma,kkr,+konto,1))#2 s addr=$P(^(1),"`",9)
	
	i kkr="L" s anrede="Sehr geehrte Damen und Herren"
	i kkr="K" s anrede=$P($$ANF^NAYKURZA("K","",$P(ad,"`",1),$P(ad,"`",2),$P(ad,"`",3)),"`",3)
	
	s erg=(+konto)_$C(10)_"1"_$C(10)_addr_$C(10)_$P(ad,"`",1)_$C(10)_anrede_$C(10)_$P(ad,"`",2)_$C(10)_$P(ad,"`",3)_$C(10)_$P(ad,"`",4)_$C(10)_$P(ad,"`",5)_"-"_$P(ad,"`",6)_" "_$P(ad,"`",7)
	q erg
]]></Implementation>
</Method>

<Method name="GetBMName">
<ClassMethod>1</ClassMethod>
<FormalSpec>faxnr:%String,csi:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	
	S FIRMA=$P(^FA(0),"`",1)
	s faxnr=$$FAXUM^BMKA(faxnr)	
	
	s kbez=""
	i $D(^BP(0,"FAX",1,faxnr))#2 s f=faxnr,kbez=^(faxnr)
	e  d
	. s f=$O(^BP(0,"FAX",1,faxnr))
	. s l=$L(faxnr) i $L(f)<l s l=$L(f)
	. i $E(f,1,l)=$E(faxnr,1,l),$D(^BP(0,"FAX",1,f))#2 s kbez=^(f)
	
	i kbez="" s faxnr=$E(faxnr,1,$L(faxnr)-1) d
	. i $D(^BP(0,"FAX",1,faxnr))#2 s f=faxnr,kbez=^(faxnr)
	. e  d
	.. s f=$O(^BP(0,"FAX",1,faxnr))
	.. s l=$L(faxnr) i $L(f)<l s l=$L(f)
	.. i $E(f,1,l)=$E(faxnr,1,l),$D(^BP(0,"FAX",1,f))#2 s kbez=^(f)

	i kbez="" s faxnr=$E(faxnr,1,$L(faxnr)-1) d
	. i $D(^BP(0,"FAX",1,faxnr))#2 s f=faxnr,kbez=^(faxnr)
	. e  d
	.. s f=$O(^BP(0,"FAX",1,faxnr))
	.. s l=$L(faxnr) i $L(f)<l s l=$L(f)
	.. i $E(f,1,l)=$E(faxnr,1,l),$D(^BP(0,"FAX",1,f))#2 s kbez=^(f)

	i kbez="" s faxnr=$E(faxnr,1,$L(faxnr)-1) d
	. i $D(^BP(0,"FAX",1,faxnr))#2 s f=faxnr,kbez=^(faxnr)
	. e  d
	.. s f=$O(^BP(0,"FAX",1,faxnr))
	.. s l=$L(faxnr) i $L(f)<l s l=$L(f)
	.. i $E(f,1,l)=$E(faxnr,1,l),$D(^BP(0,"FAX",1,f))#2 s kbez=^(f)
	
	
	i kbez="" q csi
	s ad="" i $D(^BP(0,"FAX",0,kbez,f))#2 s ad=^(f)
	i ad="" q csi
	s name="" i $D(^B($P(ad,"`",1),$P(ad,"`",2),$P(ad,"`",3),1))#2 s name=$P(^(1),"`",2)
	i name="" q csi
	
	q $P(ad,"`",2)_$P(ad,"`",3)_"  "_$$ASCIANSI^%UML(name)
]]></Implementation>
</Method>

<Method name="GetBMFaxnr">
<ClassMethod>1</ClassMethod>
<FormalSpec>firma:%String,name2:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	s name1=$ZCONVERT(name2,"U")
	s name=""
	F i=1:1:$L(name1) D
	. s c=$E(name1,i,i)
	. i c="Ö" s name=name_"OE"
	. e  i c="Ä" s name=name_"AE"
	. e  i c="Ü" s name=name_"UE"
	. e  s name=name_c
	s name=$$ANSIASCI^%UML(name),ll=$L(name)
	K ^XW($J)
	k konto
	s n=0
	I $D(^BP(0,"FAX",0,name)) S IND=$O(^BP(0,"FAX",0,name),-1)
	e  s IND=name
	f  s IND=$O(^BP(0,"FAX",0,IND)) q:IND=""  Q:$E(IND,1,ll)'=name  d  q:n>100
	. s faxnr="" f  s faxnr=$O(^BP(0,"FAX",0,IND,faxnr)) q:faxnr=""  d
	.. I $D(^(faxnr))#2 s AD=^(faxnr)
	.. e  Q
	.. s firma1=$P(AD,"`",1),kkr=$P(AD,"`",2),konto=$P(AD,"`",3)
	.. I firma=firma1,$L(firma1),$L(kkr),$L(konto),$D(^B(firma1,kkr,konto,1))#2 s name1=$$ASCIANSI^%UML($P(^(1),"`",2)),ort=$$ASCIANSI^%UML($P(^(1),"`",7))
	.. e  q
	.. i $D(konto(faxnr)) q
	.. s n=n+1
	.. S ^XW($J,n)=kkr_$E(1000000+konto,2,7)_$C(10)_name1_$C(10)_faxnr_$C(10)_ort
	.. s konto(faxnr)=""
	q $J
]]></Implementation>
</Method>

<Method name="GetBMEMail">
<ClassMethod>1</ClassMethod>
<FormalSpec>firma:%String,name2:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	s name1=$ZCONVERT(name2,"U")
	s name=""
	F i=1:1:$L(name1) D
	. s c=$E(name1,i,i)
	. i c="Ö" s name=name_"OE"
	. e  i c="Ä" s name=name_"AE"
	. e  i c="Ü" s name=name_"UE"
	. e  s name=name_c
	s name=$$ANSIASCI^%UML(name),ll=$L(name)
	K ^XW($J)
	s n=0
	I $D(^BP(0,"EMAIL",0,name)) S IND=$O(^BP(0,"EMAIL",0,name),-1)
	e  s IND=name
	f  s IND=$O(^BP(0,"EMAIL",0,IND)) q:IND=""  Q:$E(IND,1,ll)'=name  d  q:n>100
	. s email="" f  s email=$O(^BP(0,"EMAIL",0,IND,email)) q:email=""  d
	.. I $D(^(email))#2 s AD=^(email)
	.. e  Q
	.. s firma1=$P(AD,"`",1),kkr=$P(AD,"`",2),konto=$P(AD,"`",3),zus=$P(AD,"`",4)
	.. s kname="" I firma=firma1,$L(firma1),$L(kkr),$L(konto),$D(^B(firma1,kkr,konto,1))#2 s kname=$$ASCIANSI^%UML($P(^(1),"`",2)_" "_$P(^(1),"`",3))
	.. I firma=firma1,$L(firma1),$L(kkr),$L(konto),zus="",$D(^B(firma1,kkr,konto,1))#2 s name1=kname,ort=$$ASCIANSI^%UML($P(^(1),"`",7))
	.. e  i firma=firma1,$L(firma1),$L(kkr),$L(konto),$L(zus),$E(zus,1)="L",$D(^BZ(firma1,kkr,konto,3,+$E(zus,2,99),0))#2 s name1=$$ASCIANSI^%UML($P(^(0),"`",3)_" "_$P(^(0),"`",4)),ort=$$ASCIANSI^%UML($P(^(0),"`",8))
	.. e  i firma=firma1,$L(firma1),$L(kkr),$L(konto),$L(zus),$E(zus,1)="K",$D(^BZ(firma1,kkr,konto,40,+$E(zus,2,99)))#2 s name1=$$ASCIANSI^%UML($P(^(+$E(zus,2,99)),"`",1)_" "_$P(^(+$E(zus,2,99)),"`",2)),ort=""
	.. e  q
	.. s n=n+1
	.. i zus="" S ^XW($J,n)=kkr_$E(1000000+konto,2,7)_$C(10)_name1_$C(10)_email_$C(10)_ort
	.. e  S ^XW($J,n)=kkr_$E(1000000+konto,2,7)_"/"_zus_$C(10)_name1_$C(10)_email_$C(10)_ort_$C(10)_kname
	q $J
]]></Implementation>
</Method>

<Method name="DeleteXW">
<ClassMethod>1</ClassMethod>
<FormalSpec>job:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	K ^XW(job)
	
	q 1
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%CacheSQLStorage</Type>
<DataLocation>^MiniFax.BaumatD</DataLocation>
<DefaultData>BaumatDefaultData1</DefaultData>
<IdLocation>^MiniFax.BaumatD</IdLocation>
<IndexLocation>^MiniFax.BaumatI</IndexLocation>
<StreamLocation>^MiniFax.BaumatS</StreamLocation>
<Data name="BaumatDefaultData">
<Attribute>INHALT</Attribute>
<Structure>node</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>INHALT</Value>
</Value>
</Data>
<Data name="BaumatDefaultData1">
<Structure>listnode</Structure>
<Subscript>"1"</Subscript>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Berecht">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59652,64473.456634</TimeChanged>
<TimeCreated>59658,45031.477003</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="UserGrp">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

<Index name="UserGrp">
<Properties>UserGrp</Properties>
</Index>

<Method name="GetBerecht">
<ClassMethod>1</ClassMethod>
<FormalSpec>usergrp:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s id=$O(^MiniFax.BerechtI("UserGrp",usergrp,""))
	q:id="" ""
	s obj=##class(MiniFax.Berecht).%OpenId(id)
	s ber=obj.Berecht
	d obj.%Close()
	q ber
]]></Implementation>
</Method>

<Query name="Berecht">
<Type>%SQLQuery</Type>
<SqlQuery>SELECT %ID,UserGrp,Berecht FROM Berecht</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.BerechtD</DataLocation>
<DefaultData>BerechtDefaultData</DefaultData>
<IdLocation>^MiniFax.BerechtD</IdLocation>
<IndexLocation>^MiniFax.BerechtI</IndexLocation>
<StreamLocation>^MiniFax.BerechtS</StreamLocation>
<Data name="BerechtDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>UserGrp</Value>
</Value>
<Value name="3">
<Value>Berecht</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Cards">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59702,438.136285</TimeChanged>
<TimeCreated>59658,45031.522052</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

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

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

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

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

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

<Property name="Cardid">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

<Index name="IDKey">
<IdKey>1</IdKey>
<Properties>Cardid</Properties>
<Unique>1</Unique>
</Index>

<Method name="Delete">
<ClassMethod>1</ClassMethod>
<FormalSpec>site:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	&sql(delete from MiniFax.Cards where ServerSite = :site)
]]></Implementation>
</Method>

<Query name="Cards">
<Type>%SQLQuery</Type>
<FormalSpec>Serversite:%String,Site:%String</FormalSpec>
<SqlQuery>SELECT Cardid,Bez,Site,CardIn,CardOut,Amt FROM Cards
WHERE (:Serversite is null or ServerSite = :Serversite) and
      (:Site is null or Site = :Site)
ORDER by Cardid</SqlQuery>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.CardsD</DataLocation>
<DefaultData>CardsDefaultData</DefaultData>
<IdLocation>^MiniFax.CardsD</IdLocation>
<IndexLocation>^MiniFax.CardsI</IndexLocation>
<StreamLocation>^MiniFax.CardsS</StreamLocation>
<Data name="CardsDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>CardIn</Value>
</Value>
<Value name="3">
<Value>CardOut</Value>
</Value>
<Value name="4">
<Value>Site</Value>
</Value>
<Value name="5">
<Value>Amt</Value>
</Value>
<Value name="6">
<Value>ServerSite</Value>
</Value>
<Value name="7">
<Value>Bez</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.DbZug">
<ClassType>persistent</ClassType>
<Super>%Persistent</Super>
<TimeChanged>60509,74640.020086</TimeChanged>
<TimeCreated>60428,38108.460827</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

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

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

<Property name="bez">
<Type>%String</Type>
<Parameter name="MAXLEN"/>
</Property>

<Property name="typ">
<Description>
Typ 0=Konstante, 1=Ausdruck, 2=Cache Script</Description>
<Type>%Integer</Type>
</Property>

<Property name="zug">
<Type>%String</Type>
<Parameter name="MAXLEN"/>
</Property>

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

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

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

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

<Index name="index1">
<Properties>gruppe,name</Properties>
</Index>

<Method name="GetInhalte">
<ClassMethod>1</ClassMethod>
<FormalSpec>ad:%String,firma:%String,pcode:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	N (ad,firma,pcode)
	
	K ^XW($J)
	S FIRMA=firma,PCODE=pcode,FIL=0,%="`"
	for dl=1:1:5 d  q:fsw=0
	. s fsw=0
	. for i=1:1:$L(ad,$C(255)) d
	.. s ad1=$P(ad,$C(255),i) q:ad1=""
	.. s fid=$P(ad1,"`",1),fld=$P(ad1,"`",2)
	.. s id=$P($P(fld,"|",1),".",2),inh=$P(fld,"|",2),cargo=$P(fld,"|",3,99)
	.. s obj=##class(MiniFax.DbZug).%OpenId(id)
	.. q:obj=""
	.. i obj.typ=0 s x="s "_obj.name_"="""_obj.zug_"""" x x s inh=obj.zug,txt=inh
	.. i obj.typ=1 d
	... i obj.checksw s txt=$S(inh="0":"§",1:"T") q
	... i obj.editsw,inh'="" s txt=inh s x="s "_obj.name_"="""_$TR(txt,"""","")_"""" x x q
	... s inh="",x="s txt="_obj.zug
	... I +$$GET1^BMKMU1(x,"{"_obj.gruppe_"."_obj.name_"}")=0 s fsw=1
	... e  s x="s "_obj.name_"="""_$TR(txt,"""","")_"""" x x
	... i obj.signatursw s inh=txt,txt="" 
	.. i txt'="",obj.feldtyp="B2" s txt=$FN(txt,".",2)
	.. i txt'="",obj.feldtyp="B4" s txt=$FN(txt,".",4)
	.. i txt'="",obj.feldtyp="D" s txt=$$TXT10^%LN200(txt)
	.. s ^XW($J,fid)=fid_"`"_$P(fld,"|",1)_"|"_inh_"|"_cargo_"`"_txt q
	.. d obj.%Close()
	
	k obj
	q $J
]]></Implementation>
</Method>

<Method name="GetTexte">
<ClassMethod>1</ClassMethod>
<FormalSpec>ad:%String,firma:%String,pcode:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	N (ad,firma,pcode)
	
	K ^XW($J)
	S FIRMA=firma,PCODE=pcode,FIL=0,%="`"
	for dl=1:1:5 d  q:fsw=0
	. s fsw=0
	. for i=1:1:$L(ad,$C(255)) d
	.. s ad1=$P(ad,$C(255),i) q:ad1=""
	.. s fid=$P(ad1,"`",1),fld=$P(ad1,"`",2)
	.. s id=$P($P(fld,"|",1),".",2),inh=$P(fld,"|",2),cargo=$P(fld,"|",3,99)
	.. s obj=##class(MiniFax.DbZug).%OpenId(id)
	.. q:obj=""
	.. i obj.checksw s txt=$S(inh="0":"§",1:"T")
	.. e  s txt="{"_obj.gruppe_"."_obj.name_"}"
	.. s ^XW($J,fid)=fid_"`"_$P(fld,"|",1)_"|"_inh_"|"_cargo_"`"_txt q
	.. d obj.%Close()
	
	k obj
	q $J
]]></Implementation>
</Method>

<Query name="gruppe">
<Type>%SQLQuery</Type>
<SqlQuery>SELECT distinct gruppe FROM DbZug
 order by gruppe</SqlQuery>
</Query>

<Query name="listegruppe">
<Type>%SQLQuery</Type>
<FormalSpec>gr:%String</FormalSpec>
<SqlQuery>SELECT %ID,gruppe,name,bez,typ,zug FROM DbZug
 WHERE (gruppe = :gr) 
 ORDER BY bez</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Query name="liste">
<Type>%SQLQuery</Type>
<SqlQuery>SELECT %ID,gruppe,name,bez,typ,zug FROM DbZug
 ORDER BY gruppe,bez</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.DbZugD</DataLocation>
<DefaultData>DbZugDefaultData</DefaultData>
<IdLocation>^MiniFax.DbZugD</IdLocation>
<IndexLocation>^MiniFax.DbZugI</IndexLocation>
<StreamLocation>^MiniFax.DbZugS</StreamLocation>
<Data name="DbZugDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>bez</Value>
</Value>
<Value name="3">
<Value>gruppe</Value>
</Value>
<Value name="4">
<Value>name</Value>
</Value>
<Value name="5">
<Value>typ</Value>
</Value>
<Value name="6">
<Value>zug</Value>
</Value>
<Value name="7">
<Value>editsw</Value>
</Value>
<Value name="8">
<Value>checksw</Value>
</Value>
<Value name="9">
<Value>signatursw</Value>
</Value>
<Value name="10">
<Value>feldtyp</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Doks">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>61392,72123.657334</TimeChanged>
<TimeCreated>59658,45031.72227</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="AbsEmail">
<Type>%Library.String</Type>
</Property>

<Property name="Betreff">
<Type>%Library.String</Type>
<Parameter name="MAXLEN" value="500"/>
</Property>

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

<Property name="EmpfEmail">
<Type>%Library.String</Type>
</Property>

<Property name="Faxnr">
<Type>%Library.String</Type>
</Property>

<Property name="FirmaKontakt">
<Type>%Library.String</Type>
</Property>

<Property name="Kontakt">
<Type>%Library.String</Type>
</Property>

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

<Property name="Status">
<Description>
Status
2=übernommen, 3=aktiv, 4=mit Fehler gesendet, 5=ohne Fehler gesendet,6=empfangen
10=gelöscht,11=weitergeleitet, 20=Dummy für Ordner</Description>
<Type>%Library.Integer</Type>
</Property>

<Property name="bstatus">
<Description>
Bearbeitungsstatus
0=offen, 5=gelesen, 10=erledigt</Description>
<Type>%Integer</Type>
<InitialExpression>0</InitialExpression>
</Property>

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

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

<Property name="Typ">
<Type>%Library.String</Type>
<Parameter name="COLLATION" value="EXACT"/>
<Parameter name="MAXLEN" value="2"/>
</Property>

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

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

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

<Property name="StatusBez">
<Type>%Library.String</Type>
</Property>

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

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

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

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

<Property name="Anhaenge">
<Type>MiniFax.Anhaenge</Type>
<Cardinality>children</Cardinality>
<Inverse>Doks</Inverse>
<Relationship>1</Relationship>
</Property>

<Property name="Dokument">
<Type>%Stream</Type>
<Collection>binarystream</Collection>
</Property>

<Property name="Bericht">
<Type>%Stream</Type>
<Collection>binarystream</Collection>
</Property>

<Property name="Faxpic">
<Type>%Stream</Type>
<Collection>binarystream</Collection>
</Property>

<Property name="Site">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Property name="Personal">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Property name="weiteran">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
<Parameter name="MAXLEN" value="1000"/>
</Property>

<Property name="weitervon">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
<Parameter name="MAXLEN" value="1000"/>
</Property>

<Property name="uuid">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Property name="queue">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Property name="folder">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

<Property name="Vorgang">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

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

<Property name="Text">
<Type>%String</Type>
<Parameter name="MAXLEN" value="5000"/>
</Property>

<Property name="Mailtyp">
<Description>
T=Text, D=Word .doc, P=.pdf</Description>
<Type>%String</Type>
</Property>

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

<Property name="SeriendruckStatus">
<Description>
0=kein Seriendruck, 1=Parent, 2=Child</Description>
<Type>%Integer</Type>
</Property>

<Property name="beschl1">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
</Property>

<Property name="beschl2">
<Type>%String</Type>
<Parameter name="MAXLEN" value="100"/>
</Property>

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

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

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

<Property name="Seriendruck">
<Type>MiniFax.Seriendruck</Type>
<Cardinality>children</Cardinality>
<Inverse>Doks</Inverse>
<Relationship>1</Relationship>
</Property>

<Index name="bstatus">
<Properties>Site,bstatus,Typ</Properties>
</Index>

<Index name="DZ">
<Properties>Datum,Zeit</Properties>
</Index>

<Index name="DS">
<Properties>Datum,Typ,Status,Site</Properties>
</Index>

<Index name="DSF">
<Properties>Datum,Typ,Status,Site,folder</Properties>
</Index>

<Index name="DZS">
<Properties>Site,Status,Datum,Zeit</Properties>
</Index>

<Index name="SF">
<Properties>Typ,uuid</Properties>
</Index>

<Index name="beschl1">
<Properties>beschl1</Properties>
</Index>

<Index name="beschl2">
<Properties>beschl2</Properties>
</Index>

<Index name="vorgang">
<Properties>Vorgang,Site</Properties>
</Index>

<Index name="STS">
<Properties>Status,Typ,Site</Properties>
</Index>

<Index name="QUEUE">
<Properties>queue</Properties>
</Index>

<Index name="manuell">
<Properties>manuell</Properties>
</Index>

<Method name="%OnAddToSaveSet">
<FormalSpec>SaveDepth:%Integer,Insert:%Integer,CallCount:%Integer</FormalSpec>
<ReturnType>%Status</ReturnType>
<Implementation><![CDATA[
	if +..vertraulich=1 Q 1
	if +Insert=0 Q 1
	
	s erg=""
	s bis="" f  s bis=$O(^MiniFax.DomainStructI("index",bis),-1) q:bis=""  d  Q:$L(erg)
	. s obj=##class(MiniFax.Faxdomain).%OpenId($E(..Site,1,bis))
	. i $L(obj),obj.Vertraulich'=2 s erg=obj.Vertraulich d obj.%Close()
	
	I $L(erg) s ..vertraulich=erg
	
	Q 1
]]></Implementation>
</Method>

<Method name="DokTest">
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[        q $D(^MiniFax.DoksD(id))
]]></Implementation>
</Method>

<Method name="GetName">
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
        s name = ""
        
        s obj1=##class(MiniFax.Doks).%OpenId(id)
        i $L(obj1) d
        . s site = obj1.Site
        . d obj1.%Close()
        . i $L(site) d
        .. s obj1=##class(MiniFax.Faxdomain).%OpenId(site)
        .. i $L(obj1) s name=obj1.Addr1_obj1.Addr2_obj1.Addr3 d obj1.%Close()
        k obj1
        
        q name
]]></Implementation>
</Method>

<Method name="TestQueue">
<ClassMethod>1</ClassMethod>
<FormalSpec>queue1:%Integer</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
        i $D(^MiniFax.DoksI("QUEUE",queue1)) Q 0
        q 1
]]></Implementation>
</Method>

<Method name="GetOpenFax">
<ClassMethod>1</ClassMethod>
<FormalSpec>site:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[        Q ($D(^MiniFax.DoksI("bstatus",site,0,"FE"))>0)!($D(^MiniFax.DoksI("bstatus",site,5,"FE"))>0)!($D(^MiniFax.DoksI("bstatus",site,0,"SE"))>0)!($D(^MiniFax.DoksI("bstatus",site,5,"SE"))>0)!($D(^MiniFax.DoksI("bstatus",site,5,"OR"))>0)
]]></Implementation>
</Method>

<Method name="GetDoks">
<ClassMethod>1</ClassMethod>
<FormalSpec>typ:%String,fsite:%String,personal:%String,anzall:%Boolean,tage:%Integer,suche:%String,sfolder:%String="",unerl:%Integer=0,ungel:%Integer=0,vorl:%Integer=0,beschl1:%String=""</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
        k domstr,tiefe,tab
        s id="" f  s id=$O(^MiniFax.DomainStructD(id)) q:id=""  d
        . s obj=##class(MiniFax.DomainStruct).%OpenId(id)
        . s domstr(obj.Von) = obj.Bis
        . s tiefe(obj.Bis) = id
        . d obj.%Close()
        
        s maxbis=$O(tiefe(""),-1)
        s anzvertraulich=""
        s bis="" f  s bis=$O(tiefe(bis),-1) q:bis=""  d  q:$L(anzvertraulich)
        . s obj=##class(MiniFax.Faxdomain).%OpenId($E(personal,1,bis))
        . i obj'="" D
        .. i obj.Vertraulich'=2 s anzvertraulich=obj.Vertraulich 
        .. d obj.%Close()
     
        
        K ^XW($J)
        s cnt = 0
        s ll1 = ""
        s ll=$L(fsite)
        k id
        s idcnt = 0
        i beschl1="" d
        . s datum="" f  s datum=$O(^MiniFax.DoksI("DZ",datum),-1) q:datum=""  d
        .. i typ'="V",typ'="E",sfolder="",$H-datum>tage q
        .. s zeit="" f  s zeit=$O(^MiniFax.DoksI("DZ",datum,zeit),-1) q:zeit=""  d
        ... s id="" f  s id=$O(^MiniFax.DoksI("DZ",datum,zeit,id),-1) q:id=""  d
        .... s idcnt=idcnt+1,id(idcnt)=id
        . k datum,zeit
        e  d
        . s:beschl1="" beschl1="$$$"
        . s result=##class(%Library.ResultSet).%New("MiniFax.Doks:beschl1")
        . d result.Execute(beschl1)
        . f  q:'result.Next()  s idcnt=idcnt+1,id(idcnt)=result.GetData(1)
        . d result.Close()
        . k result

        s idcnt="" f  s idcnt=$O(id(idcnt)) q:idcnt=""  d
        . s id = id(idcnt)
        . s obj=##class(MiniFax.Doks).%OpenId(id)
        . i $L(obj) d
        .. s datum=obj.Datum,zeit=obj.Zeit
        .. i $E(obj.Site,1,ll)'=fsite q		//Select Folderdokumente
        .. i +anzall=0,obj.Site'=personal,'$D(^MiniFax.FaxdomainI("friend",personal,obj.Site)) Q
        .. i obj.vertraulich,'anzvertraulich q
        .. i $L(sfolder),obj.folder'=sfolder q
        .. i +vorl=0,obj.Typ="V" Q
        .. i typ="V",sfolder="",typ'="",obj.folder'="" q
        .. i sfolder="",$L(fsite)=maxbis,typ'="",obj.folder'="" q
        .. i $L(typ),typ'="R",typ'="D",typ'=obj.Typ q
        .. i $L(typ),typ="R",obj.Status'=3 q
        .. i $L(typ),typ="D",obj.Status'=10 Q
        .. i obj.Status=20 Q
        .. i +unerl!(+ungel),obj.Typ'="FE",obj.Typ'="SE" Q
        .. i +unerl,obj.bstatus=10 Q
        .. i +ungel,obj.bstatus>0 Q
        .. i obj.Typ="E",obj.Site'=fsite!(typ'="E") Q
        .. i obj.Typ="V",obj.Site'=fsite!(typ'="V") Q
        .. i obj.Site'=fsite,obj.SeriendruckStatus=2 Q
        .. i obj.Site=fsite,sfolder="",obj.SeriendruckStatus=2 Q
        .. i $E(obj.Site,1,ll)'=fsite q
        .. i $L($G(suche)),$F(obj.Text_obj.Faxnr_obj.Betreff_obj.Site_obj.FirmaKontakt_obj.Kontakt,suche)=0 q
        .. s cnt=cnt+1
        .. s ber="N" 
        .. i obj.Typ="F",obj.Status>3 s ber="J"
        .. i obj.Typ="OR",obj.Status>3 s ber="J"
        .. s ftyp="" i obj.Status>3 s ftyp=obj.Filetyp
        .. i obj.Typ="OR" s ftyp=obj.Filetyp
        .. i ll1="" d
        ... s idll=$O(^MiniFax.DomainStructD(""),-1)
        ... s objll=##class(MiniFax.DomainStruct).%OpenId(idll)
        ... s ll1=objll.Von
        ... d objll.%Close()
        .. i $L(obj.Personal) s pers=$E(obj.Personal,ll1,$L(obj.Personal))
        .. e  s pers=$E(obj.Site,ll1,$L(obj.Site))
        .. i obj.Typ="V" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(datum,3)_" "_$ZT(zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.SeitenOk_"/"_obj.Seiten_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .. i obj.Typ="B" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(datum,3)_" "_$ZT(zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.SeitenOk_"/"_obj.Seiten_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .. i obj.Typ="E" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(datum,3)_" "_$ZT(zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.SeitenOk_"/"_obj.Seiten_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .. i obj.Typ="F" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(datum,3)_" "_$ZT(zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.SeitenOk_"/"_obj.Seiten_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .. i obj.Typ="FE" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(datum,3)_" "_$ZT(zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.Seiten_$C(10)_obj.Status_$C(10)_""_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .. i obj.Typ="M" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.EmpfEmail_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_""_$C(10)_obj.Status_$C(10)_""_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .. i obj.Typ="S" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_$P(obj.Text,$C(10),1)_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .. i obj.Typ="SE" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_$P(obj.Text,$C(10),1)_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_$C(10)_obj.Status_$C(10)_""_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .. i obj.Typ="OR" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_""_$C(10)_obj.Status_$C(10)_""_$C(10)_obj.NachtJN_"|"_id_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        . i $L(obj) d obj.%Close()
        
        s id1=$O(^MiniFax.JournalD(""),-1)
        s obj=##class(MiniFax.Faxdomain).%OpenId(fsite)
        s name="" if $L(obj) s name=obj.Addr1 d obj.%Close()
        k obj
        
        q $J_"|"_id1_"|"_name
]]></Implementation>
</Method>

<Method name="GetUpdates">
<ClassMethod>1</ClassMethod>
<FormalSpec>typ:%String,fsite:%String,personal:%String,anzall:%Boolean,tage:%Integer,jourid:%String,suche:%String,sfolder:%String="",unerl:%Integer=0,ungel:%Integer=0,vorl:%Integer=0,beschl1:%String=""</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
        I $O(^MiniFax.JournalD(jourid))="" q 0_"|"_0

        k domstr,tiefe,tab
        s id="" f  s id=$O(^MiniFax.DomainStructD(id)) q:id=""  d
        . s obj=##class(MiniFax.DomainStruct).%OpenId(id)
        . s domstr(obj.Von) = obj.Bis
        . s tiefe(obj.Bis) = id
        . d obj.%Close()
        
        s maxbis=$O(tiefe(""),-1)
        s anzvertraulich=""
        s bis="" f  s bis=$O(tiefe(bis),-1) q:bis=""  d  q:$L(anzvertraulich)
        . s obj=##class(MiniFax.Faxdomain).%OpenId($E(personal,1,bis))
        . i obj'="" D
        .. i obj.Vertraulich'=2 s anzvertraulich=obj.Vertraulich 
        .. d obj.%Close() 
                
        K ^XW($J)
        s cnt = 0
        s ll1 = ""
        s sw = "N"
        s ll=$L(fsite)
        
        s beschl1su="" i $L(beschl1) d
        . s beschl1su=""""_beschl1_"""?"
        . f i1=1:1:$L(beschl1) d
        .. s c=$E(beschl1,i1)
        .. s beschl1su=beschl1su_$S(c="%":"1.A",c="_":"1A",1:"1"""_c_"""")
        
        s site="" f  s site=$O(^MiniFax.JournalI("Site",site)) q:site=""  d
        . i fsite'="",$E(site,1,ll)'=fsite Q
        . s id2=jourid f  s id2=$O(^MiniFax.JournalI("Site",site,id2)) q:id2=""  d
        .. s obj=##class(MiniFax.Journal).%OpenId(id2)
        .. I $L(obj) d
        ... s id1=obj.DokId
        ... d obj.%Close()
        ... s jourid=id2
        ... ;
        ... s obj=##class(MiniFax.Doks).%OpenId(id1)
        ... I obj="" q
        ... i $L(obj) d
        .... i $L(beschl1su),@beschl1su=0 Q
        .... i obj.vertraulich,'anzvertraulich q
        .... i typ'="V",typ'="E",sfolder="",$H-obj.Datum>tage q
        .... i $L(typ),typ'="R",typ'="D",typ'=obj.Typ q
        .... i $L($G(suche)),'$F(obj.Text_obj.Faxnr_obj.Betreff_obj.Site_obj.FirmaKontakt_obj.Kontakt,suche) q
        .... i $L(sfolder),obj.folder'=sfolder q
        .... i +vorl=0,obj.Typ="V" Q
        .... i typ="V",sfolder="",typ'="",obj.folder'="" q
        .... i sfolder="",$L(fsite)=maxbis,typ'="",obj.folder'="" q
        .... i +anzall=0,obj.Site'=personal,'$D(^MiniFax.FaxdomainI("friend",personal,obj.Site)) Q
        .... i +unerl!(+ungel),obj.Typ'="FE",obj.Typ'="SE" q
        .... i +unerl,obj.bstatus=10 Q
        .... i +ungel,obj.bstatus>0 Q
        .... i obj.Typ="E",obj.Site'=fsite!(typ'="E") Q
        .... i obj.Typ="V",obj.Site'=fsite!(typ'="V") Q
        .... i obj.Typ="V",typ'="V" Q
        .... i obj.Site'=fsite,obj.SeriendruckStatus=2 Q
        .... i obj.Site=fsite,sfolder="",obj.SeriendruckStatus=2 Q
        .... i obj.Status=20 Q
        .... s cnt=cnt+1
        .... s ber="N" 
        .... i obj.Typ="F",obj.Status>3 s ber="J"
        .... i obj.Typ="OR",obj.Status>3 s ber="J"
        .... s ftyp="" 
        .... i obj.Status>3 s ftyp=obj.Filetyp
        .... i obj.Typ="OR" s ftyp=obj.Filetyp
        .... i ll1="" d
        ..... s idll=$O(^MiniFax.DomainStructD(""),-1)
        ..... s objll=##class(MiniFax.DomainStruct).%OpenId(idll)
        ..... s ll1=objll.Von
        ..... d objll.%Close()
        .... i $L(obj.Personal) s pers=$E(obj.Personal,ll1,$L(obj.Personal))
        .... e  s pers=$E(obj.Site,ll1,$L(obj.Site))
        .... i obj.Typ="V" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.SeitenOk_"/"_obj.Seiten_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .... i obj.Typ="B" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.SeitenOk_"/"_obj.Seiten_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .... i obj.Typ="E" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.SeitenOk_"/"_obj.Seiten_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .... i obj.Typ="F" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.SeitenOk_"/"_obj.Seiten_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .... i obj.Typ="FE" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_obj.Seiten_$C(10)_obj.Status_$C(10)_""_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .... i obj.Typ="M" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.EmpfEmail_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_""_$C(10)_obj.Status_$C(10)_""_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .... i obj.Typ="S" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_$P(obj.Text,$C(10),1)_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_$C(10)_obj.Status_$C(10)_obj.Versuche_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .... i obj.Typ="SE" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_$P(obj.Text,$C(10),1)_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_$C(10)_obj.Status_$C(10)_""_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        .... i obj.Typ="OR" s ^XW($J,cnt)=obj.Typ_$C(10)_$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_obj.Faxnr_$C(10)_obj.FirmaKontakt_" "_obj.Kontakt_" "_obj.Betreff_$C(10)_pers_$C(10)_ftyp_$C(10)_ber_$C(10)_""_$C(10)_obj.Status_$C(10)_""_$C(10)_obj.NachtJN_"|"_id1_"|"_obj.Site_"|"_obj.LastTry_"|"_obj.weiteran_"|"_obj.folder_"|"_obj.weitervon_"|"_obj.bstatus_"|"_obj.Personal
        ... I $L(obj) d obj.%Close()
        
        k obj, objll
        i +cnt=0 q 0_"|"_1
        q $J_"|"_jourid
]]></Implementation>
</Method>

<Method name="SetFolder">
<ClassMethod>1</ClassMethod>
<FormalSpec>typ:%String,site:%String,folder:%String,textfolder:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
        s ofolder = folder
        s $P(folder,"/",$L(folder,"/"))=textfolder
        &sql(update MiniFax.Doks set folder=:folder where folder=:ofolder and typ=:typ and site %STARTSWITH :site)
]]></Implementation>
</Method>

<Method name="GetStruct">
<ClassMethod>1</ClassMethod>
<FormalSpec>personal:%String,anzall:%Boolean,tage:%Integer,suche:%String,unerl:%Integer=0,ungel:%Integer=0,vorl:%Integer=0,beschl1:%String=""</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
        K ^XW($J)
        k domstr,tiefe,tab
        s nn=0
        s id="" f  s id=$O(^MiniFax.DomainStructD(id)) q:id=""  d
        . s obj=##class(MiniFax.DomainStruct).%OpenId(id)
        . s domstr(obj.Von) = obj.Bis
        . s tiefe(obj.Bis) = id
        . d obj.%Close()
        
        s maxbis=$O(tiefe(""),-1)
        s anzvertraulich=""
        s bis="" f  s bis=$O(tiefe(bis),-1) q:bis=""  d  q:$L(anzvertraulich)
        . s obj=##class(MiniFax.Faxdomain).%OpenId($E(personal,1,bis))
        . i obj'="" D
        .. i obj.Vertraulich'=2 s anzvertraulich=obj.Vertraulich 
        .. d obj.%Close() 
        ;
        k id
        s idcnt = 0
        i beschl1="" d
        . s datum="" f  s datum=$O(^MiniFax.DoksI("DSF",datum),-1) q:datum=""  d
        .. s typ="" f  s typ=$O(^MiniFax.DoksI("DSF",datum,typ)) q:typ=""  d
        ... i typ'="V",typ'="E",datum>0,$H-datum>tage q
        ... s status="" f  s status=$O(^MiniFax.DoksI("DSF",datum,typ,status)) q:status=""  d
        .... s site="" f  s site=$O(^MiniFax.DoksI("DSF",datum,typ,status,site)) q:site=""  d
        ..... I +anzall=0,site'=personal,'$D(^MiniFax.FaxdomainI("friend",personal,site)) Q
        ..... s folder="" f  s folder=$O(^MiniFax.DoksI("DSF",datum,typ,status,site,folder)) q:folder=""  d
        ...... s id="" f  s id=$O(^MiniFax.DoksI("DSF",datum,typ,status,site,folder,id)) q:id=""  d
        ....... s idcnt=idcnt+1,id(idcnt)=id
        e  d
        . s:beschl1="" beschl1="$$$"
        . s result=##class(%Library.ResultSet).%New("MiniFax.Doks:beschl1")
        . d result.Execute(beschl1)
        . f  q:'result.Next()  d
        .. I +anzall=0,result.GetData(2)'=personal,'$D(^MiniFax.FaxdomainI("friend",personal,result.GetData(2))) Q
        .. s idcnt=idcnt+1,id(idcnt)=result.GetData(1)
        . d result.Close()
        . k result
        
        k datum, typ, status, site, folder
        s idcnt="" f  s idcnt=$O(id(idcnt)) q:idcnt=""  d
        . s id = id(idcnt)
        . s sw0 = 0, sw5 = 0
        . s obj=##class(MiniFax.Doks).%OpenId(id)
        . i $L(obj) d
        .. i obj.vertraulich,'anzvertraulich q
        .. s datum = obj.Datum, typ = obj.Typ, status = obj.Status, site = obj.Site, folder = obj.folder
        .. i $L($G(suche)),'$F(obj.Text_obj.Faxnr_obj.Betreff_obj.Site_obj.FirmaKontakt_obj.Kontakt,suche) d obj.%Close() q
        .. i +vorl=0,obj.Typ="V" Q
        .. i unerl!(ungel),typ'="FE",typ'="SE" q
        .. i +unerl,obj.bstatus=10 Q
        .. i +ungel,obj.bstatus>0 q
        .. i typ="FE"!(typ="SE") s:+obj.bstatus=0 sw0=1 s:obj.bstatus<10 sw5=1
        .. s von="" f  s von=$O(domstr(von)) q:von=""  d
        ... I von'>$L(site) d
        .... s fsite=$E(site,1,domstr(von))
        .... i obj.Typ="E",fsite'=site q
        .... i obj.Typ="V",fsite'=site q
        .... i fsite'=site,obj.SeriendruckStatus=2 Q
        .... s $P(tab(fsite),"|",1)=$P($G(tab(fsite)),"|",1)+sw0
        .... i +sw0 s $P(tab(fsite),"|",2)=1
        .... i +sw5 s $P(tab(fsite),"|",3)=1
        .... s ftyp=typ
        .... i status=3 s typ1="R"
        .... i status=10 s typ1="D"
        .... s $P(tab(fsite,ftyp),"|",1)=$P($G(tab(fsite,ftyp)),"|",1)
        .... i folder'<0!($L(fsite)<maxbis) s $P(tab(fsite,ftyp),"|",1)=$P($G(tab(fsite,ftyp)),"|",1)+sw0
        .... i folder'<0!($L(fsite)<maxbis),+sw0 s $P(tab(fsite,ftyp),"|",2)=1
        .... i folder'<0!($L(fsite)<maxbis),+sw5 s $P(tab(fsite,ftyp),"|",3)=1
        .... i $L(fsite)=maxbis!(typ="V"),folder'<0 d
        ..... f fi=1:1:$L(folder,"/") d
        ...... s folder1=$P(folder,"/",1,fi) q:folder1=""
        ...... s $P(tab(fsite,ftyp,folder1),"|",1)=$P($G(tab(fsite,ftyp,folder1)),"|",1)+sw0
        ...... s:+sw0 $P(tab(fsite,ftyp,folder1),"|",2)=1
        ...... s:+sw5 $P(tab(fsite,ftyp,folder1),"|",3)=1
        . i $L(obj) d obj.%Close() k obj
        ;
        s site="" f  s site=$O(tab(site)) q:site=""  d
        . s von="" f  s von=$O(domstr(von)) q:von=""  d
        .. s fsite=$E(site,1,domstr(von))
        .. I '$D(tab(fsite)) s tab(fsite)=""
        ;
        s cnt = 0
        s fsite="" f  s fsite=$O(tab(fsite)) q:fsite=""  d
        . s anz=$P(tab(fsite),"|",1)
        . s obj=##class(Faxdomain).%OpenId(fsite)
        . i $L(obj) d
        .. s cnt=cnt+1
        .. s tiefe=tiefe($L(fsite))
        .. s ^XW($J,cnt)=tiefe_"||"_obj.Addr1_"|"_fsite_"|"_""_"|"_$P(tab(fsite),"|",2)_"|"_$P(tab(fsite),"|",3)_"|"_anz
        .. s ftyp="" f  s ftyp=$O(tab(fsite,ftyp)) q:ftyp=""  d
        ... s anz=$P(tab(fsite,ftyp),"|",1)
        ... s cnt=cnt+1
        ... s typtxt=$S(ftyp="OR":"Order Hagebau",ftyp="V":"Vorlage",ftyp="B":"Brief",ftyp="E":"Entwurf",ftyp="F":"FAX Senden",ftyp="FE":"FAX Empfangen",ftyp="S":"SMS Senden",ftyp="SE":"SMS Empfangen",ftyp="M":"Mail",ftyp="D":"Gelöscht",ftyp="R":"Aktiv",1:ftyp)
        ... s ^XW($J,cnt)=(tiefe+1)_"|"_ftyp_"|"_typtxt_"|"_fsite_"|"_""_"|"_$P($G(tab(fsite,ftyp)),"|",2)_"|"_$P($G(tab(fsite,ftyp)),"|",3)_"|"_anz
        ... s folder1="" f  s folder1=$O(tab(fsite,ftyp,folder1)) q:folder1=""  d
        .... s anz=$P(tab(fsite,ftyp,folder1),"|",1)
        .... s cnt=cnt+1
        .... s foldtxt=$P(folder1,"/",$L(folder1,"/"))
        .... s fi=$L(folder1,"/")
        .... s ^XW($J,cnt)=(tiefe+1+fi)_"|"_ftyp_"|"_foldtxt_"|"_fsite_"|"_folder1_"|"_$P($G(tab(fsite,ftyp,folder1)),"|",2)_"|"_$P($G(tab(fsite,ftyp,folder1)),"|",3)_"|"_anz
        . i $L(obj) d obj.%Close()
        ;
        q $J
]]></Implementation>
</Method>

<Method name="GetVorlagenStrukt">
<ClassMethod>1</ClassMethod>
<FormalSpec>ssite:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
        K ^XW($J)
        s strcnt = 0, deep = 0, cnt = 0
        s idstr="" f  s idstr=$O(^MiniFax.DomainStructD(idstr)) q:idstr=""  d
        . s objstr=##class(MiniFax.DomainStruct).%OpenId(idstr) q:objstr=""
        . s strcnt = strcnt + 1
        . s tiefe = strcnt
        . s site1=$E(ssite,1,objstr.Bis)
        . s objdom=##class(MiniFax.Faxdomain).%OpenId(site1) q:objdom=""
        . s sitename=objdom.Addr1 d objdom.%Close()
        . s cnt=cnt+1,^XW($J,cnt)=tiefe_"|"_site1_"|"_sitename,cnt1=cnt
        . ;Suche nach Foldern
        . s datum="" f  s datum=$O(^MiniFax.DoksI("DSF",datum),-1) q:datum=""  d
        .. s status="" f  s status=$O(^MiniFax.DoksI("DSF",datum,"V",status)) q:status=""  d
        ... q:status=20
        ... s folder="" f  s folder=$O(^MiniFax.DoksI("DSF",datum,"V",status,site1,folder)) q:folder=""  d
        .... if folder'<0 f ii=1:1:$L(folder,"/") d
        ..... s folder1=$P(folder,"/",ii) q:folder1=""
        ..... s cnt=cnt+1,^XW($J,cnt)=(tiefe+ii)_"|"_site1_"|"_folder1_"|"_$P(folder,"/",1,ii)
        ..... s $P(^XW($J,cnt1),"|",3)=sitename
        . d objstr.%Close()
        
        k objstr, objdom
        q $J
]]></Implementation>
</Method>

<Method name="GetVorlagenDoks">
<ClassMethod>1</ClassMethod>
<FormalSpec>ssite:%String,sfolder:%String=""</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
        K ^XW($J)
        s strcnt=0 k strvon,strbis
        s id="" f  s id=$O(^MiniFax.DomainStructD(id)) q:id=""  d
        . s obj=##class(MiniFax.DomainStruct).%OpenId(id)
        . s strcnt = strcnt + 1
        . s strvon(strcnt) = obj.Von
        . s strbis(strcnt) = obj.Bis
        . d obj.%Close()
        
        s cnt = 0
        s datum="" f  s datum=$O(^MiniFax.DoksI("DSF",datum),-1) q:datum=""  d
        . s status="" f  s status=$O(^MiniFax.DoksI("DSF",datum,"V",status)) q:status=""  d
        .. s folder="" f  s folder=$O(^MiniFax.DoksI("DSF",datum,"V",status,ssite,folder)) q:folder=""  d
        ... s folder1=folder i folder<0 s folder1=""
        ... i folder1'=sfolder q
        ... s id="" f  s id=$O(^MiniFax.DoksI("DSF",datum,"V",status,ssite,folder,id)) q:id=""  d
        .... s obj=##class(MiniFax.Doks).%OpenId(id) q:obj=""
        .... if obj.Status<20 d
        ..... s pers=$E(obj.Site,strvon(strcnt),strbis(strcnt))
        ..... i obj.Personal'="" s pers=$E(obj.Personal,strvon(strcnt),strbis(strcnt))
        ..... s cnt=cnt+1,^XW($J,cnt)=$ZD(obj.Datum,3)_" "_$ZT(obj.Zeit)_$C(10)_pers_$C(10)_obj.Betreff_"|"_id
        .... d obj.%Close()
        
        k obj
        q $J
]]></Implementation>
</Method>

<Method name="GetVorgaenge">
<ClassMethod>1</ClassMethod>
<FormalSpec>personal:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
        s cnt = 0
        K ^XW($J)
        s vorg="" f  s vorg=$O(^MiniFax.DoksI("vorgang",vorg))  q:vorg=""  d
        . s site="" f  s site=$O(^MiniFax.DoksI("vorgang",vorg,site)) q:site=""  d
        .. I $L(personal),$E(personal,1,$L(site))'=site q
        .. s id="" f  s id=$O(^MiniFax.DoksI("vorgang",vorg,site,id)) q:id=""  d
        ... if vorg'<0 s cnt=cnt+1,^XW($J,cnt)=id_"|"_vorg_"|"_##class(MiniFax.Faxdomain).%OpenId(site).Addr1
        
        k obj
        q $J
]]></Implementation>
</Method>

<Method name="SetDummy">
<ClassMethod>1</ClassMethod>
<FormalSpec>typ:%String,site:%String,folder:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
        s obj=##class(MiniFax.Doks).%New()
        s obj.Typ = typ
        s obj.Status = 20
        s obj.bstatus = 10
        s obj.folder = folder
        s obj.Datum = 0
        s obj.Site = site
        d obj.%Save()
        d obj.%Close()
        k obj
        
        q 1
]]></Implementation>
</Method>

<Method name="KillDummy">
<ClassMethod>1</ClassMethod>
<FormalSpec>typ:%String,site:%String,folder:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
        s bstatus="" f  s bstatus=$O(^MiniFax.DoksI("bstatus",site,bstatus)) q:bstatus=""  d
        . s id="" f  s id=$O(^MiniFax.DoksI("bstatus",site,bstatus,typ,id)) q:id=""  d
        .. s obj=##class(MiniFax.Doks).%OpenId(id) q:obj=""
        .. i obj.folder=folder,obj.Status=20 d obj.%DeleteId(id)
        .. d obj.%Close()
        k obj
        
        q 1
]]></Implementation>
</Method>

<Method name="TestSerdok">
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%String</FormalSpec>
<ReturnType>%Boolean</ReturnType>
<Implementation><![CDATA[
        s obj=##class(MiniFax.Doks).%OpenId(id)
        i obj="" q 0
        s key = ""
        s sw = 0
        f  s objs=obj.Seriendruck.GetNext(.key)  q:objs=""  d  q:+sw
        . i objs.dokumentid '="" d
        .. s objd=##class(MiniFax.Doks).%OpenId(objs.dokumentid)
        .. i objd'="" s sw=1 d objd.%Close() k objd
        . d objs.%Close()
        . k objs
        
        d obj.%Close()
        k obj
        
        q sw
]]></Implementation>
</Method>

<Method name="ManuellTest">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
		s anz=0
		s id="" f  s id=$O(^MiniFax.DoksD(id)) q:id=""  d
	    . s obj=##class(MiniFax.Doks).%OpenId(id)
        . i obj="" q
        . s obj.manuell=0
        . i obj.Typ="F",obj.Datum>60538 D
        .. s sw=0
        .. s id1="" f  s id1=$O(^MiniFax.DoksD(id,"Anhaenge",id1)) q:id1=""  d
        ... s obj1=##class(MiniFax.Anhaenge).%OpenId(id_"||"_id1)
        ... i obj1.Name="baumat.tif" s sw=1
        ... d obj1.%Close()
        ... k obj1
        .. i +sw=0 s obj.manuell=1
        . i (obj.Typ="B")!(obj.Typ="V") s obj.manuell=1
		. i +obj.manuell s anz=anz+1 
		. d obj.%Save()
		. d obj.%Close()
		k obj
		
		q anz
]]></Implementation>
</Method>

<Method name="AnzManuell">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	s anz=0
	s id="" f  s id=$O(^MiniFax.DoksI("manuell",1,id)) q:id=""  d
	. s anz=anz+1
	
	q anz
]]></Implementation>
</Method>

<Query name="Liste">
<Type>%SQLQuery</Type>
<SqlQuery>SELECT %ID FROM Doks</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Query name="Faxe">
<Description>
---------------------------------------------------------------------------------------------
AusgabeBaumatFaxe</Description>
<Type>%Library.SQLQuery</Type>
<FormalSpec>Site:%String,Date:%Date</FormalSpec>
<SqlQuery><![CDATA[SELECT
 ID,
 Datum,
 Zeit,
 Faxnr,
 Firmakontakt,
 Kontakt,
 Site,
 NachtJN,
 StatusBez,
 Versuche,
 Seiten,
 Filetyp,
 Typ,
 SeitenOk,
 Status,
 Betreff,
 EmpfEmail,
 LastTry,
 Personal

From doks
WHERE (Datum >= :Date) and (:Site is null or Site = :Site)
ORDER BY Datum DESC, Zeit DESC]]></SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Query name="GetSendFaxe">
<Type>%Library.SQLQuery</Type>
<SqlQuery><![CDATA[        SELECT ID , Site, uuid, queue from doks 
        where Typ='F' and uuid<>'']]></SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Query name="beschl1">
<Type>%SQLQuery</Type>
<FormalSpec>beschl1:%String</FormalSpec>
<SqlQuery>SELECT %ID,Site FROM Doks
 WHERE (beschl1 like :beschl1 OR beschl2 like :beschl1 or Betreff like :beschl1 or Faxnr like :beschl1 or Kontakt like :beschl1 or FirmaKontakt like :beschl1)
 ORDER BY Datum DESC, Zeit DESC, %ID DESC, Typ, Status,Site,folder</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.DoksD</DataLocation>
<DefaultData>DoksDefaultData</DefaultData>
<IdLocation>^MiniFax.DoksD</IdLocation>
<IndexLocation>^MiniFax.DoksI</IndexLocation>
<StreamLocation>^MiniFax.DoksS</StreamLocation>
<Data name="DoksDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>AbsEmail</Value>
</Value>
<Value name="3">
<Value>Baust</Value>
</Value>
<Value name="4">
<Value>Bericht</Value>
</Value>
<Value name="5">
<Value>Betreff</Value>
</Value>
<Value name="6">
<Value>Datum</Value>
</Value>
<Value name="7">
<Value>DeckblattJN</Value>
</Value>
<Value name="8">
<Value>EmpfEmail</Value>
</Value>
<Value name="9">
<Value>Faxnr</Value>
</Value>
<Value name="10">
<Value>Faxpic</Value>
</Value>
<Value name="11">
<Value>FilePcl5</Value>
</Value>
<Value name="12">
<Value>Filetyp</Value>
</Value>
<Value name="13">
<Value>Firma</Value>
</Value>
<Value name="14">
<Value>FirmaKontakt</Value>
</Value>
<Value name="15">
<Value>KKR</Value>
</Value>
<Value name="16">
<Value>Kontakt</Value>
</Value>
<Value name="17">
<Value>Konto</Value>
</Value>
<Value name="18">
<Value>LastTry</Value>
</Value>
<Value name="19">
<Value>LinkBelart</Value>
</Value>
<Value name="20">
<Value>LinkBeldat</Value>
</Value>
<Value name="21">
<Value>LinkBelnr</Value>
</Value>
<Value name="22">
<Value>LinkIndexart</Value>
</Value>
<Value name="23">
<Value>NachtJN</Value>
</Value>
<Value name="24">
<Value>Personal</Value>
</Value>
<Value name="25">
<Value>Seiten</Value>
</Value>
<Value name="26">
<Value>SeitenOk</Value>
</Value>
<Value name="27">
<Value>Site</Value>
</Value>
<Value name="28">
<Value>Status</Value>
</Value>
<Value name="29">
<Value>StatusBez</Value>
</Value>
<Value name="30">
<Value>Text</Value>
</Value>
<Value name="31">
<Value>Typ</Value>
</Value>
<Value name="32">
<Value>Versuche</Value>
</Value>
<Value name="33">
<Value>Zeit</Value>
</Value>
<Value name="34">
<Value>Dauer</Value>
</Value>
<Value name="35">
<Value>FaxpicTemp</Value>
</Value>
<Value name="36">
<Value>LoeStatus</Value>
</Value>
<Value name="37">
<Value>weiter</Value>
</Value>
<Value name="38">
<Value>weiteran</Value>
</Value>
<Value name="39">
<Value>weitervon</Value>
</Value>
<Value name="40">
<Value>uuid</Value>
</Value>
<Value name="41">
<Value>folder</Value>
</Value>
<Value name="42">
<Value>queue</Value>
</Value>
<Value name="43">
<Value>bstatus</Value>
</Value>
<Value name="44">
<Value>modified</Value>
</Value>
<Value name="45">
<Value>Dokument</Value>
</Value>
<Value name="46">
<Value>Mailtyp</Value>
</Value>
<Value name="47">
<Value>Vorgang</Value>
</Value>
<Value name="48">
<Value>Cargo</Value>
</Value>
<Value name="49">
<Value>VorgangSendtyp</Value>
</Value>
<Value name="50">
<Value>SeriendruckKkr</Value>
</Value>
<Value name="51">
<Value>SeriendruckStatus</Value>
</Value>
<Value name="52">
<Value>beschl1</Value>
</Value>
<Value name="53">
<Value>beschl2</Value>
</Value>
<Value name="54">
<Value>lock</Value>
</Value>
<Value name="55">
<Value>vertraulich</Value>
</Value>
<Value name="56">
<Value>manuell</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.DomainStruct">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60531,48602.457678</TimeChanged>
<TimeCreated>59658,45031.774523</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

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

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

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

<Index name="index">
<Properties>Bis</Properties>
</Index>

<Query name="Liste">
<Type>%SQLQuery</Type>
<SqlQuery>SELECT Bez,Von,Bis FROM DomainStruct</SqlQuery>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.DomainStructD</DataLocation>
<DefaultData>DomainStructDefaultData</DefaultData>
<IdLocation>^MiniFax.DomainStructD</IdLocation>
<IndexLocation>^MiniFax.DomainStructI</IndexLocation>
<StreamLocation>^MiniFax.DomainStructS</StreamLocation>
<Data name="DomainStructDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Bez</Value>
</Value>
<Value name="3">
<Value>Bis</Value>
</Value>
<Value name="4">
<Value>Von</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Edi">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60944,70290.529836</TimeChanged>
<TimeCreated>60945,51822.073517</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Method name="Bestellung">
<ClassMethod>1</ClassMethod>
<FormalSpec>firma:%String,id:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s erg=$$Bestellung^BMHGEDI(firma,id)
	
	q erg
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.EdiD</DataLocation>
<DefaultData>EdiDefaultData</DefaultData>
<IdLocation>^MiniFax.EdiD</IdLocation>
<IndexLocation>^MiniFax.EdiI</IndexLocation>
<StreamLocation>^MiniFax.EdiS</StreamLocation>
<Data name="EdiDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Faxdomain">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>61392,72208.323502</TimeChanged>
<TimeCreated>59658,45031.933837</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

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

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

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

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

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

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

<Property name="Faxnr">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

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

<Property name="Item">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

<Property name="DruckBerJN">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

<Property name="DruckDokJN">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

<Property name="DruckEmpfJN">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

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

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

<Property name="MsnDdi">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Property name="EmailSendJN">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

<Property name="EmailEmpfJN">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

<Property name="EmailSms">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

<Property name="EmailMail">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

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

<Property name="Passwort">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

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

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

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

<Property name="Mailv">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

<Property name="Vertraulich">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

<Index name="IDKey">
<IdKey>1</IdKey>
<Properties>Item</Properties>
<Unique>1</Unique>
</Index>

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

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

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

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

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

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

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

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

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

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

<Property name="TreeExpandUser">
<Type>%Integer</Type>
<InitialExpression>2</InitialExpression>
</Property>

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

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

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

<Property name="Signatur">
<Type>%Stream</Type>
<Collection>binarystream</Collection>
</Property>

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

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

<Property name="friend">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Query name="Liste">
<Type>%SQLQuery</Type>
<SqlQuery>SELECT %ID,Item,Addr1 FROM Faxdomain
order by Item</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

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

<Index name="MsnDdi">
<Properties>MsnDdi</Properties>
</Index>

<Index name="passwort">
<Properties>Passwort</Properties>
</Index>

<Index name="friend">
<Properties>friend</Properties>
</Index>

<Index name="vertraulich">
<Properties>Vertraulich</Properties>
</Index>

<Method name="GetSitePers">
<ClassMethod>1</ClassMethod>
<FormalSpec>sitepersonal,pcode</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s erg=""
	
	s ll=$L(sitepersonal)
	s site="" f  s site=$O(^MiniFax.FaxdomainD(site)) q:site=""  d  q:$L(erg)
	. i $E(site,1,3)=$E(sitepersonal,1,3),$E(site,ll-2,ll)=$J(pcode,3) s erg=site
	
	q erg
]]></Implementation>
</Method>

<Method name="GetItem">
<ClassMethod>1</ClassMethod>
<FormalSpec>site:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s obj=##class(MiniFax.Faxdomain).%OpenId(site)
	i obj'="" s erg=obj.Addr1 d obj.%Close()
	k obj
	q erg
]]></Implementation>
</Method>

<Method name="SearchSite">
<ClassMethod>1</ClassMethod>
<FormalSpec>msnddi:%String,csi:%String,site:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	//i msnddi="99" s msnddi="9988"
	//s msnddi=$E(msnddi,3,$L(msnddi))
	;
	s csi=$TR(csi," ","")
	i $L(csi) s site=$O(^MiniFax.FaxnrRouteI("index",$TR(csi," ",""),"")) i $L(site) q site
	
	s sw=""
	s ll=$L(site)
	I $L(msnddi) s id="" f  s id=$O(^MiniFax.FaxdomainI("MsnDdi",msnddi,id)) q:id=""  d  q:$L(sw)
	. s obj=##class(MiniFax.Faxdomain).%OpenId(id)
	. q:obj=""
	. if $E(obj.Item,1,ll)=site s sw=obj.Item
	. d obj.%Close()
	i sw="" D
	. s sw=site
	. s obj=##class(MiniFax.Faxdomain).%OpenId(site)
	. i $L(obj) s sw=obj.MsnDdi d obj.%Close()
	K obj
	
	q sw
]]></Implementation>
</Method>

<Method name="LoginSites">
<ClassMethod>1</ClassMethod>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s obj=##class(MiniFax.DomainStruct).%OpenId(2)
	s len=obj.Bis
	d obj.%Close()

	s ad=""
	s site="" f  s site=$O(^MiniFax.FaxdomainD(site)) q:site=""  d
	. i $L(site)'>len,$E(site,1)="D" d
	.. s obj=##class(MiniFax.Faxdomain).%OpenId(site)
	.. s ad=ad_site_$C(255)_obj.Addr1_"|"
	.. d obj.%Close()
	i $L(ad) s ad=$E(ad,1,$L(ad)-1)
	k obj
	
	q ad
]]></Implementation>
</Method>

<Query name="MsnDdi">
<Type>%SQLQuery</Type>
<FormalSpec>sitesel:%String</FormalSpec>
<SqlQuery>SELECT MsnDdi,Item FROM Faxdomain
	where Item %Startswith :sitesel</SqlQuery>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.FaxdomainD</DataLocation>
<DefaultData>FaxdomainDefaultData</DefaultData>
<IdLocation>^MiniFax.FaxdomainD</IdLocation>
<IndexLocation>^MiniFax.FaxdomainI</IndexLocation>
<StreamLocation>^MiniFax.FaxdomainS</StreamLocation>
<Data name="FaxdomainDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Addr1</Value>
</Value>
<Value name="3">
<Value>Addr2</Value>
</Value>
<Value name="4">
<Value>Addr3</Value>
</Value>
<Value name="5">
<Value>Coverpage</Value>
</Value>
<Value name="6">
<Value>DruckBerJN</Value>
</Value>
<Value name="7">
<Value>DruckDokJN</Value>
</Value>
<Value name="8">
<Value>DruckEmpfJN</Value>
</Value>
<Value name="9">
<Value>Drucker</Value>
</Value>
<Value name="10">
<Value>EmailEmpfJN</Value>
</Value>
<Value name="11">
<Value>EmailSendJN</Value>
</Value>
<Value name="12">
<Value>Faxkennung</Value>
</Value>
<Value name="13">
<Value>Faxnr</Value>
</Value>
<Value name="14">
<Value>Item</Value>
</Value>
<Value name="15">
<Value>MsnDdi</Value>
</Value>
<Value name="16">
<Value>Ort</Value>
</Value>
<Value name="17">
<Value>Plz</Value>
</Value>
<Value name="18">
<Value>Telnr</Value>
</Value>
<Value name="19">
<Value>Email</Value>
</Value>
<Value name="20">
<Value>Passwort</Value>
</Value>
<Value name="21">
<Value>FaxloeTage</Value>
</Value>
<Value name="22">
<Value>Nachtzeit</Value>
</Value>
<Value name="23">
<Value>VersWarte</Value>
</Value>
<Value name="24">
<Value>Versuche</Value>
</Value>
<Value name="25">
<Value>FtpIp</Value>
</Value>
<Value name="26">
<Value>FtpPassw</Value>
</Value>
<Value name="27">
<Value>FtpUser</Value>
</Value>
<Value name="28">
<Value>FtpVerz</Value>
</Value>
<Value name="29">
<Value>SmsPin</Value>
</Value>
<Value name="30">
<Value>SmsZentr</Value>
</Value>
<Value name="31">
<Value>MailDomain</Value>
</Value>
<Value name="32">
<Value>MailPort</Value>
</Value>
<Value name="33">
<Value>MailServer</Value>
</Value>
<Value name="34">
<Value>Usergrp</Value>
</Value>
<Value name="35">
<Value>TimerEmpfang</Value>
</Value>
<Value name="36">
<Value>TimerMess</Value>
</Value>
<Value name="37">
<Value>TimerUserdat</Value>
</Value>
<Value name="38">
<Value>TimerXml</Value>
</Value>
<Value name="39">
<Value>TimerRefresh</Value>
</Value>
<Value name="40">
<Value>AnzTage</Value>
</Value>
<Value name="41">
<Value>TreeAb</Value>
</Value>
<Value name="42">
<Value>TreeExpandBis</Value>
</Value>
<Value name="43">
<Value>TreeExpandUser</Value>
</Value>
<Value name="44">
<Value>Weiterleit</Value>
</Value>
<Value name="45">
<Value>SmsUser</Value>
</Value>
<Value name="46">
<Value>AnwsuDB</Value>
</Value>
<Value name="47">
<Value>AnwsuP1</Value>
</Value>
<Value name="48">
<Value>TimerAnw</Value>
</Value>
<Value name="49">
<Value>Mailv</Value>
</Value>
<Value name="50">
<Value>Signatur</Value>
</Value>
<Value name="51">
<Value>isdnamt</Value>
</Value>
<Value name="52">
<Value>defsite</Value>
</Value>
<Value name="53">
<Value>friend</Value>
</Value>
<Value name="54">
<Value>EmailSms</Value>
</Value>
<Value name="55">
<Value>EmailMail</Value>
</Value>
<Value name="56">
<Value>Vertraulich</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.FaxnrRoute">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60321,45300.017223</TimeChanged>
<TimeCreated>60428,38081.045085</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="faxnr">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Property name="site">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Index name="index">
<Properties>faxnr,site</Properties>
</Index>

<Method name="SetCsi">
<ClassMethod>1</ClassMethod>
<FormalSpec>csi:%String,site:%String</FormalSpec>
<Implementation><![CDATA[

	s csi=$TR(csi," ","")
	&sql(delete from MiniFax.FaxnrRoute where faxnr=:csi)
	s obj=..%New()
	s obj.faxnr=csi
	s obj.site=site
	d obj.%Save()
	d obj.%Close()
	k obj
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.FaxnrRouteD</DataLocation>
<DefaultData>FaxnrRouteDefaultData</DefaultData>
<IdLocation>^MiniFax.FaxnrRouteD</IdLocation>
<IndexLocation>^MiniFax.FaxnrRouteI</IndexLocation>
<StreamLocation>^MiniFax.FaxnrRouteS</StreamLocation>
<Data name="FaxnrRouteDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>faxnr</Value>
</Value>
<Value name="3">
<Value>site</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Formulare">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60428,57237.989637</TimeChanged>
<TimeCreated>60428,38081.050718</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="formular">
<Type>%Stream</Type>
<Collection>binarystream</Collection>
</Property>

<Property name="name">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Method name="GetId">
<ClassMethod>1</ClassMethod>
<FormalSpec>name:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s erg=$O(^MiniFax.FormulareI("name",name,""))
	
	s ^test1("DB")=name_"|"_erg
	
	q erg
]]></Implementation>
</Method>

<Query name="liste">
<Type>%SQLQuery</Type>
<SqlQuery>SELECT %ID,name FROM Formulare
order by name</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.FormulareD</DataLocation>
<DefaultData>FormulareDefaultData</DefaultData>
<IdLocation>^MiniFax.FormulareD</IdLocation>
<IndexLocation>^MiniFax.FormulareI</IndexLocation>
<StreamLocation>^MiniFax.FormulareS</StreamLocation>
<Data name="FormulareDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>formular</Value>
</Value>
<Value name="3">
<Value>name</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.GsmDev">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59699,55245.25671</TimeChanged>
<TimeCreated>60280,68839.823743</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

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

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

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

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

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

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

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

<Method name="Delete">
<ClassMethod>1</ClassMethod>
<FormalSpec>site:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	&sql(delete from GsmDEv where Site=:site)
]]></Implementation>
</Method>

<Query name="Liste">
<Type>%SQLQuery</Type>
<FormalSpec>Site:%String,Port:%Integer</FormalSpec>
<SqlQuery>SELECT %ID,Port,Settings,Aktiv,SmsZentrale,SmsPin,SmsSite FROM GsmDev
 WHERE (Site = :Site) and (:Port=0 or Port = :Port)
 ORDER BY Port</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.GsmDevD</DataLocation>
<DefaultData>GsmDevDefaultData</DefaultData>
<IdLocation>^MiniFax.GsmDevD</IdLocation>
<IndexLocation>^MiniFax.GsmDevI</IndexLocation>
<StreamLocation>^MiniFax.GsmDevS</StreamLocation>
<Data name="GsmDevDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Aktiv</Value>
</Value>
<Value name="3">
<Value>Settings</Value>
</Value>
<Value name="4">
<Value>Site</Value>
</Value>
<Value name="5">
<Value>Port</Value>
</Value>
<Value name="6">
<Value>SmsPin</Value>
</Value>
<Value name="7">
<Value>SmsSite</Value>
</Value>
<Value name="8">
<Value>SmsZentrale</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Import">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59698,54107.168532</TimeChanged>
<TimeCreated>59658,45031.990125</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Query name="Import">
<Type>%SQLQuery</Type>
<FormalSpec>Site:%String</FormalSpec>
<SqlQuery>SELECT %ID,FtpIP,FtpUser,FtpPassw,FtpDir,FtpIntervall,FtpSw FROM Import
 WHERE (ServerSite = :Site)
 ORDER BY FtpIP</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

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

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

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

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

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

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

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

<Method name="Delete">
<ClassMethod>1</ClassMethod>
<FormalSpec>site:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[	&sql(delete from MiniFax.Import where ServerSite=:site)
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.ImportD</DataLocation>
<DefaultData>ImportDefaultData</DefaultData>
<IdLocation>^MiniFax.ImportD</IdLocation>
<IndexLocation>^MiniFax.ImportI</IndexLocation>
<StreamLocation>^MiniFax.ImportS</StreamLocation>
<Data name="ImportDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>FtpBez</Value>
</Value>
<Value name="3">
<Value>FtpDir</Value>
</Value>
<Value name="4">
<Value>FtpIP</Value>
</Value>
<Value name="5">
<Value>FtpPassw</Value>
</Value>
<Value name="6">
<Value>FtpUser</Value>
</Value>
<Value name="7">
<Value>FtpIntervall</Value>
</Value>
<Value name="8">
<Value>FtpSite</Value>
</Value>
<Value name="9">
<Value>ServerSite</Value>
</Value>
<Value name="10">
<Value>FtpSw</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Journal">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60315,86117.809233</TimeChanged>
<TimeCreated>59658,45032.040423</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

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

<Property name="Site">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

<Index name="Site">
<Properties>Site</Properties>
</Index>

<Index name="Dokid">
<Properties>DokId</Properties>
</Index>

<Method name="SetJournal">
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%String,site:%String,status:%String</FormalSpec>
<Implementation><![CDATA[
	s obj=..%New()
	s obj.DokId=id
	s obj.Site=site
	s obj.Status=status
	d obj.%Save()
	d obj.%Close()
	k obj
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.JournalD</DataLocation>
<DefaultData>JournalDefaultData</DefaultData>
<IdLocation>^MiniFax.JournalD</IdLocation>
<IndexLocation>^MiniFax.JournalI</IndexLocation>
<StreamLocation>^MiniFax.JournalS</StreamLocation>
<Data name="JournalDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>DokId</Value>
</Value>
<Value name="3">
<Value>Site</Value>
</Value>
<Value name="4">
<Value>Status</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Minifax">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>61450,53664.336143</TimeChanged>
<TimeCreated>59658,45032.12795</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Method name="SetLicense">
<ClassMethod>1</ClassMethod>
<FormalSpec>pcode:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	d $system.License.Login(pcode)
	Q 1
]]></Implementation>
</Method>

<Method name="GetUser">
<ClassMethod>1</ClassMethod>
<FormalSpec>passw:%String,loginsite:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s name="",erg="",ll=$L(loginsite)
	s site="" f  s site=$O(^MiniFax.FaxdomainI("passwort",passw,site)) q:site=""  d  q:$L(erg)
	. I $E(site,1,ll)=loginsite!(loginsite="") s erg=site
	
	q erg
]]></Implementation>
</Method>

<Method name="SmsBest">
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%String,mailserver:%String,mailport:%String,maildomain:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	s obj=##class(MiniFax.Doks).%OpenId(id)
	i obj="" q 0
	s from="Kmessage@"_maildomain
	s to=obj.AbsEmail
	s subject="SMS an "_obj.Faxnr

	if obj.Status=5 d
	. s subject="Sendebestätigung "_subject
	. s text="Das SMS "_$C(13)_$C(10)_obj.Text_$C(13)_$C(10)_" wurde ohne Fehler an "_obj.Faxnr_" versendet"_$C(13)_$C(10)_$C(13)_$C(10)_"Kmessage KräftnerIT"
	e  d
	. s subject="Fehlerbestätigung "_subject
	. s text="Beim versenden des SMS an "_obj.Faxnr_" trat ein Fehler auf"_$C(13)_$C(10)_$C(13)_$C(10)_"Kmessage KräftnerIT"
	
	s erg=##class(MiniFax.Minifax).Mailsend(id,from,to,subject,text,mailserver,mailport,maildomain) 	
	
	d obj.%Close()
	
	q erg
]]></Implementation>
</Method>

<Method name="KundenMail">
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%String,mailserver:%String,mailport:%String,maildomain:%String,best:%Boolean=1,mailtext:%String=""</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s obj=##class(MiniFax.Doks).%OpenId(id)
	i obj="" q 0
	s from=obj.AbsEmail
	s to=obj.EmpfEmail
	s subject=obj.Betreff
	d obj.%Close()
	i obj.Kontakt'="" s:$L(subject) subject=subject_", " s subject=subject_"zu Handen "_obj.Kontakt
	s erg=##class(MiniFax.Minifax).Mailsend(id,from,to,subject,mailtext,mailserver,mailport,maildomain)
	
	if +best d
	. if erg=1 d
	.. s subject="Sendebestätigung "_obj.Betreff
	.. i obj.Kontakt'="" s:$L(subject) subject=subject_", " s subject=subject_"zu Handen "_obj.Kontakt
	.. s text="Das Dokument "_obj.Betreff_" wurde ohne Fehler an "_to_" versendet"_$C(13)_$C(10)
	.. i $L(obj.Text) s text=text_$C(13)_$C(10)_"Notiz:"_$C(13)_$C(10)_obj.Text
	. e  d
	.. s subject="Fehlerbestätigung "_obj.Betreff
	.. i obj.Kontakt'="" s:$L(subject) subject=subject_", " s subject=subject_"zu Handen "_obj.Kontakt
	.. s text="Beim versenden des Dokuments an "_to_" trat ein Fehler auf"_$C(13)_$C(10)
	.. i $L(obj.Text) s text=text_$C(13)_$C(10)_"Notiz:"_$C(13)_$C(10)_obj.Text
	. s to=from
	. s from="Kmessage@"_maildomain
	. ;
	. U $P //
 	. S S=##class(%Net.SMTP).%New()
 	. S S.smtpserver=mailserver
 	. S S.localhost=maildomain
 	. S S.port=mailport
 	. ;
 	. S M=##class(%Net.MailMessage).%New()
 	. S M.From=from
 	. D M.To.Insert(to)
 	. S M.Subject=subject
 	. D M.TextData.Write(text)
 	. d S.Send(M)
 	. D M.%Close()
 	. D S.%Close()
 	
	d obj.%Close()

	q erg
]]></Implementation>
</Method>

<Method name="Mailsend">
<ClassMethod>1</ClassMethod>
<FormalSpec>id:%Integer,from:%String,to:%String,subject:%String,text:%String,mailserver:%String,mailport:%String,maildomain:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[

	s ^test1("M")=mailserver_"|"_maildomain_"|"_mailport_"|"_from_"|"_to_"|"_subject_"|"_text
	i $L(id) d
	. s obj=##class(MiniFax.Doks).%OpenId(id)
	. i obj="" q
	. ;
	. U $P //
 	. S S=##class(%Net.SMTP).%New()
 	. S S.smtpserver=mailserver
 	. S S.localhost=maildomain
 	. S S.port=mailport
 	. ;
 	. S M=##class(%Net.MailMessage).%New()
 	. S M.From=from
 	. D M.To.Insert(to)
 	. S M.Subject=subject
 	. i $TR(text,$C(13)_$C(10)_" ","")="" s text=""
    . ;
    . k file
    . s i="",file1=""
    . f  s obja=obj.Anhaenge.GetNext(.i) q:i=""  d
    .. i obj.Typ="F"!(obj.Typ="FE"),$ZCONVERT(obja.Name,"U")="BAUMAT.TIF" q
    .. i obj.Typ="F"!(obj.Typ="FE"),$ZCONVERT(obja.Name,"U")="WINDOWS.TIF" q
	.. s file(i)="dok"_id_"_"_i_"."_obja.Filetyp
	.. s x=$$JOBWAIT^%HOSTCMD("rm /tmp/"_file(i))
	.. s fobj=##class(%File).%New("/tmp/"_file(i))
	.. d fobj.Delete(file(i))
	.. d fobj.Open("WNU")
	.. d fobj.CopyFrom(obja.Anhang)
	.. d fobj.Close()
	.. k fobj
	.. d M.AttachFile("/tmp/",file(i)) 
	.. i text="",obja.Filetyp="pdf" s text="Siehe Pdf-Dateianlage" 
	.. e  i text="",obja.Filetyp="doc" s text="Siehe Word-Dateianlage"
	.. e  i text="",obja.Filetyp="tif" s text="Siehe Tiff-Dateianlage"
	.. e  i text="" s text="Siehe Dateianhang"
	.. k obja
	. ;
	. d obj.Faxpic.Rewind()
	. i obj.Faxpic.Read(1)'="" d
	.. d obj.Faxpic.Rewind()
	.. s file1="dok_fax.tif"
	.. s x=$$JOBWAIT^%HOSTCMD("rm /tmp/"_file1)
	.. s fobj=##class(%File).%New("/tmp/"_file1)
	.. d fobj.Delete(file1)
	.. d fobj.Open("WNU")
	.. d fobj.CopyFrom(obj.Faxpic)
	.. d fobj.Close()
	.. k fobj
	.. d M.AttachFile("/tmp/",file1)
	.. i text="",obj.Filetyp="pdf" s text="Siehe Pdf-Dateianlage" 
	.. e  i text="",obj.Filetyp="doc" s text="Siehe Word-Dateianlage"
	.. e  i text="",obj.Filetyp="tif" s text="Siehe Tiff-Dateianlage"
	.. e  i text="" s text="Siehe Dateianhang"
	. d obj.Faxpic.Rewind()
	. ;
	. D M.TextData.Write(text)
	. d obj.%Close()
	. S erg=S.Send(M)
 	. D M.%Close()
 	. D S.%Close()
 	. s i="" f  s i=$O(file(i)) q:i=""  d
 	.. s fobj=##class(%File).%New("/tmp/"_file(i))
 	.. d fobj.Delete("/tmp/"_file(i))
 	.. d fobj.%Close()
 	.. k fobj
 	;
 	i $L(file1) d
 	. s fobj=##class(%File).%New("/tmp/"_file1)
	. d fobj.Delete(file1)
	. d fobj.%Close()
 	. k fobj
	
	k obj,file,file1,S,M
	q erg
]]></Implementation>
</Method>

<Method name="NextId">
<ClassMethod>1</ClassMethod>
<FormalSpec>site:%String,status:%String,t:%Integer,typsel:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[
	s sw=0,typ=""
	s ll=$L(site)
	s site1="" f  s site1=$O(^MiniFax.DoksI("DZS",site1)) q:site1=""  d
	. I +ll,$E(site1,1,ll)'=site q
	. s datum="" f  s datum=$O(^MiniFax.DoksI("DZS",site1,status,datum),-1) q:datum=""  d  q:+sw
	.. s zeit="" f  s zeit=$O(^MiniFax.DoksI("DZS",site1,status,datum,zeit),-1) q:zeit=""  d  q:+sw
	... s id="" f  s id=$O(^MiniFax.DoksI("DZS",site1,status,datum,zeit,id),-1) q:id=""  d  q:+sw
	.... s obj=##class(MiniFax.Doks).%OpenId(id)
	.... q:obj=""
	.... i $L(typsel),'$F(","_typsel_",",","_obj.Typ_",") d obj.%Close() Q
	.... i +t,+obj.LastTry,obj.LastTry>t d obj.%Close() Q
	.... i +obj.SeriendruckStatus=1 Q //Kein Senden bei Seriendruck-Parent
	.... i obj.Site="" q
	.... i status=2,obj.uuid'="" q
	.... s sw=id,typ=obj.Typ
	.... d obj.%Close() 
	k obj
	s ^test("kmessagenext")=sw_"|"_typ
	
	q sw_"|"_typ
]]></Implementation>
</Method>

<Method name="DokDelete">
<ClassMethod>1</ClassMethod>
<FormalSpec>psite:%String</FormalSpec>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	s typ="" f  s typ=$O(^MiniFax.DoksI("STS",10,typ)) q:typ=""  d
	. s site="" f  s site=$O(^MiniFax.DoksI("STS",10,typ,site)) q:site=""  d
	.. s id="" f  s id=$O(^MiniFax.DoksI("STS",10,typ,site,id)) q:id=""  d 
	... i typ="V"!(site=psite) d
	.... s obj=##class(MiniFax.Doks).%OpenId(id) i $L(obj) d
	..... i 'obj.lock d
	...... d obj.%DeleteId(id)
	...... &sql(delete from Aend where id=:id)
	...... d ##class(MiniFax.Journal).SetJournal(id, site, 10)
	..... d obj.%Close() k obj
	
	q 1
]]></Implementation>
</Method>

<Method name="TestStatus">
<ClassMethod>1</ClassMethod>
<ReturnType>%Integer</ReturnType>
<Implementation><![CDATA[
	k domstr
	s domstrcnt=0
	s id="" f  s id=$O(^MiniFax.DomainStructD(id)) q:id=""  d
	. s obj=##class(MiniFax.DomainStruct).%OpenId(id)
	. s domstrcnt=domstrcnt+1
	. s domstr(domstrcnt)=obj.Bis
	. d obj.%Close()
	
	s id="" f  s id=$O(^MiniFax.DoksD(id)) q:id=""  D
	. s obj=##class(MiniFax.Doks).%OpenId(id)
	. i obj="" q
	. i obj.Typ="E" d obj.%Close() q
	. i obj.Typ="V" d obj.%Close() q
	. i obj.Status=3 s obj.Status=4,obj.StatusBez="Abgebrochen" d obj.%Save()
	. 
	. s ltage=""
	. s site=obj.Site
	. for i=domstrcnt:-1:1 d  q:+ltage
	.. s site1=$E(site,1,domstr(i))
	.. s obj1=##class(MiniFax.Faxdomain).%OpenId(site1)
	.. I $L(obj1) s ltage=obj1.FaxloeTage d obj1.%Close() 
	. i +ltage=0 s ltage=30
	. 
	. s delsw=0
	. if obj.Site="" s delsw=1
	. if $H-obj.Datum>600,+obj.Datum s delsw=1
	. if obj.Status=5,ltage>0,$H-obj.Datum'<ltage,+obj.Datum,obj.folder="" s delsw=1
	. if obj.Status=6,obj.Typ'="FE",ltage>0,$H-obj.Datum'<ltage,+obj.Datum,obj.folder="" s delsw=1
	. if obj.Status=6,obj.Typ="FE",obj.bstatus=10,ltage>0,$H-obj.Datum'<ltage,+obj.Datum,obj.folder="" s delsw=1
	. if obj.Status=10,ltage>0,$H-obj.Datum'<ltage,+obj.Datum,obj.folder="" s delsw=1
	. if obj.Status=11,obj.Typ'="FE",ltage>0,$H-obj.Datum'<ltage,+obj.Datum,obj.folder="" s delsw=1
	. if obj.Status=11,obj.Typ="FE",obj.bstatus=10,ltage>0,$H-obj.Datum'<ltage,+obj.Datum,obj.folder="" s delsw=1
	. if delsw,'obj.lock d
	.. d obj.%DeleteId(id)
	.. &sql(delete from Aend where id=:id)
	. d obj.%Close()
	k obj,obj1
	k ^MiniFax.JournalD,^MiniFax.JournalI
	S ^MiniFax.InfoStatus($H)=""
	q 1
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.MinifaxD</DataLocation>
<DefaultData>MinifaxDefaultData</DefaultData>
<IdLocation>^MiniFax.MinifaxD</IdLocation>
<IndexLocation>^MiniFax.MinifaxI</IndexLocation>
<StreamLocation>^MiniFax.MinifaxS</StreamLocation>
<Data name="MinifaxDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>BerAdmin</Value>
</Value>
<Value name="3">
<Value>BerExpert</Value>
</Value>
<Value name="4">
<Value>BerUser</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Para">
<Description>
</Description>
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59685,63745.499924</TimeChanged>
<TimeCreated>60280,68840.095177</TimeCreated>

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

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.ParaD</DataLocation>
<DefaultData>ParaDefaultData</DefaultData>
<IdLocation>^MiniFax.ParaD</IdLocation>
<IndexLocation>^MiniFax.ParaI</IndexLocation>
<StreamLocation>^MiniFax.ParaS</StreamLocation>
<Data name="ParaDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>SwDomain</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Seriendruck">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60492,49495.497819</TimeChanged>
<TimeCreated>60945,51822.153594</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Property name="Doks">
<Type>MiniFax.Doks</Type>
<Cardinality>parent</Cardinality>
<Inverse>Seriendruck</Inverse>
<Relationship>1</Relationship>
</Property>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

<Query name="Liste">
<Type>%SQLQuery</Type>
<FormalSpec>dok:%String</FormalSpec>
<SqlQuery>SELECT %ID,nr,titel,name1,name2,strasse,landplzort,dokumentid,addr,anrede,zusatz1,zusatz2,zusatz3,zusatz4,zusatz5 FROM Seriendruck
WHERE Doks=:dok</SqlQuery>
<Parameter name="CONTAINID" value="1"/>
</Query>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>{%%PARENT}("Seriendruck")</DataLocation>
<DefaultData>SeriendruckDefaultData</DefaultData>
<IdLocation>{%%PARENT}("Seriendruck")</IdLocation>
<IndexLocation>^MiniFax.SeriendruckI</IndexLocation>
<StreamLocation>^MiniFax.SeriendruckS</StreamLocation>
<Data name="SeriendruckDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>aktiv</Value>
</Value>
<Value name="3">
<Value>landplzort</Value>
</Value>
<Value name="4">
<Value>name1</Value>
</Value>
<Value name="5">
<Value>name2</Value>
</Value>
<Value name="6">
<Value>nr</Value>
</Value>
<Value name="7">
<Value>strasse</Value>
</Value>
<Value name="8">
<Value>typ</Value>
</Value>
<Value name="9">
<Value>dokumentid</Value>
</Value>
<Value name="10">
<Value>titel</Value>
</Value>
<Value name="11">
<Value>addr</Value>
</Value>
<Value name="12">
<Value>anrede</Value>
</Value>
<Value name="13">
<Value>zusatz1</Value>
</Value>
<Value name="14">
<Value>zusatz2</Value>
</Value>
<Value name="15">
<Value>zusatz3</Value>
</Value>
<Value name="16">
<Value>zusatz4</Value>
</Value>
<Value name="17">
<Value>zusatz5</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.Statistik">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>59659,86384.681757</TimeChanged>
<TimeCreated>59664,50474.198012</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Index name="Statistik">
<Properties>Typ,Site,Datum</Properties>
</Index>

<Property name="Typ">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

<Property name="Site">
<Type>%String</Type>
<Parameter name="COLLATION" value="EXACT"/>
</Property>

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

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

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

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

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

<Method name="GetId">
<ClassMethod>1</ClassMethod>
<FormalSpec>typ:%String,site:%String,datum:%String</FormalSpec>
<ReturnType>%String</ReturnType>
<Implementation><![CDATA[	Q $O(^MiniFax.StatistikI("Statistik",typ,site,datum,""))
]]></Implementation>
</Method>

<Storage name="Default">
<Type>%Library.CacheStorage</Type>
<DataLocation>^MiniFax.StatistikD</DataLocation>
<DefaultData>StatistikDefaultData</DefaultData>
<IdLocation>^MiniFax.StatistikD</IdLocation>
<IndexLocation>^MiniFax.StatistikI</IndexLocation>
<StreamLocation>^MiniFax.StatistikS</StreamLocation>
<Data name="StatistikDefaultData">
<Structure>listnode</Structure>
<Subscript/>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>Anzahl</Value>
</Value>
<Value name="3">
<Value>Datum</Value>
</Value>
<Value name="4">
<Value>Dauer</Value>
</Value>
<Value name="5">
<Value>Einheiten</Value>
</Value>
<Value name="6">
<Value>Seiten</Value>
</Value>
<Value name="7">
<Value>Site</Value>
</Value>
<Value name="8">
<Value>Typ</Value>
</Value>
</Data>
</Storage>
</Class>
<Class name="MiniFax.XW">
<ClassType>persistent</ClassType>
<ProcedureBlock>1</ProcedureBlock>
<Super>%Persistent</Super>
<TimeChanged>60490,44708.026677</TimeChanged>
<TimeCreated>60425,85218.351449</TimeCreated>
<ClassDefinitionError>0</ClassDefinitionError>

<Index name="ID">
<IdKey>1</IdKey>
<Properties>JOBNR,CNT</Properties>
</Index>

<Property name="CNT">
<Description>
Counter</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Property name="INHALT">
<Description>
Inhalt</Description>
<Type>%String</Type>
<Collection/>
<Relationship>0</Relationship>
<Parameter name="MAXLEN" value="1000"/>
</Property>

<Property name="JOBNR">
<Description>
Jobnummer</Description>
<Type>%Integer</Type>
<Collection/>
<Relationship>0</Relationship>
</Property>

<Query name="XWListe">
<Type>%Library.SQLQuery</Type>
<FormalSpec>PJobnr:%Library.String</FormalSpec>
<SqlQuery>SELECT INHALT
FROM MiniFax.XW
WHERE (JOBNR = :PJobnr)
ORDER BY INHALT</SqlQuery>
<Parameter name="CONTAINID" value="0"/>
<Parameter name="ROWSPEC" value="INHALT:%String"/>
</Query>

<Query name="XWListeNr">
<Type>%Library.SQLQuery</Type>
<FormalSpec>PJobnr:%Library.String</FormalSpec>
<SqlQuery>SELECT INHALT
FROM MiniFax.XW
WHERE (JOBNR = :PJobnr)
ORDER BY CNT</SqlQuery>
<Parameter name="CONTAINID" value="0"/>
<Parameter name="ROWSPEC" value="INHALT:%String"/>
</Query>

<Storage name="Default">
<Type>%CacheSQLStorage</Type>
<DataLocation>^XW</DataLocation>
<DefaultData>BaumatDefaultData1</DefaultData>
<IdLocation>^XW</IdLocation>
<IndexLocation>^XW</IndexLocation>
<StreamLocation>^MiniFax.BaumatS</StreamLocation>
<Data name="BaumatDefaultData">
<Attribute>INHALT</Attribute>
<Structure>node</Structure>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
<Value name="2">
<Value>INHALT</Value>
</Value>
</Data>
<Data name="BaumatDefaultData1">
<Structure>listnode</Structure>
<Subscript>"1"</Subscript>
<Value name="1">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
<SQLMap name="Map1">
<Type>data</Type>
<Global>XW</Global>
<Subscript name="1">
<Expression>{JOBNR}</Expression>
</Subscript>
<Subscript name="2">
<Expression>{CNT}</Expression>
</Subscript>
<Data name="INHALT">
<Delimiter>"`"</Delimiter>
<Piece>1</Piece>
</Data>
</SQLMap>
</Storage>
</Class>
<Project name="Minifax" LastModified="2009-06-21 11:34:09">
  <Items>
    <ProjectItem name="BM.KundFiltPar" type="CLS"/>
    <ProjectItem name="BM.LiefFiltPar" type="CLS"/>
    <ProjectItem name="BMHGEDI.int" type="MAC"/>
    <ProjectItem name="MiniFax.Aend" type="CLS"/>
    <ProjectItem name="MiniFax.Anhaenge" type="CLS"/>
    <ProjectItem name="MiniFax.Baumat" type="CLS"/>
    <ProjectItem name="MiniFax.Berecht" type="CLS"/>
    <ProjectItem name="MiniFax.Cards" type="CLS"/>
    <ProjectItem name="MiniFax.DbZug" type="CLS"/>
    <ProjectItem name="MiniFax.Doks" type="CLS"/>
    <ProjectItem name="MiniFax.DomainStruct" type="CLS"/>
    <ProjectItem name="MiniFax.Edi" type="CLS"/>
    <ProjectItem name="MiniFax.Faxdomain" type="CLS"/>
    <ProjectItem name="MiniFax.FaxnrRoute" type="CLS"/>
    <ProjectItem name="MiniFax.Formulare" type="CLS"/>
    <ProjectItem name="MiniFax.GsmDev" type="CLS"/>
    <ProjectItem name="MiniFax.Import" type="CLS"/>
    <ProjectItem name="MiniFax.Journal" type="CLS"/>
    <ProjectItem name="MiniFax.Minifax" type="CLS"/>
    <ProjectItem name="MiniFax.Para" type="CLS"/>
    <ProjectItem name="MiniFax.Seriendruck" type="CLS"/>
    <ProjectItem name="MiniFax.Statistik" type="CLS"/>
    <ProjectItem name="MiniFax.XW" type="CLS"/>
    <ProjectItem name="NAPPA.int" type="MAC"/>
    <ProjectItem name="XUTILKM1.int" type="MAC"/>
  </Items>
</Project>
<Routine name="NAPPA" type="INT" languagemode="0" timestamp="60976,61082"><![CDATA[
NAPPA ;KRA;Personal algemeiner Teil [ 01/16/00  3:31 PM ]
 d ^BMINIT
 D PW E  Q
ANF S SW=1
 S (PNR,PKBEZ,PAKTIV,ZEITJN,AKTIV,KASSAJN,ZETRM)=""
 I $D(^ANREG($J))#2 S PNR=$P(^($J),%,1),SW=+$P(^($J),%,2) S %O="" D PNR
 D ^PER01
 I SW=1,F01="A"!%E G ENDE
 I '%E,F01'="A" D SPEICH G:F01="S" ANF
 S PRG=$S(F01="P":"NAPPB",F01="L":"NAPPC",F01="B":"BMPL",F01="Z":"NAPPJ",F01="K":"BMKA",1:"")
 S $P(^ANREG($J),%,1)=PNR
 I F01="B" S ^ANREG($J)=PCODE_%_2 D ^%MENUEB I $T D START S ^ANREG($J)=PNR_%_1 S PRG="NAPPA" D ^%MENUEB G ANF
 I F01="K" S ^ANREG($J)=KNR_%_2 D ^%MENUEB I $T D START S ^ANREG($J)=PNR_%_1 S PRG="NAPPA" D ^%MENUEB G ANF
 I $L(PRG) D ^%MENUEB I $T G @("^"_PRG)
 I SW=2 Q
 K ^ANREG($J) ZD
 Q
 ;
PW I $$GET^BMXOBJ("ALLG","NADLINGER")'="J" Q 
 N SW,II,ACC,N,O,PW 
 I '$D(^LOGG("P")) 
 E  W "Personalsperre wurde aktiviert,  Bitte bei EDV-Leitung Melden !!" H 3 Q
 S SW=0 
 N pom
 F II=1:1:3 D  Q:+SW!(PW="") 
 . S N=24,O=1 W @%TC,"Passwort :  "  S PW=$$^%KRAPASS(5)
 . Q:PW=""
 . S pom=$E(10000+(%DR#10000),2,5)
 . I +PW=+($E(pom,1)+$E(pom,2)+$E(pom,3)+$E(pom,4)) S SW=1 Q
 . E  I II<3 W *7,*13,"    Falsch, Sie haben noch ",3-II," Versuche ! " H 1
 I +SW S ^LOGG($I,%DR,$P($H,",",2))="P"_%_PERSONAL_%_PW
 E  S:$L(PW) ^LOGG("P")=PERSONAL_%_%DR_%_$P($H,",",2)
 Q
ENDE ;
 K ^XW($J),^ANREG($J)
 K
 ZD
 Q
START N (PRG)
 D @("^"_PRG)
 Q
 ;
PKBEZ ;PKBEZ
 Q:PKBEZ=%O
 S VAR=18_%_PKBEZ
 D ^BMCKURZ
 Q:$D(%M)
 S PKBEZ=VAR
 Q
 ;
PNR ; PNR
 Q:PNR=%O
 S AD0="" I $D(^PERS(FIRMA,PNR,0))#2 S AD0=^(0)
 S BASZEIT=38.5 I $L(AD0) D
 S JJMM=(%DR\100)+1
 F  S JJMM=$O(^PERS(FIRMA,PNR,2,JJMM),-1) Q:JJMM=""  I $D(^(JJMM))#2 Q
 I $L(JJMM),$L($P(^(JJMM),%,3)) S BASZEIT=$P(^(JJMM),%,3)
 
 I $L(%O) ZD ^PERS(FIRMA,%O)
 ZA ^PERS(FIRMA,PNR):3
 E  S %M="Mitarbeiterdaten werden momentan bearbeitet" Q
 S (OKNR,KNR)=$P(AD0,%,4),(OPKBEZ,PKBEZ)=$P(AD0,%,1),GDAT=$P(AD0,%,5)
 S PCODE=$G(^PA(FIRMA,101,+PNR)),%O=" " S:PCODE="" AKTIV="N" 
 S EINTRITT=$P(AD0,%,2),AUSTRITT=$P(AD0,%,3),ABTNR=$P(AD0,%,6),DW=$P(AD0,%,7),(OPAKTIV,PAKTIV)=$P(AD0,%,8),(OZEITJN,ZEITJN)=$P(AD0,%,9),BUCHBIS=$P(AD0,%,10),(OKARTNR,KARTNR)=$P(AD0,%,11),(OMTXTNR,MTXTNR)=$P(AD0,%,12),EMAIL=$P(AD0,%,13),FAXDW=$P(AD0,%,14),GESCHL=$P(AD0,%,15),SVNR=$P(AD0,%,16),ZETRM=$P(AD0,%,17)
 D GDAT,EINTRITT
 S (TAETIGK)="" S JJMM=(%DR\100)+1,JJMM=$O(^PERS(FIRMA,PNR,2,JJMM),-1) I $L(JJMM),$D(^(JJMM))#2 S TAETIGK=$P(^(JJMM),%,4)
 D PCODE
 ;
 K ^XW($J)
 S IND="" F  S IND=$O(^PERS(FIRMA,PNR,6,IND)) Q:IND=""  S ^XW($J,IND)=^(IND)
 Q
 ;
 ;
KNR I PKBEZ="",$L(KNR),$D(^B(FIRMA,"K",KNR,0))#2 S (OPKBEZ,PKBEZ)=$P(^(0),%,1) 
 S AD1="" S:$L(KNR) AD1=$G(^B(FIRMA,"K",KNR,1))
 S TITEL=$P(AD1,%,1),NAME=$P(AD1,%,2),BRANCHE=$P(AD1,%,3),STRASSE=$P(AD1,%,4),LAND=$P(AD1,%,5),PLZ=$P(AD1,%,6),ORT=$P(AD1,%,7)
 S (OKGRP,KGRP)="" S:$L(KNR) (OKGRP,KGRP)=$P($G(^BZ(FIRMA,"K",KNR,1)),%,6)
 Q
 ;
KGRP ;
 I +KNR=99999,KGRP'="P0" S %M="Bei Sammelkunden mu~ Kundengruppe P0 sein !"
 Q
PCODE ;PCODE
 ;Q:PCODE=%O
 ;
 S AD=%_PNR_%_PCODE_%_KNR_%_ABTNR_%_DW_%_%_3_%_"N"_%_%_0_%_%_GDAT_%_AKTIV_%_%_"N"_%_"N"_%_"N"_%_"N"_%_"N"_%_"N"
 I $L(PCODE),$D(^PA(FIRMA,100,PCODE))#2 S AD=^(PCODE)
 S (OPNAME,PNAME)=$P(AD,%,1),PNR=$P(AD,%,2),PASSWORT=$P(AD,%,3),KNR=$P(AD,%,4),ABTNR=$P(AD,%,5),DW=$P(AD,%,6),KOST=$P(AD,%,7),BERGRP=$P(AD,%,8),PROVJN=$P(AD,%,9)
 S PROVFAKT=$P(AD,%,10),PRAE=$P(AD,%,11),PROVBAS=$P(AD,%,12),GDAT=$P(AD,%,13),AKTIV=$P(AD,%,14),MGNR=$P(AD,%,15),UEBSTJN=$P(AD,%,16),KASSAJN=$P(AD,%,17),BANKPNR=$P(AD,%,18),FAJN=$P(AD,%,19),WJJN=$P(AD,%,20),TUNEXIT=$P(AD,%,21),SAMMVKJN=$P(AD,%,22)
 S OAKTIV=AKTIV,OKNR=KNR,OPNAME=PNAME,OKASSAJN=KASSAJN,OBANKPNR=BANKPNR
 D ABTNR
 S %O=" " D KNR
 Q
AKTIV ;AKTIV
 Q
KARTNR ; KARTBR
 Q:KARTNR=""
 I $D(^PERSP(FIRMA,9,KARTNR)),^(KARTNR)'=PNR S %M="Karte "_KARTNR_" wird bei Mitarbeiter "_^(KARTNR)_" verwendet !" Q
 Q
MTXTNR ; 
 Q:MTXTNR=""
 I '$D(^PERSP(FIRMA,14,+MTXTNR)) S %M="Mailtext nicht gespeichert !" 
 Q
 ;
ABTNR S ABTBEZ="" Q:ABTNR="" 
 I $D(^PA(FIRMA,2,ABTNR))#2 S ABTBEZ=$P(^(ABTNR),%,1)
 E  S %M="Abteilung nicht gespeichert"
 Q
SPEICH ;
 D SPEICH^NAPPAA
 I PAKTIV="N" S (AKTIV,KASSAJN,ZEITJN)="N"
 I AKTIV="J" D
 . S $P(AD,%,1)=PNAME,$P(AD,%,2)=PNR,$P(AD,%,3)=PASSWORT,$P(AD,%,4)=KNR,$P(AD,%,5)=ABTNR,$P(AD,%,6)=DW,$P(AD,%,7)=KOST,$P(AD,%,8)=BERGRP,$P(AD,%,9)=PROVJN
 . I KASSAJN="J",BANKPNR="" S BANKPNR=$G(^PERSP(FIRMA,16))+1,^PERSP(FIRMA,16)=BANKPNR
 . S $P(AD,%,10)=PROVFAKT,$P(AD,%,11)=PRAE,$P(AD,%,12)=PROVBAS,$P(AD,%,13)=GDAT,$P(AD,%,14)=AKTIV,$P(AD,%,15)=MGNR,$P(AD,%,16)=UEBSTJN,$P(AD,%,17)=KASSAJN,$P(AD,%,18)=BANKPNR,$P(AD,%,19)=FAJN,$P(AD,%,20)=WJJN,$P(AD,%,21)=TUNEXIT,$P(AD,%,22)=SAMMVKJN
 . S ^PA(FIRMA,101,PNR)=PCODE S:+FIRMA=1 ^PA(2,101,PNR)=PCODE
 . S ^PA(FIRMA,100,PCODE)=AD S:+FIRMA=1 ^PA(2,100,PCODE)=AD
 E  I $L(PCODE) D
 . S $P(^PA(FIRMA,100,PCODE),%,5,6)=ABTNR_%_DW
 . S $P(^PA(FIRMA,100,PCODE),%,14)=AKTIV
 . S $P(^PA(FIRMA,100,PCODE),%,17)=KASSAJN
 I $L(PCODE),AKTIV'=OAKTIV S ^PA(FIRMA,103,PCODE,$H)=^%I($J)_%_PERSONAL_%_OAKTIV_%_AKTIV
 ; 
 I AKTIV'=OAKTIV!(KASSAJN'=OKASSAJN)!(OBANKPNR'=BANKPNR)!(OPNAME'=PNAME) D
 . I AKTIV="J",KASSAJN="J" S TR="P.07"_%_PCODE D ^BMVSEND Q
 . S TR="P.08"_%_PCODE D ^BMVSEND
 ;
 S LOE=0
 I OKARTNR'=KARTNR,$L(OKARTNR) S LOE=1
 I ZEITJN="N" S LOE=1
 I +LOE,OZEITJN="J" D PERS^NAZTSEND(PNR),PERSLOE^NAZTSEND(PNR)
 ;
 I '$D(^PERS(FIRMA,PNR,0)) S ^PERS(FIRMA,PNR,2,(%DR\100))=%_%_BASZEIT
 ;
 S ^PERS(FIRMA,PNR,0)=PKBEZ_%_EINTRITT_%_AUSTRITT_%_KNR_%_GDAT_%_ABTNR_%_DW_%_PAKTIV_%_ZEITJN_%_BUCHBIS_%_KARTNR_%_MTXTNR_%_EMAIL_%_FAXDW_%_GESCHL_%_SVNR_%_ZETRM
 I KGRP'=OKGRP D
 . ZA ^BZ(FIRMA,"K",KNR)
 . S $P(^BZ(FIRMA,"K",KNR,1),%,6)=KGRP
 . S KKBEZ=$P($G(^B(FIRMA,"K",KNR,0)),%,1)
 . K:$L(OKNR)&$L(OKGRP)&$L(KKBEZ) ^BZM(FIRMA,"K",2,OKGRP,KKBEZ,OKNR)
 . S:$L(KNR)&$L(KGRP)&$L(KKBEZ) ^BZM(FIRMA,"K",2,KGRP,KKBEZ,KNR)="" 
 . ZD ^BZ(FIRMA,"K",KNR)
 K:$L(OPKBEZ) ^PERSP(FIRMA,3,OPKBEZ,PNR)
 K:$L(OKARTNR) ^PERSP(FIRMA,9,OKARTNR)
 S ^PERSP(FIRMA,3,PKBEZ,PNR)=""
 S:$L(KARTNR) ^PERSP(FIRMA,9,KARTNR)=PNR
 ;
 S SEND=0
 I OMTXTNR'=MTXTNR S SEND=1
 I OKARTNR'=KARTNR,$L(KARTNR) S SEND=1
 I OZEITJN="N" S SEND=1
 I +SEND,ZEITJN="J" D PERS^NAZTSEND(PNR)
 ;
 I $$GET^BMXOBJ("FAXSERVER","Output")="XML",$$GET^BMXOBJ("FAXSERVER","PclPfad")'="" D
 . ;XML-Schnittstelle für KMessage
 . S DOMAIN=$$GET^BMXOBJ("EMAIL","DOMAIN")
 . s faxdir=$$GET^BMXOBJ("FAXSERVER","PclPfad")
 . s faxpr=$$GET^BMXOBJ("FAXSERVER","FaxPr")
 . s faxprddijn=$$GET^BMXOBJ("FAXSERVER","FaxPrDDIJN")
 . I $E(faxdir,$L(faxdir))'="/" s faxdir=faxdir_"/"
 . s file=faxdir_"temp"_$J_$TR($H,",","")_".xml"
 . s file1=faxdir_"user"_$J_$TR($H,",","")_".xml"
 . o file:"WN"
 . u file
 . S:FAXDW="" FAXDW=DW
 . w "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>",!
 . w "<faxuser>",!
 . w "<user site=""D"_$$ASCIANSI^%UML($E(100+FIRMA,2,3)_$J(ABTNR,2)_$J(PCODE,3))_""">",!
 . w "<name>",$$ASCIANSI^%UML(PNAME),"</name>",!
 . w "<tel>","[2]-",+DW,"</tel>",!
 . w "<fax>","[2]-",faxpr,FAXDW,"</fax>",!
 . i AKTIV="J" D
 .. i faxprddijn="J" w "<msnddi>",faxpr,FAXDW,"</msnddi>",!
 .. e  w "<msnddi>",FAXDW,"</msnddi>",!
 . i AKTIV'="J" w "<msnddi></msnddi>",! 
 . . w "<email>",EMAIL_"@"_DOMAIN,"</email>",!
 . w "<password>",$$ASCIANSI^%UML(PASSWORT),"</password>",!
 . w "</user>",!
 . w "</faxuser>",!
 . c file
 . s x=$$JOBWAIT^%HOSTCMD("chmod 777 "_file)
 . s x=$$JOBWAIT^%HOSTCMD("mv "_file_" "_file1)
 Q
 ;
EINTRITT ;
 I EINTRITT="" S DIEJA="" Q
 S DIEJA=($S($L(AUSTRITT):AUSTRITT,1:%DR)\100\100)-(EINTRITT\100\100)
 Q
AUSTRITT ;
 I EINTRITT="" S DIEJA="" Q
 S DIEJA=($S($L(AUSTRITT):AUSTRITT,1:%DR)\100\100)-(EINTRITT\100\100)
 Q
GDAT ;
 I GDAT="" S LEALT="" Q
 S LEALT=$$J3^%LN207(%DR)-$$J3^%LN207(GDAT)
 S:LEALT<1 LEALT=LEALT+100,GDAT=GDAT-1000000
 Q
]]></Routine>
<Routine name="XUTILKM1" type="INT" languagemode="0" timestamp="60976,61091"><![CDATA[
XUTILKM1	;KRA;Alle Mitarbeiter zu Faxsserver senden
 
	d ^BMINIT
	W "Firma: " R FIRMA W !
	W "Nur User J/N: " R USSW W !
	Q:USSW=""
	Q:FIRMA=""
	
	;XML-Schnittstelle für KMessage
 	S DOMAIN=$$GET^BMXOBJ("EMAIL","DOMAIN")
 	s file="/home/faxftp/temp"_$J_$TR($H,",","")_".xml"
 	s file1="/home/faxftp/user"_$J_$TR($H,",","")_".xml"
 	o file:"WN"
 	u file
 	w "<?xml version=""1.0"" encoding=""ISO-8859-1"" ?>",!
 	w "<faxuser>",!
 
	I $ZCONVERT(USSW,"U")="N" D 
	. S FIRMNAME=$P(^BP(FIRMA,1),%,2)
 	. W "<user site=""D"_$E(100+FIRMA,2,3)_""">",!
 	. w "<name>",$$ASCIANSI^%UML(FIRMNAME),"</name>",!
 	. W "</user>",!	 
 
 	s faxpr=$$GET^BMXOBJ("FAXSERVER","FaxPr")
 	s faxprddijn=$$GET^BMXOBJ("FAXSERVER","FaxPrDDIJN")
	S PCODE="" F  S PCODE=$O(^PA(FIRMA,100,PCODE)) Q:PCODE=""  D
	. S AD=^(PCODE)
	. ;Q:$P(AD,%,14)'="J"
	. Q:$E(PCODE,1)="s"
	. S AKTIV=$P(AD,%,14),ABTNR=$P(AD,%,5),PNAME=$P(AD,%,1),DW=$P(AD,%,6),PASSW=$P(AD,%,3),PNR=$P(AD,%,2)
	. Q:ABTNR=""
	. S ABTNR(ABTNR)=""
	. S (EMAIL,FAXDW)="" I $L(PNR),$D(^PERS(FIRMA,PNR,0))#2 s EMAIL=$P(^(0),%,13),FAXDW=$P(^(0),%,14)
	. I FAXDW="" S FAXDW=DW
	. u file 
	. w "<user site=""D"_$$ASCIANSI^%UML($E(100+FIRMA,2,3)_$J(ABTNR,2)_$J(PCODE,3))_""">",!
 	. w "<name>",$$ASCIANSI^%UML(PNAME),"</name>",!
 	. w "<tel>","[2]-",+DW,"</tel>",!
 	. w "<fax>","[2]-",faxpr,FAXDW,"</fax>",!
 	. i AKTIV="J" D
 	.. i faxprddijn="J" w "<msnddi>",faxpr,FAXDW,"</msnddi>",!
 	.. e  w "<msnddi>",FAXDW,"</msnddi>",!
 	. i AKTIV'="J" w "<msnddi></msnddi>",!
 	. I $L(EMAIL) w "<email>",EMAIL_"@"_DOMAIN,"</email>",!
 	. w "<password>",$$ASCIANSI^%UML(PASSW),"</password>",!
 	. w "</user>",!
 
	I $ZCONVERT(USSW,"U")="N" S ABTNR="" F  S ABTNR=$O(ABTNR(ABTNR)) Q:ABTNR=""  D
 	. I $D(^PA(FIRMA,2,ABTNR))#2 s ABTBEZ=$P(^(ABTNR),%,1)
 	. E  Q
 	. W "<user site=""D"_$E(100+FIRMA,2,3)_$J(ABTNR,2)_""">",!
 	. w "<name>",$$ASCIANSI^%UML($P(^PA(FIRMA,2,ABTNR),%,1)),"</name>",!
 	. W "</user>",!	 
 
 
	w "</faxuser>",!
 	c file
 	s x=$$JOBWAIT^%HOSTCMD("chmod 777 "_file)
 	s x=$$JOBWAIT^%HOSTCMD("mv "_file_" "_file1)
 	Q
 	
 	
TOV2
 
	s id="" f  s id=$O(^MiniFax.DoksD(id)) q:id=""  d
	. s obj=##class(MiniFax.Doks).%OpenId(id)
	. w id,!
	. i obj.Typ="FE"!(obj.Typ="FEU")!(obj.Typ="SE") D
	.. i obj.Typ="FEU" s obj.Typ="FE",obj.bstatus=5
	.. e  s obj.bstatus=10
	. d obj.%Save()
	. d obj.%Close()
	k obj
	
	q
	
 
upgrch
	s id="" f  s id=$O(^MiniFax.FaxdomainD(id)) q:id=""  d
	. w id,!
	. s obj=##class(MiniFax.Faxdomain).%OpenId(id)
	. s obj.EmailSms=2
	. s obj.EmailMail=2
	. d obj.%Save()
	. d obj.%Close()
	k obj
	q
	
	
upgrcover
	s id="" f  s id=$O(^MiniFax.FaxdomainD(id)) q:id=""  d
	. w id,!
	. s obj=##class(MiniFax.Faxdomain).%OpenId(id)
	. s obj.Coverpage=""
	. d obj.%Save()
	. d obj.%Close()
	k obj
	q
	
upgrvertraulich
	s id="" f  s id=$O(^MiniFax.FaxdomainD(id)) q:id=""  d
	. w id,!
	. s obj=##class(MiniFax.Faxdomain).%OpenId(id)
	. s obj.Vertraulich=2
	. d obj.%Save()
	. d obj.%Close()
	k obj
	q
 
]]></Routine>
<Checksum value="3242725604"/>
</Export>
