MDM, Mahnungen, EORI, Kundenblatt, MSEAPI, UTA, Zollanmeldungen_Import_Dakosy
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
Imports System.Data.SqlClient
|
||||
Imports System.Net
|
||||
Imports System.Reflection
|
||||
Imports javax
|
||||
|
||||
Public Class cMSEAPI
|
||||
|
||||
@@ -514,6 +515,10 @@ Public Class cMSEAPI
|
||||
Return "FEHLER Array Transaktions ist leer"
|
||||
End If
|
||||
|
||||
If transactions.Size = 1 Then
|
||||
row.Item("batch_seq_nr") = transactions.ObjectAt(0).StringOf("batch_seq_nr")
|
||||
End If
|
||||
|
||||
|
||||
'If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"))
|
||||
saveTransactions(num, dt, transactions, json.StringOf("receiver"), True,) ' wenn ID explizit aufgerufen keine Prüfung auf receivcer und purchaseDate
|
||||
@@ -1346,6 +1351,65 @@ 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
|
||||
Try
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
|
||||
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
|
||||
|
||||
Using cmd As New SqlCommand("select * from ( select cust.[customer_id],bills.invoice_date, bills.invoice_number, bills.specification_page_name, trans.original_currency ,sum(USteuer_EUR) as UST_EUR, sum(original_vat_amount) as UST
|
||||
FROM [VERAG].[dbo].[tblMSESettlements] as bills
|
||||
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
|
||||
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 & "'
|
||||
group by bills.invoice_date, bills.invoice_number, cust.[customer_id], bills.specification_page_name, trans.original_currency) 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)
|
||||
'While dr.Read
|
||||
' dt.Load(dr)
|
||||
'End While
|
||||
dr.Close()
|
||||
|
||||
End Using
|
||||
End Using
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||
End Try
|
||||
Return False
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function UPDATE_ARCHIV(reDat As Date, reNr As Integer, mse_kdNr As Integer) As Boolean
|
||||
Try
|
||||
Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
|
||||
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("reDat", reDat))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("reNr", reNr))
|
||||
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mse_kdNr", mse_kdNr))
|
||||
|
||||
|
||||
Return SQL.doSQLVarList("
|
||||
|
||||
UPDATE [tblMSEInvoices] set archiv=1, [archiviertDatum]=GETDATE()
|
||||
WHERE cast(invoice_date as date) = @reDat and invoice_id = @reNr and customer_number=@mse_kdNr
|
||||
", "FMZOLL",, list)
|
||||
|
||||
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
|
||||
|
||||
@@ -1907,4 +1971,5 @@ Public Class cMSECustomers
|
||||
End Try
|
||||
Return ""
|
||||
End Function
|
||||
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user