diff --git a/SDL/seriendruck/usrCntlFakturierung.Designer.vb b/SDL/seriendruck/usrCntlFakturierung.Designer.vb index a3f28fac..89b7765f 100644 --- a/SDL/seriendruck/usrCntlFakturierung.Designer.vb +++ b/SDL/seriendruck/usrCntlFakturierung.Designer.vb @@ -45,6 +45,9 @@ Partial Class usrcntlFakturierung Me.Button18 = New System.Windows.Forms.Button() Me.Label44 = New System.Windows.Forms.Label() Me.GBSammelrechnung = New System.Windows.Forms.GroupBox() + Me.Button3 = New System.Windows.Forms.Button() + Me.Button2 = New System.Windows.Forms.Button() + Me.cbxMautanh = New System.Windows.Forms.CheckBox() Me.Button1 = New System.Windows.Forms.Button() Me.PictureBox6 = New System.Windows.Forms.PictureBox() Me.PictureBox5 = New System.Windows.Forms.PictureBox() @@ -76,7 +79,10 @@ Partial Class usrcntlFakturierung Me.Label63 = New System.Windows.Forms.Label() Me.Label45 = New System.Windows.Forms.Label() Me.Button14 = New System.Windows.Forms.Button() - Me.cbxMautanh = New System.Windows.Forms.CheckBox() + Me.PictureBox7 = New System.Windows.Forms.PictureBox() + Me.Label1 = New System.Windows.Forms.Label() + Me.PictureBox8 = New System.Windows.Forms.PictureBox() + Me.Label2 = New System.Windows.Forms.Label() Me.GroupBox1.SuspendLayout() Me.GBMautberichte.SuspendLayout() CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit() @@ -87,6 +93,8 @@ Partial Class usrcntlFakturierung CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me.PictureBox8, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' 'GroupBox1 @@ -304,6 +312,12 @@ Partial Class usrcntlFakturierung ' 'GBSammelrechnung ' + Me.GBSammelrechnung.Controls.Add(Me.PictureBox8) + Me.GBSammelrechnung.Controls.Add(Me.Label2) + Me.GBSammelrechnung.Controls.Add(Me.PictureBox7) + Me.GBSammelrechnung.Controls.Add(Me.Label1) + Me.GBSammelrechnung.Controls.Add(Me.Button3) + Me.GBSammelrechnung.Controls.Add(Me.Button2) Me.GBSammelrechnung.Controls.Add(Me.cbxMautanh) Me.GBSammelrechnung.Controls.Add(Me.Button1) Me.GBSammelrechnung.Controls.Add(Me.PictureBox6) @@ -343,6 +357,42 @@ Partial Class usrcntlFakturierung Me.GBSammelrechnung.TabIndex = 14 Me.GBSammelrechnung.TabStop = False ' + 'Button3 + ' + Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.Button3.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.Button3.Location = New System.Drawing.Point(123, 346) + Me.Button3.Name = "Button3" + Me.Button3.Size = New System.Drawing.Size(121, 32) + Me.Button3.TabIndex = 109 + Me.Button3.Text = "BS berechnen" + Me.Button3.UseVisualStyleBackColor = True + Me.Button3.Visible = False + ' + 'Button2 + ' + Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.Button2.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) + Me.Button2.Location = New System.Drawing.Point(4, 346) + Me.Button2.Name = "Button2" + Me.Button2.Size = New System.Drawing.Size(106, 32) + Me.Button2.TabIndex = 108 + Me.Button2.Text = "PP berechnen" + Me.Button2.UseVisualStyleBackColor = True + Me.Button2.Visible = False + ' + 'cbxMautanh + ' + Me.cbxMautanh.AutoSize = True + Me.cbxMautanh.Checked = True + Me.cbxMautanh.CheckState = System.Windows.Forms.CheckState.Checked + Me.cbxMautanh.Location = New System.Drawing.Point(450, 262) + Me.cbxMautanh.Name = "cbxMautanh" + Me.cbxMautanh.Size = New System.Drawing.Size(184, 17) + Me.cbxMautanh.TabIndex = 107 + Me.cbxMautanh.Text = "Mautanhänge im PDF hinzufügen" + Me.cbxMautanh.UseVisualStyleBackColor = True + ' 'Button1 ' Me.Button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat @@ -358,7 +408,7 @@ Partial Class usrcntlFakturierung ' Me.PictureBox6.BackgroundImage = CType(resources.GetObject("PictureBox6.BackgroundImage"), System.Drawing.Image) Me.PictureBox6.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom - Me.PictureBox6.Location = New System.Drawing.Point(151, 172) + Me.PictureBox6.Location = New System.Drawing.Point(148, 163) Me.PictureBox6.Name = "PictureBox6" Me.PictureBox6.Size = New System.Drawing.Size(14, 14) Me.PictureBox6.TabIndex = 105 @@ -369,7 +419,7 @@ Partial Class usrcntlFakturierung ' Me.PictureBox5.BackgroundImage = CType(resources.GetObject("PictureBox5.BackgroundImage"), System.Drawing.Image) Me.PictureBox5.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom - Me.PictureBox5.Location = New System.Drawing.Point(151, 155) + Me.PictureBox5.Location = New System.Drawing.Point(148, 146) Me.PictureBox5.Name = "PictureBox5" Me.PictureBox5.Size = New System.Drawing.Size(14, 14) Me.PictureBox5.TabIndex = 104 @@ -380,7 +430,7 @@ Partial Class usrcntlFakturierung ' Me.PictureBox4.BackgroundImage = CType(resources.GetObject("PictureBox4.BackgroundImage"), System.Drawing.Image) Me.PictureBox4.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom - Me.PictureBox4.Location = New System.Drawing.Point(151, 138) + Me.PictureBox4.Location = New System.Drawing.Point(148, 129) Me.PictureBox4.Name = "PictureBox4" Me.PictureBox4.Size = New System.Drawing.Size(14, 14) Me.PictureBox4.TabIndex = 103 @@ -391,7 +441,7 @@ Partial Class usrcntlFakturierung ' Me.PictureBox3.BackgroundImage = CType(resources.GetObject("PictureBox3.BackgroundImage"), System.Drawing.Image) Me.PictureBox3.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom - Me.PictureBox3.Location = New System.Drawing.Point(151, 121) + Me.PictureBox3.Location = New System.Drawing.Point(148, 112) Me.PictureBox3.Name = "PictureBox3" Me.PictureBox3.Size = New System.Drawing.Size(14, 14) Me.PictureBox3.TabIndex = 102 @@ -402,7 +452,7 @@ Partial Class usrcntlFakturierung ' Me.PictureBox2.BackgroundImage = CType(resources.GetObject("PictureBox2.BackgroundImage"), System.Drawing.Image) Me.PictureBox2.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom - Me.PictureBox2.Location = New System.Drawing.Point(151, 104) + Me.PictureBox2.Location = New System.Drawing.Point(148, 95) Me.PictureBox2.Name = "PictureBox2" Me.PictureBox2.Size = New System.Drawing.Size(14, 14) Me.PictureBox2.TabIndex = 101 @@ -413,7 +463,7 @@ Partial Class usrcntlFakturierung ' Me.PictureBox1.BackgroundImage = Global.SDL.My.Resources.Resources.ok Me.PictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom - Me.PictureBox1.Location = New System.Drawing.Point(151, 90) + Me.PictureBox1.Location = New System.Drawing.Point(148, 76) Me.PictureBox1.Name = "PictureBox1" Me.PictureBox1.Size = New System.Drawing.Size(14, 14) Me.PictureBox1.TabIndex = 95 @@ -422,7 +472,7 @@ Partial Class usrcntlFakturierung ' 'Label4 ' - Me.Label4.Location = New System.Drawing.Point(171, 155) + Me.Label4.Location = New System.Drawing.Point(168, 146) Me.Label4.Name = "Label4" Me.Label4.Size = New System.Drawing.Size(440, 17) Me.Label4.TabIndex = 100 @@ -538,7 +588,7 @@ Partial Class usrcntlFakturierung ' Me.txtPloseAnh_Einarbeitung.BackColor = System.Drawing.Color.White Me.txtPloseAnh_Einarbeitung.BorderStyle = System.Windows.Forms.BorderStyle.None - Me.txtPloseAnh_Einarbeitung.Location = New System.Drawing.Point(209, 218) + Me.txtPloseAnh_Einarbeitung.Location = New System.Drawing.Point(510, 218) Me.txtPloseAnh_Einarbeitung.Name = "txtPloseAnh_Einarbeitung" Me.txtPloseAnh_Einarbeitung.Size = New System.Drawing.Size(106, 13) Me.txtPloseAnh_Einarbeitung.TabIndex = 38 @@ -546,7 +596,7 @@ Partial Class usrcntlFakturierung 'Label71 ' Me.Label71.AutoSize = True - Me.Label71.Location = New System.Drawing.Point(144, 218) + Me.Label71.Location = New System.Drawing.Point(443, 218) Me.Label71.Name = "Label71" Me.Label71.Size = New System.Drawing.Size(56, 13) Me.Label71.TabIndex = 35 @@ -554,14 +604,14 @@ Partial Class usrcntlFakturierung ' 'pbPloseAnh_Proz ' - Me.pbPloseAnh_Proz.Location = New System.Drawing.Point(147, 189) + Me.pbPloseAnh_Proz.Location = New System.Drawing.Point(446, 189) Me.pbPloseAnh_Proz.Name = "pbPloseAnh_Proz" - Me.pbPloseAnh_Proz.Size = New System.Drawing.Size(283, 23) + Me.pbPloseAnh_Proz.Size = New System.Drawing.Size(245, 23) Me.pbPloseAnh_Proz.TabIndex = 36 ' 'lblPloseAnh_Proz ' - Me.lblPloseAnh_Proz.Location = New System.Drawing.Point(361, 218) + Me.lblPloseAnh_Proz.Location = New System.Drawing.Point(622, 218) Me.lblPloseAnh_Proz.Name = "lblPloseAnh_Proz" Me.lblPloseAnh_Proz.Size = New System.Drawing.Size(69, 13) Me.lblPloseAnh_Proz.TabIndex = 37 @@ -572,7 +622,7 @@ Partial Class usrcntlFakturierung ' Me.Button19.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button19.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) - Me.Button19.Location = New System.Drawing.Point(10, 163) + Me.Button19.Location = New System.Drawing.Point(10, 182) Me.Button19.Name = "Button19" Me.Button19.Size = New System.Drawing.Size(121, 49) Me.Button19.TabIndex = 32 @@ -581,7 +631,7 @@ Partial Class usrcntlFakturierung ' 'Label70 ' - Me.Label70.Location = New System.Drawing.Point(171, 172) + Me.Label70.Location = New System.Drawing.Point(168, 163) Me.Label70.Name = "Label70" Me.Label70.Size = New System.Drawing.Size(429, 14) Me.Label70.TabIndex = 30 @@ -626,7 +676,7 @@ Partial Class usrcntlFakturierung ' 'Label65 ' - Me.Label65.Location = New System.Drawing.Point(171, 138) + Me.Label65.Location = New System.Drawing.Point(168, 129) Me.Label65.Name = "Label65" Me.Label65.Size = New System.Drawing.Size(440, 17) Me.Label65.TabIndex = 8 @@ -634,7 +684,7 @@ Partial Class usrcntlFakturierung ' 'Label64 ' - Me.Label64.Location = New System.Drawing.Point(171, 121) + Me.Label64.Location = New System.Drawing.Point(168, 112) Me.Label64.Name = "Label64" Me.Label64.Size = New System.Drawing.Size(440, 17) Me.Label64.TabIndex = 7 @@ -642,7 +692,7 @@ Partial Class usrcntlFakturierung ' 'Label63 ' - Me.Label63.Location = New System.Drawing.Point(171, 104) + Me.Label63.Location = New System.Drawing.Point(168, 95) Me.Label63.Name = "Label63" Me.Label63.Size = New System.Drawing.Size(440, 17) Me.Label63.TabIndex = 6 @@ -651,7 +701,7 @@ Partial Class usrcntlFakturierung ' 'Label45 ' - Me.Label45.Location = New System.Drawing.Point(171, 87) + Me.Label45.Location = New System.Drawing.Point(168, 78) Me.Label45.Name = "Label45" Me.Label45.Size = New System.Drawing.Size(224, 17) Me.Label45.TabIndex = 5 @@ -661,24 +711,50 @@ Partial Class usrcntlFakturierung ' Me.Button14.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button14.ForeColor = System.Drawing.Color.FromArgb(CType(CType(0, Byte), Integer), CType(CType(54, Byte), Integer), CType(CType(128, Byte), Integer)) - Me.Button14.Location = New System.Drawing.Point(10, 90) + Me.Button14.Location = New System.Drawing.Point(10, 81) Me.Button14.Name = "Button14" Me.Button14.Size = New System.Drawing.Size(121, 49) Me.Button14.TabIndex = 4 Me.Button14.Text = "Rechnungspos. berechnen" Me.Button14.UseVisualStyleBackColor = True ' - 'cbxMautanh + 'PictureBox7 ' - Me.cbxMautanh.AutoSize = True - Me.cbxMautanh.Checked = True - Me.cbxMautanh.CheckState = System.Windows.Forms.CheckState.Checked - Me.cbxMautanh.Location = New System.Drawing.Point(450, 262) - Me.cbxMautanh.Name = "cbxMautanh" - Me.cbxMautanh.Size = New System.Drawing.Size(184, 17) - Me.cbxMautanh.TabIndex = 107 - Me.cbxMautanh.Text = "Mautanhänge im PDF hinzufügen" - Me.cbxMautanh.UseVisualStyleBackColor = True + Me.PictureBox7.BackgroundImage = Global.SDL.My.Resources.Resources.ok + Me.PictureBox7.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom + Me.PictureBox7.Location = New System.Drawing.Point(148, 195) + Me.PictureBox7.Name = "PictureBox7" + Me.PictureBox7.Size = New System.Drawing.Size(14, 14) + Me.PictureBox7.TabIndex = 111 + Me.PictureBox7.TabStop = False + Me.PictureBox7.Visible = False + ' + 'Label1 + ' + Me.Label1.Location = New System.Drawing.Point(168, 195) + Me.Label1.Name = "Label1" + Me.Label1.Size = New System.Drawing.Size(224, 17) + Me.Label1.TabIndex = 110 + Me.Label1.Text = "1. Rechnungsnummern gesetzt" + ' + 'PictureBox8 + ' + Me.PictureBox8.BackgroundImage = Global.SDL.My.Resources.Resources.ok + Me.PictureBox8.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom + Me.PictureBox8.Location = New System.Drawing.Point(148, 212) + Me.PictureBox8.Name = "PictureBox8" + Me.PictureBox8.Size = New System.Drawing.Size(14, 14) + Me.PictureBox8.TabIndex = 113 + Me.PictureBox8.TabStop = False + Me.PictureBox8.Visible = False + ' + 'Label2 + ' + Me.Label2.Location = New System.Drawing.Point(168, 212) + Me.Label2.Name = "Label2" + Me.Label2.Size = New System.Drawing.Size(224, 17) + Me.Label2.TabIndex = 112 + Me.Label2.Text = "2. PDFs erzeugt" ' 'usrcntlFakturierung ' @@ -705,6 +781,8 @@ Partial Class usrcntlFakturierung CType(Me.PictureBox3, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox2, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBox7, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me.PictureBox8, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) Me.PerformLayout() @@ -762,4 +840,10 @@ Partial Class usrcntlFakturierung Friend WithEvents PictureBox2 As PictureBox Friend WithEvents Button1 As Button Friend WithEvents cbxMautanh As CheckBox + Friend WithEvents Button3 As Button + Friend WithEvents Button2 As Button + Friend WithEvents PictureBox7 As PictureBox + Friend WithEvents Label1 As Label + Friend WithEvents PictureBox8 As PictureBox + Friend WithEvents Label2 As Label End Class diff --git a/SDL/seriendruck/usrCntlFakturierung.vb b/SDL/seriendruck/usrCntlFakturierung.vb index cb932963..2af5af47 100644 --- a/SDL/seriendruck/usrCntlFakturierung.vb +++ b/SDL/seriendruck/usrCntlFakturierung.vb @@ -65,6 +65,11 @@ Public Class usrcntlFakturierung End If + If VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("ADMINFUNCTIONS", "SDL") Then + Button2.Visible = True + Button3.Visible = True + End If + End Sub @@ -303,7 +308,7 @@ Public Class usrcntlFakturierung End Sub - Private Function PortoPapiere(Sachbearbeiter As String, rechnungsdatum As Date) As Boolean + Private Function PortoPapiere(Sachbearbeiter As String, rechnungsdatum As Date, Optional kdNr As Integer = -1) As Boolean ' Die Abfrage ermittelt aus den Rechnungspositonen, @@ -327,10 +332,10 @@ Public Class usrcntlFakturierung INNER JOIN RechnungsausgangPositionen ON Rechnungsausgang.RK_ID = RechnungsausgangPositionen.RK_ID WHERE - Rechnungsausgang.Status = 0 + Rechnungsausgang.Status in " & If(kdNr > 0, "(0,2)", "(0)") & " AND Rechnungsausgang.Sammelrechnung = 6 AND UPPER(Rechnungsausgang.Sachbearbeiter) = '" & Sachbearbeiter & "' - AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "' + AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "' " & IIf(kdNr > 0, " AND RechnungsKundenNr = " & kdNr, "") & " GROUP BY Rechnungsausgang.Firma_ID, @@ -584,16 +589,16 @@ Public Class usrcntlFakturierung End Function - Private Function Bankspesen(Sachbearbeiter As String, rechnungsdatum As Date) + Private Function Bankspesen(Sachbearbeiter As String, rechnungsdatum As Date, Optional kdNr As Integer = -1) Dim isSet As Boolean = False Dim sqlBB = " Select Firma_ID, Status, Sammelrechnung, Sachbearbeiter, RechnungsKundenNr, BelegartenNr, Währungscode, [Steuersatz %], Lastschrift From dbo.Rechnungsausgang - Where Status = 0 + Where Status IN " & If(kdNr > 0, "(0,2)", "(0)") & " And Sammelrechnung = 6 And UPPER([Sachbearbeiter]) ='" & Sachbearbeiter & "' - AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "' + AND cast(Abfertigungsdatum as Date) = '" & rechnungsdatum & "'" & If(kdNr > 0, " AND RechnungsKundenNr = " & kdNr, "") & " Group By Firma_ID, Status, Sammelrechnung, Sachbearbeiter, RechnungsKundenNr, BelegartenNr, Währungscode, [Steuersatz %], Lastschrift Order By Firma_ID, Status, Sammelrechnung, Sachbearbeiter, RechnungsKundenNr, BelegartenNr, Währungscode, [Steuersatz %], Lastschrift" @@ -712,9 +717,9 @@ Public Class usrcntlFakturierung If sumCurrenRow > 0 Then - preis = Math.Floor(sumCurrenRow * rowBS("Bankspesen %") + 0.5) + preis = Math.Round(sumCurrenRow * rowBS("Bankspesen %") + 0.5, 2) Else - preis = Math.Floor(0 - sumCurrenRow * rowBS("Bankspesen %") + 0.5) + preis = Math.Round(0 - sumCurrenRow * rowBS("Bankspesen %") + 0.5, 2) End If Else @@ -948,14 +953,14 @@ Public Class usrcntlFakturierung If dtSammelrechnungen.Rows.Count > 0 Then - For Each rowSARE In dtSammelrechnungen.Rows + Dim reNrisSet = setStatus2(Sachbearbeiter, rechnungsdatum, dtSammelrechnungen) - If Not setStatus2(Sachbearbeiter, rechnungsdatum, dtSammelrechnungen) Then - MsgBox("Fehler beim Setzen der Rechnungsnummer" & vbNewLine & "Vorgang wird abgebrochen!") - Exit Sub - End If + showPic(reNrisSet, PictureBox7) - Next + If Not reNrisSet Then + MsgBox("Fehler beim Setzen der Rechnungsnummer" & vbNewLine & "Vorgang wird abgebrochen!") + Exit Sub + End If End If @@ -977,7 +982,7 @@ Public Class usrcntlFakturierung nurNICHTEUKunden = MsgBox("Sollen nur die Rechnungen der NICHT-EU Kunden gedruckt werden?", vbYesNo) End If - Dim dTLANDEU As DataTable = (New SQL).loadDgvBySql("select LandKz, MitgliedslandEU from Währungstabelle where LandKz is not null", "FMZOLL") + Dim dTLANDEU As DataTable = (New SQL).loadDgvBySql("select LandKz, MitgliedslandEU from Währungstabelle where LandKz is not null", "FMZOLL") Dim R As DataRow = dTLANDEU.NewRow R("LandKz") = "MK" @@ -1024,11 +1029,14 @@ Public Class usrcntlFakturierung If Not FormularManagerNEU.MergePdfFiles(listPDFs, pathPDFMerge) Then Exit Sub MsgBox("Fehler beim Zusammenführen der PDFs.") + showPic(False, PictureBox8) Else + showPic(True, PictureBox8) Process.Start(pathPDFMerge) End If Else + showPic(True, PictureBox8) Process.Start(pathPDF) End If @@ -1138,7 +1146,8 @@ Public Class usrcntlFakturierung Else - MsgBox("Keine Sammelrechnung zum " & rechnungsdatum.ToShortDateString & " von " & Sachbearbeiter & " vorhanden!") + showPic(false, PictureBox8) + MsgBox("Keine Sammelrechnung zum " & rechnungsdatum.ToShortDateString & " von " & Sachbearbeiter & " vorhanden!") End If End Sub @@ -1644,7 +1653,7 @@ Public Class usrcntlFakturierung End Function - Private Sub cboSachbearbeiter_RightToLeftChanged(sender As Object, e As EventArgs) Handles cboSachbearbeiter.RightToLeftChanged + Private Sub cboSachbearbeiter_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboSachbearbeiter.SelectedIndexChanged Dim sammelrechnung0vorhanden As Boolean = True sammelrechnung0vorhanden = checkIfStatus0Sammelrechnugnenvorhanden(cboSachbearbeiter._value, CDate(dtRechnungsdatum.Text)) @@ -1652,6 +1661,53 @@ Public Class usrcntlFakturierung Button14.Enabled = sammelrechnung0vorhanden Button20.Enabled = sammelrechnung0vorhanden + End Sub + + Private Sub Button2_Click_1(sender As Object, e As EventArgs) Handles Button2.Click, Button3.Click + + Dim Sachbearbeiter = cboSachbearbeiter._value + Dim rechnungsdatum As Date = CDate(dtRechnungsdatum.Text) + Dim kdNr As Integer = -1 + + If rechnungsdatum > Today() Then + MsgBox("Rechnungsdatum liegt in der Zukunft, nicht möglich") + Exit Sub + + End If + + If Sachbearbeiter = "" Then + MsgBox("Sachbearbeiter auswählen!") + Exit Sub + End If + + If rbkunde.Checked Then + If KdSearchBox3.KdNr > 0 Then + kdnr = KdSearchBox3.KdNr + Else + MsgBox("Kunde auswählen!") + Exit Sub + End If + End If + + + + Select Case sender.Name + Case "Button2" + + ' Porto/Papiere berechnen. + PortoPapiere(Sachbearbeiter, rechnungsdatum, kdNr) + + Case "Button3" + + 'Berechnet Banküberweisung/Bankspesen. + Bankspesen(Sachbearbeiter, rechnungsdatum, kdNr) + + End Select + + + + End Sub + End Class