IDS-Dieselpreise, etc.

This commit is contained in:
2025-08-26 10:38:21 +02:00
parent 868a2abec3
commit 5937ba8067
6 changed files with 492 additions and 637 deletions

View File

@@ -301,11 +301,11 @@ Public Class cIDS
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
str &= "" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblIDSTransactionsNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode " & IIf(PARAM <> "" AndAlso VALUE <> "", " AND " & PARAM & "=" & VALUE, "") & " AND isnull(charged,0) = 0 ")
Return (" UPDATE tblIDSTransactionsNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode " & IIf(PARAM <> "" AndAlso VALUE <> "", " AND " & PARAM & "=" & VALUE, "") & " AND isnull(charged,0) = 0 ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
@@ -321,7 +321,7 @@ Public Class cIDS
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
str &= "" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
@@ -457,10 +457,10 @@ Public Class cIDS
'Else
.TransactionVolume = isleernothing((currentRow(8)))
.AmminclVAT = isleernothing((currentRow(9)))
.TotalNetAmount = isleernothing((currentRow(10)))
.VATAmount = isleernothing((currentRow(11)))
.avpriceexclVAT = IIf(avprive <> "" AndAlso IsNumeric(avprive), avprive, 0)
.AmminclVAT = isleernothing((currentRow(9)))
.TotalNetAmount = isleernothing((currentRow(10)))
.VATAmount = isleernothing((currentRow(11)))
.avpriceexclVAT = IIf(avprive <> "" AndAlso IsNumeric(avprive), avprive, 0)
' End If
@@ -544,31 +544,31 @@ Public Class cIDS
Using cmd As New SqlCommand("SELECT
tblIDSTransactionsNew.KdNrVERAG as Kundennummer,
ISNULL(tblIDSTransactionsNew.[OBONumber],ISNULL(tblIDSTransactionsNew.[VRNumber], tblIDSTransactionsNew.[Paymentsummarynumber])) AS Rechnungsnummer,
tblIDSTransactionsNew.[YearMonthDay] AS Rechnungsdatum,
SUM(tblIDSTransactionsNew.[VATAmount]) AS Steuerbetrag
ISNULL(tblIDSTransactionsNew.OBONumber],ISNULL(tblIDSTransactionsNew.VRNumber], tblIDSTransactionsNew.Paymentsummarynumber])) AS Rechnungsnummer,
tblIDSTransactionsNew.YearMonthDay] AS Rechnungsdatum,
SUM(tblIDSTransactionsNew.VATAmount]) AS Steuerbetrag
FROM
tblIDSTransactionsNew
INNER JOIN
tbl_IDS_Länder
ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode
ON tblIDSTransactionsNew.OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode
WHERE
tblIDSTransactionsNew.[YearMonthDay] BETWEEN @von AND @bis
tblIDSTransactionsNew.YearMonthDay] BETWEEN @von AND @bis
AND tblIDSTransactionsNew.KdNrVERAG = @AdressenNr
AND tbl_IDS_Länder.[Lieferland_ISO2] = @LandKZ
AND tblIDSTransactionsNew.[VATAmount] <> 0
AND tbl_IDS_Länder.Lieferland_ISO2] = @LandKZ
AND tblIDSTransactionsNew.VATAmount] <> 0
" & IIf(Archiv, " ", " AND isnull(UStVAn_ID,0) = 0 ") & "
GROUP BY
tblIDSTransactionsNew.KdNrVERAG,
tblIDSTransactionsNew.[YearMonthDay],
ISNULL(tblIDSTransactionsNew.[OBONumber],
ISNULL(tblIDSTransactionsNew.[VRNumber], tblIDSTransactionsNew.[Paymentsummarynumber]))
tblIDSTransactionsNew.YearMonthDay],
ISNULL(tblIDSTransactionsNew.OBONumber],
ISNULL(tblIDSTransactionsNew.VRNumber], tblIDSTransactionsNew.Paymentsummarynumber]))
ORDER BY
tblIDSTransactionsNew.KdNrVERAG,
tblIDSTransactionsNew.[YearMonthDay],
ISNULL(tblIDSTransactionsNew.[OBONumber],
ISNULL(tblIDSTransactionsNew.[VRNumber], tblIDSTransactionsNew.[Paymentsummarynumber]));", conn)
tblIDSTransactionsNew.YearMonthDay],
ISNULL(tblIDSTransactionsNew.OBONumber],
ISNULL(tblIDSTransactionsNew.VRNumber], tblIDSTransactionsNew.Paymentsummarynumber]));", conn)
cmd.Parameters.AddWithValue("@LandKZ", LandKZ)
cmd.Parameters.AddWithValue("@von", von)
@@ -607,11 +607,11 @@ Public Class cIDS
Return SQL.doSQLVarList("update tblIDSTransactionsNew set UStVAn_ID = @UStVAn_ID
FROM tblIDSTransactionsNew
INNER JOIN tbl_IDS_Länder
ON tblIDSTransactionsNew.[OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode
ON tblIDSTransactionsNew.OutletCountryCode] = tbl_IDS_Länder.OutletCountryCode
WHERE
tblIDSTransactionsNew.[YearMonthDay] = @reDat AND ISNULL(tblIDSTransactionsNew.[OBONumber], ISNULL(tblIDSTransactionsNew.[VRNumber], tblIDSTransactionsNew.[Paymentsummarynumber])) = @reNr
tblIDSTransactionsNew.YearMonthDay] = @reDat AND ISNULL(tblIDSTransactionsNew.OBONumber], ISNULL(tblIDSTransactionsNew.VRNumber], tblIDSTransactionsNew.Paymentsummarynumber])) = @reNr
AND tblIDSTransactionsNew.KdNrVERAG = @ids_kdNr
AND tbl_IDS_Länder.[Lieferland_ISO2] = @country", "FMZOLL",, list)
AND tbl_IDS_Länder.Lieferland_ISO2] = @country", "FMZOLL",, list)
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
@@ -624,7 +624,7 @@ Public Class cIDS
Shared apiSettingsloaded As Boolean = False
Shared SQL As New VERAG_PROG_ALLGEMEIN.SQL
Shared Function GET_PARAM_ByName(tcParam_name, TESTSYSTEM) As String
Return SQL.getValueTxtBySql("SELECT TOP 1 [Param_value] FROM [tblPartnersystem_Paramter] WHERE Param_system='IDS' AND [Param_name]='" & tcParam_name & "' AND Param_testsystem = " & IIf(TESTSYSTEM, 1, 0), , , SQL.GetNewOpenConnectionFMZOLL_SYSTEM(False))
Return SQL.getValueTxtBySql("SELECT TOP 1 Param_value] FROM tblPartnersystem_Paramter] WHERE Param_system='IDS' AND Param_name]='" & tcParam_name & "' AND Param_testsystem = " & IIf(TESTSYSTEM, 1, 0), , , SQL.GetNewOpenConnectionFMZOLL_SYSTEM(False))
End Function
Shared Function getFTPConenction(ByRef API_String As String, ByRef API As DataTable, ByRef program As String) As Boolean
@@ -770,11 +770,11 @@ Public Class cIDSInvoice
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
str &= "" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblIDSInvoicesNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber")
Return (" UPDATE tblIDSInvoicesNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
@@ -788,7 +788,7 @@ Public Class cIDSInvoice
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
str &= "" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
@@ -1005,11 +1005,11 @@ Public Class cIDSInvoiceSplittedByCountry
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
str &= "" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblIDSInvoicesNewSplittedByCountry] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber AND Country=@Country")
Return (" UPDATE tblIDSInvoicesNewSplittedByCountry] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND CustomerCode=@CustomerCode AND Invoicenumber=@Invoicenumber AND Country=@Country")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
@@ -1023,7 +1023,7 @@ Public Class cIDSInvoiceSplittedByCountry
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
str &= "" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
@@ -1039,6 +1039,158 @@ Public Class cIDSInvoiceSplittedByCountry
End Class
Public Class cIDSDieselpreisRW
Property ID As Integer
Property OutletCountryCode As Object = Nothing
Property OutletCode As Object = Nothing
Property CustomerCode As Object = Nothing
Property ProductTypeCode As Object = Nothing
Property Rechenwert As Object = Nothing
Property Kz As Object = Nothing
Property Zeitstempel As Object = Nothing
Property Sachbearbeiter As Object = Nothing
Property KategorieNr As Object = Nothing
Public hasEntry = False
Dim SQL As New SQL
Sub New()
End Sub
Sub New(ID)
Me.ID = ID
LOADID()
End Sub
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ID", ID,, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OutletCountryCode", OutletCountryCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("OutletCode", OutletCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("CustomerCode", CustomerCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("ProductTypeCode", ProductTypeCode))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Rechenwert", Rechenwert))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Kz", Kz))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Zeitstempel", Zeitstempel))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("Sachbearbeiter", Sachbearbeiter))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("KategorieNr", KategorieNr))
Return list
End Function
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tbl_IDS_Rechenwerte WHERE ID=@ID) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
Public Sub LOADID()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tbl_IDS_Rechenwerte WHERE ID=@ID ", conn)
cmd.Parameters.AddWithValue("@ID", ID)
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
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tbl_IDS_Rechenwerte WHERE ID=@ID", conn)
cmd.Parameters.AddWithValue("@ID", ID)
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
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Function getUpdateCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "" & i.Text & " = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE tbl_IDS_Rechenwerte SET " & str & " WHERE ID=@ID")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
Public Function getInsertCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "" & i.Text & ","
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tbl_IDS_Rechenwerte (" & str & ") VALUES(" & values & ") ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
End Class