Kundendatenblatt, ustva, IDS, UTA, MSE

This commit is contained in:
2024-12-17 11:18:54 +01:00
parent af3c0ab285
commit bdf6272bbb
15 changed files with 900 additions and 185 deletions

View File

@@ -114,7 +114,7 @@ Public Class cIDS
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSTransactionsNew WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode) " &
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblIDSTransactionsNew WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode and isnull(charged,0) = 0) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
@@ -155,7 +155,7 @@ Public Class cIDS
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactionsNew WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode ", conn)
Using cmd As New SqlCommand("SELECT * FROM tblIDSTransactionsNew WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode", conn)
cmd.Parameters.AddWithValue("@YearMonthDay", YearMonthDay)
cmd.Parameters.AddWithValue("@Paymentsummarynumber", Paymentsummarynumber)
cmd.Parameters.AddWithValue("@CustomerCode", CustomerCode)
@@ -196,7 +196,7 @@ Public Class cIDS
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 ")
Return (" UPDATE [tblIDSTransactionsNew] SET " & str & " WHERE YearMonthDay=@YearMonthDay AND Paymentsummarynumber=@Paymentsummarynumber AND CustomerCode=@CustomerCode AND OutletCountryCode=@OutletCountryCode AND OutletCode=@OutletCode AND ProductTypeCode=@ProductTypeCode AND isnull(charged,0) = 0 ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
@@ -349,8 +349,8 @@ Public Class cIDS
AND tblIDSTransactionsNew.KdNrVERAG = @AdressenNr
AND tbl_IDS_Länder.[Lieferland_ISO2] = @LandKZ
AND tblIDSTransactionsNew.[VATAmount] <> 0
AND UStVAn_ID is null
GROUP BY
AND isnull(UStVAn_ID,0) = " & IIf(Archiv IsNot Nothing AndAlso Archiv, 1, 0) &
"GROUP BY
tblIDSTransactionsNew.KdNrVERAG,
tblIDSTransactionsNew.[YearMonthDay],
ISNULL(tblIDSTransactionsNew.[OBONumber],
@@ -365,7 +365,7 @@ Public Class cIDS
cmd.Parameters.AddWithValue("@von", von)
cmd.Parameters.AddWithValue("@bis", bis)
cmd.Parameters.AddWithValue("@AdressenNr", KundenNr)
'If Archiv IsNot Nothing Then cmd.Parameters.AddWithValue("@Archiv", If(Archiv, 1, 0))
If Archiv IsNot Nothing Then cmd.Parameters.AddWithValue("@Archiv", If(Archiv, 1, 0))
Dim dr = cmd.ExecuteReader()
dt.Load(dr)