Beschreibung
Die Funktion wird aus der Volanzeige von einem Daxe- oder Haxe-Datensatz aus aufgerufen. Die Verknüpfungsnummer in Kategorie 4180 wird kopiert und aus dem verknüpften Datensatz die PND-IDN aus Kategorie 3040 kopiert. Je nach Notation wird in den Daxe-Datensätzen die PND-IDN in Kategorie 3030 (Notation B.01), 3000 (B.02) oder 3020 (B.03) kopiert. In Haxe-Datensätzen wird die PND-IDN in Kategorie 3000 eingefügt.
Historie
Datum |
geändert von |
Beschreibung |
---|---|---|
2011-07-05 |
Althaus |
neu erstellt |
Code
dnb_dea.js
function Exilbrief() { var str0500; var str4180; var str4180IDN; var str4180NOTAT; var str3040; var str3040IDN; var intIndex; if (application.activeWindow.getVariable("scr") != "8A") { __dnbFehler("Exilbrief","Die Funktion kann nur aus der Vollanzeige aufgerufen werden!"); return false; } application.activeWindow.command("k",false); application.activeWindow.title.startOfBuffer(false); strMatCode = application.activeWindow.title.findTag("0500", 0, false, true, false); //application.messageBox("",strMatCode,""); if ((strMatCode == "Daxe") || (strMatCode == "Haxe")) { application.activeWindow.title.startOfBuffer(false); str4180 = application.activeWindow.title.findTag("4180", 0, false, true, false) if (!str4180) { application.activeWindow.simulateIBWKey("FE"); __dnbFehler("Exilbrief","Feld 4180 ist nicht vorhanden!"); return false; } else { intIndex = str4180.indexOf("#"); str4180NOTAT = str4180.substring(intIndex+1,intIndex+5); //application.messageBox("",str4180NOTAT,""); intIndex = str4180.indexOf("!"); str4180IDN = str4180.substring(intIndex+1,str4180.indexOf("!",intIndex+1)); //application.messageBox("",str4180IDN,""); } if (strMatCode == "Daxe") { if ((str4180NOTAT != "B.01") && (str4180NOTAT != "B.02") && (str4180NOTAT != "B.03")) { application.activeWindow.simulateIBWKey("FE"); __dnbFehler("Exilbrief","Notation in Feld 4180 ist nicht B.01 oder B.02 oder B.03 !"); return false; } } application.activeWindow.command("f idn " + str4180IDN,false); application.activeWindow.command("k",false); application.activeWindow.title.startOfBuffer(false); str3040 = application.activeWindow.title.findTag("3040", 0, false, true, false); application.activeWindow.simulateIBWKey("FE"); application.activeWindow.closeWindow(); if (!str3040) { application.activeWindow.simulateIBWKey("FE"); __dnbFehler("Exilbrief","Im verknüpften Satz ist Feld 3040 nicht vorhanden!"); return false; } intIndex = str3040.indexOf("!"); str3040IDN = str3040.substring(intIndex+1,str3040.indexOf("!",intIndex+1)); //application.messageBox("",str3040IDN,""); __geheZuKat("3030","",true); if (strMatCode == "Daxe") { switch (str4180NOTAT) { case "B.01": __geheZuKat("3030","",true); //Adressat application.activeWindow.title.insertText("\n3030 !" + str3040IDN + "!"); break; case "B.02": __geheZuKat("3000","",true); // Verfasser application.activeWindow.title.insertText("\n3000 !" + str3040IDN + "!"); break; case "B.03": __geheZuKat("3020","",true); // Korrespondezpartner (Default) application.activeWindow.title.insertText("\n3020 !" + str3040IDN + "!"); break; } } else { if (strMatCode == "Haxe") { __geheZuKat("3000","",true); application.activeWindow.title.insertText("\n3000 !" + str3040IDN + "!"); } } } else { application.activeWindow.simulateIBWKey("FE"); __dnbFehler("Exilbrief","Keine Satzart Daxe oder Haxe!"); } }
VB-Script
'******************************************************************** Sub ExilBrief() '******************************************************************** Set WinA = Application.ActiveWindow if not WinA.Variable("scr") = "8A" then Fehler "Es liegt kein Datensatz in Vollanzeige vor!" exit sub end if WinIdA = WinA.WindowID CopyTitle = WinA.CopyTitle on error resume next K0500 = mid(CopyTitle, instr(CopyTitle,"0500")) K0500 = left(K0500, instr(K0500,vbcr)) Satzart = mid(K0500,6,4) if (Satzart = "Daxe") or (Satzart = "Haxe") then Pos = instr(CopyTitle,"4180") if Pos = 0 then Fehler "Feld 4180 ist nicht vorhanden!" exit sub end if K4180 = mid(CopyTitle, Pos) K4180 = left(K4180, instr(K4180,"#!")+11) K4180_IDN = mid(K4180, instr(K4180,"!")+1,9) K4180_Not = mid(K4180,7,4) if Satzart = "Daxe" then if (K4180_Not <> "B.01" and K4180_Not <> "B.02" and K4180_Not <> "B.03") then Fehler "Notation in Feld 4180 ist nicht " & chr(34) &_ "B.01" & chr(34) & " oder " & chr(34) &_ "B.02" & chr(34) & " oder " & chr(34) &_ "B.03" & chr(34) & "!" exit sub end if end if WinA.Command "f idn " & K4180_IDN, true Set WinB = Application.ActiveWindow CopyTitle = WinB.CopyTitle Pos = instr(CopyTitle,"3040") if Pos = 0 then Fehler "Im verknüpften Datensatz ist Feld 3040 nicht vorhanden!" WinB.CloseWindow exit sub end if K3040 = mid(CopyTitle, Pos) K3040 = left(K3040, instr(K3040,"!")+11) K3040_IDN = mid(K3040, instr(K3040,"!")+1,9) WinB.CloseWindow Application.ActivateWindow(WinIdA) WinA.Command "k" if Satzart = "Daxe" then if K4180_Not = "B.01" then 'Adressat WinA.Title.InsertText "3030 !" & K3040_IDN & "!" & vbcr elseif K4180_Not = "B.02" then 'Verfasser WinA.Title.InsertText "3000 !" & K3040_IDN & "!" & vbcr elseif K4180_Not = "B.03" then 'Korrespondenzpartner (Default) WinA.Title.InsertText "3020 !" & K3040_IDN & "!" & vbcr end if elseif Satzart = "Haxe" then WinA.Title.InsertText "3000 !" & K3040_IDN & "!" & vbcr end if WinA.Title.CharLeft else Fehler ("Keine Satzart " & chr(34) & "Daxe" & chr(34) &_ " oder " & chr(34) & "Haxe" & chr(34)) end if End Sub
Überblick
Inhalte