From 7bb33a0833b2f5ba21bb43138ce358ce44604cbc Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Mon, 17 Aug 2026 14:50:29 +0200 Subject: [PATCH] plose, etc. --- MDM_Worker/cPLOSE_Inv_Data.vb | 43 ++++++++++ UID/ADMIN.vbproj | 4 + UID/usrctlProcedures.Designer.vb | 12 +++ UID/usrctlProcedures.resx | 6 ++ UID/usrctlProcedures.vb | 82 +++++++++++++++++++ initATLASAufschubkonten/cWorker_NCTS.vb | 4 +- initATLASAufschubkonten/cWorker_Verwahrung.vb | 2 +- 7 files changed, 149 insertions(+), 4 deletions(-) diff --git a/MDM_Worker/cPLOSE_Inv_Data.vb b/MDM_Worker/cPLOSE_Inv_Data.vb index 7a345cd..cc612f9 100644 --- a/MDM_Worker/cPLOSE_Inv_Data.vb +++ b/MDM_Worker/cPLOSE_Inv_Data.vb @@ -44,6 +44,17 @@ Public Class cPLOSE_Inv_Data Me.plInv_Id = plInv_Id LOAD() End Sub + + Sub New(plInv_Dateiname, plInv_PLOSEKundennummer, plInv_SupplierRechnungsNr, plInv_SupplierRechnungsDatum) + + Me.plInv_Dateiname = plInv_Dateiname + Me.plInv_PLOSEKundennummer = plInv_PLOSEKundennummer + Me.plInv_SupplierRechnungsNr = plInv_SupplierRechnungsNr + Me.plInv_SupplierRechnungsDatum = plInv_SupplierRechnungsDatum + LOADINVOICESWITHOUTPDF() + + + End Sub Function getParameterList(Optional withPrimaryKey As Boolean = True) As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) @@ -143,6 +154,38 @@ Public Class cPLOSE_Inv_Data End Sub + Public Sub LOADINVOICESWITHOUTPDF() + Try + hasEntry = False + Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL() + Using cmd As New SqlCommand("SELECT * FROM tblPLOSE_Inv_Data WHERE plInv_PLOSEKundennummer=@plInv_PLOSEKundennummer AND plInv_SupplierRechnungsNr=@plInv_SupplierRechnungsNr AND plInv_SupplierRechnungsDatum=@plInv_SupplierRechnungsDatum AND plInv_Datensatztyp = 'PDF' and plInv_PdfFileName is null ", conn) + 'cmd.Parameters.AddWithValue("@plInv_Dateiname", plInv_Dateiname) + cmd.Parameters.AddWithValue("@plInv_PLOSEKundennummer", plInv_PLOSEKundennummer) + cmd.Parameters.AddWithValue("@plInv_SupplierRechnungsNr", plInv_SupplierRechnungsNr) + cmd.Parameters.AddWithValue("@plInv_SupplierRechnungsDatum", plInv_SupplierRechnungsDatum) + Dim dr = cmd.ExecuteReader() + If dr.Read Then + For Each li In getParameterList() + Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable) + + If dr.Item(li.Text) Is DBNull.Value Then + propInfo.SetValue(Me, Nothing) + Else + propInfo.SetValue(Me, dr.Item(li.Text)) + End If + + Next + hasEntry = True + End If + dr.Close() + End Using + End Using + Catch ex As Exception + MsgBox("Fehler in der Funktion '" & System.Reflection.MethodInfo.GetCurrentMethod.Name & "'" & vbNewLine & vbNewLine & ex.Message & vbNewLine & vbNewLine & ex.StackTrace) + End Try + End Sub + + Public Function getUpdateCmd() As String Try diff --git a/UID/ADMIN.vbproj b/UID/ADMIN.vbproj index 518199c..9367466 100644 --- a/UID/ADMIN.vbproj +++ b/UID/ADMIN.vbproj @@ -1158,6 +1158,10 @@ {50e8e49b-4fd9-4dd4-b159-bdc2b7d0e94f} DAKOSY_Worker_lib + + {2E4DBC09-E57B-4AC5-8554-6117D71F993B} + MDM_Worker_lib + {5b947a66-009a-4bb6-b925-f84a01045095} TELOTEC_Worker_lib diff --git a/UID/usrctlProcedures.Designer.vb b/UID/usrctlProcedures.Designer.vb index c484e84..b604d2f 100644 --- a/UID/usrctlProcedures.Designer.vb +++ b/UID/usrctlProcedures.Designer.vb @@ -182,6 +182,7 @@ Partial Class usrctlProcedures Me.Button57 = New System.Windows.Forms.Button() Me.Button58 = New System.Windows.Forms.Button() Me.Button59 = New System.Windows.Forms.Button() + Me.Button60 = New System.Windows.Forms.Button() Me.tbTRStat.SuspendLayout() Me.TabPage3.SuspendLayout() Me.TabPage1.SuspendLayout() @@ -824,6 +825,7 @@ Partial Class usrctlProcedures ' 'TabPage6 ' + Me.TabPage6.Controls.Add(Me.Button60) Me.TabPage6.Controls.Add(Me.Label23) Me.TabPage6.Controls.Add(Me.Button54) Me.TabPage6.Controls.Add(Me.Label19) @@ -1728,6 +1730,15 @@ Partial Class usrctlProcedures Me.Button59.Text = "Firmenlogo in DB" Me.Button59.UseVisualStyleBackColor = True ' + 'Button60 + ' + Me.Button60.Location = New System.Drawing.Point(336, 63) + Me.Button60.Name = "Button60" + Me.Button60.Size = New System.Drawing.Size(106, 49) + Me.Button60.TabIndex = 74 + Me.Button60.Text = "Plose PDF-Zuweisung" + Me.Button60.UseVisualStyleBackColor = True + ' 'usrctlProcedures ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -1977,4 +1988,5 @@ Partial Class usrctlProcedures Friend WithEvents Button57 As Button Friend WithEvents Button58 As Button Friend WithEvents Button59 As Button + Friend WithEvents Button60 As Button End Class diff --git a/UID/usrctlProcedures.resx b/UID/usrctlProcedures.resx index 508fc32..c9977e7 100644 --- a/UID/usrctlProcedures.resx +++ b/UID/usrctlProcedures.resx @@ -123,4 +123,10 @@ True + + True + + + True + \ No newline at end of file diff --git a/UID/usrctlProcedures.vb b/UID/usrctlProcedures.vb index dca925f..9e72728 100644 --- a/UID/usrctlProcedures.vb +++ b/UID/usrctlProcedures.vb @@ -16,6 +16,7 @@ Imports DAKOSY_Worker Imports DAKOSY_Worker.FreierVerkehrAktVeredelUmwandlung_004 Imports GrapeCity Imports itextsharp.text.pdf +Imports MDM_Worker Imports Microsoft.Office.Interop Imports Newtonsoft.Json.Linq Imports PdfSharp.Drawing @@ -5044,6 +5045,79 @@ OPTION (MAXRECURSION 1000);", "AVISO") ' Return Nothing End Function + Private Sub Button60_Click(sender As Object, e As EventArgs) Handles Button60.Click + + Dim cnt = 0 + + Dim sql As New VERAG_PROG_ALLGEMEIN.SQL + Dim kdnr_tmp = "" + Try + + VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cbxMDM_Testsystem.Checked + + Dim fd As New OpenFileDialog + If fd.ShowDialog = DialogResult.OK Then + If fd.FileName.ToLower.EndsWith(".csv") Then + + Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(fd.FileName, Encoding.Default) + MyReader.TextFieldType = FileIO.FieldType.Delimited + MyReader.SetDelimiters(";") + Dim currentRow As String() + While Not MyReader.EndOfData + Try + currentRow = MyReader.ReadFields() + + 'If currentRow.Length > 2 Then + + + If currentRow.Length > 2 Then + If Not (currentRow(0).Trim() = "PloseCode") Then + If currentRow.Length > 15 Then + + + If isleernothing(currentRow(0)) IsNot Nothing AndAlso IsNumeric(currentRow(0)) AndAlso + isleernothing(currentRow(7)) IsNot Nothing AndAlso IsDate(currentRow(7)) AndAlso + isleernothing(currentRow(8)) IsNot Nothing AndAlso (currentRow(8) <> "") AndAlso + isleernothing(currentRow(14)) IsNot Nothing AndAlso (currentRow(14) <> "") Then + + Dim plInv_SupplierRechnungsDatum = sql.isleernothingDateFormatstring(currentRow(7)) + + + Dim ploseInv As New cPLOSE_Inv_Data(fd.SafeFileName, currentRow(0), currentRow(8), plInv_SupplierRechnungsDatum) + + If ploseInv.hasEntry Then + ploseInv.plInv_PdfFileName = currentRow(14) + ploseInv.SAVE() + End If + + End If + + + End If + + End If + + + cnt += 1 + + End If + + + Catch ex As Exception + MsgBox(kdnr_tmp & " " & ex.Message & ex.StackTrace) + End Try + End While + End Using + End If + End If + + Catch ex As Exception + MessageBox.Show("Datei nicht vorhanden.") + Finally + End Try + + End Sub + 'Private Sub Button26_Click(sender As Object, e As EventArgs) ' For Each d In System.IO.Directory.GetDirectories("\\192.168.0.91\Datenarchiv\DAKOSY\ECHTSYSTEM\Nachrichtendaten_Ablage\2019") ' Dim fi As New FileInfo(d) @@ -5065,6 +5139,14 @@ OPTION (MAXRECURSION 1000);", "AVISO") ' ' Next 'End Sub + + Function isleernothingDateFormatstring(o) As Object + If o Is Nothing Then Return o + If o.ToString = "" Then Return Nothing + If IsDate(o) Then Return CDate(o).ToShortDateString + Return Nothing + End Function + End Class diff --git a/initATLASAufschubkonten/cWorker_NCTS.vb b/initATLASAufschubkonten/cWorker_NCTS.vb index fc3c700..31b668c 100644 --- a/initATLASAufschubkonten/cWorker_NCTS.vb +++ b/initATLASAufschubkonten/cWorker_NCTS.vb @@ -4102,8 +4102,6 @@ Public Class cWorker_NCTS 'End If ' NCTS.LOADByBezugsNr(bezugsNr, False) ' Falls schon ein DS mit dieser Bezugsnummer vorhanden ist. - - If readNCTS_Ueberlassungsmeldung009 <> "" And MRN <> "" Then 'BEZUGSNR vorhanden Dim STATUS As DAKOSY_Worker.cDakosy_Statusmeldungen = FORM.getStatusCheckTransID(NCTS.Transaktion.IOReferenz, NCTS.Transaktion.IODatumZeit) STATUS.dySt_BezugsNr = readNCTS_Ueberlassungsmeldung009 @@ -4179,7 +4177,7 @@ Public Class cWorker_NCTS If saveVerwahrung Then 'saveVerwahrungsAusgang(MRN, posErledigung, NCTS, sendMail, testlauf) - cWorker_Verwahrung.saveVerwahrungsAusgang(MRN, posErledigung, "", zp, sendMail, testlauf, STATUS.dySt_id, True, "T1") + cWorker_Verwahrung.saveVerwahrungsAusgang(MRN, posErledigung, "", zp, sendMail, testlauf, -1, True, "T1") End If diff --git a/initATLASAufschubkonten/cWorker_Verwahrung.vb b/initATLASAufschubkonten/cWorker_Verwahrung.vb index e1d1047..d5ddc6f 100644 --- a/initATLASAufschubkonten/cWorker_Verwahrung.vb +++ b/initATLASAufschubkonten/cWorker_Verwahrung.vb @@ -895,7 +895,7 @@ Anzeige: Dim gs_row As Array = Nothing - gs_row = dtGesamtsicherheit.Select("gs_posSubNr = " & SUMA_POSNr & " AND isnull(gsp_MRNNr,'') <> ''") + gs_row = dtGesamtsicherheit.Select("gs_posSubNr = " & SUMA_POSNr & " AND isnull(gsp_MRNNr,'') = ''") If gs_row.Length = 0 Then Continue For