Abrechnungsmaske, FIBU, Spedbuch, etc.

This commit is contained in:
2026-05-26 14:17:16 +02:00
parent 2ebb045ef6
commit 70b2952efc
13 changed files with 162 additions and 70 deletions

View File

@@ -154,6 +154,7 @@ Partial Class usrCntlBH
Me.Button7 = New System.Windows.Forms.Button()
Me.TabPage2 = New System.Windows.Forms.TabPage()
Me.GroupBox14 = New System.Windows.Forms.GroupBox()
Me.Label63 = New System.Windows.Forms.Label()
Me.Label66 = New System.Windows.Forms.Label()
Me.txtLand = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Label64 = New System.Windows.Forms.Label()
@@ -189,7 +190,9 @@ Partial Class usrCntlBH
Me.txtZRbis = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Label51 = New System.Windows.Forms.Label()
Me.txtJahr_FIBU = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Label63 = New System.Windows.Forms.Label()
Me.Button16 = New System.Windows.Forms.Button()
Me.Label67 = New System.Windows.Forms.Label()
Me.cboFirma_FIBUFilialen = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.pnl.SuspendLayout()
Me.TabPage1.SuspendLayout()
Me.GroupBox13.SuspendLayout()
@@ -687,7 +690,7 @@ Partial Class usrCntlBH
'
Me.Label32.Font = New System.Drawing.Font("Microsoft Sans Serif", 10.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label32.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.Label32.Location = New System.Drawing.Point(7, 104)
Me.Label32.Location = New System.Drawing.Point(7, 124)
Me.Label32.Name = "Label32"
Me.Label32.Size = New System.Drawing.Size(298, 18)
Me.Label32.TabIndex = 12
@@ -697,15 +700,15 @@ Partial Class usrCntlBH
'
Me.GroupBox7.Controls.Add(Me.Label33)
Me.GroupBox7.Controls.Add(Me.Button6)
Me.GroupBox7.Location = New System.Drawing.Point(6, 116)
Me.GroupBox7.Location = New System.Drawing.Point(6, 137)
Me.GroupBox7.Name = "GroupBox7"
Me.GroupBox7.Size = New System.Drawing.Size(369, 69)
Me.GroupBox7.Size = New System.Drawing.Size(369, 48)
Me.GroupBox7.TabIndex = 13
Me.GroupBox7.TabStop = False
'
'Label33
'
Me.Label33.Location = New System.Drawing.Point(145, 30)
Me.Label33.Location = New System.Drawing.Point(150, 21)
Me.Label33.Name = "Label33"
Me.Label33.Size = New System.Drawing.Size(224, 17)
Me.Label33.TabIndex = 3
@@ -717,7 +720,7 @@ Partial Class usrCntlBH
Me.Button6.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button6.Location = New System.Drawing.Point(6, 12)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(121, 49)
Me.Button6.Size = New System.Drawing.Size(121, 31)
Me.Button6.TabIndex = 1
Me.Button6.Text = "zum Mahnlauf"
Me.Button6.UseVisualStyleBackColor = True
@@ -888,6 +891,9 @@ Partial Class usrCntlBH
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.cboFirma_FIBUFilialen)
Me.GroupBox2.Controls.Add(Me.Label67)
Me.GroupBox2.Controls.Add(Me.Button16)
Me.GroupBox2.Controls.Add(Me.txtMonateSyskavergleich)
Me.GroupBox2.Controls.Add(Me.Label61)
Me.GroupBox2.Controls.Add(Me.Button15)
@@ -896,7 +902,7 @@ Partial Class usrCntlBH
Me.GroupBox2.Controls.Add(Me.Button1)
Me.GroupBox2.Location = New System.Drawing.Point(6, 15)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(461, 86)
Me.GroupBox2.Size = New System.Drawing.Size(461, 107)
Me.GroupBox2.TabIndex = 4
Me.GroupBox2.TabStop = False
'
@@ -915,7 +921,7 @@ Partial Class usrCntlBH
Me.txtMonateSyskavergleich._Waehrung = False
Me.txtMonateSyskavergleich._WaehrungZeichen = False
Me.txtMonateSyskavergleich.ForeColor = System.Drawing.Color.Black
Me.txtMonateSyskavergleich.Location = New System.Drawing.Point(383, 58)
Me.txtMonateSyskavergleich.Location = New System.Drawing.Point(377, 58)
Me.txtMonateSyskavergleich.MaxLength = 2
Me.txtMonateSyskavergleich.MaxLineLength = -1
Me.txtMonateSyskavergleich.MaxLines_Warning = ""
@@ -929,11 +935,11 @@ Partial Class usrCntlBH
'Label61
'
Me.Label61.AutoSize = True
Me.Label61.Location = New System.Drawing.Point(145, 61)
Me.Label61.Location = New System.Drawing.Point(133, 61)
Me.Label61.Name = "Label61"
Me.Label61.Size = New System.Drawing.Size(226, 13)
Me.Label61.Size = New System.Drawing.Size(247, 13)
Me.Label61.TabIndex = 30
Me.Label61.Text = "Kunden ohne FIBU-Filiale der letzten x Monate"
Me.Label61.Text = "akt. Kunden ohne FIBU-Filiale der letzten x Monate"
'
'Button15
'
@@ -942,9 +948,9 @@ Partial Class usrCntlBH
Me.Button15.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button15.Image = Global.SDL.My.Resources.Resources.Excel_logo
Me.Button15.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button15.Location = New System.Drawing.Point(6, 49)
Me.Button15.Location = New System.Drawing.Point(6, 51)
Me.Button15.Name = "Button15"
Me.Button15.Size = New System.Drawing.Size(121, 31)
Me.Button15.Size = New System.Drawing.Size(121, 27)
Me.Button15.TabIndex = 29
Me.Button15.Text = " Excel"
Me.Button15.UseVisualStyleBackColor = True
@@ -1959,6 +1965,15 @@ Partial Class usrCntlBH
Me.GroupBox14.TabIndex = 38
Me.GroupBox14.TabStop = False
'
'Label63
'
Me.Label63.AutoSize = True
Me.Label63.Location = New System.Drawing.Point(725, 70)
Me.Label63.Name = "Label63"
Me.Label63.Size = New System.Drawing.Size(103, 13)
Me.Label63.TabIndex = 76
Me.Label63.Text = "*wenn leer dann alle"
'
'Label66
'
Me.Label66.AutoSize = True
@@ -2513,14 +2528,40 @@ Partial Class usrCntlBH
Me.txtJahr_FIBU.TabIndex = 76
Me.txtJahr_FIBU.Text = "0"
'
'Label63
'Button16
'
Me.Label63.AutoSize = True
Me.Label63.Location = New System.Drawing.Point(725, 70)
Me.Label63.Name = "Label63"
Me.Label63.Size = New System.Drawing.Size(103, 13)
Me.Label63.TabIndex = 76
Me.Label63.Text = "*wenn leer dann alle"
Me.Button16.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Center
Me.Button16.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button16.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer))
Me.Button16.Image = Global.SDL.My.Resources.Resources.Excel_logo
Me.Button16.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button16.Location = New System.Drawing.Point(6, 81)
Me.Button16.Name = "Button16"
Me.Button16.Size = New System.Drawing.Size(121, 23)
Me.Button16.TabIndex = 44
Me.Button16.Text = " Excel"
Me.Button16.UseVisualStyleBackColor = True
'
'Label67
'
Me.Label67.AutoSize = True
Me.Label67.Location = New System.Drawing.Point(145, 87)
Me.Label67.Name = "Label67"
Me.Label67.Size = New System.Drawing.Size(105, 13)
Me.Label67.TabIndex = 45
Me.Label67.Text = "Vergleich UID-Syska"
'
'cboFirma_FIBUFilialen
'
Me.cboFirma_FIBUFilialen._allowedValuesFreiText = Nothing
Me.cboFirma_FIBUFilialen._allowFreiText = False
Me.cboFirma_FIBUFilialen._value = ""
Me.cboFirma_FIBUFilialen.DropDownWidth = 150
Me.cboFirma_FIBUFilialen.FormattingEnabled = True
Me.cboFirma_FIBUFilialen.Location = New System.Drawing.Point(406, 57)
Me.cboFirma_FIBUFilialen.Name = "cboFirma_FIBUFilialen"
Me.cboFirma_FIBUFilialen.Size = New System.Drawing.Size(54, 21)
Me.cboFirma_FIBUFilialen.TabIndex = 43
'
'usrCntlBH
'
@@ -2744,4 +2785,7 @@ Partial Class usrCntlBH
Friend WithEvents txtKundeNrBis As VERAG_PROG_ALLGEMEIN.MyTextBox
Friend WithEvents Label65 As Label
Friend WithEvents Label63 As Label
Friend WithEvents cboFirma_FIBUFilialen As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents Label67 As Label
Friend WithEvents Button16 As Button
End Class

