BL.Sys.FOP.Common 1 BL.Flow.Docs.Basis,BL.Flow.Basis.DocNew 61788,57960.798558 0 Previous value : "levering_01.01" levdocNotStapled_01.01 levdocStapled_01.01 levdocNotStapled_01.01 DocType voor task-keywords (zie ook BL.Sys.FOP.Common.INC) LEVBON LevBon L LEVBON_PS 16bit, 7 ->32bit]]> 6 1 BONNr:%String,KLNr:%String %Status s xmlp="\\cache02\c$\Temp\LevBon_63205.xml" s sc=##class(BL.Flow.Levering.Doc).RenderAndFileFromXML(xmlp,"\\fop\e$\FOP\LevBon_Voorbeeld_20090116.pdf") w sc,! s xmlp="\\cache02\c$\Temp\LevBon_63205_FR.xml" s sc=##class(BL.Flow.Levering.Doc).RenderAndFileFromXML(xmlp,"\\fop\e$\FOP\LevBon_Voorbeeld_20090116_FR.pdf") w sc,! 1 0) NumCopies=1 Set:($$$ISOK(sc)) sc=Task.AddActionPrint(PrinterName,NumCopies,,) Quit:($$$ISERR(sc)) sc Set sc=##class(BL.Sys.FOP.CommonTasks).RunFopTask(Task,$$$rmBatch,$$$qpvLow) ; $$$rmBatch ; $$$rmSync Quit sc } ClassMethod RenderAndFtpDocXXXxxxOLD(BONNr As %String, FtpServer As %String, DestDir As %String, DestFName As %String, blnShowRembours As %Boolean = 0) As %Status { #define SaveTempFile 1 ;New Task,sc Set Task=..CreateFopTaskOLD("DocRenderAndFtp",,) Set sc=..DocSetRenderDefsOLD(Task.AddDoc(), $LB(BONNr,blnShowRembours,""),..#ADBTemplateNotStapled , "PDF", $LB(), $G(pWithLogo,1)) If $$$SaveTempFile Do . Do ..BuildFileData("TempFTP", .FName,.Dir,.FilePath, BONNr) ; The returned 'Dir' can be local path to FOP; the 'Dir in the FilePath' is the network-converted 'Dir' . Set FtpSrcPath=FilePath . Set:($$$ISOK(sc)) sc=Task.AddActionFile(FName,Dir) Else Do . Set FtpSrcPath="" ; TO DO : indicate that SourceData should be retrieved from the (temp)Stream object If $$$LCase(FtpServer)?1(1"vhisiedownload.vanhoecke.be",1"testftp") Do . Set tmpUserName="Tineke" . Set tmpPassWord="T!neKe" . Set tmpPort="" . Set tmpBinaryFtp="" Set:($$$ISOK(sc)) sc=Task.AddActionFtp(FtpServer,FtpSrcPath,.DestDir,.DestFName, .tmpUserName, .tmpPassWord, .tmpPort, tmpBinaryFtp) Quit:($$$ISERR(sc)) sc Set sc=##class(BL.Sys.FOP.CommonTasks).RunFopTask(Task,$$$rmInLine) ; $$$rmSync Quit sc } /// FileURL : als .local doorgeven /// enkel de FileName doorgeven indien gewenst, anders wordt deze ge-default. /// het volledige pad (server+dir+filename) wordt in URL-vorm teruggegeven ClassMethod RenderAndFileWWWDocXXXxxxOLD(BONNr As %String, ByRef FileURL As %String, blnShowRembours As %Boolean = 0) As %Status { #define SubDir "Tmp\" #define SubDirURL $TR($$$SubDir,"\","/") ; New FName,Dir,FilePath Set FilePath=$G(FileURL) Do ..BuildFileData("FileWWW", .FName,.Dir,.FilePath, $G(BONNr,"TestWV")) Do ..BuildFileData("FileWWWUrl", FName, ,.FileURL) Quit ..RenderAndFileDoc(.BONNr,FilePath,blnShowRembours) } ClassMethod RenderAndPrintDocViaTypeXXxxOLD(BONNr As %String, LevDocType As %String, PrinterName As %String, blnStapling As %Boolean = 1) As %Status { #define ErrorLevDocTypeInvalid(%v) $$$ERROR($$$GeneralError,"LevDocType "_%v_" onbekend of foutief gedefinieerd.") // Get settings Set PrinterName=$G(PrinterName,..#PrinterDFL) ; "DocuColor" Set blnShowRembours=1 Kill arSettings Do rpdSettingsForLevDocType() Quit:('$D(arSettings("RP1"))) $$$ErrorLevDocTypeInvalid(LevDocType) // Create FopTask Set Task=..CreateFopTaskOLD("DocRenderAndPrint",,) Set sc=$$rpdBuildTaskRenderAndPrint("RP1") If $$$aHasSubNodes(arSettings("RP2")) Do . Set:($$$ISOK(sc)) sc=$$rpdBuildTaskRenderAndPrint("RP2") Quit:($$$ISERR(sc)) sc Set NumCopies=1 Set:($$$ISOK(sc)) sc=Task.AddActionPrint(PrinterName,NumCopies,,) Quit:($$$ISERR(sc)) sc // Run FopTask Set sc=##class(BL.Sys.FOP.CommonTasks).RunFopTask(Task,$$$rmBatch,$$$qpvLow+1) ; $$$rmBatch ; $$$rmSync Quit sc rpdBuildTaskRenderAndPrint(Key) Set lbDocDefs=arSettings(Key,"DocDefs") Set lbPPODKeywords=$G(arSettings(Key,"PPODKeywords"),$LB()) Set pWithLogo=$G(arSettings(Key,"BonWithLogo"),1) Set:($L($G(arSettings(Key,"BewijsWithLogo")))) pWithLogo=pWithLogo_$$$xslpDelim_arSettings(Key,"BewijsWithLogo") Set pTraySelect=##class(BL.Sys.FOP.CommonTasks).GetPrinterTray(PrinterName,arSettings(Key,"BonPapierSoort"),"TRAY") Set:($L($G(arSettings(Key,"BewijsPapierSoort")))) pTraySelect=pTraySelect_$$$xslpDelim_##class(BL.Sys.FOP.CommonTasks).GetPrinterTray(PrinterName,arSettings(Key,"BewijsPapierSoort"),"TRAY") ; Stapling settings Set StaplingMode=$G(arSettings(0,"StaplingMode")) Set pStaplingConfig=##class(BL.Sys.FOP.CommonTasks).GetStaplingConfig(PrinterName,.StaplingMode,"2") ; Add Doc If $G(arSettings(Key,"RenderDoc"))="LevBewijs" Do . Set sc=##class(BL.Flow.TransportLijst.Doc).DocSetRenderDefsLevBewijs(Task.AddDoc(), lbDocDefs , "PS", lbPPODKeywords, pWithLogo, pTraySelect, pStaplingConfig, (StaplingMode="")) Else Do . Set Template=$S(StaplingMode="":..#ADBTemplateNotStapled, 1:..#ADBTemplateStapled) ; Set Template=$G(arSettings(Key,"Template")) . Set pPosLevBewijs=$LG(lbDocDefs,3) . Set sc=..DocSetRenderDefsOLD(Task.AddDoc(), lbDocDefs, Template, "PS", lbPPODKeywords, pWithLogo, pTraySelect, pStaplingConfig, pPosLevBewijs) . ;Set sc=..DocSetRenderDefs(Task.AddDoc(), ..lbDocs, ..ADBTemplate, ..TransformType, ..lbPPODKeywords) Quit sc rpdSettingsForLevDocType() Set arSettings(0,"StaplingMode")=(''blnStapling) ; ... Quit } */ ]]> FileURL : als .local doorgeven enkel de FileName doorgeven indien gewenst, anders wordt deze ge-default. het volledige pad (server+dir+filename) wordt in URL-vorm teruggegeven 1 %Status 1 %Status 1 BONNr:%String,MailTo:%String,Subject:%String,Body:%String,FileName:%String,blnShowRembours:%Boolean=0,MailFrom:%String %Status Oproepen via : s sc=##class(BL.Flow.Levering.Doc).RenderAndFtpDoc(171251,"vhisiedownload.vanhoecke.be",,"TestWimV002.pdf") w sc,! 1 BONNr:%String,FtpServer:%String,DestDir:%String,DestFName:%String,blnShowRembours:%Boolean=0 %Status Oproepen via : s sc=##class(BL.Flow.Levering.Doc).RenderAndPrintDoc(330313,,) w sc,! s sc=##class(BL.Flow.Levering.Doc).RenderAndPrintDoc(305229,0,"BrotherBoekH",1) w sc,! 1 BONNr:%String,blnShowRembours:%Boolean=1,PrinterName:%String,pWithLogo:%Boolean=1,pTraySelect:%String="" %Status Leveringsdocument printen, waarbij de levbon centraal staat. LevDocType bepaalt de samenstelling en de specificaties van het document: levbon, bewijs, kopie (geel), ... . blnStapling enkel mogelijk indien de printer dit ondersteunt (uiteraard!) Oproepen via : s sc=##class(BL.Flow.Levering.Doc).RenderAndPrintDocViaType(305229,"BonWit\BonGeel\Pakbon","KYOCERAFS4000") w sc,! 1 BONNr:%String,LevDocType:%String,PrinterName:%String,blnStapling:%Boolean=1 %Status Genereert de XML voor de leveringsbon in lbDocs en geeft deze terug via DataStream. DataStream als .local doorgeven. 1 %Status initiator ;Set sc=pxDoc.XMLExportToStream(.DataStream,"DOCS","literal,indent") Quit sc ]]> Debug Tool Genereert de XML voor de leveringsbon in lbDocs en bewaart deze in de opgegeven file (path/dir moet reeds bestaan) Oproepen via : s FP="\\Cache02\c$\Temp\LevBon_" s sc=##class(BL.Flow.Levering.Doc).FopXMLToFile(FP_$P($H,",",2)_".xml", $LB( )) w sc,! s sc=##class(BL.Flow.Levering.Doc).FopXMLToFile(FP_$P($H,",",2)_".xml", $LB(371901)) w sc,! !!! Op Cache02 !!! 1 FileName:%String,lbDocs:%List %Status
]]>
1 BL.Flow.Proxy.pxFlowDocs
1 lbLeveringen:%List,KLNr:%String %Status Geeft de standaard Keywords terug op basis van de opgegeven AnalyseRoutine. Deze method kan in de afgeleide klasse overschreven worden voor specifieke uitbreidingen. DocType:%String,AnalyseRoutine:%String %String DocRef kan ofwel BONNr zijn, ofwel lbDocs (list) Target: File, FileWWW, FileWWWUrl, TempFTP, Mail, TempMail Berekent de checksum voor leveringbons, facturen en proforma facturen BONNr:%Integer,FacSoort:%String="",KLNr:%String="" %Integer berekent een controlegetal van een factuur FAKNr:%Integer,BONNr:%Integer %Integer berekent een controlegetal van een proforma factuur FAKNr:%Integer,BONNr:%Integer %Integer Cheksum van de hoofding van een leverbon PreviousCheckSum:%Integer,BONNr:%Integer,xHeader:%String,xAdres:%String 1 %Integer vervolg van de berekening van de checksum: vertrekt van de cheksum van de header iedere detaillijn vertrekt van de checksum van de vorige lijn PreviousCheckSum:%Integer,BONNr:%Integer,LNr:%Integer,XLN:%String 1 %Integer PreviousCheckSum:%Integer,Tekst:%String 1 %Integer 1 BeginDat!'Dat Do ..Set FactuurNr="" For Set FactuurNr=$O(^KFA1("F",KlantNr,Dat,FactuurNr)) Quit:FactuurNr="" Do ...Set ^HULP($J,"Fac",-Dat,FactuurNr)=KlantNr ...Set aantalFac=aantalFac+1 Set Dat="" For Set Dat=$O(^HULP($J,"Fac",Dat)) Quit:Dat="" Do .Set FactuurNr="" For Set FactuurNr=$O(^HULP($J,"Fac",Dat,FactuurNr)) Q:FactuurNr="" Do ..Set KlantNr=^HULP($J,"Fac",Dat,FactuurNr) ..Set LevNr="U" For Set LevNr=$O(^KFA("F",FactuurNr,LevNr)) Q:$E(LevNr)'="U" Do ...Set BonNr=$E(LevNr,2,99) ...If '$D(^KU1(BonNr)) Write $zd(Dat,4)," Factuur: ",FactuurNr," Bon ",BonNr," bestaat niet",! Quit ...Set xKFAKlant=^KFA("F",FactuurNr,LevNr,1) ...Set KlantNrFKA=$Piece(xKFAKlant,"\",6) ...Set DatKFA=$Piece(xKFAKlant,"\",2) ...Set KlantNrKUL=$Piece(^KU1(BonNr,"F"),"\") ...If KlantNrKUL'=KlantNrFKA Write $zd(Dat,4)," Factuur: ",FactuurNr," Bon ",BonNr," is overschreven",! Quit ...; een bonnr kan worden herbruikt => dat zie je aan het klantnummer ...Set FacSoort=$$NODE^FLOWBON(BonNr) ...Set xKULKlant=$G(^KUL(KlantNr,FacSoort,BonNr,1)) ...Set DatKUL=$Piece(xKULKlant,"\",2) ...If DatKUL'=DatKFA w $zd(Dat,4)," Factuur: ",FactuurNr," Bon ",BonNr," is overschreven => datum is verschillend",! Quit ...; een bonnr kan worden herbruikt => dat zie je ook aan de datum ...Set Ref=..%New() ...Set CheckSumFactuur=Ref.CheckSumFactuur(FactuurNr,BonNr) ...Set CheckSumLevNr=Ref.CheckSumBon(BonNr) ...Set aantalLevBon=aantalLevBon+1 ...If CheckSumFactuur=CheckSumLevNr d ....s aantalOK=aantalOK+1 ...Else Do ....Set aantalFout=aantalFout+1 ....Write $zd(Dat,4)," ",FactuurNr," ",BonNr," ",CheckSumFactuur," ",CheckSumLevNr,! ;r test Write "Aantal facturen: ",aantalFac,! Write "Aantal leveringsbonnen: ",aantalLevBon,! Write "Fout: ",aantalFout,! Write "OK: ",aantalOK,! ]]> 1