diff --git a/SDL/My Project/AssemblyInfo.vb b/SDL/My Project/AssemblyInfo.vb index 6685acfd..a9b32428 100644 --- a/SDL/My Project/AssemblyInfo.vb +++ b/SDL/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - - + + diff --git a/SDL/frmEssensbestellungen.Designer.vb b/SDL/frmEssensbestellungen.Designer.vb index b692ece9..e9716385 100644 --- a/SDL/frmEssensbestellungen.Designer.vb +++ b/SDL/frmEssensbestellungen.Designer.vb @@ -178,7 +178,7 @@ Partial Class frmEssensbestellungen 'lblBestellungen ' Me.lblBestellungen.AutoSize = True - Me.lblBestellungen.Location = New System.Drawing.Point(15, 385) + Me.lblBestellungen.Location = New System.Drawing.Point(12, 399) Me.lblBestellungen.Name = "lblBestellungen" Me.lblBestellungen.Size = New System.Drawing.Size(100, 13) Me.lblBestellungen.TabIndex = 20 @@ -198,7 +198,7 @@ Partial Class frmEssensbestellungen Me.cbxGebauede._allowedValuesFreiText = Nothing Me.cbxGebauede._allowFreiText = True Me.cbxGebauede._value = "" - Me.cbxGebauede.DropDownWidth = 100 + Me.cbxGebauede.DropDownWidth = 120 Me.cbxGebauede.FormattingEnabled = True Me.cbxGebauede.Location = New System.Drawing.Point(580, 89) Me.cbxGebauede.Name = "cbxGebauede" @@ -269,7 +269,7 @@ Partial Class frmEssensbestellungen ' 'txtMenu_dienstag ' - Me.txtMenu_dienstag.Location = New System.Drawing.Point(0, 39) + Me.txtMenu_dienstag.Location = New System.Drawing.Point(3, 39) Me.txtMenu_dienstag.Name = "txtMenu_dienstag" Me.txtMenu_dienstag.Size = New System.Drawing.Size(188, 32) Me.txtMenu_dienstag.TabIndex = 30 @@ -311,7 +311,7 @@ Partial Class frmEssensbestellungen Me.txtAlt_dienstag._Waehrung = False Me.txtAlt_dienstag._WaehrungZeichen = True Me.txtAlt_dienstag.ForeColor = System.Drawing.Color.Black - Me.txtAlt_dienstag.Location = New System.Drawing.Point(0, 93) + Me.txtAlt_dienstag.Location = New System.Drawing.Point(3, 93) Me.txtAlt_dienstag.MaxLineLength = -1 Me.txtAlt_dienstag.MaxLines_Warning = "" Me.txtAlt_dienstag.MaxLines_Warning_Label = Nothing @@ -380,7 +380,7 @@ Partial Class frmEssensbestellungen ' 'txtMenu_montag ' - Me.txtMenu_montag.Location = New System.Drawing.Point(6, 39) + Me.txtMenu_montag.Location = New System.Drawing.Point(3, 39) Me.txtMenu_montag.Name = "txtMenu_montag" Me.txtMenu_montag.Size = New System.Drawing.Size(188, 32) Me.txtMenu_montag.TabIndex = 29 @@ -435,7 +435,7 @@ Partial Class frmEssensbestellungen ' Me.rbMenuAlt_montag.AutoSize = True Me.rbMenuAlt_montag.GroupName = "GroupBox1" - Me.rbMenuAlt_montag.Location = New System.Drawing.Point(6, 74) + Me.rbMenuAlt_montag.Location = New System.Drawing.Point(3, 74) Me.rbMenuAlt_montag.Name = "rbMenuAlt_montag" Me.rbMenuAlt_montag.Size = New System.Drawing.Size(70, 17) Me.rbMenuAlt_montag.TabIndex = 1 @@ -514,7 +514,7 @@ Partial Class frmEssensbestellungen Me.txtAlt_freitag._Waehrung = False Me.txtAlt_freitag._WaehrungZeichen = True Me.txtAlt_freitag.ForeColor = System.Drawing.Color.Black - Me.txtAlt_freitag.Location = New System.Drawing.Point(-3, 97) + Me.txtAlt_freitag.Location = New System.Drawing.Point(3, 97) Me.txtAlt_freitag.MaxLineLength = -1 Me.txtAlt_freitag.MaxLines_Warning = "" Me.txtAlt_freitag.MaxLines_Warning_Label = Nothing @@ -527,7 +527,7 @@ Partial Class frmEssensbestellungen ' Me.rbMenuAlt_freitag.AutoSize = True Me.rbMenuAlt_freitag.GroupName = "Freitag" - Me.rbMenuAlt_freitag.Location = New System.Drawing.Point(0, 78) + Me.rbMenuAlt_freitag.Location = New System.Drawing.Point(3, 78) Me.rbMenuAlt_freitag.Name = "rbMenuAlt_freitag" Me.rbMenuAlt_freitag.Size = New System.Drawing.Size(70, 17) Me.rbMenuAlt_freitag.TabIndex = 1 @@ -582,7 +582,7 @@ Partial Class frmEssensbestellungen ' 'txtMenu_mittwoch ' - Me.txtMenu_mittwoch.Location = New System.Drawing.Point(0, 39) + Me.txtMenu_mittwoch.Location = New System.Drawing.Point(3, 39) Me.txtMenu_mittwoch.Name = "txtMenu_mittwoch" Me.txtMenu_mittwoch.Size = New System.Drawing.Size(188, 32) Me.txtMenu_mittwoch.TabIndex = 31 @@ -624,7 +624,7 @@ Partial Class frmEssensbestellungen Me.txtAlt_mittwoch._Waehrung = False Me.txtAlt_mittwoch._WaehrungZeichen = True Me.txtAlt_mittwoch.ForeColor = System.Drawing.Color.Black - Me.txtAlt_mittwoch.Location = New System.Drawing.Point(0, 93) + Me.txtAlt_mittwoch.Location = New System.Drawing.Point(3, 93) Me.txtAlt_mittwoch.MaxLineLength = -1 Me.txtAlt_mittwoch.MaxLines_Warning = "" Me.txtAlt_mittwoch.MaxLines_Warning_Label = Nothing @@ -716,7 +716,7 @@ Partial Class frmEssensbestellungen Me.txtAlt_donnerstag._Waehrung = False Me.txtAlt_donnerstag._WaehrungZeichen = True Me.txtAlt_donnerstag.ForeColor = System.Drawing.Color.Black - Me.txtAlt_donnerstag.Location = New System.Drawing.Point(1, 97) + Me.txtAlt_donnerstag.Location = New System.Drawing.Point(3, 97) Me.txtAlt_donnerstag.MaxLineLength = -1 Me.txtAlt_donnerstag.MaxLines_Warning = "" Me.txtAlt_donnerstag.MaxLines_Warning_Label = Nothing @@ -729,7 +729,7 @@ Partial Class frmEssensbestellungen ' Me.rbMenuAlt_donnerstag.AutoSize = True Me.rbMenuAlt_donnerstag.GroupName = "Donnerstag" - Me.rbMenuAlt_donnerstag.Location = New System.Drawing.Point(4, 78) + Me.rbMenuAlt_donnerstag.Location = New System.Drawing.Point(3, 78) Me.rbMenuAlt_donnerstag.Name = "rbMenuAlt_donnerstag" Me.rbMenuAlt_donnerstag.Size = New System.Drawing.Size(70, 17) Me.rbMenuAlt_donnerstag.TabIndex = 1 diff --git a/SDL/frmEssensbestellungen.vb b/SDL/frmEssensbestellungen.vb index 7a0d2c21..6716c437 100644 --- a/SDL/frmEssensbestellungen.vb +++ b/SDL/frmEssensbestellungen.vb @@ -365,12 +365,12 @@ Public Class frmEssensbestellungen If TypeOf gb Is GroupBox Then For Each c As Control In gb.Controls - If c.Text.ToLower.StartsWith("menü") AndAlso TypeOf c Is VERAG_PROG_ALLGEMEIN.MyRadioButton AndAlso c.Enabled = True Then + If c.Text.ToLower.StartsWith(menu.ToLower) AndAlso TypeOf c Is VERAG_PROG_ALLGEMEIN.MyRadioButton AndAlso c.Enabled = True Then Dim rb As VERAG_PROG_ALLGEMEIN.MyRadioButton = c If rb.Checked Then countMenus = countMenus + 1 End If - If c.Text.ToLower.StartsWith("a la carte") AndAlso TypeOf c Is VERAG_PROG_ALLGEMEIN.MyRadioButton AndAlso c.Enabled = True Then + If c.Text.ToLower.StartsWith(alacarte.ToLower) AndAlso TypeOf c Is VERAG_PROG_ALLGEMEIN.MyRadioButton AndAlso c.Enabled = True Then Dim rb As VERAG_PROG_ALLGEMEIN.MyRadioButton = c If rb.Checked Then countlaCarte = countlaCarte + 1 End If @@ -503,7 +503,7 @@ Public Class frmEssensbestellungen rbMenu__freitag.Checked = True Else rbMenuAlt_freitag.Checked = True - If currentEssen.eb_freitag IsNot Nothing Then txtAlt_donnerstag.Text = currentEssen.eb_freitag.ToString + If currentEssen.eb_freitag IsNot Nothing Then txtAlt_freitag.Text = currentEssen.eb_freitag.ToString End If Else cb_freitag.Checked = False diff --git a/SDL/kunden/frmKundenblatt.Designer.vb b/SDL/kunden/frmKundenblatt.Designer.vb index 29aaf3de..e314daee 100644 --- a/SDL/kunden/frmKundenblatt.Designer.vb +++ b/SDL/kunden/frmKundenblatt.Designer.vb @@ -236,7 +236,7 @@ Partial Class frmKundenblatt Me.tbFirmendaten.Location = New System.Drawing.Point(4, 25) Me.tbFirmendaten.Name = "tbFirmendaten" Me.tbFirmendaten.Padding = New System.Windows.Forms.Padding(3) - Me.tbFirmendaten.Size = New System.Drawing.Size(1623, 591) + Me.tbFirmendaten.Size = New System.Drawing.Size(1623, 642) Me.tbFirmendaten.TabIndex = 3 Me.tbFirmendaten.Text = "Firmendaten" ' @@ -246,7 +246,7 @@ Partial Class frmKundenblatt Me.Panel4.Dock = System.Windows.Forms.DockStyle.Fill Me.Panel4.Location = New System.Drawing.Point(3, 3) Me.Panel4.Name = "Panel4" - Me.Panel4.Size = New System.Drawing.Size(1617, 585) + Me.Panel4.Size = New System.Drawing.Size(1617, 636) Me.Panel4.TabIndex = 0 ' 'UsrcntlKundeBearbeitenFull1 @@ -256,7 +256,7 @@ Partial Class frmKundenblatt Me.UsrcntlKundeBearbeitenFull1.Location = New System.Drawing.Point(0, 0) Me.UsrcntlKundeBearbeitenFull1.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.UsrcntlKundeBearbeitenFull1.Name = "UsrcntlKundeBearbeitenFull1" - Me.UsrcntlKundeBearbeitenFull1.Size = New System.Drawing.Size(1617, 585) + Me.UsrcntlKundeBearbeitenFull1.Size = New System.Drawing.Size(1617, 636) Me.UsrcntlKundeBearbeitenFull1.TabIndex = 0 ' 'tbcntrMain @@ -273,7 +273,7 @@ Partial Class frmKundenblatt Me.tbcntrMain.Margin = New System.Windows.Forms.Padding(0) Me.tbcntrMain.Name = "tbcntrMain" Me.tbcntrMain.SelectedIndex = 0 - Me.tbcntrMain.Size = New System.Drawing.Size(1631, 620) + Me.tbcntrMain.Size = New System.Drawing.Size(1631, 671) Me.tbcntrMain.TabIndex = 3 ' 'tbAllgemein @@ -306,7 +306,7 @@ Partial Class frmKundenblatt Me.tbAllgemein.Margin = New System.Windows.Forms.Padding(0) Me.tbAllgemein.Name = "tbAllgemein" Me.tbAllgemein.Padding = New System.Windows.Forms.Padding(3) - Me.tbAllgemein.Size = New System.Drawing.Size(1623, 591) + Me.tbAllgemein.Size = New System.Drawing.Size(1623, 659) Me.tbAllgemein.TabIndex = 0 Me.tbAllgemein.Text = "Allgemein" ' @@ -601,7 +601,7 @@ Partial Class frmKundenblatt Me.dgvSperrliste.Location = New System.Drawing.Point(732, 36) Me.dgvSperrliste.Name = "dgvSperrliste" Me.dgvSperrliste.ReadOnly = True - Me.dgvSperrliste.Size = New System.Drawing.Size(828, 481) + Me.dgvSperrliste.Size = New System.Drawing.Size(828, 549) Me.dgvSperrliste.TabIndex = 23 ' 'PictureBox2 @@ -655,7 +655,7 @@ Partial Class frmKundenblatt Me.tbZoll.Location = New System.Drawing.Point(4, 25) Me.tbZoll.Name = "tbZoll" Me.tbZoll.Padding = New System.Windows.Forms.Padding(3) - Me.tbZoll.Size = New System.Drawing.Size(1623, 591) + Me.tbZoll.Size = New System.Drawing.Size(1623, 642) Me.tbZoll.TabIndex = 9 Me.tbZoll.Text = "ZOLL" Me.tbZoll.UseVisualStyleBackColor = True @@ -667,7 +667,7 @@ Partial Class frmKundenblatt Me.tbcntrZOLL.Location = New System.Drawing.Point(3, 3) Me.tbcntrZOLL.Name = "tbcntrZOLL" Me.tbcntrZOLL.SelectedIndex = 0 - Me.tbcntrZOLL.Size = New System.Drawing.Size(1617, 585) + Me.tbcntrZOLL.Size = New System.Drawing.Size(1617, 636) Me.tbcntrZOLL.TabIndex = 0 ' 'tabZoll_Artikel @@ -675,7 +675,7 @@ Partial Class frmKundenblatt Me.tabZoll_Artikel.Location = New System.Drawing.Point(4, 22) Me.tabZoll_Artikel.Name = "tabZoll_Artikel" Me.tabZoll_Artikel.Padding = New System.Windows.Forms.Padding(3) - Me.tabZoll_Artikel.Size = New System.Drawing.Size(1609, 559) + Me.tabZoll_Artikel.Size = New System.Drawing.Size(1609, 610) Me.tabZoll_Artikel.TabIndex = 1 Me.tabZoll_Artikel.Text = "Artikel" Me.tabZoll_Artikel.UseVisualStyleBackColor = True @@ -686,7 +686,7 @@ Partial Class frmKundenblatt Me.tbMdm.Location = New System.Drawing.Point(4, 25) Me.tbMdm.Name = "tbMdm" Me.tbMdm.Padding = New System.Windows.Forms.Padding(3) - Me.tbMdm.Size = New System.Drawing.Size(1623, 591) + Me.tbMdm.Size = New System.Drawing.Size(1623, 642) Me.tbMdm.TabIndex = 10 Me.tbMdm.Text = "MDM" Me.tbMdm.UseVisualStyleBackColor = True @@ -704,7 +704,7 @@ Partial Class frmKundenblatt Me.tbcntrMDM.Margin = New System.Windows.Forms.Padding(0) Me.tbcntrMDM.Name = "tbcntrMDM" Me.tbcntrMDM.SelectedIndex = 0 - Me.tbcntrMDM.Size = New System.Drawing.Size(1617, 585) + Me.tbcntrMDM.Size = New System.Drawing.Size(1617, 636) Me.tbcntrMDM.TabIndex = 0 ' 'tbSDL @@ -716,7 +716,7 @@ Partial Class frmKundenblatt Me.tbSDL.Margin = New System.Windows.Forms.Padding(0) Me.tbSDL.Name = "tbSDL" Me.tbSDL.Padding = New System.Windows.Forms.Padding(3) - Me.tbSDL.Size = New System.Drawing.Size(1609, 559) + Me.tbSDL.Size = New System.Drawing.Size(1609, 610) Me.tbSDL.TabIndex = 5 Me.tbSDL.Text = "SDL-Leistungen" Me.tbSDL.UseVisualStyleBackColor = True @@ -734,7 +734,7 @@ Partial Class frmKundenblatt Me.dgvSDLLeistungenFull.Name = "dgvSDLLeistungenFull" Me.dgvSDLLeistungenFull.ReadOnly = True Me.dgvSDLLeistungenFull.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvSDLLeistungenFull.Size = New System.Drawing.Size(1603, 363) + Me.dgvSDLLeistungenFull.Size = New System.Drawing.Size(1603, 414) Me.dgvSDLLeistungenFull.TabIndex = 5 ' 'Panel6 @@ -838,7 +838,7 @@ Partial Class frmKundenblatt Me.Panel5.Controls.Add(Me.lblLetzterSA_SDL) Me.Panel5.Controls.Add(Me.rtbVermerke) Me.Panel5.Dock = System.Windows.Forms.DockStyle.Bottom - Me.Panel5.Location = New System.Drawing.Point(3, 413) + Me.Panel5.Location = New System.Drawing.Point(3, 464) Me.Panel5.Name = "Panel5" Me.Panel5.Size = New System.Drawing.Size(1603, 143) Me.Panel5.TabIndex = 177 @@ -1223,7 +1223,7 @@ Partial Class frmKundenblatt Me.usrcntlKarten.Location = New System.Drawing.Point(3, 3) Me.usrcntlKarten.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5) Me.usrcntlKarten.Name = "usrcntlKarten" - Me.usrcntlKarten.Size = New System.Drawing.Size(186, 68) + Me.usrcntlKarten.Size = New System.Drawing.Size(172, 33) Me.usrcntlKarten.TabIndex = 0 ' 'tbLKW @@ -1678,7 +1678,7 @@ Partial Class frmKundenblatt Me.tbOfferte.Location = New System.Drawing.Point(4, 25) Me.tbOfferte.Margin = New System.Windows.Forms.Padding(2) Me.tbOfferte.Name = "tbOfferte" - Me.tbOfferte.Size = New System.Drawing.Size(1623, 591) + Me.tbOfferte.Size = New System.Drawing.Size(1623, 642) Me.tbOfferte.TabIndex = 11 Me.tbOfferte.Text = "Offerte" Me.tbOfferte.UseVisualStyleBackColor = True @@ -1690,7 +1690,7 @@ Partial Class frmKundenblatt Me.UsrCntlOfferte1.Location = New System.Drawing.Point(0, 0) Me.UsrCntlOfferte1.Margin = New System.Windows.Forms.Padding(1) Me.UsrCntlOfferte1.Name = "UsrCntlOfferte1" - Me.UsrCntlOfferte1.Size = New System.Drawing.Size(1623, 591) + Me.UsrCntlOfferte1.Size = New System.Drawing.Size(1623, 642) Me.UsrCntlOfferte1.TabIndex = 0 ' 'cntxtExcel @@ -1809,7 +1809,7 @@ Partial Class frmKundenblatt Me.ToolStripMenuItem2.ImageAlign = System.Drawing.ContentAlignment.TopCenter Me.ToolStripMenuItem2.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None Me.ToolStripMenuItem2.Name = "ToolStripMenuItem2" - Me.ToolStripMenuItem2.Size = New System.Drawing.Size(99, 70) + Me.ToolStripMenuItem2.Size = New System.Drawing.Size(122, 70) Me.ToolStripMenuItem2.Text = "Firmendaten" Me.ToolStripMenuItem2.TextAlign = System.Drawing.ContentAlignment.BottomCenter Me.ToolStripMenuItem2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageAboveText @@ -1957,7 +1957,7 @@ Partial Class frmKundenblatt Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScroll = True Me.BackColor = System.Drawing.Color.White - Me.ClientSize = New System.Drawing.Size(1180, 749) + Me.ClientSize = New System.Drawing.Size(1180, 800) Me.Controls.Add(Me.lblAbfVerb) Me.Controls.Add(Me.btnAbfVerb) Me.Controls.Add(Me.tbcntrMain) diff --git a/SDL/kunden/frmKundenblatt.vb b/SDL/kunden/frmKundenblatt.vb index bc5e544e..e95c829d 100644 --- a/SDL/kunden/frmKundenblatt.vb +++ b/SDL/kunden/frmKundenblatt.vb @@ -1703,5 +1703,7 @@ Public Class frmKundenblatt Dim f As New frmLKW_AnhaengeDatenarchiv(kdNr, LIST) f.ShowDialog(Me) End Sub + + End Class diff --git a/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb b/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb index 0368451c..1b8a2509 100644 --- a/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb +++ b/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb @@ -321,6 +321,7 @@ Partial Class usrcntlKundeBearbeitenFull Me.cboAuswahl = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.txtERROR = New System.Windows.Forms.TextBox() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() + Me.Button5 = New System.Windows.Forms.Button() Me.tbcntrDetails.SuspendLayout() Me.tbAbfertigung.SuspendLayout() Me.tbcntrAbf.SuspendLayout() @@ -4343,11 +4344,23 @@ Partial Class usrcntlKundeBearbeitenFull Me.DataGridViewTextBoxColumn2.HeaderText = "E-Mail" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" ' + 'Button5 + ' + Me.Button5.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.Button5.Location = New System.Drawing.Point(1067, 547) + Me.Button5.Name = "Button5" + Me.Button5.Size = New System.Drawing.Size(51, 23) + Me.Button5.TabIndex = 23 + Me.Button5.Text = "Datev" + Me.Button5.UseVisualStyleBackColor = True + Me.Button5.Visible = False + ' 'usrcntlKundeBearbeitenFull ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.White + Me.Controls.Add(Me.Button5) Me.Controls.Add(Me.CheckBox1) Me.Controls.Add(Me.Button4) Me.Controls.Add(Me.cbxFiBuLG) @@ -4718,4 +4731,5 @@ Partial Class usrcntlKundeBearbeitenFull Friend WithEvents cboFremdspeditionExport As System.Windows.Forms.ComboBox Friend WithEvents FlowLayoutPanel1 As FlowLayoutPanel Friend WithEvents Panel1 As Panel + Friend WithEvents Button5 As Button End Class diff --git a/SDL/kunden/usrcntlKundeBearbeitenFull.vb b/SDL/kunden/usrcntlKundeBearbeitenFull.vb index b1cd7294..1cd94c66 100644 --- a/SDL/kunden/usrcntlKundeBearbeitenFull.vb +++ b/SDL/kunden/usrcntlKundeBearbeitenFull.vb @@ -1439,4 +1439,9 @@ Public Class usrcntlKundeBearbeitenFull End Sub + + Private Sub Button5_Click_2(sender As Object, e As EventArgs) Handles Button5.Click + VERAG_PROG_ALLGEMEIN.cDatev_Interface.genDatensatzCSV_ALL(False, True, True) + + End Sub End Class diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cWarenorte.vb b/VERAG_PROG_ALLGEMEIN/Classes/cWarenorte.vb index e8d50441..d97b3eef 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cWarenorte.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cWarenorte.vb @@ -14,6 +14,10 @@ Public Class cWarenorte Property wo_grenzstelle As Object = Nothing Property wo_knnr As Object = Nothing Property wo_strasse As Object = Nothing + Property wo_ex As Boolean + Property wo_im As Boolean + Property wo_zv As Boolean + Property wo_ze As Boolean Public hasEntry = False @@ -50,6 +54,12 @@ Public Class cWarenorte list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_grenzstelle", wo_grenzstelle)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_knnr", wo_knnr)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_strasse", wo_strasse)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_ex", wo_ex)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_im", wo_im)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_zv", wo_zv)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("wo_ze", wo_ze)) + + Return list End Function diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/cDatev_Interface.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/cDatev_Interface.vb new file mode 100644 index 00000000..2b625be7 --- /dev/null +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/cDatev_Interface.vb @@ -0,0 +1,496 @@ +Public Class cDatev_Interface + + Shared datevVersion As Integer = 700 + Shared KreditorenNr As Integer = 16 + Shared StapelbuchungsNr As Integer = 21 + Shared BeraterNr As Integer = 1001 + Shared MandantenNr As Integer = 99999 + Shared SQL As New VERAG_PROG_ALLGEMEIN.SQL + 'STAMMDATEN + Shared Function getStammdaten() As DataTable + Dim sqlStr = "Select 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], [Strasse], 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], 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 &= " Order by [Kontonummer] " + Return SQL.loadDgvBySql(sqlStr, "FMZOLL") + End Function + + Shared Function updateFibu() As DataTable + Dim sqlStr = " UPDATE Kunden " + sqlStr &= " SET FiBuSchnittstelle = '0' " + sqlStr &= " FROM Adressen INNER JOIN Kunden ON Kundennr=AdressenNr " + sqlStr &= " LEFT JOIN tblKundenErweitert ON KundenNr=kde_KundenNr " + sqlStr &= " WHERE FiBuSchnittstelle=1 AND Auswahl='A' AND FilialenNr='5701' " + Return SQL.loadDgvBySql(sqlStr, "FMZOLL") + End Function + + + Public Shared Function genStammdatenBeginn() As String + Return "Konto;Name (Adressattyp Unternehmen);Unternehmensgegenstand;Name (Adressattyp natürl. Person);Vorname (Adressattyp natürl. Person);Name (Adressattyp keine Angabe);Adressattyp;Kurzbezeichnung;EU-Land;EU-UStID;Anrede;Titel/Akad. Grad;Adelstitel;Namensvorsatz;Adressart;Straße;Postfach;Postleitzahl;Ort;Land;Versandzusatz;Adresszusatz;Abweichende Anrede;Abw. Zustellbezeichnung 1;Abw. Zustellbezeichnung 2;Kennz. Korrespondenzadresse;Adresse Gültig von;Adresse Gültig bis;Telefon;Bemerkung (Telefon);Telefon GL;Bemerkung (Telefon GL);E-Mail;Bemerkung (E-Mail);Internet;Bemerkung (Internet);Fax;Bemerkung (Fax);Sonstige;Bemerkung (Sonstige);Bankleitzahl 1;Bankbezeichnung 1;Bank-Kontonummer 1;Länderkennzeichen 1;IBAN-Nr. 1;Leerfeld;SWIFT-Code 1;Abw. Kontoinhaber 1;Kennz. Hauptbankverb. 1;Bankverb 1 Gültig von;Bankverb 1 Gültig bis;Bankleitzahl 2;Bankbezeichnung 2;Bank-Kontonummer 2;Länderkennzeichen 2;IBAN-Nr. 2;Leerfeld;SWIFT-Code 2;Abw. Kontoinhaber 2;Kennz. Hauptbankverb. 2;Bankverb 2 Gültig von;Bankverb 2 Gültig bis;Bankleitzahl 3;Bankbezeichnung 3;Bank-Kontonummer 3;Länderkennzeichen 3;IBAN-Nr. 3;Leerfeld;SWIFT-Code 3;Abw. Kontoinhaber 3;Kennz. Hauptbankverb. 3;Bankverb 3 Gültig von;Bankverb 3 Gültig bis;Bankleitzahl 4;Bankbezeichnung 4;Bank-Kontonummer 4;Länderkennzeichen 4;IBAN-Nr. 4;Leerfeld;SWIFT-Code 4;Abw. Kontoinhaber 4;Kennz. Hauptbankverb. 4;Bankverb 4 Gültig von;Bankverb 4 Gültig bis;Bankleitzahl 5;Bankbezeichnung 5;Bank-Kontonummer 5;Länderkennzeichen 5;IBAN-Nr. 5;Leerfeld;SWIFT-Code 5;Abw. Kontoinhaber 5;Kennz. Hauptbankverb. 5;Bankverb 5 Gültig von;Bankverb 5 Gültig bis;Leerfeld;Briefanrede;Grußformel;Kunden-/Lief.-Nr.;Steuernummer;Sprache;Ansprechpartner;Vertreter;Sachbearbeiter;Diverse-Konto;Ausgabeziel;Währungssteuerung;Kreditlimit (Debitor);Zahlungsbedingung;Fälligkeit in Tagen (Debitor);Skonto in Prozent (Debitor);Kreditoren-Ziel 1 Tg.;Kreditoren-Skonto 1 %;Kreditoren-Ziel 2 Tg.;Kreditoren-Skonto 2 %;Kreditoren-Ziel 3 Brutto Tg.;Kreditoren-Ziel 4 Tg.;Kreditoren-Skonto 4 %;Kreditoren-Ziel 5 Tg.;Kreditoren-Skonto 5 %;Mahnung;Kontoauszug;Mahntext 1;Mahntext 2;Mahntext 3;Kontoauszugstext;Mahnlimit Betrag;Mahnlimit %;Zinsberechnung;Mahnzinssatz 1;Mahnzinssatz 2;Mahnzinssatz 3;Lastschrift;Leerfeld;Mandantenbank;Zahlungsträger;Indiv. Feld 1;Indiv. Feld 2;Indiv. Feld 3;Indiv. Feld 4;Indiv. Feld 5;Indiv. Feld 6;Indiv. Feld 7;Indiv. Feld 8;Indiv. Feld 9;Indiv. Feld 10;Indiv. Feld 11;Indiv. Feld 12;Indiv. Feld 13;Indiv. Feld 14;Indiv. Feld 15;Abweichende Anrede (Rechnungsadresse);Adressart (Rechnungsadresse);Straße (Rechnungsadresse);Postfach (Rechnungsadresse);Postleitzahl (Rechnungsadresse);Ort (Rechnungsadresse);Land (Rechnungsadresse);Versandzusatz (Rechnungsadresse);Adresszusatz (Rechnungsadresse);Abw. Zustellbezeichnung 1 (Rechnungsadresse);Abw. Zustellbezeichnung 2 (Rechnungsadresse);Adresse Gültig von (Rechnungsadresse);Adresse Gültig bis (Rechnungsadresse);Bankleitzahl 6;Bankbezeichnung 6;Bank-Kontonummer 6;Länderkennzeichen 6;IBAN-Nr. 6;Leerfeld;SWIFT-Code 6;Abw. Kontoinhaber 6;Kennz. Hauptbankverb. 6;Bankverb 6 Gültig von;Bankverb 6 Gültig bis;Bankleitzahl 7;Bankbezeichnung 7;Bank-Kontonummer 7;Länderkennzeichen 7;IBAN-Nr. 7;Leerfeld;SWIFT-Code 7;Abw. Kontoinhaber 7;Kennz. Hauptbankverb. 7;Bankverb 7 Gültig von;Bankverb 7 Gültig bis;Bankleitzahl 8;Bankbezeichnung 8;Bank-Kontonummer 8;Länderkennzeichen 8;IBAN-Nr. 8;Leerfeld;SWIFT-Code 8;Abw. Kontoinhaber 8;Kennz. Hauptbankverb. 8;Bankverb 8 Gültig von;Bankverb 8 Gültig bis;Bankleitzahl 9;Bankbezeichnung 9;Bank-Kontonummer 9;Länderkennzeichen 9;IBAN-Nr. 9;Leerfeld;SWIFT-Code 9;Abw. Kontoinhaber 9;Kennz. Hauptbankverb. 9;Bankverb 9 Gültig von;Bankverb 9 Gültig bis;Bankleitzahl 10;Bankbezeichnung 10;Bank-Kontonummer 10;Länderkennzeichen 10;IBAN-Nr. 10;Leerfeld;SWIFT-Code 10;Abw. Kontoinhaber 10;Kennz. Hauptbankverb. 10;Bankverb 10 Gültig von;Bankverb 10 Gültig bis;Nummer Fremdsystem;Insolvent;SEPA-Mandatsreferenz 1;SEPA-Mandatsreferenz 2;SEPA-Mandatsreferenz 3;SEPA-Mandatsreferenz 4;SEPA-Mandatsreferenz 5;SEPA-Mandatsreferenz 6;SEPA-Mandatsreferenz 7;SEPA-Mandatsreferenz 8;SEPA-Mandatsreferenz 9;SEPA-Mandatsreferenz 10;Verknüpftes OPOS-Konto;Mahnsperre bis;Lastschriftsperre bis;Zahlungssperre bis;Gebührenberechnung;Mahngebühr 1;Mahngebühr 2;Mahngebühr 3;Pauschalenberechnung;Verzugspauschale 1;Verzugspauschale 2;Verzugspauschale 3;Alternativer Suchname;Status;Anschrift manuell geändert (Korrespondenzadresse);Anschrift individuell (Korrespondenzadresse);Anschrift manuell geändert (Rechnungsadresse);Anschrift individuell (Rechnungsadresse);Fristberechnung bei Debitor;Mahnfrist 1;Mahnfrist 2;Mahnfrist 3;Letzte Frist" + End Function + + + Public Shared Function getPersonenKto(row As DataRow) As String + + Dim personenRow As String = "" + + personenRow &= row("Kontonummer") & ";" 'Mapping für KOntonummern einbauen weil bei AMBAR Kontonummer <> Kundennummer + personenRow &= FormatStringDVO(row("Name"), 50) & ";" + personenRow &= FormatStringDVO(row("Name2"), 50) & ";" + personenRow &= emptyFormatedValue(3) + personenRow &= FormatStringDVO(2) & ";" 'Typ Unternehmen + personenRow &= emptyFormatedValue() + personenRow &= FormatStringDVO(row("EU-Land")) & ";" + personenRow &= FormatStringDVO(row("EU-UstID")) & ";" + personenRow &= FormatStringDVO(row("Anrede")) & ";" + personenRow &= emptyFormatedValue(4) + personenRow &= FormatStringDVO(row("Strasse"), 36) & ";" + personenRow &= emptyFormatedValue() + personenRow &= FormatStringDVO(row("PLZ")) & ";" + personenRow &= FormatStringDVO(row("Ort")) & ";" + personenRow &= Chr(34) & cProgramFunctions.getISO2Land(row("Länderkennzeichen")) & Chr(34) & ";" + personenRow &= emptyFormatedValue() + personenRow &= FormatStringDVO(row("Adresszusatz")) & ";" + personenRow &= emptyFormatedValue(6) + personenRow &= FormatStringDVO(row("Telefonnummer")) & ";" + personenRow &= emptyFormatedValue(3) + personenRow &= FormatStringDVO(row("E-Mail")) & ";" + personenRow &= emptyFormatedValue() + personenRow &= FormatStringDVO(row("Internetadresse")) & ";" + personenRow &= emptyFormatedValue() + personenRow &= FormatStringDVO(row("Faxnummer")) & ";" + personenRow &= emptyFormatedValue(3) + personenRow &= FormatStringDVO(row("BLZ")) & ";" + personenRow &= emptyFormatedValue() + personenRow &= FormatStringDVO(row("Bankkonto")) & ";" + personenRow &= emptyFormatedValue() + personenRow &= FormatStringDVO(row("IBAN")) & ";" + personenRow &= emptyFormatedValue(208) + + Return personenRow + + 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 + + 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 + '------------------------------------------------------------------------------------------- + Dim pathArchivKD = "\\datenarchiv.verag.ost.dmn\DATENARCHIV\DATENARCHIV_TESTSYSTEM\INTERFACE\DATEV\ARCHIV\STAMMDATEN\" + Dim pathKD = "\\datenarchiv.verag.ost.dmn\DATENARCHIV\DATENARCHIV_TESTSYSTEM\INTERFACE\DATEV\STAMMDATEN\" & Geschaeftsjahr & "\" + '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) + '------------------------------------------------------------------------------------------- + + + If True Then 'boolKunden Then + '----------------- STAMMDATEN ----------------- + Dim dt_Stamm As DataTable = getStammdaten() + If 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")) + + + fileKD.WriteLine(genStammdatenHeader()) + fileKD.WriteLine(genStammdatenBeginn()) + + initKDNr(dt_Stamm) + For Each r In dt_Stamm.Rows + fileKD.WriteLine(getPersonenKto(r)) + Next + bool_DatenVorhanden = True + + + 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 + + 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 + + + + 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 + genDatensatzCSV_ALL = True + If boolKunden Then + If Not genDatensatzCSV_Stammdaten(OpenFile, Geschaeftsjahr) Then genDatensatzCSV_ALL = False + End If + If boolBuchungen Then + If Not genDatensatzCSV_Buchungen(24, OpenFile, Geschaeftsjahr) Then genDatensatzCSV_ALL = False + + End If + End Function + + Public Shared Function genDatensatzCSV_Buchungen(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 FIRMA As New VERAG_PROG_ALLGEMEIN.cFirmen(Firma_ID) + + 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 + 'nur UNISPED!! + + 'DATEIPFAD für Buchungsdaten + '------------------------------------------------------------------------------------------- + Dim pathArchiv = "\\datenarchiv.verag.ost.dmn\DATENARCHIV\DATENARCHIV_TESTSYSTEM\INTERFACE\DATEV\ARCHIV\AR-DATEN\" + Dim path = "\\datenarchiv.verag.ost.dmn\DATENARCHIV\DATENARCHIV_TESTSYSTEM\INTERFACE\DATEV\AR-DATEN\" & Geschaeftsjahr & "\" + ' path = pathArchiv 'TEST + If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then + 'path = VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.getRootDir + 'pathArchiv = "" + 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 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 + End Select + + + '----------------- Buchungssätze ----------------- + If True Then 'boolBuchungen Then + TrdInvoice_FUNCTIONS.TrdinSchreiben(FIRMA.Firma_ID, Buchungsjahr) 'Lädt die Daten aus der Tabelle Rechnungsausgang in die Tabelle trdInvoice (nur für 20 = IMEX ) + Dim dt_Buchungen As DataTable = getBuchungen(FIRMA.Firma_ID) + If dt_Buchungen IsNot Nothing AndAlso dt_Buchungen.Rows.Count > 0 Then + Try + Dim file As System.IO.StreamWriter + Dim Dateiname = "DTVF_STB_" & NameZusatz & Now.ToString("ddMMyyyy_HHmm") & ".csv" + file = My.Computer.FileSystem.OpenTextFileWriter(path & Dateiname, True, System.Text.Encoding.GetEncoding("iso-8859-15")) + + ' initKDNr(dt_Buchungen) + Dim SummeBuchungen As Double = 0 + file.WriteLine(genStapelbuchungsHeader()) + file.WriteLine(genBuchungenBeginn()) + For Each r In dt_Buchungen.Rows + file.WriteLine(genBuchungsZeile(r, SummeBuchungen, Geschaeftsjahr, FIRMA)) + Next + ' file.WriteLine(genBuchungenEnd(SummeBuchungen)) + bool_DatenVorhanden = True + + 'Update Filename TrdIn + 'SQL.doSQL("update [tblTrdinInvoice] Set TrdinDateiname='" & Now.ToString("ddMMyyyyHHmm") & "' WHERE [Firma_ID] = " & FIRMA.Firma_ID & " AND TrdinDateiname is null ", "FMZOLL") + + file.Close() + + 'In Archiv sichern + If pathArchiv <> "" Then + If Not IO.Directory.Exists(pathArchiv) Then IO.Directory.CreateDirectory(pathArchiv) + If path <> pathArchiv Then IO.File.Copy(path & Dateiname, pathArchiv & Dateiname) + End If + + If bool_DatenVorhanden Then + If OpenFile Then Process.Start(path & Dateiname) + Else + IO.File.Delete(path & Dateiname) + End If + + Catch ex As Exception + MsgBox(ex.Message & ex.StackTrace) + End Try + + End If + End If + '---------------------------------- + + + + Catch ex As Exception + MsgBox(ex.Message & ex.StackTrace) + End Try + Return False + End Function + + Shared Function FormatStringDVO(s As Object, Optional length As Integer = -1, Optional defaultValue As String = "") As String + If s Is Nothing Then Return defaultValue + If s Is DBNull.Value Then Return defaultValue + FormatStringDVO = s.ToString.Replace(";", ",") + 'FormatStringDVO = s.ToString.Replace(",", "") + 'FormatStringDVO = s.ToString.Replace("""", "\22") + If length > 0 Then + If FormatStringDVO.Length > length Then FormatStringDVO = FormatStringDVO.Substring(0, length) + End If + + FormatStringDVO = Chr(34) & FormatStringDVO & Chr(34) + + End Function + + Shared Function getBuchungen(Firma_ID As Integer) As DataTable + + Dim sqlStr = " SELECT TOP (1000) IVO.Rechnungsdatum,IVO.Rechnungsnummer,min(Speditionsbuch) as Speditionsbuch ,min(FilialenNr) as FilialenNr,min(AbfertigungsNr) as AbfertigungsNr,min(UnterNr) as UnterNr,min(Abfertigungsdatum) as Abfertigungsdatum,min(BelegartenNr) as BelegartenNr + ,min(KundenNrZentrale) as [KundenNrZentrale],min(RechnungsKundenNr) as RechnungsKundenNr,min(RechnungsLandKz) as RechnungsLandKz,min(RechnungsUstIdKz) as RechnungsUstIdKz,min(RechnungsUstIdNr) as RechnungsUstIdNr + ,min(Lastschrift+0) as Lastschrift,min(Steuerschlüssel) as Steuerschlüssel,min([Steuersatz %]) as Steuersatz,min(WährungLokal) as WährungLokal,min(SteuerbetragLokal) as SteuerbetragLokal,min(RechnungsbetragLokal) as RechnungsbetragLokal + ,min(WährungFremd) as WährungFremd,min(SteuerbetragFremd) as SteuerbetragFremd,min(RechnungsbetragFremd) as RechnungsbetragFremd,min(TrdinDateiname) as TrdinDateiname,min(Abgleich_op_debitor+0) as Abgleich_op_debitor + ,min(Nettozahlungsziel) as Nettozahlungsziel,min(Firma_ID) as Firma_ID,min(UStVAn_ID) as UStVAn_ID ,Leistungsnummer,Leistungsbezeichnung,Steuerpflichtig,sum(PROD.SteuerpflichtigerBetragLokal) as SteuerpflichtigerBetragLokal + ,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 = '19400002' + group by IVO.Rechnungsnummer,IVO.rechnungsdatum,Leistungsnummer,Leistungsbezeichnung,Steuerpflichtig + ORDER BY Rechnungsdatum, Rechnungsnummer " + ' --and IVO.Rechnungsnummer=19400002 + Return SQL.loadDgvBySql(sqlStr, "FMZOLL", 9800) + + 'WHERE Firma_ID ='" & Firma_ID & "' AND TrdinDateiname Is Null + + End Function + + Public Shared Function genBuchungenBeginn() As String + Return "Umsatz (ohne Soll/Haben-Kz);Soll/Haben-Kennzeichen;WKZ Umsatz;Kurs;Basis-Umsatz;WKZ Basis-Umsatz;Konto;Gegenkonto (ohne BU-Schlüssel);BU-Schlüssel;Belegdatum;Belegfeld 1;Belegfeld 2;Skonto;Buchungstext;Postensperre;Diverse Adressnummer;Geschäftspartnerbank;Sachverhalt;Zinssperre;Beleglink;Beleginfo - Art 1;Beleginfo - Inhalt 1;Beleginfo - Art 2;Beleginfo - Inhalt 2;Beleginfo - Art 3;Beleginfo - Inhalt 3;Beleginfo - Art 4;Beleginfo - Inhalt 4;Beleginfo - Art 5;Beleginfo - Inhalt 5;Beleginfo - Art 6;Beleginfo - Inhalt 6;Beleginfo - Art 7;Beleginfo - Inhalt 7;Beleginfo - Art 8;Beleginfo - Inhalt 8;KOST1 - Kostenstelle;KOST2 - Kostenstelle;Kost-Menge;EU-Land u. UStID;EU-Steuersatz;Abw. Versteuerungsart;Sachverhalt L+L;Funktionsergänzung L+L;BU 49 Hauptfunktionstyp;BU 49 Hauptfunktionsnummer;BU 49 Funktionsergänzung;Zusatzinformation - Art 1;Zusatzinformation- Inhalt 1;Zusatzinformation - Art 2;Zusatzinformation- Inhalt 2;Zusatzinformation - Art 3;Zusatzinformation- Inhalt 3;Zusatzinformation - Art 4;Zusatzinformation- Inhalt 4;Zusatzinformation - Art 5;Zusatzinformation- Inhalt 5;Zusatzinformation - Art 6;Zusatzinformation- Inhalt 6;Zusatzinformation - Art 7;Zusatzinformation- Inhalt 7;Zusatzinformation - Art 8;Zusatzinformation- Inhalt 8;Zusatzinformation - Art 9;Zusatzinformation- Inhalt 9;Zusatzinformation - Art 10;Zusatzinformation- Inhalt 10;Zusatzinformation - Art 11;Zusatzinformation- Inhalt 11;Zusatzinformation - Art 12;Zusatzinformation- Inhalt 12;Zusatzinformation - Art 13;Zusatzinformation- Inhalt 13;Zusatzinformation - Art 14;Zusatzinformation- Inhalt 14;Zusatzinformation - Art 15;Zusatzinformation- Inhalt 15;Zusatzinformation - Art 16;Zusatzinformation- Inhalt 16;Zusatzinformation - Art 17;Zusatzinformation- Inhalt 17;Zusatzinformation - Art 18;Zusatzinformation- Inhalt 18;Zusatzinformation - Art 19;Zusatzinformation- Inhalt 19;Zusatzinformation - Art 20;Zusatzinformation- Inhalt 20;Stück;Gewicht;Zahlweise;Forderungsart;Veranlagungsjahr;Zugeordnete Fälligkeit;Skontotyp;Auftragsnummer;Buchungstyp (Anzahlungen);USt-Schlüssel (Anzahlungen);EU-Land (Anzahlungen);Sachverhalt L+L (Anzahlungen);EU-Steuersatz (Anzahlungen);Erlöskonto (Anzahlungen);Herkunft-Kz;Buchungs GUID;KOST-Datum;SEPA-Mandatsreferenz;Skontosperre;Gesellschaftername;Beteiligtennummer;Identifikationsnummer;Zeichnernummer;Postensperre bis;Bezeichnung SoBil-Sachverhalt;Kennzeichen SoBil-Buchung;Festschreibung;Leistungsdatum;Datum Zuord. Steuerperiode;Fälligkeit;Generalumkehr (GU);Steuersatz;Land;Abrechnungsreferenz;BVV-Position" + End Function + Public Shared Function genBuchungenEnd() As String + Return "" + End Function + + + + Public Shared Function genStammdatenHeader() As String + Dim headerString = Chr(34) & "EXTF" & Chr(34) & ";" 'Export aus 3rd Party App + headerString &= datevVersion.ToString & ";" 'Versionnummer Datev + headerString &= KreditorenNr.ToString & ";" 'Debitoren\Kreditoren + headerString &= Chr(34) & "Debitoren/Kreditoren" & Chr(34) & ";" 'Debitoren\Kreditoren + headerString &= "5;" 'Debitoren\Kreditoren + headerString &= ";;;;;" + headerString &= BeraterNr.ToString & ";" 'Beraternummer + headerString &= MandantenNr.ToString & ";" 'Mandantennummer + headerString &= "20210101;" 'WJ-Beginn + headerString &= "6;" 'Sachkontenlänge + headerString &= ";" 'DatumVon + headerString &= ";" 'DatumBis + headerString &= "IMPORT AUS AVISO;" 'Bezeichnung + headerString &= Chr(34) & Chr(34) & ";" + headerString &= ";;;;;;;;;;;;" + Return headerString + End Function + + Public Shared Function genStapelbuchungsHeader() As String + Dim headerString = Chr(34) & "EXTF" & Chr(34) & ";" 'Export aus 3rd Party App + headerString &= datevVersion.ToString & ";" 'Versionnummer Datev + headerString &= StapelbuchungsNr.ToString & ";" 'Stapelbuchungen + headerString &= Chr(34) & "Buchungsstapel" & Chr(34) & ";" 'Buchungsstapel + headerString &= "11;" 'Buchungsstapel + headerString &= ";;;;;" + headerString &= BeraterNr.ToString & ";" 'Beraternummer + headerString &= MandantenNr.ToString & ";" 'Mandantennummer + headerString &= "20210101;" 'WJ-Beginn + headerString &= "6;" 'Sachkontenlänge + headerString &= "20210101;" 'DatumVon + headerString &= "20210331;" 'DatumBis + headerString &= "IMPORT AUS AVISO;" 'Bezeichnung + headerString &= Chr(34) & Chr(34) & ";" + headerString &= ";;;;;;;;;;;;" + Return headerString + End Function + + Public Shared Function genStammdatenEnd() As String + Return "" + End Function + + Public Shared Function genBuchungsZeile(row As DataRow, ByRef SummeBuchungen As Double, ByRef Geschäftsjahr As Integer, ByRef FIRMA As VERAG_PROG_ALLGEMEIN.cFirmen) As String + genBuchungsZeile = "" + Dim steuerbetragLokal As Double = 0 + Dim GJ_short = Geschäftsjahr.ToString.Substring(2, 2) + Dim RgNrOld = FormatStringDVO(row("Rechnungsnummer")).Substring(2) + + If CBool(row("Steuerpflichtig")) Then + steuerbetragLokal = CDbl((getDbl2(row("SteuerpflichtigerBetragLokal")) * getDbl2(row("Steuersatz")))) + steuerbetragLokal += CDbl((getDbl2(row("SteuerpflichtigerBetragFremd")) * getDbl2(row("Steuersatz")))) + End If + ' If steuerbetragLokal < 0 Then steuerbetragLokal = steuerbetragLokal * -1 --> SONST PROBLKEM BEI UNISPED; DA STEUER vom NETTO abgezogen wird! + genBuchungsZeile &= getDbltr(getDbl(row("SteuerpflichtigerBetragLokal")) + getDbl(row("SteuerfreierBetragLokal")) + getDbl(row("SteuerpflichtigerBetragFremd")) + getDbl(row("SteuerfreierBetragFremd")) + If(steuerbetragLokal <> 0, getDbltr(steuerbetragLokal), "0")) & ";" 'betrag + steuer (brutto) + genBuchungsZeile &= FormatStringDVO(Chr(83)) & ";" 'Soll-Haben-Steuerung!!! + genBuchungsZeile &= emptyFormatedValue() + genBuchungsZeile &= emptyFormatedValueWithoutCommas(2) + genBuchungsZeile &= emptyFormatedValue() + genBuchungsZeile &= (initKDNr2(row("KundenNrZentrale"))) & ";" + genBuchungsZeile &= fill0Stellen(row("Sachkonto"), 4) & ";" + genBuchungsZeile &= emptyFormatedValue() + genBuchungsZeile &= "" & CDate(row("Rechnungsdatum")).ToString("ddMM") & ";" + genBuchungsZeile &= FormatStringDVO(row("Rechnungsnummer")).Substring(0, 2) & "-" & FormatStringDVO(row("Rechnungsnummer")).Substring(2) & ";" + genBuchungsZeile &= emptyFormatedValue() + genBuchungsZeile &= emptyFormatedValue() ' Skontoangabe + genBuchungsZeile &= FormatStringDVO(SQL.DLookup("[Ordnungsbegriff]", "Adressen", " AdressenNr= " & row("KundenNrZentrale"), "FMZOLL", "")) & ";" + + + + 'Dim KdAtrNr = SQL.DLookup("KdAuftragsNr", "Rechnungsausgang", "rechnungsnr='" & RgNrOld & "' And Buchungsjahr='" & Geschäftsjahr & "' and Firma_ID='" & FIRMA.Firma_ID & "'", "FMZOLL", "") + 'KdAtrNr = KdAtrNr.ToString.Replace(vbNewLine, "").Replace(vbCr, "").Replace(vbLf, "").Replace(vbCrLf, "").Replace(System.Environment.NewLine, " ") + ' genBuchungsZeile &= KdAtrNr & ";".Replace(Environment.NewLine, "") 'extbelegnr + + ' genBuchungsZeile &= If(row("BelegartenNr") = "70", "AR", "AG") & ";" ' Rg/GS 70=Rechnung 'AG ???????? + ' genBuchungsZeile &= If(row("BelegartenNr") = "70", "1", "2") & ";" ' Rg/GS 70=Rechnung 'AG ???????? + + + 'genBuchungsZeile &= getSteuercode(row, FIRMA) & ";" + ' If CBool(row("Steuerpflichtig")) Then + ' genBuchungsZeile &= (getDbl2(row("Steuersatz")) * 100) & ";" 'buchcode === 1 oder 2?? + ' Else + ' genBuchungsZeile &= "0;" 'buchcode === 1 oder 2?? + ' End If + + + 'genBuchungsZeile &= "" & If(steuerbetragLokal <> 0, getDbltr(steuerbetragLokal), "0") & ";" 'steuer + + + 'genBuchungsZeile &= FormatStringDVO(row("Nettozahlungsziel")) & ";" ' Text + + ''... aus ... + 'SummeBuchungen += getDbl(getDbl(row("SteuerpflichtigerBetragLokal")) + getDbl(row("SteuerfreierBetragLokal"))) + + genBuchungsZeile &= emptyFormatedValue(107) + + 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 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 + + Shared Function getSteuercode(r As DataRow, FIRMA As VERAG_PROG_ALLGEMEIN.cFirmen) As String + Select Case r("Sachkonto") + 'Case "3550", "3553", "3558" + ' Return "999" + Case Else + + If Not CBool(r("Steuerpflichtig")) Then + 'Vorher immer return "" - galube es soll bei eu aber 77 sein... + If SQL.DLookup("[MitgliedslandEU]", "[Währungstabelle]", "[LandKz]='" & r("RechnungsLandKz") & "'", "FMZOLL", False) Then + Return "77" ' EU-LAND + Else + Return "" ' Drittland + End If + Else + If (r("RechnungsLandKz")).ToString.Replace("AT", "A").Replace("DE", "D") = FIRMA.Firma_LandKz Then 'Abhängig von FIRMA --> INLAND!!!!!! + Return "1" 'Steuerpflichtig und AT + Else + If SQL.DLookup("[MitgliedslandEU]", "[Währungstabelle]", "[LandKz]='" & r("RechnungsLandKz") & "'", "FMZOLL", False) Then + Return "77" ' EU-LAND + Else + Return "" ' Drittland + End If + End If + End If + + End Select + Return "" + End Function + + + + Shared Function getDbl(o As Object) As Double + Try + If o Is Nothing Then Return 0 + If o Is DBNull.Value Then Return 0 + Return CDbl(o) + Catch ex As Exception + Return 0 + End Try + End Function + Shared Function getDbl2(o As Object) As Double + Try + If o Is Nothing Then Return 0 + If o Is DBNull.Value Then Return 0 + Return CDbl(o.ToString.Replace(".", ",")) + Catch ex As Exception + Return 0 + End Try + End Function + + + Shared Function getDbltr(o As Object) As String + Try + If o Is Nothing Then Return 0 + If o Is DBNull.Value Then Return 0 + Return CDbl(o).ToString("N2").Replace(".", "") '.Replace(",", ".") + Catch ex As Exception + Return 0 + End Try + End Function + + Shared Function fill0Stellen(i As Object, l As Integer) As String + If i Is DBNull.Value Then i = "" + If i Is Nothing Then i = "" + While i.ToString.Length < l + i &= "0" + End While + Return i + End Function + + Shared Function emptyFormatedValue(Optional count As Integer = 1) As String + + Dim retturnText As String = "" + + For i = 1 To count + + retturnText &= Chr(34) & Chr(34) & ";" + + Next + + Return retturnText + + End Function + + Shared Function emptyFormatedValueWithoutCommas(Optional count As Integer = 1) As String + + Dim retturnText As String = "" + + For i = 1 To count + + retturnText &= ";" + + Next + + Return retturnText + + End Function + + + +End Class diff --git a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj index 53391e77..951e2f78 100644 --- a/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj +++ b/VERAG_PROG_ALLGEMEIN/VERAG_PROG_ALLGEMEIN.vbproj @@ -566,6 +566,7 @@ +