plose, etc.
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
Imports System.Data.SqlClient
|
Imports System.Data.SqlClient
|
||||||
Imports System.Reflection
|
Imports System.Reflection
|
||||||
|
Imports System.Windows.Forms
|
||||||
Imports VERAG_PROG_ALLGEMEIN.TESTJSON
|
Imports VERAG_PROG_ALLGEMEIN.TESTJSON
|
||||||
|
|
||||||
Public Class cDakosyEZA
|
Public Class cDakosyEZA
|
||||||
@@ -245,9 +246,17 @@ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("eza_BezugsnummerBEAnteilZL", eza_
|
|||||||
Return Me.SAVE
|
Return Me.SAVE
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Public Function SAVE() As Boolean
|
Public Function SAVE() As Boolean
|
||||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
|
If Not VERAG_PROG_ALLGEMEIN.cProgramFunctions.ValidateSQLFieldLengths(list, "tblDakosy_EZA", "", "FMZOLL") Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblDakosy_eza WITH(updlock,serializable) WHERE eza_Id=@eza_Id) " &
|
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblDakosy_eza WITH(updlock,serializable) WHERE eza_Id=@eza_Id) " &
|
||||||
" BEGIN " & getUpdateCmd() & " END " &
|
" BEGIN " & getUpdateCmd() & " END " &
|
||||||
" Else " &
|
" Else " &
|
||||||
|
|||||||
@@ -128,6 +128,9 @@ Public Class cPLOSE
|
|||||||
Public Function SAVE() As Boolean
|
Public Function SAVE() As Boolean
|
||||||
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
|
||||||
|
|
||||||
|
If Not VERAG_PROG_ALLGEMEIN.cProgramFunctions.ValidateSQLFieldLengths(list, "tblPLOSE_Details", "", "FMZOLL") Then
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblPLOSE_Details WITH(updlock,serializable) WHERE plose_id=@plose_id) " &
|
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblPLOSE_Details WITH(updlock,serializable) WHERE plose_id=@plose_id) " &
|
||||||
" BEGIN " & getUpdateCmd() & " End " &
|
" BEGIN " & getUpdateCmd() & " End " &
|
||||||
|
|||||||
@@ -776,7 +776,17 @@ Public Class cGetMsgType
|
|||||||
Shared Function isPLOSE_NewFormat_TR(doc As String) As Boolean
|
Shared Function isPLOSE_NewFormat_TR(doc As String) As Boolean
|
||||||
Dim lines() As String = System.IO.File.ReadAllLines(doc)
|
Dim lines() As String = System.IO.File.ReadAllLines(doc)
|
||||||
If lines.Count > 0 Then
|
If lines.Count > 0 Then
|
||||||
If lines(0).ToString.Replace("""", "").StartsWith("CustomerCode") Then
|
If lines(0).ToString.Replace("""", "").StartsWith("CustomerCode") AndAlso lines(0).ToString.Contains("ServiceDescription") AndAlso lines(0).ToString.Contains("ItalianDocNumber") Then
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Return False
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Shared Function isPLOSE_NewFormat_INV(doc As String) As Boolean
|
||||||
|
Dim lines() As String = System.IO.File.ReadAllLines(doc)
|
||||||
|
If lines.Count > 0 Then
|
||||||
|
If lines(0).ToString.Replace("""", "").StartsWith("CustomerCode") AndAlso lines(0).ToString.Contains("DocumentNumber") AndAlso lines(0).ToString.Contains("PdfFileName") AndAlso doc.ToUpper.Contains("RDOC") Then
|
||||||
Return True
|
Return True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
' Dim BOX_VERSION = "8.8"
|
' Dim BOX_VERSION = "8.8"
|
||||||
|
|
||||||
Dim Dateiname = ""
|
Dim Dateiname = ""
|
||||||
|
Public newFormatTR As Boolean = False
|
||||||
|
Public newFormatINV As Boolean = False
|
||||||
|
|
||||||
Sub New()
|
Sub New()
|
||||||
|
|
||||||
@@ -46,10 +48,23 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
'VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir() & "DAKOSY\TESTSYSTEM\Nachrichtendaten_Ablage\"
|
'VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir() & "DAKOSY\TESTSYSTEM\Nachrichtendaten_Ablage\"
|
||||||
Me.ERROR_PFAD = MDM_Worker.cMDM_Paramter.GET_PARAM_ByName("ERROR_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
Me.ERROR_PFAD = MDM_Worker.cMDM_Paramter.GET_PARAM_ByName("ERROR_PFAD", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
'VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir() & "DAKOSY\TESTSYSTEM\Nachrichtendaten_ERROR\"
|
'VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir() & "DAKOSY\TESTSYSTEM\Nachrichtendaten_ERROR\"
|
||||||
|
|
||||||
|
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
||||||
|
Me.TELOTEC_PFAD = Me.TELOTEC_PFAD.ToString.Replace("ECHTSYSTEM", "TESTSYSTEM")
|
||||||
|
Me.VERARBEITUNGS_PFAD = Me.VERARBEITUNGS_PFAD.ToString.Replace("ECHTSYSTEM", "TESTSYSTEM")
|
||||||
|
Me.ZIEL_PFAD = Me.ZIEL_PFAD.ToString.Replace("ECHTSYSTEM", "TESTSYSTEM")
|
||||||
|
Me.ERROR_PFAD = Me.ERROR_PFAD.ToString.Replace("ECHTSYSTEM", "TESTSYSTEM")
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
If Not System.IO.Directory.Exists(VERARBEITUNGS_PFAD) Then System.IO.Directory.CreateDirectory(VERARBEITUNGS_PFAD)
|
If Not System.IO.Directory.Exists(VERARBEITUNGS_PFAD) Then System.IO.Directory.CreateDirectory(VERARBEITUNGS_PFAD)
|
||||||
If Not System.IO.Directory.Exists(ZIEL_PFAD) Then System.IO.Directory.CreateDirectory(ZIEL_PFAD)
|
If Not System.IO.Directory.Exists(ZIEL_PFAD) Then System.IO.Directory.CreateDirectory(ZIEL_PFAD)
|
||||||
If Not System.IO.Directory.Exists(ERROR_PFAD) Then System.IO.Directory.CreateDirectory(ERROR_PFAD)
|
If Not System.IO.Directory.Exists(ERROR_PFAD) Then System.IO.Directory.CreateDirectory(ERROR_PFAD)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Me.BOX_VERSION = MDM_Worker.cDY_Paramter.GET_PARAM_ByName("BOX_VERSION", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
'Me.BOX_VERSION = MDM_Worker.cDY_Paramter.GET_PARAM_ByName("BOX_VERSION", VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -356,7 +371,7 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For i = 1 To 6
|
For i = 1 To 5
|
||||||
|
|
||||||
For Each d In System.IO.Directory.GetFiles(VERARBEITUNGS_PFAD)
|
For Each d In System.IO.Directory.GetFiles(VERARBEITUNGS_PFAD)
|
||||||
Try
|
Try
|
||||||
@@ -382,9 +397,11 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
'------------------------------------------
|
'------------------------------------------
|
||||||
If fi.Extension.ToLower = ".csv" Then
|
If fi.Extension.ToLower = ".csv" Then
|
||||||
|
|
||||||
If Not found And cGetMsgType.isPLOSE_Detail(d) Then
|
If Not newFormatTR AndAlso (Not found And cGetMsgType.isPLOSE_Detail(d)) Then
|
||||||
If readPLOSE_Detail(d) <> "" Then found = True
|
If readPLOSE_Detail(d) <> "" Then found = True
|
||||||
' If bezugsNr <> "" Then addDGVEinarbeitung("NCTS: Versandbestätigung", bezugsNr) : found = True
|
|
||||||
|
ElseIf newFormatTR AndAlso (Not found And cGetMsgType.isPLOSE_NewFormat_TR(d)) Then
|
||||||
|
If readPLOSE_Detail_NEW_FORMAT(d) <> "" Then found = True
|
||||||
End If
|
End If
|
||||||
If found Then cntDatenEingelesen += 1
|
If found Then cntDatenEingelesen += 1
|
||||||
End If
|
End If
|
||||||
@@ -407,27 +424,21 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
'------------------------------------------
|
'------------------------------------------
|
||||||
|
|
||||||
If fi.Extension.ToLower = ".csv" Then
|
If fi.Extension.ToLower = ".csv" Then
|
||||||
If Not found And cGetMsgType.isPLOSE_INVData(d) Then
|
|
||||||
|
|
||||||
|
If Not newFormatINV AndAlso Not found And cGetMsgType.isPLOSE_INVData(d) Then
|
||||||
If readPLOSE_INVData(d) <> "" Then found = True
|
If readPLOSE_INVData(d) <> "" Then found = True
|
||||||
' ' If bezugsNr <> "" Then addDGVEinarbeitung("NCTS: Versandbestätigung", bezugsNr) : found = True
|
' ' If bezugsNr <> "" Then addDGVEinarbeitung("NCTS: Versandbestätigung", bezugsNr) : found = True
|
||||||
|
ElseIf newFormatINV AndAlso Not found And cGetMsgType.isPLOSE_NewFormat_INV(d) Then
|
||||||
|
If readPLOSE_INVData_NEW_FORMAT(d) <> "" Then found = True
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
If found Then cntDatenEingelesen += 1
|
If found Then cntDatenEingelesen += 1
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Case 4
|
Case 4
|
||||||
' '------------------------------------------
|
|
||||||
' '------- NEW FORMAT - TRANS-FILE ----------
|
|
||||||
' '------------------------------------------
|
|
||||||
' If fi.Extension.ToLower = ".csv" Then
|
|
||||||
|
|
||||||
' If Not found And cGetMsgType.isPLOSE_NewFormat_TR(d) Then
|
|
||||||
' If readPLOSE_Detail_NEW_FORMAT(d) <> "" Then found = True
|
|
||||||
|
|
||||||
' End If
|
|
||||||
' If found Then cntDatenEingelesen += 1
|
|
||||||
' End If
|
|
||||||
|
|
||||||
Case 5
|
|
||||||
'------------------------------------------
|
'------------------------------------------
|
||||||
'------------------ PDF ------------------
|
'------------------ PDF ------------------
|
||||||
'------------------------------------------
|
'------------------------------------------
|
||||||
@@ -486,7 +497,7 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
Case 6
|
Case 5
|
||||||
frmStartOptions.moveFile_DateBack(d, ERROR_PFAD)
|
frmStartOptions.moveFile_DateBack(d, ERROR_PFAD)
|
||||||
dsNichtErkannt += 1
|
dsNichtErkannt += 1
|
||||||
End Select
|
End Select
|
||||||
@@ -759,7 +770,7 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Function readPLOSE_Detail_NEW_FORMAT(d As String) As String
|
Function readPLOSE_Detail_NEW_FORMAT(d As String) As String 'neues Format der Transaktion-Files
|
||||||
Try
|
Try
|
||||||
readPLOSE_Detail_NEW_FORMAT = ""
|
readPLOSE_Detail_NEW_FORMAT = ""
|
||||||
Dim KdnR = ""
|
Dim KdnR = ""
|
||||||
@@ -777,22 +788,40 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
Dim plose_Lieferant = Nothing
|
Dim plose_Lieferant = Nothing
|
||||||
|
|
||||||
Dim fi As FileInfo = New FileInfo(d)
|
Dim fi As FileInfo = New FileInfo(d)
|
||||||
If fi.Name.Length > 8 Then
|
|
||||||
|
|
||||||
plose_RechnungsJahr = fi.Name.Substring(0, 2)
|
Dim fileName As String = System.IO.Path.GetFileNameWithoutExtension(fi.Name)
|
||||||
plose_RechnungsLieferantCode = fi.Name.Substring(2, 1)
|
|
||||||
|
|
||||||
|
' _RGDAT_... entfernen
|
||||||
|
fileName = fileName.Split("_"c)(0)
|
||||||
|
|
||||||
'--------> auslesen [tblPLOSE_Lieferant]
|
'File Name: {company}-{country}-{document type}-{document number}-{document year-month}-{document year-month-day}-{customercode}-{partner/reseller customer code}
|
||||||
Select Case plose_RechnungsLieferantCode
|
|
||||||
Case "0" : plose_Lieferant = "PLOSE Sistem Service"
|
|
||||||
Case "7" : plose_Lieferant = "Consortio PLOSE"
|
|
||||||
Case "1" : plose_Lieferant = "Plose Union"
|
|
||||||
Case "9" : plose_Lieferant = "PLOSE UNION SOCIETA COOPERATIVA"
|
|
||||||
End Select
|
|
||||||
|
|
||||||
|
Dim parts() As String = fileName.Split("-"c)
|
||||||
|
|
||||||
|
If parts.Length >= 8 Then
|
||||||
|
Dim company As String = parts(0)
|
||||||
|
Dim country As String = parts(1)
|
||||||
|
Dim documentType As String = parts(2)
|
||||||
|
Dim documentNumber As String = parts(3)
|
||||||
|
Dim documentYear As String = parts(4)
|
||||||
|
Dim documentMonth As String = parts(5)
|
||||||
|
Dim documentDay As String = parts(6)
|
||||||
|
Dim customerCode As String = parts(7)
|
||||||
|
Dim partnerCustomerCode As String = parts(8)
|
||||||
|
plose_RechnungsJahr = documentYear
|
||||||
|
plose_RechnungsLieferantCode = company
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
'--------> auslesen [tblPLOSE_Lieferant]
|
||||||
|
Select Case plose_RechnungsLieferantCode
|
||||||
|
Case "0" : plose_Lieferant = "PLOSE Sistem Service"
|
||||||
|
Case "7" : plose_Lieferant = "Consortio PLOSE"
|
||||||
|
Case "1" : plose_Lieferant = "Plose Union"
|
||||||
|
Case "9" : plose_Lieferant = "PLOSE UNION SOCIETA COOPERATIVA"
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(d, Encoding.UTF8)
|
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(d, Encoding.UTF8)
|
||||||
MyReader.TextFieldType = FileIO.FieldType.Delimited
|
MyReader.TextFieldType = FileIO.FieldType.Delimited
|
||||||
MyReader.SetDelimiters(";")
|
MyReader.SetDelimiters(";")
|
||||||
@@ -801,105 +830,123 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
Dim cnt = 0
|
Dim cnt = 0
|
||||||
If True Then
|
If True Then
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
While Not MyReader.EndOfData
|
While Not MyReader.EndOfData
|
||||||
Try
|
Try
|
||||||
|
|
||||||
|
|
||||||
currentRow = MyReader.ReadFields()
|
currentRow = MyReader.ReadFields()
|
||||||
|
|
||||||
|
If cnt = 0 Then
|
||||||
If True Then 'fi.Name.Length > 8 Then
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
'Select Case currentRow(0)
|
|
||||||
' Case "TR1"
|
|
||||||
'RECHNUGNSDATUM
|
|
||||||
If currentRow.Length > 1 AndAlso currentRow(11).ToString.Length = 8 Then
|
|
||||||
Dim datumParse = DateTime.ParseExact(currentRow(11), "yyyyMMdd", Nothing)
|
|
||||||
plose_RechnungsDat = datumParse
|
|
||||||
End If
|
|
||||||
'RECHNUGNSNR
|
|
||||||
If currentRow.Length > 2 Then 'AndAlso currentRow(1).ToString.Length = 8 Then
|
|
||||||
plose_RechnungsNr = SQL.isleernothing(currentRow(12)) 'Rechnungsdatum aus TR1 Datensatz, überschreibt den Wert aus der Dateierstellung
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Case "TR5"
|
|
||||||
If currentRow.Length > 24 AndAlso currentRow(12) <> "839160" Then 'KDNR <> VERAG --> Die Kosten bleiben uns
|
|
||||||
Dim PLOSE As New MDM_Worker.cPLOSE
|
|
||||||
|
|
||||||
PLOSE.plose_Dateiname = fi.Name
|
|
||||||
PLOSE.plose_RechnungsNr = plose_RechnungsNr
|
|
||||||
PLOSE.plose_Lieferant = plose_Lieferant
|
|
||||||
PLOSE.plose_LieferantCode = plose_RechnungsLieferantCode
|
|
||||||
PLOSE.plose_RechnungsJahr = plose_RechnungsJahr
|
|
||||||
If plose_RechnungsDat IsNot Nothing Then PLOSE.plose_RechnungsDatum = plose_RechnungsDat
|
|
||||||
PLOSE.plose_Datensatztyp = SQL.isleernothing(currentRow(0))
|
|
||||||
PLOSE.plose_KodexMautTankstelle = SQL.isleernothing(currentRow(1))
|
|
||||||
PLOSE.plose_BeschreibungMautTankstelle = SQL.isleernothing(currentRow(2))
|
|
||||||
PLOSE.plose_KodexEinfahrt = SQL.isleernothing(currentRow(3))
|
|
||||||
PLOSE.plose_BeschreibungEinfahrt = SQL.isleernothing(currentRow(4))
|
|
||||||
PLOSE.plose_KodexAusfahrt = SQL.isleernothing(currentRow(5))
|
|
||||||
PLOSE.plose_BeschreibungAusfahrt = SQL.isleernothing(currentRow(6))
|
|
||||||
PLOSE.plose_Kartenkodex = SQL.isleernothing(currentRow(7))
|
|
||||||
PLOSE.plose_Kontonummer = SQL.isleernothing(currentRow(8))
|
|
||||||
PLOSE.plose_NummerKarteGeraet = SQL.isleernothing(currentRow(9))
|
|
||||||
PLOSE.plose_Kennzeichen = SQL.isleernothing(currentRow(10))
|
|
||||||
PLOSE.plose_InterneNrFahrzeug = SQL.isleernothing(currentRow(11))
|
|
||||||
PLOSE.plose_POLSEKundennummer = SQL.isleernothing(currentRow(12))
|
|
||||||
PLOSE.plose_Firmenname = SQL.isleernothing(currentRow(13))
|
|
||||||
PLOSE.plose_DatumTransaktion = SQL.isleernothingDateFormatstring(currentRow(14))
|
|
||||||
PLOSE.plose_Produktbeschreibung = SQL.isleernothing(currentRow(15))
|
|
||||||
PLOSE.plose_Menge = SQL.isNullNothingDbl(currentRow(16))
|
|
||||||
PLOSE.plose_Preis = SQL.isNullNothingDbl(currentRow(17))
|
|
||||||
PLOSE.Einheitsrabatt = SQL.isleernothing(currentRow(18))
|
|
||||||
PLOSE.plose_NettobetragTransaktion = SQL.isNullNothingDbl(currentRow(19))
|
|
||||||
PLOSE.plose_MWSTBetrag = SQL.isNullNothingDbl(currentRow(20))
|
|
||||||
PLOSE.plose_BruttobetragTransaktion = SQL.isNullNothingDbl(currentRow(21))
|
|
||||||
PLOSE.plose_NettobetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(22))
|
|
||||||
PLOSE.plose_MWSTBetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(23))
|
|
||||||
PLOSE.plose_BruttobetragWaehrungAbbuchung = SQL.isNullNothingDbl(currentRow(24))
|
|
||||||
PLOSE.plose_WaehrungLandDiesntleistung = SQL.isleernothing(currentRow(25))
|
|
||||||
PLOSE.plose_WaehrungAbbuchung = SQL.isleernothing(currentRow(26))
|
|
||||||
PLOSE.plose_DokumentNrQuittungUhrzeit = SQL.isleernothing(currentRow(27))
|
|
||||||
PLOSE.plose_ArtTransaktion = SQL.isleernothing(currentRow(28))
|
|
||||||
PLOSE.plose_Fahrzeugklasse = SQL.isleernothing(currentRow(29))
|
|
||||||
PLOSE.plose_KlassenidentifikationEURO = SQL.isleernothing(currentRow(30))
|
|
||||||
PLOSE.plose_ProduktbeschreibungShort = SQL.isleernothing(currentRow(31))
|
|
||||||
PLOSE.plose_DokumentNrQuittungUhrzeit = SQL.isleernothing(currentRow(32))
|
|
||||||
PLOSE.plose_Geraetetyp = SQL.isleernothing(currentRow(33))
|
|
||||||
PLOSE.plose_ProduktCode = SQL.isleernothing(currentRow(34))
|
|
||||||
PLOSE.plose_ReferenzenBuchungMaut = SQL.isleernothing(currentRow(35))
|
|
||||||
|
|
||||||
If currentRow.Length > 36 Then PLOSE.plose_SupplierRechnungsNr = SQL.isleernothing(currentRow(36))
|
|
||||||
If currentRow.Length > 37 AndAlso currentRow(37).ToString.Length = 8 Then
|
|
||||||
Dim datumParse = DateTime.ParseExact(currentRow(37), "yyyyMMdd", Nothing)
|
|
||||||
PLOSE.plose_SupplierRechnungsDatum = datumParse
|
|
||||||
End If
|
|
||||||
|
|
||||||
If If(PLOSE.plose_SupplierRechnungsNr, "").contains("-SFC-") Then ' SOFICO
|
|
||||||
PLOSE.plose_LieferantCode = "90"
|
|
||||||
PLOSE.plose_Lieferant = SQL.DLookup("pl_Bezeichnung", "tblPLOSE_Lieferant", " [pl_LieferantCode]='" & PLOSE.plose_LieferantCode & "' ", "FMZOLL", "")
|
|
||||||
End If
|
|
||||||
|
|
||||||
''''''''''''
|
|
||||||
If PLOSE.SAVE() Then
|
|
||||||
savedTrans += 1
|
|
||||||
End If
|
|
||||||
|
|
||||||
counTrans += 1
|
|
||||||
|
|
||||||
End If
|
|
||||||
'End Select
|
|
||||||
|
|
||||||
cnt += 1
|
cnt += 1
|
||||||
|
Continue While ' erste Zeile überspringen
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
'For Each currentField In currentRow
|
If currentRow.Length < 45 Then Continue While
|
||||||
'Next
|
|
||||||
|
'RECHNUGNSDATUM
|
||||||
|
If currentRow.Length > 1 AndAlso currentRow(36).ToString.Length = 19 Then
|
||||||
|
Dim datumParse = DateTime.ParseExact(currentRow(36).ToString(), "dd/MM/yyyy HH:mm:ss", Globalization.CultureInfo.InvariantCulture)
|
||||||
|
plose_RechnungsDat = datumParse
|
||||||
|
End If
|
||||||
|
'RECHNUGNSNR
|
||||||
|
If currentRow.Length > 2 Then
|
||||||
|
plose_RechnungsNr = SQL.isleernothing(currentRow(35))
|
||||||
|
End If
|
||||||
|
|
||||||
|
If currentRow.Length > 24 AndAlso currentRow(0) <> "839160" Then 'KDNR <> VERAG --> Die Kosten bleiben uns
|
||||||
|
Dim PLOSE As New MDM_Worker.cPLOSE
|
||||||
|
|
||||||
|
PLOSE.plose_Dateiname = fi.Name
|
||||||
|
PLOSE.plose_RechnungsNr = plose_RechnungsNr
|
||||||
|
PLOSE.plose_Lieferant = plose_Lieferant
|
||||||
|
PLOSE.plose_LieferantCode = plose_RechnungsLieferantCode
|
||||||
|
PLOSE.plose_RechnungsJahr = plose_RechnungsJahr
|
||||||
|
If plose_RechnungsDat IsNot Nothing Then PLOSE.plose_RechnungsDatum = plose_RechnungsDat
|
||||||
|
PLOSE.plose_Datensatztyp = "NEW"
|
||||||
|
PLOSE.plose_KodexMautTankstelle = SQL.isleernothing(currentRow(15))
|
||||||
|
|
||||||
|
Dim BeschreibungMaut = SQL.isleernothing(currentRow(16))
|
||||||
|
If BeschreibungMaut IsNot Nothing AndAlso BeschreibungMaut <> "" AndAlso BeschreibungMaut.ToString.Length > 12 Then
|
||||||
|
BeschreibungMaut = BeschreibungMaut.ToString.Substring(0, 12)
|
||||||
|
End If
|
||||||
|
|
||||||
|
PLOSE.plose_BeschreibungMautTankstelle = BeschreibungMaut
|
||||||
|
PLOSE.plose_KodexEinfahrt = SQL.isleernothing(currentRow(17))
|
||||||
|
PLOSE.plose_BeschreibungEinfahrt = SQL.isleernothing(currentRow(18))
|
||||||
|
PLOSE.plose_KodexAusfahrt = SQL.isleernothing(currentRow(19))
|
||||||
|
PLOSE.plose_BeschreibungAusfahrt = SQL.isleernothing(currentRow(20))
|
||||||
|
PLOSE.plose_Kartenkodex = SQL.isleernothing(currentRow(8))
|
||||||
|
PLOSE.plose_Kontonummer = SQL.isleernothing(currentRow(7))
|
||||||
|
PLOSE.plose_NummerKarteGeraet = SQL.isleernothing(currentRow(12))
|
||||||
|
PLOSE.plose_Kennzeichen = SQL.isleernothing(currentRow(13))
|
||||||
|
'PLOSE.plose_InterneNrFahrzeug = SQL.isleernothing(currentRow(11))
|
||||||
|
PLOSE.plose_POLSEKundennummer = SQL.isleernothing(currentRow(0))
|
||||||
|
Dim Firmenname = SQL.isleernothing(currentRow(1))
|
||||||
|
If Firmenname IsNot Nothing AndAlso Firmenname <> "" AndAlso Firmenname.ToString.Length > 35 Then
|
||||||
|
Firmenname = Firmenname.ToString.Substring(0, 35)
|
||||||
|
End If
|
||||||
|
|
||||||
|
PLOSE.plose_Firmenname = Firmenname
|
||||||
|
PLOSE.plose_DatumTransaktion = SQL.isleernothingDateFormatstring(currentRow(23))
|
||||||
|
|
||||||
|
|
||||||
|
Dim ProduktBeschreibung = SQL.isleernothing(currentRow(22))
|
||||||
|
If ProduktBeschreibung IsNot Nothing AndAlso ProduktBeschreibung <> "" AndAlso ProduktBeschreibung.ToString.Length > 15 Then
|
||||||
|
ProduktBeschreibung = ProduktBeschreibung.ToString.Substring(0, 15)
|
||||||
|
End If
|
||||||
|
PLOSE.plose_Produktbeschreibung = ProduktBeschreibung
|
||||||
|
|
||||||
|
'PLOSE.plose_Menge = SQL.isNullNothingDbl(currentRow(24))
|
||||||
|
'PLOSE.plose_Preis = SQL.isNullNothingDbl(currentRow(26))
|
||||||
|
|
||||||
|
PLOSE.plose_Menge = CDbl(SQL.isNullReturnValue(currentRow(24), 0).replace(".", ","))
|
||||||
|
PLOSE.plose_Preis = CDbl(SQL.isNullReturnValue(currentRow(26), 0).replace(".", ","))
|
||||||
|
|
||||||
|
PLOSE.Einheitsrabatt = SQL.isleernothing(0) 'gibts nicht mehr?? in neuer Datei!
|
||||||
|
PLOSE.plose_NettobetragTransaktion = CDbl(SQL.isNullReturnValue(currentRow(27), 0).replace(".", ","))
|
||||||
|
PLOSE.plose_MWSTBetrag = CDbl(CDbl(SQL.isNullReturnValue(currentRow(29), 0).replace(".", ",")) - CDbl(SQL.isNullReturnValue(currentRow(27), 0).replace(".", ","))) 'selbst ausrechnen!!!
|
||||||
|
PLOSE.plose_BruttobetragTransaktion = CDbl(SQL.isNullReturnValue(currentRow(29), 0).replace(".", ","))
|
||||||
|
PLOSE.plose_NettobetragWaehrungAbbuchung = CDbl(SQL.isNullReturnValue(currentRow(31), 0).replace(".", ","))
|
||||||
|
PLOSE.plose_MWSTBetragWaehrungAbbuchung = CDbl(CDbl(SQL.isNullReturnValue(currentRow(32), 0).replace(".", ",")) - CDbl(SQL.isNullReturnValue(currentRow(31), 0).replace(".", ","))) 'selbst ausrechnen!!!
|
||||||
|
PLOSE.plose_BruttobetragWaehrungAbbuchung = CDbl(SQL.isNullReturnValue(currentRow(32), 0).replace(".", ","))
|
||||||
|
PLOSE.plose_WaehrungLandDiesntleistung = SQL.isleernothing(currentRow(25))
|
||||||
|
PLOSE.plose_WaehrungAbbuchung = SQL.isleernothing(currentRow(30))
|
||||||
|
PLOSE.plose_ProduktCode = SQL.isleernothing(currentRow(21))
|
||||||
|
'PLOSE.plose_ProduktbeschreibungShort = SQL.isleernothing(currentRow(22))
|
||||||
|
PLOSE.plose_KlassenidentifikationEURO = SQL.isleernothing(currentRow(39))
|
||||||
|
PLOSE.plose_Fahrzeugklasse = SQL.isleernothing(currentRow(40))
|
||||||
|
|
||||||
|
'das stimmt nicht so.....
|
||||||
|
'PLOSE.plose_DokumentNrQuittungUhrzeit = SQL.isleernothing(currentRow(27)) '???
|
||||||
|
'PLOSE.plose_ArtTransaktion = SQL.isleernothing(currentRow(39)) -> Gibt nicht mehr!
|
||||||
|
'PLOSE.plose_Geraetetyp = SQL.isleernothing(currentRow(33)) -> Gibt nicht mehr!
|
||||||
|
' PLOSE.plose_ReferenzenBuchungMaut = SQL.isleernothing(currentRow(35)) -> Gibt nicht mehr!
|
||||||
|
|
||||||
|
PLOSE.plose_SupplierRechnungsNr = SQL.isleernothing(currentRow(37))
|
||||||
|
If currentRow(38).ToString.Length = 19 Then
|
||||||
|
Dim datumParse = DateTime.ParseExact(currentRow(38).ToString(), "dd/MM/yyyy HH:mm:ss", Globalization.CultureInfo.InvariantCulture)
|
||||||
|
PLOSE.plose_SupplierRechnungsDatum = datumParse 'ItalianDocDate -> vom Lieferanten!
|
||||||
|
End If
|
||||||
|
|
||||||
|
If If(PLOSE.plose_SupplierRechnungsNr, "").contains("-SFC-") Then ' SOFICO
|
||||||
|
PLOSE.plose_LieferantCode = "90"
|
||||||
|
PLOSE.plose_Lieferant = SQL.DLookup("pl_Bezeichnung", "tblPLOSE_Lieferant", " [pl_LieferantCode]='" & PLOSE.plose_LieferantCode & "' ", "FMZOLL", "")
|
||||||
|
End If
|
||||||
|
|
||||||
|
''''''''''''
|
||||||
|
If PLOSE.SAVE() Then
|
||||||
|
savedTrans += 1
|
||||||
|
End If
|
||||||
|
|
||||||
|
counTrans += 1
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
cnt += 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
End Try
|
End Try
|
||||||
@@ -1125,6 +1172,143 @@ Public Class frmMDMNachrichtenVerarbeitung
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Function readPLOSE_INVData_NEW_FORMAT(d As String) As String
|
||||||
|
Try
|
||||||
|
Dim cnt = 0
|
||||||
|
readPLOSE_INVData_NEW_FORMAT = ""
|
||||||
|
|
||||||
|
|
||||||
|
Using MyReader As New Microsoft.VisualBasic.FileIO.TextFieldParser(d, Encoding.UTF8)
|
||||||
|
MyReader.TextFieldType = FileIO.FieldType.Delimited
|
||||||
|
MyReader.SetDelimiters(";")
|
||||||
|
Dim currentRow As String()
|
||||||
|
|
||||||
|
|
||||||
|
Dim fi As FileInfo = New FileInfo(d)
|
||||||
|
|
||||||
|
Dim fileName As String = System.IO.Path.GetFileNameWithoutExtension(fi.Name)
|
||||||
|
|
||||||
|
'Alles ab "_RGDAT_" entfernen
|
||||||
|
fileName = fileName.Split("_"c)(0)
|
||||||
|
|
||||||
|
Dim parts() As String = fileName.Split("-"c)
|
||||||
|
|
||||||
|
If parts.Length >= 10 Then
|
||||||
|
Dim company As String = parts(0)
|
||||||
|
Dim documentType As String = parts(1) 'rdoc
|
||||||
|
Dim documentNumber As String = parts(2)
|
||||||
|
Dim documentYearMonth As String = parts(3) & "-" & parts(4)
|
||||||
|
Dim documentYearMonthDay As String = parts(5) & "-" & parts(6) & "-" & parts(7)
|
||||||
|
Dim customerCode As String = parts(8)
|
||||||
|
Dim partnerCustomerCode As String = parts(9)
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
While Not MyReader.EndOfData
|
||||||
|
Try
|
||||||
|
currentRow = MyReader.ReadFields()
|
||||||
|
|
||||||
|
|
||||||
|
If cnt = 0 Then
|
||||||
|
cnt += 1
|
||||||
|
Continue While ' erste Zeile überspringen
|
||||||
|
End If
|
||||||
|
|
||||||
|
If currentRow.Length >= 28 Then
|
||||||
|
Dim PLOSE_INV As New MDM_Worker.cPLOSE_Inv_Data
|
||||||
|
PLOSE_INV.plInv_SupplierRechnungsDatum = SQL.isleernothingDateFormatstring(currentRow(8))
|
||||||
|
PLOSE_INV.plInv_SupplierRechnungsNr = SQL.isleernothing(currentRow(9))
|
||||||
|
PLOSE_INV.plInv_SupplierCountry = SQL.isleernothing(currentRow(7))
|
||||||
|
PLOSE_INV.plInv_Lieferant = SQL.isleernothing(currentRow(5))
|
||||||
|
PLOSE_INV.plInv_LieferantCode = SQL.isleernothing(currentRow(3))
|
||||||
|
PLOSE_INV.plInv_LieferantUID = SQL.isleernothing(currentRow(6))
|
||||||
|
PLOSE_INV.plInv_PdfFileName = SQL.isleernothing(currentRow(22))
|
||||||
|
If If(PLOSE_INV.plInv_PdfFileName, "") <> "" Then
|
||||||
|
If Not PLOSE_INV.plInv_PdfFileName.ToString.ToLower.EndsWith(".pdf") Then PLOSE_INV.plInv_PdfFileName += ".pdf" ' Falls Endung nciht .pdf --> anfügen
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim origCurrency = SQL.isleernothing(currentRow(11))
|
||||||
|
|
||||||
|
|
||||||
|
PLOSE_INV.plInv_Einlesedatum = Now.ToShortDateString
|
||||||
|
PLOSE_INV.plInv_Datensatztyp = "PDF"
|
||||||
|
PLOSE_INV.plInv_PLOSEKundennummer = SQL.isleernothing(currentRow(0))
|
||||||
|
PLOSE_INV.plInv_Firmenname = SQL.isleernothing(currentRow(1))
|
||||||
|
PLOSE_INV.plInv_Services = SQL.isleernothing(currentRow(21))
|
||||||
|
|
||||||
|
Select Case origCurrency 'HUF immer in Fremdwährung abpeichern...
|
||||||
|
Case "HUF"
|
||||||
|
PLOSE_INV.plInv_Currency = "HUF"
|
||||||
|
PLOSE_INV.plInv_Nettobetrag = CDbl(CDbl(SQL.isNullReturnValue(currentRow(12), 0).replace(".", ",")))
|
||||||
|
PLOSE_INV.plInv_MWSTBetrag = CDbl(SQL.isNullReturnValue(currentRow(13), 0).replace(".", ","))
|
||||||
|
PLOSE_INV.plInv_Bruttobetrag = CDbl(SQL.isNullReturnValue(currentRow(15), 0).replace(".", ","))
|
||||||
|
|
||||||
|
Case Else
|
||||||
|
PLOSE_INV.plInv_Currency = "EUR"
|
||||||
|
PLOSE_INV.plInv_Nettobetrag = CDbl(CDbl(SQL.isNullReturnValue(currentRow(16), 0).replace(".", ",")))
|
||||||
|
PLOSE_INV.plInv_MWSTBetrag = CDbl(SQL.isNullReturnValue(currentRow(17), 0).replace(".", ","))
|
||||||
|
PLOSE_INV.plInv_Bruttobetrag = CDbl(SQL.isNullReturnValue(currentRow(19), 0).replace(".", ","))
|
||||||
|
End Select
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
' [plInv_daId]
|
||||||
|
|
||||||
|
'If If(PLOSE_INV.plInv_PdfFileName, "") <> "" Then 'And PLOSE_INV.plInv_daId Is Nothing Then
|
||||||
|
' PLOSE_INV.plInv_daId = SQL.getValueTxtBySql("SELECT TOP (1) [da_id] FROM [tblDatenarchiv] where da_kategorie = 'MDM' AND da_ordner='MDM_DATEN' and da_name='" & PLOSE_INV.plInv_PdfFileName & "' order by da_id desc", "FMZOLL",,, Nothing)
|
||||||
|
'End If
|
||||||
|
|
||||||
|
|
||||||
|
PLOSE_INV.plInv_Dateiname = fi.Name
|
||||||
|
|
||||||
|
''''''''''''
|
||||||
|
If PLOSE_INV.SAVEUNQIUE() Then
|
||||||
|
|
||||||
|
' UPDATE tblPLOSE_Details:
|
||||||
|
SQL.doSQL("UPDATE [tblPLOSE_Details] SET [plose_plInvId] ='" & PLOSE_INV.plInv_Id & "' where plose_SupplierRechnungsNr='" & PLOSE_INV.plInv_SupplierRechnungsNr & "' AND plose_SupplierRechnungsDatum='" & PLOSE_INV.plInv_SupplierRechnungsDatum & "'", "FMZOLL")
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
cnt += 1
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
End Try
|
||||||
|
End While
|
||||||
|
|
||||||
|
|
||||||
|
readPLOSE_INVData_NEW_FORMAT = "Zeilen: " & cnt
|
||||||
|
|
||||||
|
End Using
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Try
|
||||||
|
' System.IO.File.Delete(p)
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
addDGVEinarbeitung("PLOSE: INV_DATA (" & cnt & ")", readPLOSE_INVData_NEW_FORMAT)
|
||||||
|
|
||||||
|
' End Using
|
||||||
|
|
||||||
|
'End If
|
||||||
|
|
||||||
|
Catch ex As Exception
|
||||||
|
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace & vbNewLine & "Datei: " & Dateiname, System.Reflection.MethodInfo.GetCurrentMethod.Name)
|
||||||
|
MsgBox(ex.StackTrace & ex.Message)
|
||||||
|
readPLOSE_INVData_NEW_FORMAT = ""
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Private Sub dgvEinarbeitung_SelectionChanged(sender As Object, e As EventArgs) Handles dgvEinarbeitung.SelectionChanged
|
Private Sub dgvEinarbeitung_SelectionChanged(sender As Object, e As EventArgs) Handles dgvEinarbeitung.SelectionChanged
|
||||||
dgvEinarbeitung.ClearSelection()
|
dgvEinarbeitung.ClearSelection()
|
||||||
|
|||||||
2046
initATLASAufschubkonten/frmStartOptions.Designer.vb
generated
2046
initATLASAufschubkonten/frmStartOptions.Designer.vb
generated
File diff suppressed because it is too large
Load Diff
@@ -767,6 +767,30 @@
|
|||||||
+z1oZ9B6syqzaGEdYX5mdmYqt4qgQDVINcVjocfByBORr63brCulbaW10NVQHYibiNsHbQ+6L24q7oAu
|
+z1oZ9B6syqzaGEdYX5mdmYqt4qgQDVINcVjocfByBORr63brCulbaW10NVQHYibiNsHbQ+6L24q7oAu
|
||||||
RxPAxs8mJG4iDmp1USehIAMuLi4GeXl5NlNTU347OzsRe3t7UWRsZ2cnbG5uzicrK8vKxcVFXOmCD0hK
|
RxPAxs8mJG4iDmp1USehIAMuLi4GeXl5NlNTU347OzsRe3t7UWRsZ2cnbG5uzicrK8vKxcVFXOmCD0hK
|
||||||
SjJ6enoK1NXVqU6aNMlg2rRpxsh48uTJus3NzYqurq68EhISJGd6ADkzAttxL7feAAAAAElFTkSuQmCC
|
SjJ6enoK1NXVqU6aNMlg2rRpxsh48uTJus3NzYqurq68EhISJGd6ADkzAttxL7feAAAAAElFTkSuQmCC
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
|
<data name="pbOfferten.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>
|
||||||
|
iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAABGdBTUEAALGPC/xhBQAABGdJREFUSEtj
|
||||||
|
YKAyYOFk4Za0knSzzrXOd8x2jJeUlGRgZ2dHV0YFwMjAKKInomlUYJRl32e/wn+Z/0Gf2T4L9eP1rQRV
|
||||||
|
BQWZ2JnQdVAGBNQEFI2KjHLCj4Qfjz0f+zX+Uvz/iKMR9z2XeU7USdNxENYVFmZkYWRE10c2sGqyKgg/
|
||||||
|
FH4s7mLcPxAGWQhjR5+Pnm5Wa+bAxs/Ggq6PbODQ77Aw5mzMO5BF6DjuYtzDoB1BU5ynO9uh6yMZcIpy
|
||||||
|
Sin5KsX5rva9gMWiP3EX4354LPDYb9VkVWpSZmKIrp8kwMrDyifnLBcUtCPoYfSp6G9oln2PPh39InRf
|
||||||
|
6EXVYNUYLjEuCXT9JAMFT4UI5+nO22POxPyMuxD3F83CK/4b/CdoJ2hb8CnwiTIyM5Iff8yczNxSVlJu
|
||||||
|
Nm02i8P2h72EJRKwRRfifsScibnts9Kn0yjfyIZfkZ+bhZOFGd0MkgC7ALuIXppeDXq8xZ6L/Rl+MPyR
|
||||||
|
2xy3iXpperai+qLUyfG4LIw8GvnGY57HVnFDcTk2bjZ0beQBHikeeWV/5QTvpd4nI49FfoRZFnM+5rdd
|
||||||
|
j91KEV0REzY+Ng5GZgJ5nJmDmZtPgU9dwUPBUsZeRoNLgosNXRO7ILsIOKFMdd4adTzqE7Lv/Pf6b9JM
|
||||||
|
1wxB0YALgFIQrxyvmlacVrHfer/prnNccxW9FWXZBdhZGZCKQEENQUOzKrMpaKnxR9zFuOeWMyy9JDwl
|
||||||
|
WJHNxQk4xTilVAJVkkP2hjyLPhP9NvJE5C7PJZ7J4ibikqw8rPDkjMPCazEXYorkveWVWHiISPnMHMxc
|
||||||
|
qsGqKe7z3Q+Cy75LcSBDXkQcjdjuMMEhStJKUo6JlYmVlZdVQD9Lv8F3je9FeKq8EHvZf5N/j26Grg6P
|
||||||
|
LA8PutlYgYKbQqjzVOdtyK6GuvxD7IXYlea15v5ixmISXBJcsm5z3PZC5X7FXYx7Grg9cKpZlZkzuxA7
|
||||||
|
GxMrE4FUAgXIpTuahWDxmPMx011mudiiWQhyzBKzSjMvQQ1BXnQz8QJpG2lPZX/lKMs6y464i3H34y/F
|
||||||
|
g+syJIsfhh8KPw6yLPxQ+GuQWOSRyNc27Tbd0rbSZizcZJQibHxsvBImEsamFaaVrjNdNwXvDH6A7mMY
|
||||||
|
BlnqNtttj5yrXDAosaGbRTKQdZYNsOu2WxZ9MvpD3IW43/GX4hHl5MW4n75rfI/pZ+kXsouwC6HrJQuw
|
||||||
|
cLPwKngqeLvPc18adTLqRfyl+F9IFt73We0zQTdd14BdkIotI25JbgkZBxkHtVC1JLc5brtjz8f+jL0Q
|
||||||
|
+z1oZ9B6syqzaGEdYX5mdmYqt4qgQDVINcVjocfByBORr63brCulbaW10NVQHYibiNsHbQ+6L24q7oAu
|
||||||
|
RxPAxs8mJG4iDmp1USehIAMuLi4GeXl5NlNTU347OzsRe3t7UWRsZ2cnbG5uzicrK8vKxcVFXOmCD0hK
|
||||||
|
SjJ6enoK1NXVqU6aNMlg2rRpxsh48uTJus3NzYqurq68EhISJGd6ADkzAttxL7feAAAAAElFTkSuQmCC
|
||||||
</value>
|
</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PictureBox12.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
<data name="PictureBox12.BackgroundImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
|||||||
@@ -6,11 +6,10 @@ Imports System.Security.Cryptography.X509Certificates
|
|||||||
Imports System.Text
|
Imports System.Text
|
||||||
Imports System.Threading
|
Imports System.Threading
|
||||||
Imports System.Xml
|
Imports System.Xml
|
||||||
Imports com.sun.xml.internal.rngom
|
Imports com.sun.org.apache.xpath.internal.operations
|
||||||
Imports iTextSharp.text
|
Imports iTextSharp.text
|
||||||
Imports javax
|
Imports javax
|
||||||
Imports MDM_Worker
|
Imports MDM_Worker
|
||||||
Imports Microsoft.Office.Interop
|
|
||||||
Imports Renci.SshNet
|
Imports Renci.SshNet
|
||||||
Imports VERAG_PROG_ALLGEMEIN
|
Imports VERAG_PROG_ALLGEMEIN
|
||||||
Imports VERAG_PROG_ALLGEMEIN.cAllgemein
|
Imports VERAG_PROG_ALLGEMEIN.cAllgemein
|
||||||
@@ -111,6 +110,8 @@ Public Class frmStartOptions
|
|||||||
cbxGestellungspeichern.Checked = Paramslist.GET_PARAMETER_VALUE_BOOL("Gestellung_erstellen")
|
cbxGestellungspeichern.Checked = Paramslist.GET_PARAMETER_VALUE_BOOL("Gestellung_erstellen")
|
||||||
cbxVW_Infomail.Checked = Paramslist.GET_PARAMETER_VALUE_BOOL("Gestellung_erstellen_Infomail")
|
cbxVW_Infomail.Checked = Paramslist.GET_PARAMETER_VALUE_BOOL("Gestellung_erstellen_Infomail")
|
||||||
cbxGESTELLUNG_TESTLAUF.Checked = Paramslist.GET_PARAMETER_VALUE_BOOL("Gestellung_TESTLAUF")
|
cbxGESTELLUNG_TESTLAUF.Checked = Paramslist.GET_PARAMETER_VALUE_BOOL("Gestellung_TESTLAUF")
|
||||||
|
cbxPlose_TRNewFormat.Checked = Paramslist.GET_PARAMETER_VALUE_BOOL("PLOSE_TR_newFormat")
|
||||||
|
cbxPlose_INVNewFormat.Checked = Paramslist.GET_PARAMETER_VALUE_BOOL("PLOSE_INV_newFormat")
|
||||||
|
|
||||||
|
|
||||||
Dim PARAM = "" 'INSERT_BENACHRICHTIGUNG_VERMERKE_TEAMS
|
Dim PARAM = "" 'INSERT_BENACHRICHTIGUNG_VERMERKE_TEAMS
|
||||||
@@ -237,6 +238,8 @@ Public Class frmStartOptions
|
|||||||
Case "MDM_EINARBEITUNG"
|
Case "MDM_EINARBEITUNG"
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
Dim f As New frmMDMNachrichtenVerarbeitung(True)
|
Dim f As New frmMDMNachrichtenVerarbeitung(True)
|
||||||
|
f.newFormatTR = cbxPlose_TRNewFormat.Checked
|
||||||
|
f.newFormatINV = cbxPlose_INVNewFormat.Checked
|
||||||
' Me.Visible = False
|
' Me.Visible = False
|
||||||
f.Show()
|
f.Show()
|
||||||
AddHandler f.FormClosed, AddressOf closeMe
|
AddHandler f.FormClosed, AddressOf closeMe
|
||||||
@@ -4106,6 +4109,8 @@ Public Class frmStartOptions
|
|||||||
Me.Visible = False
|
Me.Visible = False
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = True
|
||||||
Dim f As New frmMDMNachrichtenVerarbeitung
|
Dim f As New frmMDMNachrichtenVerarbeitung
|
||||||
|
f.newFormatTR = cbxPlose_TRNewFormat.Checked
|
||||||
|
f.newFormatINV = cbxPlose_INVNewFormat.Checked
|
||||||
f.ShowDialog()
|
f.ShowDialog()
|
||||||
Me.Visible = True
|
Me.Visible = True
|
||||||
End Sub
|
End Sub
|
||||||
@@ -4114,6 +4119,8 @@ Public Class frmStartOptions
|
|||||||
Me.Visible = False
|
Me.Visible = False
|
||||||
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = False
|
||||||
Dim f As New frmMDMNachrichtenVerarbeitung
|
Dim f As New frmMDMNachrichtenVerarbeitung
|
||||||
|
f.newFormatTR = cbxPlose_TRNewFormat.Checked
|
||||||
|
f.newFormatINV = cbxPlose_INVNewFormat.Checked
|
||||||
f.ShowDialog()
|
f.ShowDialog()
|
||||||
Me.Visible = True
|
Me.Visible = True
|
||||||
End Sub
|
End Sub
|
||||||
@@ -5314,6 +5321,17 @@ Public Class frmStartOptions
|
|||||||
Dim count As Integer = 0
|
Dim count As Integer = 0
|
||||||
countmissingCSinPortfolio(count)
|
countmissingCSinPortfolio(count)
|
||||||
lbl_CS_online.Text = count
|
lbl_CS_online.Text = count
|
||||||
|
|
||||||
|
ElseIf tbcntr.SelectedIndex = 6 Then
|
||||||
|
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cbxDatevTest.Checked
|
||||||
|
|
||||||
|
cbxOffertenNr.Items.Clear()
|
||||||
|
cbxOffertenNr.fillWithSQL("SELECT [OffertenNr],[OffertenBez] FROM [Offertenstamm] order by OffertenNr", True, "FMZOLL", True)
|
||||||
|
cbxOffertenNr.changeItem("")
|
||||||
|
cbxLeistungNr.Items.Clear()
|
||||||
|
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
@@ -8566,7 +8584,7 @@ repeatRequest:
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Dim dt_bestellungen_aggregiert As DataTable = SQL.loadDgvBySql("select * from (SELECT 1 as tagID, eb_gebaeude, 'Montag' AS Tag, eb_montag AS Menu, COUNT(*) AS Anzahl" & SQLAnmerkung & " FROM tblEssensbestellungen WHERE ISNULL(eb_montag,'') <> '' and " & SQLWHERE & " GROUP BY eb_gebaeude, eb_montag UNION ALL
|
Dim dt_bestellungen_aggregiert As DataTable = SQL.loadDgvBySql("select * from (SELECT 1 as tagID, eb_gebaeude, 'Montag' AS Tag, eb_montag AS Menu, COUNT(*) AS Anzahl" & SQLAnmerkung & " FROM tblEssensbestellungen WHERE ISNULL(eb_montag,'') <> '' and " & SQLWHERE & " GROUP BY eb_gebaeude, eb_montag UNION ALL
|
||||||
SELECT 2 as tagID, eb_gebaeude, 'Dienstag' AS Tag, eb_dienstag AS Menu, COUNT(*) AS Anzahl" & SQLAnmerkung & " FROM tblEssensbestellungen WHERE ISNULL(eb_dienstag,'') <> '' and " & SQLWHERE & " GROUP BY eb_gebaeude, eb_dienstag UNION ALL
|
SELECT 2 as tagID, eb_gebaeude, 'Dienstag' AS Tag, eb_dienstag AS Menu, COUNT(*) AS Anzahl" & SQLAnmerkung & " FROM tblEssensbestellungen WHERE ISNULL(eb_dienstag,'') <> '' and " & SQLWHERE & " GROUP BY eb_gebaeude, eb_dienstag UNION ALL
|
||||||
SELECT 3 as tagID, eb_gebaeude, 'Mittwoch' AS Tag, eb_mittwoch AS Menu, COUNT(*) AS Anzahl" & SQLAnmerkung & " FROM tblEssensbestellungen WHERE ISNULL(eb_mittwoch,'') <> '' and " & SQLWHERE & " GROUP BY eb_gebaeude, eb_mittwoch UNION ALL
|
SELECT 3 as tagID, eb_gebaeude, 'Mittwoch' AS Tag, eb_mittwoch AS Menu, COUNT(*) AS Anzahl" & SQLAnmerkung & " FROM tblEssensbestellungen WHERE ISNULL(eb_mittwoch,'') <> '' and " & SQLWHERE & " GROUP BY eb_gebaeude, eb_mittwoch UNION ALL
|
||||||
SELECT 4 as tagID, eb_gebaeude, 'Donnerstag' AS Tag, eb_donnerstag AS Menu, COUNT(*) AS Anzahl" & SQLAnmerkung & " FROM tblEssensbestellungen WHERE ISNULL(eb_donnerstag,'') <> '' and " & SQLWHERE & " GROUP BY eb_gebaeude, eb_donnerstag UNION ALL
|
SELECT 4 as tagID, eb_gebaeude, 'Donnerstag' AS Tag, eb_donnerstag AS Menu, COUNT(*) AS Anzahl" & SQLAnmerkung & " FROM tblEssensbestellungen WHERE ISNULL(eb_donnerstag,'') <> '' and " & SQLWHERE & " GROUP BY eb_gebaeude, eb_donnerstag UNION ALL
|
||||||
@@ -8717,5 +8735,221 @@ repeatRequest:
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Private Sub Button34_Click(sender As Object, e As EventArgs) Handles Button34.Click
|
||||||
|
|
||||||
|
VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM = cbxDatevTest.Checked
|
||||||
|
|
||||||
|
If cbxOffertenNr._value <> "" AndAlso IsNumeric(cbxOffertenNr._value) AndAlso cbxLeistungNr._value <> "" AndAlso IsNumeric(cbxLeistungNr._value) Then
|
||||||
|
Dim dt As DataTable = checkLeitungsNrimOffert(cbxOffertenNr._value, cbxLeistungNr._value)
|
||||||
|
|
||||||
|
If dt.Rows.Count > 0 Then
|
||||||
|
Dim STDOF As New cStandardofferten(cbxOffertenNr._value, "EUR", cbxLeistungNr._value, cbxLeistungNr.SelectedItem.text)
|
||||||
|
If STDOF.hasEntry Then
|
||||||
|
|
||||||
|
|
||||||
|
If Not checkStandardOffert(STDOF) Then
|
||||||
|
MsgBox("BerechnungsartNr ist nicht im Standardoffert hinterlegt!")
|
||||||
|
Else
|
||||||
|
showPic(insertOfferenPositionen(STDOF), pbOfferten)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
showPic(True, pbOfferten)
|
||||||
|
End If
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
|
Private Function checkLeitungsNrimOffert(OffertenNr As Integer, LeistungsNr As Integer) As DataTable
|
||||||
|
|
||||||
|
Dim sqlWhere = ""
|
||||||
|
Dim selectString = "*"
|
||||||
|
If cbxNurAktiveKunen.Checked Then
|
||||||
|
sqlWhere = " inner join Adressen on Adressen.AdressenNr = Temp.KundenNr
|
||||||
|
inner join Kunden on Kunden.KundenNr = Temp.KundenNr
|
||||||
|
where isnull(Kunden.Abfertigungsverbot, 0) = 0 and Adressen.Auswahl = 'A'"
|
||||||
|
|
||||||
|
selectString = "Kunden.KundenNr, OffertenNr"
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim sqlStringFehlendeOffertenNr = "select " & selectString & " from (select KundenNr, OffertenNr from Offertenpositionen where OffertenNr = " & OffertenNr & "
|
||||||
|
GROUP by KundenNr, OffertenNr
|
||||||
|
EXCEPT
|
||||||
|
select KundenNr, OffertenNr from Offertenpositionen where LeistungsNr = " & LeistungsNr & " and OffertenNr = " & OffertenNr & "
|
||||||
|
GROUP by KundenNr, OffertenNr) as Temp " & sqlWhere
|
||||||
|
|
||||||
|
Dim dtfehlendeOfferten As DataTable = (New SQL).loadDgvBySql(sqlStringFehlendeOffertenNr, "FMZOLL")
|
||||||
|
If dtfehlendeOfferten.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
Select Case MsgBox("Es fehlen bei " & dtfehlendeOfferten.Rows.Count & IIf(cbxNurAktiveKunen.Checked, " aktiven", "") & " Kunden im Offert " & OffertenNr & " die LeistungsNr " & LeistungsNr & "!" & vbNewLine & "Soll diese eingefügt werden??", vbYesNoCancel)
|
||||||
|
Case vbYes
|
||||||
|
Case vbNo : dtfehlendeOfferten.Clear()
|
||||||
|
Case Else : dtfehlendeOfferten.Clear()
|
||||||
|
End Select
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return dtfehlendeOfferten
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function checkStandardOffert(StandardOffert As cStandardofferten) As Boolean
|
||||||
|
If StandardOffert.BerechnungsartNr Is Nothing Then
|
||||||
|
|
||||||
|
If txtBerechnungsart.Text <> "" AndAlso IsNumeric(txtBerechnungsart.Text) AndAlso txtBerechnungsart.Text.Length = 1 Then
|
||||||
|
StandardOffert.BerechnungsartNr = txtBerechnungsart.Text
|
||||||
|
Return True
|
||||||
|
Else
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
|
||||||
|
Else
|
||||||
|
Return True
|
||||||
|
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function insertOfferenPositionen(StandardOffert As cStandardofferten)
|
||||||
|
|
||||||
|
Dim sqlWhere = ""
|
||||||
|
If cbxNurAktiveKunen.Checked Then
|
||||||
|
sqlWhere = " inner join Adressen on Adressen.AdressenNr = Temp.KundenNr
|
||||||
|
inner join Kunden on Kunden.KundenNr = Temp.KundenNr
|
||||||
|
where isnull(Kunden.Abfertigungsverbot, 0) = 0 and Adressen.Auswahl = 'A'"
|
||||||
|
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim sqlstr_select As String = "SELECT
|
||||||
|
Temp.KundenNr,
|
||||||
|
Temp.OffertenNr,
|
||||||
|
|
||||||
|
" & SQLSafe(StandardOffert.LeistungsNr) & " AS LeistungsNr,
|
||||||
|
" & SQLSafe(StandardOffert.LeistungsBez) & " AS LeistungsBez,
|
||||||
|
" & SQLSafe(StandardOffert.BerechnungsartNr) & " AS BerechnungsartNr,
|
||||||
|
" & SQLSafe(StandardOffert.Preis) & " AS Preis,
|
||||||
|
" & SQLSafe(StandardOffert.Anzahl) & " AS Anzahl,
|
||||||
|
" & SQLSafe(StandardOffert.BGebLeistungsNr) & " AS BGebLeistungsNr,
|
||||||
|
" & SQLSafe(StandardOffert.BGebProzent) & " AS BGebProzent,
|
||||||
|
" & SQLSafe(StandardOffert.BGebMinBetrag) & " AS BGebMinBetrag,
|
||||||
|
|
||||||
|
GETDATE() AS [Eingegeben am],
|
||||||
|
GETDATE() AS [Geändert am],
|
||||||
|
|
||||||
|
'AUTO-IMPORT' AS Sachbearbeiter,
|
||||||
|
NULL AS Preisänderung,
|
||||||
|
NULL AS PreisänderungProzent,
|
||||||
|
NULL AS PreisAlt,
|
||||||
|
|
||||||
|
" & SQLSafe(StandardOffert.BerechnungsartPosInkludiert) & " AS BerechnungsartPosInkludiert,
|
||||||
|
|
||||||
|
NULL AS MDM_Land,
|
||||||
|
NULL AS MDM_VZ,
|
||||||
|
NULL AS MDM_RMC,
|
||||||
|
NULL AS MDM_Fremd,
|
||||||
|
NULL AS MDM_Preisstaffel
|
||||||
|
|
||||||
|
FROM (
|
||||||
|
SELECT KundenNr, OffertenNr
|
||||||
|
FROM Offertenpositionen
|
||||||
|
WHERE OffertenNr = " & SQLSafe(StandardOffert.OffertenNr) & "
|
||||||
|
GROUP BY KundenNr, OffertenNr
|
||||||
|
|
||||||
|
EXCEPT
|
||||||
|
|
||||||
|
SELECT KundenNr, OffertenNr
|
||||||
|
FROM Offertenpositionen
|
||||||
|
WHERE LeistungsNr = " & SQLSafe(StandardOffert.LeistungsNr) & "
|
||||||
|
AND OffertenNr = " & SQLSafe(StandardOffert.OffertenNr) & "
|
||||||
|
GROUP BY KundenNr, OffertenNr
|
||||||
|
) AS Temp " & sqlWhere
|
||||||
|
|
||||||
|
|
||||||
|
Dim dt As DataTable = (New SQL).loadDgvBySql_Param(sqlstr_select, "FMZOLL")
|
||||||
|
|
||||||
|
Dim updated As Boolean = False
|
||||||
|
|
||||||
|
If dt.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
|
||||||
|
Dim InsertSatement As String = " INSERT INTO Offertenpositionen
|
||||||
|
(
|
||||||
|
[KundenNr]
|
||||||
|
,[OffertenNr]
|
||||||
|
,[LeistungsNr]
|
||||||
|
,[LeistungsBez]
|
||||||
|
,[BerechnungsartNr]
|
||||||
|
,[Preis]
|
||||||
|
,[Anzahl]
|
||||||
|
,[BGebLeistungsNr]
|
||||||
|
,[BGebProzent]
|
||||||
|
,[BGebMinBetrag]
|
||||||
|
,[Eingegeben am]
|
||||||
|
,[Geändert am]
|
||||||
|
,[Sachbearbeiter]
|
||||||
|
,[Preisänderung]
|
||||||
|
,[PreisänderungProzent]
|
||||||
|
,[PreisAlt]
|
||||||
|
,[BerechnungsartPosInkludiert]
|
||||||
|
,[MDM_Land]
|
||||||
|
,[MDM_VZ]
|
||||||
|
,[MDM_RMC]
|
||||||
|
,[MDM_Fremd]
|
||||||
|
,[MDM_Preisstaffel]
|
||||||
|
)"
|
||||||
|
|
||||||
|
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
|
||||||
|
|
||||||
|
updated = (New SQL).doSQL(InsertSatement & sqlstr_select, "FMZOLL",,,, 500)
|
||||||
|
|
||||||
|
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return updated
|
||||||
|
|
||||||
|
|
||||||
|
End Function
|
||||||
|
|
||||||
|
Private Function SQLSafe(value As Object, Optional defaultValue As Object = Nothing) As String
|
||||||
|
If value Is Nothing OrElse IsDBNull(value) Then
|
||||||
|
If defaultValue Is Nothing Then Return "NULL"
|
||||||
|
Return defaultValue.ToString()
|
||||||
|
End If
|
||||||
|
|
||||||
|
If TypeOf value Is String Then
|
||||||
|
Return "'" & value.ToString().Replace("'", "''") & "'"
|
||||||
|
End If
|
||||||
|
|
||||||
|
If TypeOf value Is Boolean Then
|
||||||
|
Return If(CBool(value), "1", "0")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return value.ToString().Replace(",", ".")
|
||||||
|
End Function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Private Sub cbxOffertenNr_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxOffertenNr.SelectedIndexChanged
|
||||||
|
If cbxOffertenNr._value <> "" AndAlso IsNumeric(cbxOffertenNr._value) Then
|
||||||
|
txtOfferenNr.Text = cbxOffertenNr.SelectedItem.text
|
||||||
|
cbxLeistungNr.fillWithSQL("SELECT [LeistungsNr],[LeistungsBez] FROM [Standardofferten] where OffertenNr = " & cbxOffertenNr._value, False, "FMZOLL", True)
|
||||||
|
Else
|
||||||
|
txtOfferenNr.Text = ""
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub cbxLeistungNr_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxLeistungNr.SelectedIndexChanged
|
||||||
|
If cbxLeistungNr._value <> "" AndAlso IsNumeric(cbxLeistungNr._value) Then
|
||||||
|
txtLeistungsNr.Text = cbxLeistungNr.SelectedItem.text
|
||||||
|
Else
|
||||||
|
txtLeistungsNr.Text = ""
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
Reference in New Issue
Block a user