Messenger zusätliche Prüfung aus Status, cDatev generisch gesetzt
This commit is contained in:
@@ -354,7 +354,7 @@ Public Class cMessenger
|
||||
End Function
|
||||
|
||||
Public Function READ_ALL_MESSAGES() As Boolean
|
||||
Dim sqlstr = "UPDATE tblMessenger_ChatMessageStatus SET chatMgSt_gelesen=1 FROM [tblMessenger_Chat] INNER JOIN tblMessenger_ChatMessages ON [chat_id]=chatMg_chatId INNER JOIN tblMessenger_ChatMessageStatus ON chatMgSt_chatMsgId=chatMg_id WHERE chat_id=" & Me.chat_id & " AND chatMgSt_MaId=" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & " AND chatMgSt_gelesen=0 AND [chatMgSt_art]='STAT' "
|
||||
Dim sqlstr = "UPDATE tblMessenger_ChatMessageStatus SET chatMgSt_gelesen=1 FROM [tblMessenger_Chat] INNER JOIN tblMessenger_ChatMessages ON [chat_id]=chatMg_chatId INNER JOIN tblMessenger_ChatMessageStatus ON chatMgSt_chatMsgId=chatMg_id WHERE chat_id=" & Me.chat_id & " AND chatMgSt_MaId=" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRID & " AND chatMgSt_gelesen=0 AND ([chatMgSt_art]='STAT' OR [chatMgSt_art]='STATUS') "
|
||||
Return SQL.doSQL(sqlstr, "ADMIN")
|
||||
End Function
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ Partial Class frmMessenger
|
||||
'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
|
||||
<System.Diagnostics.DebuggerStepThrough()> _
|
||||
Private Sub InitializeComponent()
|
||||
Me.components = New System.ComponentModel.Container()
|
||||
Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle()
|
||||
@@ -38,11 +39,11 @@ Partial Class frmMessenger
|
||||
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmMessenger))
|
||||
Me.SplitContainer = New System.Windows.Forms.SplitContainer()
|
||||
Me.SplitContainer2 = New System.Windows.Forms.SplitContainer()
|
||||
Me.dgvChats = New VERAG_PROG_ALLGEMEIN.MyDatagridview()
|
||||
Me.dgvChats = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||
Me.Panel6 = New System.Windows.Forms.Panel()
|
||||
Me.lblLKWChat_MsgCntInaktiv = New System.Windows.Forms.Label()
|
||||
Me.cbxInaktiveChats = New System.Windows.Forms.CheckBox()
|
||||
Me.DGVSonstige = New VERAG_PROG_ALLGEMEIN.MyDatagridview()
|
||||
Me.DGVSonstige = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
|
||||
Me.Panel5 = New System.Windows.Forms.Panel()
|
||||
Me.MyTextBox2 = New VERAG_PROG_ALLGEMEIN.MyTextBox()
|
||||
Me.PictureBox2 = New System.Windows.Forms.PictureBox()
|
||||
@@ -63,7 +64,7 @@ Partial Class frmMessenger
|
||||
Me.btnNeu = New System.Windows.Forms.Button()
|
||||
Me.Button1 = New System.Windows.Forms.Button()
|
||||
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer()
|
||||
Me.MyFlowLayoutPanel1 = New VERAG_PROG_ALLGEMEIN.MyFlowLayoutPanel()
|
||||
Me.MyFlowLayoutPanel1 = New VERAG_PROG_ALLGEMEIN.MyFlowLayoutPanel(Me.components)
|
||||
Me.UsrCntlMessenger_ChatElement1 = New VERAG_PROG_ALLGEMEIN.usrCntlMessenger_ChatElement()
|
||||
Me.Panel3 = New System.Windows.Forms.Panel()
|
||||
Me.btnTeilnehmer = New System.Windows.Forms.Button()
|
||||
@@ -90,9 +91,9 @@ Partial Class frmMessenger
|
||||
Me.btnSendAtt = New System.Windows.Forms.Button()
|
||||
Me.btnSenden = New System.Windows.Forms.Button()
|
||||
Me.rtbChatMessage = New System.Windows.Forms.RichTextBox()
|
||||
Me.TimerNEW_MESSAGE = New System.Windows.Forms.Timer()
|
||||
Me.Timer_REFRESH = New System.Windows.Forms.Timer()
|
||||
Me.cntxt = New System.Windows.Forms.ContextMenuStrip()
|
||||
Me.TimerNEW_MESSAGE = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.Timer_REFRESH = New System.Windows.Forms.Timer(Me.components)
|
||||
Me.cntxt = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.ChatDeaktivierenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.toolChatReminder = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.DataGridViewTextBoxColumn1 = New System.Windows.Forms.DataGridViewTextBoxColumn()
|
||||
|
||||
@@ -8,18 +8,18 @@
|
||||
Shared Kontenlänge As Integer = 6
|
||||
Shared Formatversion As Integer = 4
|
||||
Shared SQL As New VERAG_PROG_ALLGEMEIN.SQL
|
||||
|
||||
'STAMMDATEN
|
||||
Shared Function getStammdaten() As DataTable
|
||||
Dim sqlStr = "Select top (10) KundenNrZentrale As [Kontonummer], isnull([Name 1],'') as Name, isnull([Name 2],'') as Name2, LTRIM([Ort]) as Ort,KundenNr As [Kundennummer],isnull(UstIdKz,'') As [EU-Land] ,isnull(UstIdNr,'') As [EU-UstID], isnull(Anrede,'') as Anrede,isnull(KTO,'') as Bankkonto, isnull(BLZ,'') as [BLZ], '' as [Bankname], '' as [Länderkennzeichen Bank], '' as [IBAN], '' as [BIC], '' as [Anrede], '' as [Adresszusatz], ISNULL([Strasse],'') as Strasse, ISNULL(PLZ,'') as PLZ, isnull(UstIdNr,'') as [Steuernummer], isnull(Ansprechpartner,'') as [Ansprechpartner], isnull(Telefon,'') as [Telefonnummer], isnull([E-Mail],'') as [E-Mail], isnull([Telefax],'') as [Faxnummer], '' as [Internetadresse], isnull(Adressen.landkz,'') as [Länderkennzeichen]"
|
||||
Shared Function getStammdaten(filialNr As Integer) As DataTable
|
||||
Dim sqlStr = "Select TOP (1000) KundenNrZentrale As [Kontonummer], isnull([Ordnungsbegriff],'') as Ordnungsbegriff, isnull([Name 1],'') as Name, isnull([Name 2],'') as Name2, LTRIM([Ort]) as Ort,KundenNr As [Kundennummer],isnull(UstIdKz,'') As [EU-Land] ,isnull(UstIdNr,'') As [EU-UstID], isnull(Anrede,'') as Anrede,isnull(KTO,'') as Bankkonto, isnull(BLZ,'') as [BLZ], '' as [Bankname], '' as [Länderkennzeichen Bank], '' as [IBAN], '' as [BIC], '' as [Anrede], '' as [Adresszusatz], ISNULL([Strasse],'') as Strasse, ISNULL(PLZ,'') as PLZ, isnull(UstIdNr,'') as [Steuernummer], isnull(Ansprechpartner,'') as [Ansprechpartner], isnull(Telefon,'') as [Telefonnummer], isnull([E-Mail],'') as [E-Mail], isnull([Telefax],'') as [Faxnummer], '' as [Internetadresse], isnull(Adressen.landkz,'') as [Länderkennzeichen]"
|
||||
sqlStr &= " FROM Adressen INNER JOIN Kunden ON Kundennr=AdressenNr "
|
||||
sqlStr &= " LEFT JOIN tblKundenErweitert ON KundenNr=kde_KundenNr "
|
||||
sqlStr &= " LEFT JOIN [Länderverzeichnis für die Außenhandelsstatistik] as St ON St.LandKz=Adressen.LandKz "
|
||||
sqlStr &= " LEFT JOIN Währungstabelle ON St.LandNr = Währungstabelle.Währungsschlüssel "
|
||||
sqlStr &= "WHERE Auswahl='A' AND FilialenNr='5701' AND FiBuSchnittstelle=1 "
|
||||
sqlStr &= "WHERE Auswahl='A' AND FilialenNr='" & filialNr & "'" 'AND FiBuSchnittstelle=1
|
||||
sqlStr &= " Order by [Kontonummer] "
|
||||
Return SQL.loadDgvBySql(sqlStr, "FMZOLL")
|
||||
End Function
|
||||
'
|
||||
|
||||
Shared Function updateFibu() As DataTable
|
||||
Dim sqlStr = " UPDATE Kunden "
|
||||
@@ -45,7 +45,7 @@
|
||||
personenRow &= FormatStringDVO(row("Name2"), 50) & ";"
|
||||
personenRow &= emptyFormatedValue(4)
|
||||
'personenRow &= FormatStringDVO(2) & ";" 'Typ Unternehmen
|
||||
personenRow &= FormatStringDVO(row("Name"), 15) & ";"
|
||||
personenRow &= FormatStringDVO(row("Ordnungsbegriff"), 15) & ";"
|
||||
personenRow &= FormatStringDVO(row("EU-Land")) & ";"
|
||||
personenRow &= FormatStringDVO(row("EU-UstID")) & ";"
|
||||
personenRow &= FormatStringDVO(row("Anrede")) & ";"
|
||||
@@ -78,11 +78,23 @@
|
||||
End Function
|
||||
|
||||
|
||||
Public Shared Function genDatensatzCSV_Stammdaten(Optional OpenFile As Boolean = False, Optional Geschaeftsjahr As Integer = -1) As Boolean ' Optional OpenFile = False, Optional boolKunden = True, Optional boolBuchungen = True ) As Boolean
|
||||
Try
|
||||
Public Shared Function genDatensatzCSV_Stammdaten(ByRef Firma_ID As Integer, Optional OpenFile As Boolean = False, Optional Geschaeftsjahr As Integer = -1) As Boolean ' Optional OpenFile = False, Optional boolKunden = True, Optional boolBuchungen = True ) As Boolean
|
||||
Try
|
||||
|
||||
Dim bool_DatenVorhanden As Boolean = False
|
||||
If Geschaeftsjahr <= 0 Then Geschaeftsjahr = Now.Year 'If(Now.Month = 1, Now.Year - 1, Now.Year) --> Bei IMEX ist das GJ=Wirtschaftsjahr
|
||||
Dim FIRMA As New VERAG_PROG_ALLGEMEIN.cFirmen(Firma_ID)
|
||||
Dim filialNr As Integer
|
||||
|
||||
Select Case FIRMA.Firma_ID
|
||||
Case 24 : filialNr = 5701
|
||||
|
||||
Case Else : filialNr = -1
|
||||
|
||||
|
||||
End Select
|
||||
|
||||
|
||||
Dim bool_DatenVorhanden As Boolean = False
|
||||
If Geschaeftsjahr <= 0 Then Geschaeftsjahr = Now.Year 'If(Now.Month = 1, Now.Year - 1, Now.Year) --> Bei IMEX ist das GJ=Wirtschaftsjahr
|
||||
|
||||
'DATEIPFAD für Stammdaten
|
||||
'-------------------------------------------------------------------------------------------
|
||||
@@ -91,20 +103,20 @@
|
||||
'pathKD = pathArchivKD 'TEST
|
||||
|
||||
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
|
||||
'path = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir
|
||||
'pathArchivKD = ""
|
||||
End If
|
||||
If Not IO.Directory.Exists(pathKD) Then IO.Directory.CreateDirectory(pathKD)
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
'path = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir
|
||||
'pathArchivKD = ""
|
||||
End If
|
||||
If Not IO.Directory.Exists(pathKD) Then IO.Directory.CreateDirectory(pathKD)
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
If True Then 'boolKunden Then
|
||||
'----------------- STAMMDATEN -----------------
|
||||
Dim dt_Stamm As DataTable = getStammdaten()
|
||||
If dt_Stamm IsNot Nothing AndAlso dt_Stamm.Rows.Count > 0 Then
|
||||
If True Then 'boolKunden Then
|
||||
'----------------- STAMMDATEN -----------------
|
||||
Dim dt_Stamm As DataTable = getStammdaten(filialNr)
|
||||
If dt_Stamm IsNot Nothing AndAlso dt_Stamm.Rows.Count > 0 Then
|
||||
|
||||
Dim fileKD As System.IO.StreamWriter
|
||||
Dim fileKD As System.IO.StreamWriter
|
||||
Dim DateinameKD = "DTVF_KD_" & Now.ToString("ddMMyyyy_HHmm") & ".csv"
|
||||
fileKD = My.Computer.FileSystem.OpenTextFileWriter(pathKD & DateinameKD, True, System.Text.Encoding.GetEncoding("iso-8859-15"))
|
||||
|
||||
@@ -112,47 +124,47 @@
|
||||
fileKD.WriteLine(genStammdatenHeader(Geschaeftsjahr))
|
||||
fileKD.WriteLine(genStammdatenBeginn())
|
||||
|
||||
initKDNr(dt_Stamm)
|
||||
For Each r In dt_Stamm.Rows
|
||||
fileKD.WriteLine(getPersonenKto(r))
|
||||
Next
|
||||
bool_DatenVorhanden = True
|
||||
initKDNr(dt_Stamm, FIRMA.Firma_ID)
|
||||
For Each r In dt_Stamm.Rows
|
||||
fileKD.WriteLine(getPersonenKto(r))
|
||||
Next
|
||||
bool_DatenVorhanden = True
|
||||
|
||||
|
||||
fileKD.Close()
|
||||
fileKD.Close()
|
||||
|
||||
'In Archiv sichern
|
||||
If pathArchivKD <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If pathKD <> pathArchivKD Then IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
End If
|
||||
'In Archiv sichern
|
||||
If pathArchivKD <> "" Then
|
||||
If Not IO.Directory.Exists(pathArchivKD) Then IO.Directory.CreateDirectory(pathArchivKD)
|
||||
If pathKD <> pathArchivKD Then IO.File.Copy(pathKD & DateinameKD, pathArchivKD & DateinameKD)
|
||||
End If
|
||||
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(pathKD & DateinameKD)
|
||||
Else
|
||||
IO.File.Delete(pathKD & DateinameKD)
|
||||
End If
|
||||
If bool_DatenVorhanden Then
|
||||
If OpenFile Then Process.Start(pathKD & DateinameKD)
|
||||
Else
|
||||
IO.File.Delete(pathKD & DateinameKD)
|
||||
End If
|
||||
|
||||
'updateFibu() ' UPDATE FiBuSchnittstelle --> 0
|
||||
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
Return False
|
||||
End Function
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message & ex.StackTrace)
|
||||
End Try
|
||||
Return False
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Public Shared Function genDatensatzCSV_ALL(Optional OpenFile As Boolean = False, Optional boolKunden As Boolean = True, Optional boolBuchungen As Boolean = True, Optional Geschaeftsjahr As Integer = -1) As Boolean
|
||||
Public Shared Function genDatensatzCSV_ALL(Optional OpenFile As Boolean = False, Optional boolKunden As Boolean = True, Optional boolBuchungen As Boolean = True, Optional Geschaeftsjahr As Integer = -1) As Boolean
|
||||
genDatensatzCSV_ALL = True
|
||||
If boolKunden Then
|
||||
If Not genDatensatzCSV_Stammdaten(OpenFile, Geschaeftsjahr) Then genDatensatzCSV_ALL = False
|
||||
End If
|
||||
If Not genDatensatzCSV_Stammdaten(24, OpenFile, Geschaeftsjahr) Then genDatensatzCSV_ALL = False
|
||||
End If
|
||||
If boolBuchungen Then
|
||||
If Not genDatensatzCSV_Buchungen(24, OpenFile, Geschaeftsjahr) Then genDatensatzCSV_ALL = False
|
||||
|
||||
@@ -178,16 +190,15 @@
|
||||
End If
|
||||
If Not IO.Directory.Exists(path) Then IO.Directory.CreateDirectory(path)
|
||||
If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv)
|
||||
'-------------------------------------------------------------------------------------------
|
||||
'-------------------------------------------------------------------------------------------
|
||||
|
||||
|
||||
Dim NameZusatz = ""
|
||||
Dim NameZusatz = ""
|
||||
Dim Buchungsjahr = -1
|
||||
Select Case FIRMA.Firma_ID
|
||||
Case 21 : NameZusatz = "UNISPED_AT_" : Buchungsjahr = Geschaeftsjahr
|
||||
Case 22 : NameZusatz = "UNISPED_DE_" : Buchungsjahr = Geschaeftsjahr
|
||||
Case 23 : NameZusatz = "UNISPED_ZS_" : Buchungsjahr = Geschaeftsjahr
|
||||
Case 24 : NameZusatz = "AMBAR_" : Buchungsjahr = Geschaeftsjahr
|
||||
Case 24 : NameZusatz = "AMBAR_DE_" : Buchungsjahr = Geschaeftsjahr
|
||||
End Select
|
||||
|
||||
|
||||
@@ -269,10 +280,10 @@
|
||||
,sum(PROD.SteuerfreierBetragLokal) as SteuerfreierBetragLokal,sum(PROD.SteuerpflichtigerBetragFremd) as SteuerpflichtigerBetragFremd,sum(PROD.SteuerfreierBetragFremd) as SteuerfreierBetragFremd,min(Belegdaten) as Belegdaten
|
||||
,min(Sachkonto) as Sachkonto,min(Buchungstext) as Buchungstext
|
||||
FROM VERAG.dbo.tblTrdinInvoice as IVO left JOIN tblTrdinProduct as PROD on IVO.Rechnungsnummer=PROD.Rechnungsnummer
|
||||
WHERE IVO.Rechnungsnummer = '21400139'
|
||||
WHERE Firma_ID ='" & Firma_ID & "' AND TrdinDateiname Is Null
|
||||
group by IVO.Rechnungsnummer,IVO.rechnungsdatum,Leistungsnummer,Leistungsbezeichnung,Steuerpflichtig
|
||||
ORDER BY Rechnungsdatum, Rechnungsnummer "
|
||||
' --and IVO.Rechnungsnummer=19400002
|
||||
' --and IVO.Rechnungsnummer='21400139'
|
||||
Return SQL.loadDgvBySql(sqlStr, "FMZOLL", 9800)
|
||||
|
||||
'WHERE Firma_ID ='" & Firma_ID & "' AND TrdinDateiname Is Null
|
||||
@@ -350,7 +361,7 @@
|
||||
'Erlöskonto
|
||||
genBuchungsZeile &= fill0Stellen(row("Sachkonto"), 4) & ";"
|
||||
'Debitorenkonto
|
||||
genBuchungsZeile &= (initKDNr2(row("KundenNrZentrale"))) & ";"
|
||||
genBuchungsZeile &= (initKDNr2(row("KundenNrZentrale"), FIRMA.Firma_ID)) & ";"
|
||||
|
||||
'BU-Schlüssel -> nicht benötigt
|
||||
|
||||
@@ -441,20 +452,43 @@
|
||||
|
||||
End Function
|
||||
|
||||
Shared Sub initKDNr(ByRef dt As DataTable)
|
||||
For Each r In dt.Rows
|
||||
If IsNumeric(r("Kontonummer")) AndAlso CInt(r("Kontonummer")) > 2000000 Then r("Kontonummer") = (CInt(r("Kontonummer")) - 2000000)
|
||||
' MsgBox((CInt(r("Konto-Nr")) - 1000000) + 200000)
|
||||
Next
|
||||
End Sub
|
||||
Shared Sub initKDNr(ByRef dt As DataTable, ByVal firmaID As Integer)
|
||||
|
||||
Shared Function initKDNr2(ktoNr As String) As String
|
||||
If IsNumeric(ktoNr) AndAlso CInt(ktoNr) > 2000000 Then ktoNr = (CInt(ktoNr) - 2000000) '+ 200000
|
||||
Return ktoNr
|
||||
End Function
|
||||
' Trdin=false
|
||||
Select Case firmaID
|
||||
Case 24
|
||||
|
||||
Shared Function getSteuercode(r As DataRow, FIRMA As VERAG_PROG_ALLGEMEIN.cFirmen) As String
|
||||
For Each r In dt.Rows
|
||||
If IsNumeric(r("Kontonummer")) AndAlso CInt(r("Kontonummer")) > 3000000 AndAlso r("Kontonummer").ToString.Length = 7 Then r("Kontonummer") = (CInt(r("Kontonummer")) - 3000000)
|
||||
Next
|
||||
|
||||
|
||||
Case Else
|
||||
|
||||
For Each r In dt.Rows
|
||||
If IsNumeric(r("Kontonummer")) AndAlso CInt(r("Kontonummer")) > 2000000 Then r("Kontonummer") = (CInt(r("Kontonummer")) - 2000000)
|
||||
' MsgBox((CInt(r("Konto-Nr")) - 1000000) + 200000)
|
||||
Next
|
||||
End Select
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Shared Function initKDNr2(ktoNr As String, ByVal firmaID As Integer) As String
|
||||
Select Case firmaID
|
||||
Case 24
|
||||
If IsNumeric(ktoNr) AndAlso CInt(ktoNr) > 3000000 AndAlso ktoNr.Length = 7 Then ktoNr = (CInt(ktoNr) - 3000000) '- 300000
|
||||
|
||||
Case Else
|
||||
|
||||
If IsNumeric(ktoNr) AndAlso CInt(ktoNr) > 2000000 Then ktoNr = (CInt(ktoNr) - 2000000) '+ 200000
|
||||
End Select
|
||||
|
||||
|
||||
Return ktoNr
|
||||
End Function
|
||||
' Trdin=false
|
||||
|
||||
Shared Function getSteuercode(r As DataRow, FIRMA As VERAG_PROG_ALLGEMEIN.cFirmen) As String
|
||||
Select Case r("Sachkonto")
|
||||
'Case "3550", "3553", "3558"
|
||||
' Return "999"
|
||||
|
||||
Reference in New Issue
Block a user