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

@@ -794,4 +794,5 @@ Public Class frmAbrechnungsMaske
Dim webAddress As String = "https://wiki.verag.ag/de/abteilungen/verrechnung/xxxx" Dim webAddress As String = "https://wiki.verag.ag/de/abteilungen/verrechnung/xxxx"
Process.Start(webAddress) Process.Start(webAddress)
End Sub End Sub
End Class End Class

View File

@@ -1,4 +1,5 @@
Imports System.IO Imports System.IO
Imports com.sun.xml.internal.rngom.digested
Imports VERAG_PROG_ALLGEMEIN Imports VERAG_PROG_ALLGEMEIN
Public Class usrCntlFaktAbrechnung Public Class usrCntlFaktAbrechnung
@@ -4091,7 +4092,9 @@ Nächste_Textzeile_lesen:
Dim check As Integer = cAllgemein.checkSteuerschluessel(cboFirma._value, RECHNUNG.RechnungsLandKz, RECHNUNG.RechnungsUstIdKz, RECHNUNG.RechnungsUstIdNr, RECHNUNG.RechnungsUstIdGeprüft) Dim check As Integer = cAllgemein.checkSteuerschluessel(cboFirma._value, RECHNUNG.RechnungsLandKz, RECHNUNG.RechnungsUstIdKz, RECHNUNG.RechnungsUstIdNr, RECHNUNG.RechnungsUstIdGeprüft)
If check >= 0 Then If check >= 0 Then
If IsNumeric(cboSteuerschlüssel._value) AndAlso CInt(cboSteuerschlüssel._value) <> check Then If IsNumeric(cboSteuerschlüssel._value) AndAlso CInt(cboSteuerschlüssel._value) <> check Then
If Not vbYes = MsgBox("Falscher Steuertyp!" & vbNewLine & " Steuerschlüssel mit " & IIf(check = 2, "20 %", check & " %") & " sollte hinterlegt werden." & vbNewLine & "Trotzdem speichern?", vbYesNo) Then Dim text = SQL.getValueTxtBySql("select Steuerbezeichnung from Steuertabelle where Steuerschlüssel =" & check, "FMZOLL")
Dim hintUIDPruef As String = IIf((RECHNUNG.RechnungsUstIdGeprüft IsNot Nothing AndAlso CDate(RECHNUNG.RechnungsUstIdGeprüft) < Today.AddDays(-30)), " UID-ÜrPrüfung ist älter als 30 Tage!", "")
If Not vbYes = MsgBox("Falscher Steuertyp!" & vbNewLine & " Steuerschlüssel " & text & " sollte hinterlegt werden." & vbNewLine & IIf(hintUIDPruef <> "", hintUIDPruef & vbNewLine, "") & "Trotzdem speichern?", vbYesNo) Then
Return False Return False
End If End If
End If End If

View File

@@ -81,7 +81,7 @@ Public Class cDatev_Interface
End Function 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 Try
Dim FIRMA As New VERAG_PROG_ALLGEMEIN.cFirmen(Firma_ID) 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" Dim DateinameKD = "DTVF_KD_" & Now.ToString("ddMMyyyy_HHmm") & ".csv"
fileKD = My.Computer.FileSystem.OpenTextFileWriter(pathKD & DateinameKD, True, System.Text.Encoding.GetEncoding("iso-8859-15")) 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()) fileKD.WriteLine(genStammdatenBeginn())
initKDNr(dt_Stamm, FIRMA.Firma_ID) 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 If PathList IsNot Nothing Then
PathList.Clear() PathList.Clear()
@@ -179,13 +180,13 @@ Public Class cDatev_Interface
End If End If
If boolKunden Then If boolKunden Then
If genDatensatzCSV_Stammdaten(24, OpenFile, Geschaeftsjahr, Path) Then If genDatensatzCSV_Stammdaten(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
ExportfileCreated = True ExportfileCreated = True
If Path <> "" Then PathList.Add(Path) If Path <> "" Then PathList.Add(Path)
End If End If
End If End If
If boolBuchungen Then If boolBuchungen Then
If genDatensatzCSV_Buchungen(24, OpenFile, Geschaeftsjahr, Path) Then If genDatensatzCSV_Buchungen(24, OpenFile, Geschaeftsjahr, Path, automatischerExport) Then
ExportfileCreated = True ExportfileCreated = True
If Path <> "" Then PathList.Add(Path) If Path <> "" Then PathList.Add(Path)
End If End If
@@ -194,7 +195,7 @@ Public Class cDatev_Interface
End Function 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 Try
Dim FIRMA As New VERAG_PROG_ALLGEMEIN.cFirmen(Firma_ID) Dim FIRMA As New VERAG_PROG_ALLGEMEIN.cFirmen(Firma_ID)
@@ -236,7 +237,8 @@ Public Class cDatev_Interface
' initKDNr(dt_Buchungen) ' initKDNr(dt_Buchungen)
Dim SummeBuchungen As Double = 0 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()) file.WriteLine(genBuchungenBeginn())
For Each r In dt_Buchungen.Rows For Each r In dt_Buchungen.Rows
file.WriteLine(genBuchungsZeile(r, SummeBuchungen, Geschaeftsjahr, FIRMA)) 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",) isEU = sql.getValueTxtBySql("select MitgliedslandEU from Währungstabelle where landkz = '" & landKz & "'", "FMZOLL",)
If isEU Then 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 Return 10
Else Else
Return 2 Return 2
End If End If
Else
Return 0
End If End If
Case "D", "DE" Case "D", "DE"
@@ -213,11 +215,13 @@ Public Class cAllgemein
isEU = sql.getValueTxtBySql("select MitgliedslandEU from Währungstabelle where landkz = '" & landKz & "'", "FMZOLL",) isEU = sql.getValueTxtBySql("select MitgliedslandEU from Währungstabelle where landkz = '" & landKz & "'", "FMZOLL",)
If isEU Then 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 Return 10
Else Else
Return 19 Return 19
End If End If
Else
Return 0
End If End If
Case "GB" Case "GB"
@@ -227,11 +231,13 @@ Public Class cAllgemein
isEU = sql.getValueTxtBySql("select MitgliedslandEU from Währungstabelle where landkz = '" & landKz & "'", "FMZOLL",) isEU = sql.getValueTxtBySql("select MitgliedslandEU from Währungstabelle where landkz = '" & landKz & "'", "FMZOLL",)
If isEU Then 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 Return 10
Else Else
Return 20 Return 20
End If End If
Else
Return 0
End If End If