This commit is contained in:
2024-01-16 09:26:12 +01:00
21 changed files with 2476 additions and 444 deletions

View File

@@ -2360,8 +2360,8 @@ Public Class cAvisoTVDAL
sql &= " AND Standort='" & Standort & "'"
End If
If Standort <> "" Then
sql &= " AND (Special is null or Special='" & Special & "') "
If Special <> "" Then
sql &= " AND (Special is null or Special='" & Special & "' or Special='" & Now.ToShortDateString & "') "
End If
sql &= " ORDER BY Special desc,TVID "

View File

@@ -90,6 +90,7 @@ Public Class cMitarbeiter
Property mit_ATGRNAccessCode_AT52VA6 As Object = Nothing
Property mit_Sprachkentnisse As Object = Nothing
Property mit_homeoffice As Boolean = False
Property mit_timasNichtStempeln As Boolean = False
@@ -200,6 +201,7 @@ Public Class cMitarbeiter
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_ATGRNAccessCode_AT52VA6", mit_ATGRNAccessCode_AT52VA6))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_Sprachkentnisse", mit_Sprachkentnisse))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_homeoffice", mit_homeoffice))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("mit_timasNichtStempeln", mit_timasNichtStempeln))
Return list
@@ -398,6 +400,7 @@ Public Class cMitarbeiter
If Not dr.Item("mit_ATGRNAccessCode_AT52VA6") Is DBNull.Value Then Me.mit_ATGRNAccessCode_AT52VA6 = dr.Item("mit_ATGRNAccessCode_AT52VA6")
If Not dr.Item("mit_Sprachkentnisse") Is DBNull.Value Then Me.mit_Sprachkentnisse = dr.Item("mit_Sprachkentnisse")
Me.mit_homeoffice = dr.Item("mit_homeoffice")
Me.mit_timasNichtStempeln = dr.Item("mit_timasNichtStempeln")
Catch ex As Exception

View File

@@ -0,0 +1,142 @@

Imports System.Data.SqlClient
Imports System.Reflection
Public Class cOrigianlATR
Property atr_id As Integer
Property atr_documentNr As Object = Nothing
Property atr_erfassungsdatum As Date
Property atr_Sachbearbeiter As String
Property atr_mitId As Integer
Property atr_absender As Object = Nothing
Property atr_empfaenger As Object = Nothing
Property atr_austellungsdatum As Object = Nothing
Property atr_AvisoId As Object = Nothing
Property atr_SendungsId As Object = Nothing
Property atr_LKW As Object = Nothing
Property atr_dsId As Object = Nothing
Property atr_DHL_ReferenzNr As Object = Nothing
Property atr_location As Object = Nothing
Property atr_info As Object = Nothing
Public hasEntry = False
Dim SQL As New SQL
Sub New(atr_id)
Me.atr_id = atr_id
LOAD()
End Sub
Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_id", atr_id,, True))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_documentNr", atr_documentNr))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_erfassungsdatum", atr_erfassungsdatum))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_Sachbearbeiter", atr_Sachbearbeiter))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_mitId", atr_mitId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_absender", atr_absender))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_empfaenger", atr_empfaenger))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_austellungsdatum", atr_austellungsdatum))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_AvisoId", atr_AvisoId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_SendungsId", atr_SendungsId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_LKW", atr_LKW))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_dsId", atr_dsId))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_DHL_ReferenzNr", atr_DHL_ReferenzNr))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_location", atr_location))
list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("atr_info", atr_info))
Return list
End Function
Public Function SAVE() As Boolean
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Me.atr_mitId = VERAG_PROG_ALLGEMEIN.cAllgemein.USRID
Me.atr_Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblOriginalATR WHERE atr_id=@atr_id) " &
" BEGIN " & getUpdateCmd() & " END " &
" Else " &
" BEGIN " & getInsertCmd() & " END " &
" commit tran "
Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
End Function
Public Sub LOAD()
Try
hasEntry = False
Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
Using cmd As New SqlCommand("SELECT * FROM tblOriginalATR WHERE atr_id=@atr_id ", conn)
cmd.Parameters.AddWithValue("@atr_id", atr_id)
Dim dr = cmd.ExecuteReader()
If dr.Read Then
For Each li In getParameterList()
Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
If dr.Item(li.Text) Is DBNull.Value Then
propInfo.SetValue(Me, Nothing)
Else
propInfo.SetValue(Me, dr.Item(li.Text))
End If
Next
hasEntry = True
End If
dr.Close()
End Using
End Using
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
End Sub
Public Function getUpdateCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
Return (" UPDATE [tblOriginalATR] SET " & str & " WHERE atr_id=@atr_id ")
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
End Try
Return ""
End Function
Public Function getInsertCmd() As String
Try
Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
Dim str As String = ""
Dim values As String = ""
For Each i In list
If Not i.isPrimaryParam Then
str &= "[" & i.Text & "],"
values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
End If
Next
str = str.Substring(0, str.Length - 1) 'wg. ','
values = values.Substring(0, values.Length - 1) 'wg. ','
Return (" INSERT INTO tblOriginalATR (" & str & ") VALUES(" & values & ") ")
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

