Datev, Abrechnung, Steuerschl

This commit is contained in:
2024-06-13 10:53:14 +02:00
parent 08ffc3c49f
commit ab3357d1f5
4 changed files with 23 additions and 11 deletions

View File

@@ -81,7 +81,7 @@ Public Class cDatev_Interface
End Function
Public Shared Function genDatensatzCSV_Stammdaten(ByRef Firma_ID As Integer, Optional OpenFile As Boolean = False, Optional Geschaeftsjahr As Integer = -1, Optional filepath As String = "") As Boolean ' Optional OpenFile = False, Optional boolKunden = True, Optional boolBuchungen = True ) As Boolean
Public Shared Function genDatensatzCSV_Stammdaten(ByRef Firma_ID As Integer, Optional OpenFile As Boolean = False, Optional Geschaeftsjahr As Integer = -1, Optional filepath As String = "", Optional automatischerExport As Boolean = True) As Boolean ' Optional OpenFile = False, Optional boolKunden = True, Optional boolBuchungen = True ) As Boolean
Try
Dim FIRMA As New VERAG_PROG_ALLGEMEIN.cFirmen(Firma_ID)
@@ -123,8 +123,9 @@ Public Class cDatev_Interface
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)
fileKD.WriteLine(genStammdatenHeader(Geschaeftsjahr, Now.Month))
fileKD.WriteLine(genStammdatenHeader(Geschaeftsjahr, month))
fileKD.WriteLine(genStammdatenBeginn())
initKDNr(dt_Stamm, FIRMA.Firma_ID)
@@ -164,7 +165,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) 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) As Boolean
If PathList IsNot Nothing Then
PathList.Clear()
@@ -179,13 +180,13 @@ Public Class cDatev_Interface
End If
If boolKunden Then
If genDatensatzCSV_Stammdaten(24, OpenFile, Geschaeftsjahr, Path) 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) Then
If genDatensatzCSV_Buchungen(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
ExportfileCreated = True
If Path <> "" Then PathList.Add(Path)
End If
@@ -194,7 +195,7 @@ Public Class cDatev_Interface
End Function
Public Shared Function genDatensatzCSV_Buchungen(ByRef Firma_ID As Integer, Optional OpenFile As Boolean = False, Optional Geschaeftsjahr As Integer = -1, Optional ByRef filepath As String = "") As Boolean ' Optional OpenFile = False, Optional boolKunden = True, Optional boolBuchungen = True ) As Boolean
Public Shared Function genDatensatzCSV_Buchungen(ByRef Firma_ID As Integer, Optional OpenFile As Boolean = False, Optional Geschaeftsjahr As Integer = -1, Optional ByRef filepath As String = "", Optional automatischerExport As Boolean = True) As Boolean ' Optional OpenFile = False, Optional boolKunden = True, Optional boolBuchungen = True ) As Boolean
Try
Dim FIRMA As New VERAG_PROG_ALLGEMEIN.cFirmen(Firma_ID)
@@ -236,7 +237,8 @@ Public Class cDatev_Interface
' initKDNr(dt_Buchungen)
Dim SummeBuchungen As Double = 0
file.WriteLine(genStapelbuchungsHeader(Geschaeftsjahr, Now.Month))
Dim month = IIf(automatischerExport, Now.AddDays(-1).Month, Now.Month)
file.WriteLine(genStapelbuchungsHeader(Geschaeftsjahr, month))
file.WriteLine(genBuchungenBeginn())
For Each r In dt_Buchungen.Rows
file.WriteLine(genBuchungsZeile(r, SummeBuchungen, Geschaeftsjahr, FIRMA))

View File

@@ -199,11 +199,13 @@ Public Class cAllgemein
isEU = sql.getValueTxtBySql("select MitgliedslandEU from Währungstabelle where landkz = '" & landKz & "'", "FMZOLL",)
If isEU Then
If UIDLandKz <> "" AndAlso UstIdNr <> "" AndAlso UstIdGeprüft IsNot Nothing Then
If UIDLandKz <> "" AndAlso UstIdNr <> "" AndAlso UstIdGeprüft IsNot Nothing AndAlso CDate(UstIdGeprüft) < Today.AddDays(-30) Then
Return 10
Else
Return 2
End If
Else
Return 0
End If
Case "D", "DE"
@@ -213,11 +215,13 @@ Public Class cAllgemein
isEU = sql.getValueTxtBySql("select MitgliedslandEU from Währungstabelle where landkz = '" & landKz & "'", "FMZOLL",)
If isEU Then
If UIDLandKz <> "" AndAlso UstIdNr <> "" AndAlso UstIdGeprüft IsNot Nothing Then
If UIDLandKz <> "" AndAlso UstIdNr <> "" AndAlso UstIdGeprüft IsNot Nothing AndAlso CDate(UstIdGeprüft) < Today.AddDays(-30) Then
Return 10
Else
Return 19
End If
Else
Return 0
End If
Case "GB"
@@ -227,11 +231,13 @@ Public Class cAllgemein
isEU = sql.getValueTxtBySql("select MitgliedslandEU from Währungstabelle where landkz = '" & landKz & "'", "FMZOLL",)
If isEU Then
If UIDLandKz <> "" AndAlso UstIdNr <> "" AndAlso UstIdGeprüft IsNot Nothing Then
If UIDLandKz <> "" AndAlso UstIdNr <> "" AndAlso UstIdGeprüft IsNot Nothing AndAlso CDate(UstIdGeprüft) < Today.AddDays(-30) Then
Return 10
Else
Return 20
End If
Else
Return 0
End If