sdl änderungen

This commit is contained in:
2024-09-19 14:02:39 +02:00
parent 1c3bfacdc6
commit b47be8cbc6
7 changed files with 224 additions and 41 deletions

View File

@@ -1,5 +1,6 @@
Imports System.Data.SqlClient
Imports System.EnterpriseServices
Imports System.IO
Imports System.Net
Imports System.Reflection
Imports DocumentFormat.OpenXml.InkML
@@ -864,7 +865,7 @@ Public Class cMSEAPI
Return CDate(o)
End If
End Function
Public Function getInvoices(jwt As String, dt As DataTable, startDate As Date, end_date As Date) As String
Public Function getInvoices(jwt As String, dt As DataTable, startDate As Date, end_date As Date, uploadToDs As Boolean) As String
Try
Dim returnText As String = ""
Dim failureText As String = ""
@@ -1005,8 +1006,6 @@ Public Class cMSEAPI
inv.SAVE()
End If
j = j + 1
End While
@@ -1017,18 +1016,24 @@ Public Class cMSEAPI
'\\datenarchiv\Datenarchiv\MDM_SCHNITTSTELLEN\ECHTSYSTEM\Nachrichtendaten_ZIEL\MSE
If r("url") <> "" AndAlso r("name") <> "" AndAlso r("name").contains("VAT") Then 'only VAT-Invoices
VERAG_PROG_ALLGEMEIN.cFormularManager.getPDFViaSpirePDF_FromURLStream(r("url"), r("name"), PDFRECHNUNGENPFAD, False)
Dim inv As New cMSEInvoices(r("name"), r("inv.invoice_id"))
If Not inv.imported Then 'verhindert unnötige Downloads
Dim filepath = VERAG_PROG_ALLGEMEIN.cFormularManager.getPDFViaSpirePDF_FromURLStream(r("url"), r("name"), PDFRECHNUNGENPFAD, False)
If filepath <> "" AndAlso uploadToDs Then
Dim DS As New VERAG_PROG_ALLGEMEIN.cDATENSERVER("MDM", "MDM_DATEN", "MSE", Now.Year, Now.ToString("yyyyMMdd"), r("name"))
DS.uploadDataToDATENSERVER(filepath & "\" & r("name"),,,,,, True)
SQL.doSQL("Update [tblMSEInvoices] SET [daId]='" & DS.da_id & "', imported = 1 where [name] = '" & r("name") & "'", "FMZOLL")
End If
End If
End If
Next
dt = dt.DefaultView.ToTable()
End If
Catch ex As WebException
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
@@ -1356,6 +1361,8 @@ Public Class cMSEInvoices
Property invoice_date As Object = Nothing
Property customer_number As Object = Nothing
Property country As Object = Nothing
Property imported As Boolean = False
Property daId As Object = Nothing
Public hasEntry = False
@@ -1380,6 +1387,8 @@ Public Class cMSEInvoices
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("invoice_date", invoice_date))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("customer_number", customer_number))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("country", country))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("imported", imported))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("daId", daId))
Return list
End Function