View File

@@ -15,34 +15,41 @@ Public Class cRechnungsnummern
Me.SpeditionsbuchNr = SpeditionsbuchNr
Me.Buchungsjahr = Buchungsjahr
Dim BJ_short = Right(Buchungsjahr, 2)
Select Case SpeditionsbuchNr
Case 1, 3, 4, 7, 11, 15, 19
If Now < CDate("01.02.204") Then BJ_short = Now.ToString("yy") ' Bisher wurde das aktuelle Jahr als Angabe für die RgNr verwendet, zukünftig soll es das BJ sein
End Select
'Default-Werte:
'-------------------------------------
Select Case SpeditionsbuchNr
Case 1
VonRechnungsNr = Now.ToString("yy") & "100001"
BisRechnungsNr = Now.ToString("yy") & "199999"
VonRechnungsNr = BJ_short & "100001"
BisRechnungsNr = BJ_short & "199999"
Case 3
VonRechnungsNr = Now.ToString("yy") & "300001"
BisRechnungsNr = Now.ToString("yy") & "399999"
VonRechnungsNr = BJ_short & "300001"
BisRechnungsNr = BJ_short & "399999"
Case 4 'VERAG AG (DE)
VonRechnungsNr = Now.ToString("yy") & "800001"
BisRechnungsNr = Now.ToString("yy") & "899999"
VonRechnungsNr = BJ_short & "800001"
BisRechnungsNr = BJ_short & "899999"
Case 7
VonRechnungsNr = Now.ToString("yy") & "700001"
BisRechnungsNr = Now.ToString("yy") & "799999"
VonRechnungsNr = BJ_short & "700001"
BisRechnungsNr = BJ_short & "799999"
Case 11
VonRechnungsNr = Now.ToString("yy") & "900001"
BisRechnungsNr = Now.ToString("yy") & "999999"
VonRechnungsNr = BJ_short & "900001"
BisRechnungsNr = BJ_short & "999999"
Case 15, 19 'VERAG 360
VonRechnungsNr = Now.ToString("yy") & "200001"
BisRechnungsNr = Now.ToString("yy") & "299999"
VonRechnungsNr = BJ_short & "200001"
BisRechnungsNr = BJ_short & "299999"
Case 20
VonRechnungsNr = Now.ToString("yy") & "400001"
BisRechnungsNr = Now.ToString("yy") & "499999"
VonRechnungsNr = BJ_short & "400001"
BisRechnungsNr = BJ_short & "499999"
Case 17 'FrontOffice
VonRechnungsNr = Now.ToString("yy") & "500001"
BisRechnungsNr = Now.ToString("yy") & "599999"
VonRechnungsNr = BJ_short & "500001"
BisRechnungsNr = BJ_short & "599999"
Case 21 ' UNISPED AT
VonRechnungsNr = "7000000"
@@ -57,8 +64,8 @@ Public Class cRechnungsnummern
VonRechnungsNr = "0000001"
BisRechnungsNr = "9999999"
Case 26 ' VERAG-UNISPED
VonRechnungsNr = Now.ToString("yy") & "0000001"
BisRechnungsNr = Now.ToString("yy") & "9999999"
VonRechnungsNr = BJ_short & "0000001"
BisRechnungsNr = BJ_short & "9999999"
End Select
LfdRechnungsNr = VonRechnungsNr
'-------------------------------------

View File