View File

@@ -1,5 +1,6 @@
Imports System.Globalization
Imports System.Text
Imports ClosedXML.Excel
Imports VERAG_PROG_ALLGEMEIN
Public Class usrCntlBH
@@ -29,6 +30,9 @@ Public Class usrCntlBH
cboAbfVerbFirma.fillWithSQL("SELECT distinct([Firma]) FROM [VERAG].[dbo].[Filialen] order by [Firma]", False, "FMZOLL", True)
cboAbfVerbFirma.changeItem(VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA)
cboFirma_FIBUFilialen.fillWithSQL("SELECT distinct([Firma]) FROM [VERAG].[dbo].[Filialen] order by [Firma]", False, "FMZOLL", True)
cboFirma_FIBUFilialen.changeItem(VERAG_PROG_ALLGEMEIN.cAllgemein.FIRMA)
cbxFirma_RE.fillWithSQL("SELECT Firma_ID, Firma_Bez FROM [VERAG].[dbo].[tblFirma] where Firma_ID in (1,4,7,11,19,20,21,22,23,24,26)", False, "FMZOLL", True)
txtRE_Jahr.Text = Now().Year
@@ -1601,11 +1605,12 @@ Public Class usrCntlBH
If txtMonateSyskavergleich.Text <> "" AndAlso IsNumeric(txtMonateSyskavergleich.Text) Then
Dim SQLString = "select RechnungsKundenNr, Adressen.[Name 1], Kunden.FilialenNr, MAX(cast(RechnungsDatum as Date)) as aktuellsteRE from Rechnungsausgang
inner join Kunden on Kunden.KundenNr = Rechnungsausgang.KundenNrZentrale
inner join Adressen on Adressen.AdressenNr = Kunden.KundenNr
where cast(RechnungsDatum as date) >= DATEADD(MONTH,-" & txtMonateSyskavergleich.Text & ", GETDATE()) and Kunden.FiBuSchnittstelle = 0 and Kunden.FiBuSchnittstelleNr is null
group by RechnungsKundenNr, Adressen.[Name 1], Kunden.FilialenNr
order by MAX(cast(RechnungsDatum as Date)) "
inner join Kunden on Kunden.KundenNr = Rechnungsausgang.RechnungsKundenNr
inner join Adressen on Adressen.AdressenNr = Kunden.KundenNr
inner join Filialen On Filialen.FilialenNr=Kunden.FilialenNr
where cast(RechnungsDatum as date) >= DATEADD(MONTH,-" & txtMonateSyskavergleich.Text & ", GETDATE()) and Kunden.FiBuSchnittstelle = 0 and Kunden.FiBuSchnittstelleNr is null and Adressen.Auswahl = 'A'" & IIf(cboFirma_FIBUFilialen._value <> "", " And Filialen.Firma = '" & cboFirma_FIBUFilialen._value & "'", "") &
" group by RechnungsKundenNr, Adressen.[Name 1], Kunden.FilialenNr
order by MAX(cast(RechnungsDatum as Date)) "
Me.Cursor = Cursors.WaitCursor
Dim dt_RE As DataTable = SQL.loadDgvBySql(SQLString, "FMZOLL")
@@ -2001,4 +2006,35 @@ Public Class usrCntlBH
End Sub
Private Sub Button16_Click_1(sender As Object, e As EventArgs) Handles Button16.Click
Dim firmenlist As New List(Of MyListItem)
firmenlist.Add(New MyListItem("VERAG AG", 1))
firmenlist.Add(New MyListItem("VERAG CS", 11))
firmenlist.Add(New MyListItem("ATILLA", 7))
Dim dtList As New List(Of DataTable)
For Each i In firmenlist
Dim sql As New SQL
Dim sqlstrKunden = " select * from ( SELECT [KundenNr] as KundenNr,[Name 1], Adressen.LandKz, (isnull(Adressen.UstIdKz,'') + isnull(Adressen.UstIdNr,'')) as UIDNrKunden, isnull(c_ustidnr,'') as UIDNrKundenDeb, [i_firm_refid] as MandantFIBU, FiBuSchnittstelleNr as MandantAVISO FROM [VERAG].[dbo].[Kunden]
inner join Adressen on Adressen.AdressenNr = Kunden.KundenNr
inner join Buchhaltung.[FIBU2].[dbo].[fibu_konto] on Kunden.KundenNrZentrale = i_konto
where isnull(KundenNrZentrale,0) <> 0 and Auswahl = 'A' And isnull(FiBuSchnittstelleNr,0) = " & i.Value & " ANd [i_firm_refid] = " & i.Value & " ) as temp where UIDNrKunden <> UIDNrKundenDeb"
Dim dtKunden As DataTable = sql.loadDgvBySql(sqlstrKunden, "FMZOLL")
If dtKunden.Rows.Count > 0 Then
dtKunden.TableName = i.Text
dtList.Add(dtKunden)
End If
Next
If dtList.Count > 0 Then
cProgramFunctions.genExcelFromMultibleDT_NEW(dtList,,,,,,,,,,,, True)
End If
End Sub
End Class