Ueberstuden, Einfuhrverbot, Formulare, Timas, Datev
This commit is contained in:
@@ -1250,7 +1250,7 @@ Public Class cTimasAPI
|
||||
|
||||
End Function
|
||||
|
||||
Public Function deleteTimeAccounts(ByRef from As Date, ByRef toDate As Date, ByRef employeeNr As Integer, ByRef accountsdt As DataTable) As Boolean
|
||||
Public Function deleteTimeAccounts(ByRef from As Date, ByRef toDate As Date, ByRef employeeNr As Integer, ByRef accountsdt As DataTable, ByRef info As String) As Boolean
|
||||
Dim timeEntryDeleted As Boolean = False
|
||||
Try
|
||||
|
||||
@@ -1281,7 +1281,11 @@ Public Class cTimasAPI
|
||||
End If
|
||||
|
||||
If (rest.ResponseStatusCode <> 200) Then
|
||||
Debug.WriteLine(rest.ResponseStatusCode & " " & rest.ResponseStatusText & sbResponseBody.ToString)
|
||||
Debug.WriteLine(rest.ResponseHeader)
|
||||
info = rest.ResponseStatusCode & " " & rest.ResponseStatusText
|
||||
If sbResponseBody <> "" Then
|
||||
info &= vbNewLine & sbResponseBody
|
||||
End If
|
||||
Return timeEntryDeleted
|
||||
Else
|
||||
timeEntryDeleted = True
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
Imports DocumentFormat.OpenXml.Wordprocessing
|
||||
Imports System.IO
|
||||
Imports System.Net
|
||||
Imports DocumentFormat.OpenXml.Wordprocessing
|
||||
|
||||
Public Class cDatev_Interface
|
||||
|
||||
@@ -117,13 +119,14 @@ Public Class cDatev_Interface
|
||||
|
||||
'----------------- STAMMDATEN -----------------
|
||||
Dim dt_Stamm As DataTable = getStammdaten(filialNr)
|
||||
If dt_Stamm IsNot Nothing AndAlso dt_Stamm.Rows.Count > 0 Then
|
||||
|
||||
If True Then 'dt_Stamm IsNot Nothing AndAlso dt_Stamm.Rows.Count > 0 Then
|
||||
|
||||
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"))
|
||||
|
||||
Dim month = IIf(automatischerExport, Now.AddDays(-1).Month, Now.Month)
|
||||
Dim month As String = IIf(automatischerExport, Now.AddDays(-1).Month.ToString("d2"), Now.Month.ToString("d2"))
|
||||
|
||||
fileKD.WriteLine(genStammdatenHeader(Geschaeftsjahr, month))
|
||||
fileKD.WriteLine(genStammdatenBeginn())
|
||||
@@ -165,7 +168,7 @@ Public Class cDatev_Interface
|
||||
|
||||
|
||||
|
||||
Public Shared Function genDatensatzCSV_ALL(firma As String, Optional OpenFile As Boolean = False, Optional boolKunden As Boolean = True, Optional boolBuchungen As Boolean = True, Optional Geschaeftsjahr As Integer = -1, Optional PathList As List(Of String) = Nothing, Optional automatischerExport As Boolean = True) As Boolean
|
||||
Public Shared Function genDatensatzCSV_ALL(firma As String, Optional OpenFile As Boolean = False, Optional boolKunden As Boolean = True, Optional boolBuchungen As Boolean = True, Optional Geschaeftsjahr As Integer = -1, Optional PathList As List(Of String) = Nothing, Optional automatischerExport As Boolean = True, Optional kindOfExport As String = "mail") As Boolean
|
||||
|
||||
If PathList IsNot Nothing Then
|
||||
PathList.Clear()
|
||||
@@ -179,19 +182,70 @@ Public Class cDatev_Interface
|
||||
Return ExportfileCreated
|
||||
End If
|
||||
|
||||
If boolKunden Then
|
||||
If genDatensatzCSV_Stammdaten(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
|
||||
ExportfileCreated = True
|
||||
If Path <> "" Then PathList.Add(Path)
|
||||
End If
|
||||
End If
|
||||
If boolBuchungen Then
|
||||
If genDatensatzCSV_Buchungen(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
|
||||
ExportfileCreated = True
|
||||
If Path <> "" Then PathList.Add(Path)
|
||||
End If
|
||||
End If
|
||||
Return ExportfileCreated
|
||||
Select Case kindOfExport
|
||||
Case "mail"
|
||||
|
||||
If boolKunden Then
|
||||
If genDatensatzCSV_Stammdaten(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
|
||||
ExportfileCreated = True
|
||||
If Path <> "" Then PathList.Add(Path)
|
||||
End If
|
||||
End If
|
||||
If boolBuchungen Then
|
||||
If genDatensatzCSV_Buchungen(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
|
||||
ExportfileCreated = True
|
||||
If Path <> "" Then PathList.Add(Path)
|
||||
End If
|
||||
End If
|
||||
Return ExportfileCreated
|
||||
|
||||
|
||||
Case "ftp"
|
||||
Try
|
||||
|
||||
Dim API As New DataTable
|
||||
Dim Program = "DATEV-PDF"
|
||||
API = SQL.loadDgvBySql("SELECT top(1) * FROM tblAPIEinstellungen WHERE api_program='" & Program & "' and api_productive ='" & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "0", "1") & "'", "ADMIN")
|
||||
If API.Rows.Count = 0 Then
|
||||
MsgBox("keine gültigen FTP-Einstellungen für " & Program & " gefunden!" & vbNewLine & "Vorgang wird abgebrochen!")
|
||||
Return ExportfileCreated
|
||||
Else
|
||||
|
||||
|
||||
Dim client As WebClient = New WebClient
|
||||
client.Credentials = New NetworkCredential(API.Rows(0).Item("api_user").ToString, API.Rows(0).Item("api_password").ToString)
|
||||
|
||||
|
||||
If boolKunden Then
|
||||
If genDatensatzCSV_Stammdaten(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
|
||||
ExportfileCreated = True
|
||||
If Path <> "" Then
|
||||
Dim fi As FileInfo = New FileInfo(Path)
|
||||
client.UploadFile(API.Rows(0).Item("api_url") & "/DATEV/ " & fi.Name, Path)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If boolBuchungen Then
|
||||
If genDatensatzCSV_Buchungen(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
|
||||
ExportfileCreated = True
|
||||
If Path <> "" Then
|
||||
Dim fi As FileInfo = New FileInfo(Path)
|
||||
client.UploadFile(API.Rows(0).Item("api_url") & "/DATEV/ " & fi.Name, Path)
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Return ExportfileCreated
|
||||
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("FTP Fehler!" & ex.Message & ex.StackTrace)
|
||||
Return False
|
||||
End Try
|
||||
|
||||
|
||||
End Select
|
||||
|
||||
|
||||
End Function
|
||||
|
||||
@@ -319,7 +373,7 @@ Public Class cDatev_Interface
|
||||
|
||||
|
||||
|
||||
Public Shared Function genStammdatenHeader(Geschäftsjahr As Integer, aktuellesMonat As Integer) As String
|
||||
Public Shared Function genStammdatenHeader(Geschäftsjahr As Integer, aktuellesMonat As String) As String
|
||||
|
||||
Dim day = New cFeiertage(Geschäftsjahr)
|
||||
|
||||
@@ -334,14 +388,14 @@ Public Class cDatev_Interface
|
||||
headerString &= Geschäftsjahr.ToString & "0101" & ";" 'WJ-Beginn
|
||||
headerString &= KontenlängePersonKto.ToString & ";"
|
||||
headerString &= Geschäftsjahr.ToString & aktuellesMonat & "01" & ";" 'DatumVon
|
||||
headerString &= Geschäftsjahr.ToString & aktuellesMonat & day.GetLastyDayYInxMonth(Now.DayOfWeek, aktuellesMonat, Geschäftsjahr, True) & ";" 'DatumBis
|
||||
headerString &= Geschäftsjahr.ToString & aktuellesMonat & day.GetLastyDayYInxMonth(Now.DayOfWeek, CInt(aktuellesMonat), Geschäftsjahr, True).Day & ";" 'DatumBis
|
||||
headerString &= "IMPORT AUS AVISO;" 'Bezeichnung
|
||||
headerString &= Chr(34) & Chr(34) & ";"
|
||||
headerString &= emptyFormatedValueWithoutCommas(12)
|
||||
Return headerString
|
||||
End Function
|
||||
|
||||
Public Shared Function genStapelbuchungsHeader(Geschäftsjahr As Integer, aktuellesMonat As Integer) As String
|
||||
Public Shared Function genStapelbuchungsHeader(Geschäftsjahr As Integer, aktuellesMonat As String) As String
|
||||
Dim headerString = Chr(34) & "EXTF" & Chr(34) & ";" 'Export aus 3rd Party App
|
||||
Dim day = New cFeiertage(Geschäftsjahr)
|
||||
headerString &= datevVersion.ToString & ";" 'Versionnummer Datev
|
||||
@@ -354,7 +408,7 @@ Public Class cDatev_Interface
|
||||
headerString &= Geschäftsjahr.ToString & "0101" & ";" 'WJ-Beginn
|
||||
headerString &= KontenlängeSachKto.ToString & ";"
|
||||
headerString &= Geschäftsjahr.ToString & aktuellesMonat & "01" & ";" 'DatumVon
|
||||
headerString &= Geschäftsjahr.ToString & aktuellesMonat & day.GetLastyDayYInxMonth(Now.DayOfWeek, aktuellesMonat, Geschäftsjahr, True) & ";" 'DatumBis
|
||||
headerString &= Geschäftsjahr.ToString & aktuellesMonat & day.GetLastyDayYInxMonth(Now.DayOfWeek, CInt(aktuellesMonat), Geschäftsjahr, True).Day & ";" 'DatumBis
|
||||
headerString &= "IMPORT AUS AVISO;" 'Bezeichnung
|
||||
headerString &= Chr(34) & Chr(34) & ";"
|
||||
headerString &= emptyFormatedValueWithoutCommas(12)
|
||||
|
||||
Reference in New Issue
Block a user