FaktMail, MDM-Vollmachten, MDM-Auswertung

This commit is contained in:
2025-01-14 18:21:58 +01:00
parent 8616ce1735
commit 481ab094de
17 changed files with 989 additions and 147 deletions

View File

@@ -1359,7 +1359,7 @@ Public Class cMSEAPI
End Sub
Public Shared Function GET_Antraege_MSE(ByRef dt As DataTable, von As Date, bis As Date, KundenNr As Integer, LandKZ As String, Wahrungscode As String, Optional Archiv As Object = Nothing) As Boolean
Public Shared Function GET_Antraege_MSE(ByRef dt As DataTable, von As Date, bis As Date, KundenNr As Integer, LandKZ As String, Wahrungscode As String, Optional Archiv As Boolean = False) As Boolean
Try
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
@@ -1370,14 +1370,13 @@ Public Class cMSEAPI
left join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
left join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
left join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.customer_number = cust.customer_id and bills.invoice_date = inv.invoice_date and inv.country = trans.transaction_country
where bills.invoice_date Between '" & von & "' And '" & bis & "'and trans.charged = 1 and cust.[partner_customer_number] = " & KundenNr & " and trans.transaction_country = '" & LandKZ & "' and trans.original_currency = '" & Wahrungscode & "' AND isnull(UStVAn_ID,0) = " & IIf(Archiv IsNot Nothing AndAlso Archiv, 1, 0) & "
where bills.invoice_date Between '" & von & "' And '" & bis & "'and trans.charged = 1 and cust.[partner_customer_number] = " & KundenNr & " and trans.transaction_country = '" & LandKZ & "' and trans.original_currency = '" & Wahrungscode & "'" & IIf(Archiv, " ", " AND isnull(UStVAn_ID,0) = 0 ") & "
group by bills.invoice_date, bills.invoice_number, cust.[customer_id], bills.specification_page_name, trans.original_currency, inv.daId) as temp
where temp.UST <> 0", conn)
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))
Dim dr = cmd.ExecuteReader()
dt.Load(dr)