@@ -333,7 +333,7 @@ Public Class frmMitarbeitersuche
Case "SUB" : timestp = timestp.AddHours(1)
Case "SBG" : timestp = timestp.AddHours(1) 'Verag Post + AT Zoll
Case "WAI" : timestp = timestp.AddMinutes(30)
Case "NKD" : timestp = timestp.AddMinutes(30)
Case "NKD" : timestp = timestp.AddMinutes(20)
Case "DTB" : timestp = timestp.AddMinutes(30)
Case Else
timestp = timestp.AddMinutes(1) 'NICHT ERLAUBT
@@ -370,11 +370,11 @@ Public Class frmMitarbeitersuche
Dim aktengang As DateTime = Now().AddMinutes(-minutesBeforeStart)
Dim askPost As MsgBoxResult = MsgBox("Aktengang für " & VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME & " eintragen?" & vbNewLine & aktengang.ToString(), vbYesNo)
If askPost = vbYes Then
Dim info
Dim info
Dim timestp = aktengang
Dim timeEntryExisting As Boolean = False
Dim isOnline = timas.getTimeEntries(cAllgemein.MITARBEITER.mit_timasId, Nothing, timeEntryExisting)
Dim isOnline = timas.getTimeEntries(cAllgemein.MITARBEITER.mit_timasId, Nothing, timeEntryExisting)
If Not timeEntryExisting AndAlso Not isOnline Then
timas.setTimeEntry(cAllgemein.MITARBEITER, timestp, info, "in", 10) 'Start 10 Aktengang
timestp = timestp.AddMinutes(minutesBeforeStart)
@@ -384,13 +384,13 @@ Public Class frmMitarbeitersuche
End If
MsgBox(info)
Thread.Sleep(2000) 'warten bis Eintrag in Timas-DB
requestDone = False
initTimasData()
End If
Thread.Sleep(2000) 'warten bis Eintrag in Timas-DB
requestDone = False
initTimasData()
End If
Else
Else
'normales kommen/gehen
Dim a As MsgBoxResult = MsgBox(IIf(cbxHomeoffice.Checked, "Homeoffice", "Büro") & vbNewLine & sender.text & " für " & VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME & vbNewLine & Now.ToString(), vbYesNo)

View File

@@ -1358,6 +1358,30 @@ Public Class cSyska_Interface
Return False
End If
End If
OP_LFD_SALDO_AKTUALISIERN(Firma_ID, KdNr)
Return True
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
Return False
End Try
End Function
Public Shared Function OP_LFD_SALDO_AKTUALISIERN(Firma_ID As Integer, Optional KdNr As Integer = -1) As Boolean
Try
Dim sqlStr = "
UPDATE KUNDEN
SET LfdSaldo=(SELECT TOP 1 [KumSaldoEUR] FROM [Offene Posten] where Kontonummer=KundenNrZentrale order by [OP_ID] desc )
FROM
Kunden
WHERE (SELECT COUNT(*) FROM [Offene Posten] WHERE KundenNrZentrale=Kontonummer " & If(Firma_ID > 0, " AND Firma_ID='" & Firma_ID & "' ", "") & ")>=0 "
If KdNr > 0 Then sqlStr &= " AND KundenNrZentrale='" & KdNr & "' "
SQL.doSQL(sqlStr, "FMZOLL")
Return True
Catch ex As Exception
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodBase.GetCurrentMethod.Name, VERAG_PROG_ALLGEMEIN.ERROR_OP.MAIL)
@@ -1431,7 +1455,9 @@ Public Class cSyska_Interface
For Each r In dt.Rows
If KdNr = -1 OrElse r("KundenNrZentrale") = KdNr Then 'TEST!!
Dim strRisiko = Format(CDbl(r("Risiko")), fmt).Replace(",", ".")
Dim strRisiko = 0
If r("Risiko") Is DBNull.Value Then strRisiko = Format(CDbl(r("Risiko")), fmt).Replace(",", ".")
SQL.doSQL("UPDATE [FIBU2].[dbo].[fibu_konto]
SET [dec_wert3] = '" & strRisiko & "'
WHERE ([i_firm_refid]=1 Or [i_firm_refid]=19)

View File

@@ -369,6 +369,7 @@
<Compile Include="Classes\cNCTS_TR_Nachrichten.vb" />
<Compile Include="Classes\cOffene_Posten.vb" />
<Compile Include="Classes\cOffene_Posten_DVO.vb" />
<Compile Include="Classes\cOriginalATR.vb" />
<Compile Include="Classes\cParkzeiten.vb" />
<Compile Include="frmErrorMeldung.Designer.vb">
<DependentUpon>frmErrorMeldung.vb</DependentUpon>

View File

@@ -15,9 +15,9 @@ Public Class cErrorHandler
' bm.Save("C:\formgrab.bmp", Drawing.Imaging.ImageFormat.Bmp)
'End If
Try
Select Case OP
Select Case OP
Case ERROR_OP.MAIL
sendERRORperMail(title & " | " & My.Application.Info.AssemblyName, message, stack, mailadess, zusatz, functionName)
Case ERROR_OP.SHOW
@@ -33,6 +33,15 @@ Public Class cErrorHandler
VERAG_PROG_ALLGEMEIN.cERS.saveErr(OP, message, stack, errCode, functionName, recieverMailAdress, zusatz)
Catch ex As Exception
Try
VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
Catch ex2 As Exception
End Try
End Try
End Sub
Public Shared Sub sendERRORperMail(title, errmsg, errstack, recieverMailAdress, zusatz, functionName)