From e8ade89a6bc5b3d86efe9ce435de955012acc317 Mon Sep 17 00:00:00 2001 From: "d.breimaier" Date: Tue, 14 Oct 2025 17:38:23 +0200 Subject: [PATCH] div. Punkte --- SDL/My Project/AssemblyInfo.vb | 4 +- SDL/USTV/frmUSTVoffeneAntraege.Designer.vb | 187 +++++++------- SDL/USTV/frmUSTVoffeneAntraege.vb | 16 ++ SDL/buchhaltung/usrCntlBH.Designer.vb | 10 +- SDL/buchhaltung/usrCntlBH.vb | 83 ++++-- .../frmGoMautBoxen_Bestellung.Designer.vb | 206 +++++++-------- SDL/kunden/frmGoMautBoxen_Bestellung.vb | 236 ++++++++++++++---- SDL/kunden/frmKundenblatt.Designer.vb | 75 +++--- SDL/kunden/frmKundenblatt.vb | 139 ++++++++++- SDL/kunden/usrCntlOfferte.Designer.vb | 33 ++- SDL/kunden/usrCntlOfferte.vb | 28 +++ .../usrcntlKundeBearbeitenFull.Designer.vb | 56 +++-- SDL/kunden/usrcntlKundeBearbeitenFull.vb | 37 ++- .../Classes/cMDMZinsberechnung.vb | 4 + 14 files changed, 789 insertions(+), 325 deletions(-) diff --git a/SDL/My Project/AssemblyInfo.vb b/SDL/My Project/AssemblyInfo.vb index 4c692da1..46d49bdf 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/USTV/frmUSTVoffeneAntraege.Designer.vb b/SDL/USTV/frmUSTVoffeneAntraege.Designer.vb index bcb4006b..fa9431c5 100644 --- a/SDL/USTV/frmUSTVoffeneAntraege.Designer.vb +++ b/SDL/USTV/frmUSTVoffeneAntraege.Designer.vb @@ -23,9 +23,9 @@ Partial Class frmUSTVoffeneAntraege _ Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() - Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle2 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle3 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle4 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle5 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle6 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.FlowLayoutPanel = New System.Windows.Forms.FlowLayoutPanel() Me.btn = New System.Windows.Forms.Button() Me.Button7 = New System.Windows.Forms.Button() @@ -47,21 +47,22 @@ Partial Class frmUSTVoffeneAntraege Me.lblKunde = New System.Windows.Forms.Label() Me.Label4 = New System.Windows.Forms.Label() Me.pnlLand = New System.Windows.Forms.Panel() + Me.Label6 = New System.Windows.Forms.Label() Me.Label5 = New System.Windows.Forms.Label() - Me.cbxKundeLand = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.cbxNichtEroeffneteAntraege = New System.Windows.Forms.CheckBox() Me.cbxUStV = New System.Windows.Forms.CheckBox() - Me.MyComboBox1 = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.AntragEröffnenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.Button4 = New System.Windows.Forms.Button() + Me.cbxKundenMWST = New System.Windows.Forms.CheckBox() + Me.cbxLieferant = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.cbxKundeLand = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.MyComboBox1 = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.txtmaxAnz = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.txtMWST = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.txtAnzahl = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.MyDatagridview1 = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) - Me.cbxKundenMWST = New System.Windows.Forms.CheckBox() - Me.Label6 = New System.Windows.Forms.Label() - Me.cbxLieferant = New VERAG_PROG_ALLGEMEIN.MyComboBox() + Me.Button5 = New System.Windows.Forms.Button() Me.FlowLayoutPanel.SuspendLayout() Me.Panel4.SuspendLayout() Me.pnlLand.SuspendLayout() @@ -298,6 +299,16 @@ Partial Class frmUSTVoffeneAntraege Me.pnlLand.TabIndex = 42 Me.pnlLand.Visible = False ' + 'Label6 + ' + Me.Label6.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.Label6.AutoSize = True + Me.Label6.Location = New System.Drawing.Point(18, 9) + Me.Label6.Name = "Label6" + Me.Label6.Size = New System.Drawing.Size(51, 13) + Me.Label6.TabIndex = 51 + Me.Label6.Text = "Lieferant:" + ' 'Label5 ' Me.Label5.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) @@ -308,17 +319,6 @@ Partial Class frmUSTVoffeneAntraege Me.Label5.TabIndex = 49 Me.Label5.Text = "Land-Kunde:" ' - 'cbxKundeLand - ' - Me.cbxKundeLand._allowedValuesFreiText = Nothing - Me.cbxKundeLand._allowFreiText = False - Me.cbxKundeLand._value = "" - Me.cbxKundeLand.FormattingEnabled = True - Me.cbxKundeLand.Location = New System.Drawing.Point(244, 6) - Me.cbxKundeLand.Name = "cbxKundeLand" - Me.cbxKundeLand.Size = New System.Drawing.Size(72, 21) - Me.cbxKundeLand.TabIndex = 48 - ' 'cbxNichtEroeffneteAntraege ' Me.cbxNichtEroeffneteAntraege.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) @@ -341,17 +341,6 @@ Partial Class frmUSTVoffeneAntraege Me.cbxUStV.Text = " nur mit UStV" Me.cbxUStV.UseVisualStyleBackColor = True ' - 'MyComboBox1 - ' - Me.MyComboBox1._allowedValuesFreiText = Nothing - Me.MyComboBox1._allowFreiText = False - Me.MyComboBox1._value = "" - Me.MyComboBox1.FormattingEnabled = True - Me.MyComboBox1.Location = New System.Drawing.Point(396, 5) - Me.MyComboBox1.Name = "MyComboBox1" - Me.MyComboBox1.Size = New System.Drawing.Size(72, 21) - Me.MyComboBox1.TabIndex = 46 - ' 'ContextMenuStrip1 ' Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.AntragEröffnenToolStripMenuItem}) @@ -374,6 +363,53 @@ Partial Class frmUSTVoffeneAntraege Me.Button4.Text = "PDFs prüfen" Me.Button4.UseVisualStyleBackColor = True ' + 'cbxKundenMWST + ' + Me.cbxKundenMWST.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.cbxKundenMWST.AutoSize = True + Me.cbxKundenMWST.Checked = True + Me.cbxKundenMWST.CheckState = System.Windows.Forms.CheckState.Checked + Me.cbxKundenMWST.Location = New System.Drawing.Point(1654, 78) + Me.cbxKundenMWST.Name = "cbxKundenMWST" + Me.cbxKundenMWST.Size = New System.Drawing.Size(158, 17) + Me.cbxKundenMWST.TabIndex = 47 + Me.cbxKundenMWST.Text = "Kunden-MWST ausblenden" + Me.cbxKundenMWST.UseVisualStyleBackColor = True + Me.cbxKundenMWST.Visible = False + ' + 'cbxLieferant + ' + Me.cbxLieferant._allowedValuesFreiText = Nothing + Me.cbxLieferant._allowFreiText = False + Me.cbxLieferant._value = "" + Me.cbxLieferant.FormattingEnabled = True + Me.cbxLieferant.Location = New System.Drawing.Point(92, 6) + Me.cbxLieferant.Name = "cbxLieferant" + Me.cbxLieferant.Size = New System.Drawing.Size(72, 21) + Me.cbxLieferant.TabIndex = 50 + ' + 'cbxKundeLand + ' + Me.cbxKundeLand._allowedValuesFreiText = Nothing + Me.cbxKundeLand._allowFreiText = False + Me.cbxKundeLand._value = "" + Me.cbxKundeLand.FormattingEnabled = True + Me.cbxKundeLand.Location = New System.Drawing.Point(244, 6) + Me.cbxKundeLand.Name = "cbxKundeLand" + Me.cbxKundeLand.Size = New System.Drawing.Size(72, 21) + Me.cbxKundeLand.TabIndex = 48 + ' + 'MyComboBox1 + ' + Me.MyComboBox1._allowedValuesFreiText = Nothing + Me.MyComboBox1._allowFreiText = False + Me.MyComboBox1._value = "" + Me.MyComboBox1.FormattingEnabled = True + Me.MyComboBox1.Location = New System.Drawing.Point(396, 5) + Me.MyComboBox1.Name = "MyComboBox1" + Me.MyComboBox1.Size = New System.Drawing.Size(72, 21) + Me.MyComboBox1.TabIndex = 46 + ' 'txtmaxAnz ' Me.txtmaxAnz._DateTimeOnly = False @@ -460,79 +496,55 @@ Partial Class frmUSTVoffeneAntraege Me.MyDatagridview1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - DataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.MyDatagridview1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle1 + DataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.MyDatagridview1.ColumnHeadersDefaultCellStyle = DataGridViewCellStyle4 Me.MyDatagridview1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - DataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window - DataGridViewCellStyle2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText - DataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] - Me.MyDatagridview1.DefaultCellStyle = DataGridViewCellStyle2 + DataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window + DataGridViewCellStyle5.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText + DataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.[False] + Me.MyDatagridview1.DefaultCellStyle = DataGridViewCellStyle5 Me.MyDatagridview1.Location = New System.Drawing.Point(12, 98) Me.MyDatagridview1.Name = "MyDatagridview1" Me.MyDatagridview1.ReadOnly = True - DataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft - DataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control - DataGridViewCellStyle3.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - DataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText - DataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight - DataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText - DataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] - Me.MyDatagridview1.RowHeadersDefaultCellStyle = DataGridViewCellStyle3 + DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft + DataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control + DataGridViewCellStyle6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + DataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText + DataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight + DataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText + DataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] + Me.MyDatagridview1.RowHeadersDefaultCellStyle = DataGridViewCellStyle6 Me.MyDatagridview1.RowHeadersWidth = 62 Me.MyDatagridview1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect Me.MyDatagridview1.Size = New System.Drawing.Size(1770, 528) Me.MyDatagridview1.TabIndex = 30 ' - 'cbxKundenMWST + 'Button5 ' - Me.cbxKundenMWST.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.cbxKundenMWST.AutoSize = True - Me.cbxKundenMWST.Checked = True - Me.cbxKundenMWST.CheckState = System.Windows.Forms.CheckState.Checked - Me.cbxKundenMWST.Location = New System.Drawing.Point(1654, 78) - Me.cbxKundenMWST.Name = "cbxKundenMWST" - Me.cbxKundenMWST.Size = New System.Drawing.Size(158, 17) - Me.cbxKundenMWST.TabIndex = 47 - Me.cbxKundenMWST.Text = "Kunden-MWST ausblenden" - Me.cbxKundenMWST.UseVisualStyleBackColor = True - Me.cbxKundenMWST.Visible = False - ' - 'Label6 - ' - Me.Label6.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.Label6.AutoSize = True - Me.Label6.Location = New System.Drawing.Point(18, 9) - Me.Label6.Name = "Label6" - Me.Label6.Size = New System.Drawing.Size(51, 13) - Me.Label6.TabIndex = 51 - Me.Label6.Text = "Lieferant:" - ' - 'cbxLieferant - ' - Me.cbxLieferant._allowedValuesFreiText = Nothing - Me.cbxLieferant._allowFreiText = False - Me.cbxLieferant._value = "" - Me.cbxLieferant.FormattingEnabled = True - Me.cbxLieferant.Location = New System.Drawing.Point(92, 6) - Me.cbxLieferant.Name = "cbxLieferant" - Me.cbxLieferant.Size = New System.Drawing.Size(72, 21) - Me.cbxLieferant.TabIndex = 50 + Me.Button5.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.Button5.Location = New System.Drawing.Point(111, 639) + Me.Button5.Name = "Button5" + Me.Button5.Size = New System.Drawing.Size(98, 23) + Me.Button5.TabIndex = 48 + Me.Button5.Text = "SE-DK-Logik" + Me.Button5.UseVisualStyleBackColor = True ' 'frmUSTVoffeneAntraege ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(1818, 681) + Me.Controls.Add(Me.Button5) Me.Controls.Add(Me.cbxKundenMWST) Me.Controls.Add(Me.Button4) Me.Controls.Add(Me.lblKunde) @@ -598,4 +610,5 @@ Partial Class frmUSTVoffeneAntraege Friend WithEvents cbxKundenMWST As CheckBox Friend WithEvents Label6 As Label Friend WithEvents cbxLieferant As VERAG_PROG_ALLGEMEIN.MyComboBox + Friend WithEvents Button5 As Button End Class diff --git a/SDL/USTV/frmUSTVoffeneAntraege.vb b/SDL/USTV/frmUSTVoffeneAntraege.vb index 6683f131..fd2439b4 100644 --- a/SDL/USTV/frmUSTVoffeneAntraege.vb +++ b/SDL/USTV/frmUSTVoffeneAntraege.vb @@ -64,6 +64,12 @@ Public Class frmUSTVoffeneAntraege MyDatagridview1.DataSource = Nothing Me.LIEFERANT = l + If Me.LIEFERANT = "PLOSE" Then + Button5.Visible = True + Else + Button5.Visible = False + End If + For Each c As Button In FlowLayoutPanel.Controls If c Is btn Then c.BackColor = Color.Wheat @@ -1137,4 +1143,14 @@ Public Class frmUSTVoffeneAntraege Private Sub cbxEigeneMWST_CheckedChanged(sender As Object, e As EventArgs) Handles cbxKundenMWST.CheckedChanged init() End Sub + + Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click + + Dim SQL As New SQL + + If SQL.doSQL("update [VERAG].[dbo].[tblPLOSE_Inv_Data] set plInv_SupplierCountry = 'SE' where plInv_SupplierRechnungsNr like 'SE%' and plInv_SupplierCountry = 'DK'", "FMZOLL", False) Then + MsgBox("Wurden erfolgreich gesetzt!") + End If + + End Sub End Class \ No newline at end of file diff --git a/SDL/buchhaltung/usrCntlBH.Designer.vb b/SDL/buchhaltung/usrCntlBH.Designer.vb index 9fbcfcbc..abb31705 100644 --- a/SDL/buchhaltung/usrCntlBH.Designer.vb +++ b/SDL/buchhaltung/usrCntlBH.Designer.vb @@ -295,7 +295,7 @@ Partial Class usrCntlBH Me.txtZinssatz.MaxLines_Warning_Label = Nothing Me.txtZinssatz.Name = "txtZinssatz" Me.txtZinssatz.Size = New System.Drawing.Size(34, 20) - Me.txtZinssatz.TabIndex = 34 + Me.txtZinssatz.TabIndex = 31 Me.txtZinssatz.Text = "9.5" ' 'Label45 @@ -337,7 +337,7 @@ Partial Class usrCntlBH Me.txtKdNrvon.MaxLines_Warning_Label = Nothing Me.txtKdNrvon.Name = "txtKdNrvon" Me.txtKdNrvon.Size = New System.Drawing.Size(70, 20) - Me.txtKdNrvon.TabIndex = 30 + Me.txtKdNrvon.TabIndex = 32 ' 'Label46 ' @@ -369,7 +369,7 @@ Partial Class usrCntlBH Me.txtKdNrbis.MaxLines_Warning_Label = Nothing Me.txtKdNrbis.Name = "txtKdNrbis" Me.txtKdNrbis.Size = New System.Drawing.Size(70, 20) - Me.txtKdNrbis.TabIndex = 32 + Me.txtKdNrbis.TabIndex = 33 ' 'txtTolInTagen ' @@ -435,7 +435,7 @@ Partial Class usrCntlBH Me.txtZRvon.MaxLines_Warning_Label = Nothing Me.txtZRvon.Name = "txtZRvon" Me.txtZRvon.Size = New System.Drawing.Size(70, 20) - Me.txtZRvon.TabIndex = 21 + Me.txtZRvon.TabIndex = 34 ' 'txtZRbis ' @@ -459,7 +459,7 @@ Partial Class usrCntlBH Me.txtZRbis.MaxLines_Warning_Label = Nothing Me.txtZRbis.Name = "txtZRbis" Me.txtZRbis.Size = New System.Drawing.Size(70, 20) - Me.txtZRbis.TabIndex = 24 + Me.txtZRbis.TabIndex = 35 ' 'Label42 ' diff --git a/SDL/buchhaltung/usrCntlBH.vb b/SDL/buchhaltung/usrCntlBH.vb index d10d22d6..171e1c9d 100644 --- a/SDL/buchhaltung/usrCntlBH.vb +++ b/SDL/buchhaltung/usrCntlBH.vb @@ -1,5 +1,7 @@ Imports System.Globalization Imports System.Text +Imports com.sun.xml.internal.rngom +Imports GrapeCity.ActiveReports.ReportsCore.Tools Imports VERAG_PROG_ALLGEMEIN Public Class usrCntlBH @@ -46,8 +48,8 @@ Public Class usrCntlBH Case Else Dim isMDM As Boolean = False - If VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_abteilung = "MDM" Then isMDM = True - If isMDM Then txtnichtabrechneteKunden.Text = SQL.getValueTxtBySql("SELECT count(distinct(kundenNr)) FROM [VERAG].[dbo].[tblMDM_Zinsberechnung] where verrechnet is null group by kundenNr", "FMZOLL",,, "0") + If VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_abteilung = "MDM" OrElse VERAG_PROG_ALLGEMEIN.cAllgemein.MITARBEITER.mit_nname = "Breimaier" Then isMDM = True + If isMDM Then txtnichtabrechneteKunden.Text = SQL.getValueTxtBySql("SELECT count(distinct(kundenNr)) FROM [VERAG].[dbo].[tblMDM_Zinsberechnung] where verrechnet is null", "FMZOLL",,, "0") MyListBox1.fillWithSQL("SELECT [Firma_ID],[Firma_Bez] FROM [VERAG].[dbo].[tblFirma] where Firma_ID NOT IN (20) order by [Firma_ID] ", False, "FMZOLL") @@ -579,7 +581,7 @@ Public Class usrCntlBH If fd.ShowDialog = DialogResult.OK Then If fd.FileName.ToUpper.EndsWith(".CSV") Then - Dim Lines As String() = My.Computer.FileSystem.ReadAllText(fd.FileName, System.Text.Encoding.Default).split(vbCr) + Dim Lines As String() = My.Computer.FileSystem.ReadAllText(fd.FileName, System.Text.Encoding.Default).Split(vbCr) Dim LineCount As Integer = Lines.Length ' fd.FileName.EndsWith(".csv") @@ -841,7 +843,8 @@ Public Class usrCntlBH op_debitor.eur_bruttobetrag * isnull(kde_zinssatz," & zinssatz.ToString.Replace(",", ".") & ") / 100 * DATEDIFF(DAY, DATEADD(DAY, (isnull(dbo.fibu_zahlziel.si_ntage,0) + " & toleranztage & " ), op_debitor.d_rechnung), op_debitor.d_zahlung) / 360 - else 0 end as Zinsbetrag + else 0 end as Zinsbetrag, + cast(0 as bit) as abgerechnet FROM op_debitor INNER JOIN fibu_konto ON (op_debitor.i_personenkonto = fibu_konto.i_konto) inner join [FMZOLL\SQLFMZOLL].[VERAG].[dbo].[tblKundenErweitert] on kde_KundenNr = op_debitor.i_personenkonto @@ -863,7 +866,6 @@ Public Class usrCntlBH If dt.Rows.Count = 0 Then MsgBox("keine Daten") Else - cProgramFunctions.genExcelFromDT_NEW(dt, {"E1:E" & (dt.Rows.Count + 1), "F1:F" & (dt.Rows.Count + 1), "P1:P" & (dt.Rows.Count + 1)}) Dim counter As Integer = 0 @@ -873,8 +875,13 @@ Public Class usrCntlBH Dim zins As New cMDMZinsberechnung(r.Item("KundenNr"), r.Item("BelegNr")) - If zins.hasEntry AndAlso zins.verrechnet Then + If zins.hasEntry AndAlso zins.verrechnet IsNot Nothing Then counter += 1 + + dt.Columns("abgerechnet").ReadOnly = False + r.Item("abgerechnet") = True + dt.Columns("abgerechnet").ReadOnly = True + Else zins.buchungstext = r.Item("buchungstext") @@ -887,6 +894,8 @@ Public Class usrCntlBH zins.belegDatum = r.Item("Belegdatum") zins.zahlungsBetrag = r.Item("Zahlungsbetrag") zins.zahlungDatum = r.Item("Zahlungsdatum") + zins.zahlungsperiode_start = CDate(txtZRvon.Text).ToShortDateString + zins.zahlungsperiode_ende = CDate(txtZRbis.Text).ToShortDateString zins.SAVE() End If @@ -899,15 +908,23 @@ Public Class usrCntlBH MsgBox("In der Zinsberechnung befinden sich " & counter & " Positionen, die bereits abgerechnet wurden!" & vbNewLine & "Diese wurden ") End If + Dim dtTemp As New DataTable + + dtTemp = dt.Select("Zinsbetrag > 0").CopyToDataTable + If dtTemp.Rows.Count > 0 Then + cProgramFunctions.genExcelFromDT_NEW(dtTemp, {"E1:E" & (dt.Rows.Count + 1), "F1:F" & (dt.Rows.Count + 1), "P1:P" & (dt.Rows.Count + 1)}) + txtnichtabrechneteKunden.Text = SQL.getValueTxtBySql("SELECT count(distinct(kundenNr)) FROM [VERAG].[dbo].[tblMDM_Zinsberechnung] where verrechnet is null", "FMZOLL",,, "0") + End If + End If - End If + End If End Sub - Function gen_SPEDBUCH_ByKdNr(KdNr As String, ByRef SPEDBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, Optional abrechnugsdatum As Date = Nothing) + Function gen_SPEDBUCH_ByKdNr(KdNr As String, ByRef SPEDBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch, Optional abrechnugsdatum As Date = Nothing, Optional Vermerk As String = "") Try If KdNr = "" Then Return False @@ -943,6 +960,8 @@ Public Class usrCntlBH SPEDBUCH.veoerz_basbtg = Nothing SPEDBUCH.Sicherheitsbetrag = Nothing + SPEDBUCH.Vermerk = Vermerk + SPEDBUCH.Sachbearbeiter = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME @@ -1015,6 +1034,7 @@ Public Class usrCntlBH RG.Vorlageprovision_Proz = KD.Vorlageprovision RG.Kreditaufwendungen_Proz = KD.Kreditaufwendungen RG.RechnungSprache = "DE" + RG.Packstücke_und_Warenbezeichnung = "" RG.Anlage_2 = "" RG.Anlage_3 = "" @@ -1060,7 +1080,6 @@ Public Class usrCntlBH Dim LeistungsBezAdd As String = "" If r("buchungstext") <> "" Then LeistungsBezAdd &= r("buchungstext") - If LeistungsBezAdd.Length > 30 Then LeistungsBezAdd = LeistungsBezAdd.ToString.Substring(0, 30) End If @@ -1155,33 +1174,65 @@ Public Class usrCntlBH Private Sub btnZNBverrechnen_Click(sender As Object, e As EventArgs) Handles btnZNBverrechnen.Click - Dim dt_Main As DataTable = SQL.loadDgvBySql_Param("Select [kundenNr] FROM [VERAG].[dbo].[tblMDM_Zinsberechnung] where [verrechnet] Is null group by [kundenNr] ", "FMZOLL") + Dim dt_Main As DataTable = SQL.loadDgvBySql_Param("Select [kundenNr], zahlungsperiode_start,zahlungsperiode_ende FROM [VERAG].[dbo].[tblMDM_Zinsberechnung] where [verrechnet] Is null group by [kundenNr], zahlungsperiode_start, zahlungsperiode_ende ", "FMZOLL") If dt_Main.Rows.Count > 0 Then + Dim kundenNr As String = "" + If dt_Main.Columns.Contains("kundenNr") Then + Dim dtNew As DataTable = dt_Main.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable() + If dtNew.Rows.Count > 0 Then + Dim counter = 0 + For Each r As DataRow In dtNew.Rows + kundenNr &= r.Item(0) + counter = counter + 1 + If (dtNew.Rows.Count <> 0 And counter <> dtNew.Rows.Count) Then + kundenNr &= "," + End If + Next + End If + End If + + + Dim sqlStringFehlendeOffertenNr = "select KundenNr from Offertenpositionen where KundenNr in (" & kundenNr & ") + GROUP by KundenNr + EXCEPT + select KundenNr from Offertenpositionen where LeistungsNr = 950 and OffertenNr = 95 and KundenNr in (" & kundenNr & ") + GROUP by KundenNr" + + Dim dtfehlendeOfferten As DataTable = SQL.loadDgvBySql(sqlStringFehlendeOffertenNr, "FMZOLL") + If dtfehlendeOfferten.Rows.Count > 0 Then + MsgBox("Es fehlen bei " & dtfehlendeOfferten.Rows.Count & " Kunden das Offert 95, bitte hinterlegen ansonsten wird die Position nicht verrechnet!" & "Vorgang wird abgebrochen!") + cProgramFunctions.genExcelCSVFromDT(dtfehlendeOfferten, True) + Exit Sub + End If + If vbYes = MsgBox("Möchten Sie für " & dt_Main.Rows.Count & " Kunden die Zinsbelastung verrechnen?", vbYesNoCancel) Then For Each R In dt_Main.Rows + + Dim startDate As String = CDate(R("zahlungsperiode_start")).ToShortDateString + Dim EndDate As String = CDate(R("zahlungsperiode_ende")).ToShortDateString + + Dim vermerk As String = "Abrechnungsperiode von " & startDate & " bis " & EndDate + Dim verarbOK As Boolean = True Dim SPEDBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch = Nothing Dim RK_ID As Integer = -1 - If Not gen_SPEDBUCH_ByKdNr(R("kundenNr"), SPEDBUCH, Now()) Then verarbOK = False + If Not gen_SPEDBUCH_ByKdNr(R("kundenNr"), SPEDBUCH, Now(), vermerk) Then verarbOK = False If Not gen_RECHNUNG_BySPEDBUCH(R("kundenNr"), SPEDBUCH, RK_ID) Then verarbOK = False If verarbOK Then - 'UPDATE Fakturiert - SQL.doSQL("UPDATE [tblMDM_Zinsberechnung] Set [verrechnet]=GETDATE(), RK_ID = " & RK_ID & " WHERE [verrechnet] Is null And kundenNr='" & R("kundenNr") & "' ", "FMZOLL") + SQL.doSQL("UPDATE [tblMDM_Zinsberechnung] SET [verrechnet]=GETDATE(), RK_ID = " & RK_ID & " WHERE [verrechnet] Is null And kundenNr='" & R("kundenNr") & "' ", "FMZOLL") End If Next - + txtnichtabrechneteKunden.Text = SQL.getValueTxtBySql("SELECT count(distinct(kundenNr)) FROM [VERAG].[dbo].[tblMDM_Zinsberechnung] where verrechnet is null", "FMZOLL",,, "0") End If - txtnichtabrechneteKunden.Text = SQL.getValueTxtBySql("SELECT count(distinct(kundenNr)) FROM [VERAG].[dbo].[tblMDM_Zinsberechnung] where verrechnet is null group by kundenNr", "FMZOLL",,, "0") - End If diff --git a/SDL/kunden/frmGoMautBoxen_Bestellung.Designer.vb b/SDL/kunden/frmGoMautBoxen_Bestellung.Designer.vb index 1c78b677..61cde09b 100644 --- a/SDL/kunden/frmGoMautBoxen_Bestellung.Designer.vb +++ b/SDL/kunden/frmGoMautBoxen_Bestellung.Designer.vb @@ -24,12 +24,14 @@ Partial Class frmGoMautBoxen_Bestellung Private Sub InitializeComponent() Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmGoMautBoxen_Bestellung)) Me.pnl = New System.Windows.Forms.Panel() + Me.Label24 = New System.Windows.Forms.Label() + Me.txtAnsprechpartner_NN = New System.Windows.Forms.TextBox() Me.txtAxles = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.Label23 = New System.Windows.Forms.Label() Me.MyComboBox3 = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.Label22 = New System.Windows.Forms.Label() - Me.MyTextBox1 = New VERAG_PROG_ALLGEMEIN.MyTextBox() - Me.MyTextBox2 = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.txtFahrzeugtyp = New VERAG_PROG_ALLGEMEIN.MyTextBox() + Me.txtLicensePlate = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.Label20 = New System.Windows.Forms.Label() Me.Label21 = New System.Windows.Forms.Label() Me.txtJahr = New VERAG_PROG_ALLGEMEIN.MyTextBox() @@ -39,7 +41,7 @@ Partial Class frmGoMautBoxen_Bestellung Me.cbxKK = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.Label19 = New System.Windows.Forms.Label() Me.Label16 = New System.Windows.Forms.Label() - Me.TextBox1 = New System.Windows.Forms.TextBox() + Me.txtTitle = New System.Windows.Forms.TextBox() Me.Label15 = New System.Windows.Forms.Label() Me.txtTel = New System.Windows.Forms.TextBox() Me.Label14 = New System.Windows.Forms.Label() @@ -60,7 +62,7 @@ Partial Class frmGoMautBoxen_Bestellung Me.lblAenderung = New System.Windows.Forms.Label() Me.txtAnsprechpartnerAnrede = New System.Windows.Forms.TextBox() Me.Label13 = New System.Windows.Forms.Label() - Me.txtAnsprechpartner = New System.Windows.Forms.TextBox() + Me.txtAnsprechpartner_VN = New System.Windows.Forms.TextBox() Me.cbxLandKz = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.txtOrt = New System.Windows.Forms.TextBox() Me.Label12 = New System.Windows.Forms.Label() @@ -74,9 +76,7 @@ Partial Class frmGoMautBoxen_Bestellung Me.Label5 = New System.Windows.Forms.Label() Me.KdSearchBox1 = New VERAG_PROG_ALLGEMEIN.KdSearchBox() Me.btnAbbrechen = New System.Windows.Forms.Button() - Me.btnOK = New System.Windows.Forms.Button() - Me.TextBox2 = New System.Windows.Forms.TextBox() - Me.Label24 = New System.Windows.Forms.Label() + Me.btnNew = New System.Windows.Forms.Button() Me.pnl.SuspendLayout() Me.SuspendLayout() ' @@ -85,13 +85,13 @@ Partial Class frmGoMautBoxen_Bestellung Me.pnl.BackColor = System.Drawing.Color.White Me.pnl.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle Me.pnl.Controls.Add(Me.Label24) - Me.pnl.Controls.Add(Me.TextBox2) + Me.pnl.Controls.Add(Me.txtAnsprechpartner_NN) Me.pnl.Controls.Add(Me.txtAxles) Me.pnl.Controls.Add(Me.Label23) Me.pnl.Controls.Add(Me.MyComboBox3) Me.pnl.Controls.Add(Me.Label22) - Me.pnl.Controls.Add(Me.MyTextBox1) - Me.pnl.Controls.Add(Me.MyTextBox2) + Me.pnl.Controls.Add(Me.txtFahrzeugtyp) + Me.pnl.Controls.Add(Me.txtLicensePlate) Me.pnl.Controls.Add(Me.Label20) Me.pnl.Controls.Add(Me.Label21) Me.pnl.Controls.Add(Me.txtJahr) @@ -101,7 +101,7 @@ Partial Class frmGoMautBoxen_Bestellung Me.pnl.Controls.Add(Me.cbxKK) Me.pnl.Controls.Add(Me.Label19) Me.pnl.Controls.Add(Me.Label16) - Me.pnl.Controls.Add(Me.TextBox1) + Me.pnl.Controls.Add(Me.txtTitle) Me.pnl.Controls.Add(Me.Label15) Me.pnl.Controls.Add(Me.txtTel) Me.pnl.Controls.Add(Me.Label14) @@ -122,7 +122,7 @@ Partial Class frmGoMautBoxen_Bestellung Me.pnl.Controls.Add(Me.lblAenderung) Me.pnl.Controls.Add(Me.txtAnsprechpartnerAnrede) Me.pnl.Controls.Add(Me.Label13) - Me.pnl.Controls.Add(Me.txtAnsprechpartner) + Me.pnl.Controls.Add(Me.txtAnsprechpartner_VN) Me.pnl.Controls.Add(Me.cbxLandKz) Me.pnl.Controls.Add(Me.txtOrt) Me.pnl.Controls.Add(Me.Label12) @@ -136,13 +136,32 @@ Partial Class frmGoMautBoxen_Bestellung Me.pnl.Controls.Add(Me.Label5) Me.pnl.Controls.Add(Me.KdSearchBox1) Me.pnl.Controls.Add(Me.btnAbbrechen) - Me.pnl.Controls.Add(Me.btnOK) + Me.pnl.Controls.Add(Me.btnNew) Me.pnl.Dock = System.Windows.Forms.DockStyle.Fill Me.pnl.Location = New System.Drawing.Point(0, 0) Me.pnl.Name = "pnl" Me.pnl.Size = New System.Drawing.Size(827, 448) Me.pnl.TabIndex = 1 ' + 'Label24 + ' + Me.Label24.AutoSize = True + Me.Label24.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.Label24.Location = New System.Drawing.Point(509, 83) + Me.Label24.Name = "Label24" + Me.Label24.Size = New System.Drawing.Size(56, 13) + Me.Label24.TabIndex = 80 + Me.Label24.Text = "Lastname:" + ' + 'txtAnsprechpartner_NN + ' + Me.txtAnsprechpartner_NN.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.txtAnsprechpartner_NN.Location = New System.Drawing.Point(621, 80) + Me.txtAnsprechpartner_NN.MaxLength = 40 + Me.txtAnsprechpartner_NN.Name = "txtAnsprechpartner_NN" + Me.txtAnsprechpartner_NN.Size = New System.Drawing.Size(194, 20) + Me.txtAnsprechpartner_NN.TabIndex = 79 + ' 'txtAxles ' Me.txtAxles._DateTimeOnly = False @@ -201,51 +220,51 @@ Partial Class frmGoMautBoxen_Bestellung Me.Label22.TabIndex = 75 Me.Label22.Text = "License Plate Nat.:" ' - 'MyTextBox1 + 'txtFahrzeugtyp ' - Me.MyTextBox1._DateTimeOnly = False - Me.MyTextBox1._numbersOnly = False - Me.MyTextBox1._numbersOnlyKommastellen = "" - Me.MyTextBox1._numbersOnlyTrennzeichen = False - Me.MyTextBox1._Prozent = False - Me.MyTextBox1._ShortDateNew = False - Me.MyTextBox1._ShortDateOnly = False - Me.MyTextBox1._TimeOnly = False - Me.MyTextBox1._TimeOnly_Seconds = False - Me.MyTextBox1._value = "" - Me.MyTextBox1._Waehrung = False - Me.MyTextBox1._WaehrungZeichen = False - Me.MyTextBox1.ForeColor = System.Drawing.Color.Black - Me.MyTextBox1.Location = New System.Drawing.Point(621, 316) - Me.MyTextBox1.MaxLineLength = -1 - Me.MyTextBox1.MaxLines_Warning = "" - Me.MyTextBox1.MaxLines_Warning_Label = Nothing - Me.MyTextBox1.Name = "MyTextBox1" - Me.MyTextBox1.Size = New System.Drawing.Size(53, 20) - Me.MyTextBox1.TabIndex = 74 + Me.txtFahrzeugtyp._DateTimeOnly = False + Me.txtFahrzeugtyp._numbersOnly = False + Me.txtFahrzeugtyp._numbersOnlyKommastellen = "" + Me.txtFahrzeugtyp._numbersOnlyTrennzeichen = False + Me.txtFahrzeugtyp._Prozent = False + Me.txtFahrzeugtyp._ShortDateNew = False + Me.txtFahrzeugtyp._ShortDateOnly = False + Me.txtFahrzeugtyp._TimeOnly = False + Me.txtFahrzeugtyp._TimeOnly_Seconds = False + Me.txtFahrzeugtyp._value = "" + Me.txtFahrzeugtyp._Waehrung = False + Me.txtFahrzeugtyp._WaehrungZeichen = False + Me.txtFahrzeugtyp.ForeColor = System.Drawing.Color.Black + Me.txtFahrzeugtyp.Location = New System.Drawing.Point(621, 316) + Me.txtFahrzeugtyp.MaxLineLength = -1 + Me.txtFahrzeugtyp.MaxLines_Warning = "" + Me.txtFahrzeugtyp.MaxLines_Warning_Label = Nothing + Me.txtFahrzeugtyp.Name = "txtFahrzeugtyp" + Me.txtFahrzeugtyp.Size = New System.Drawing.Size(53, 20) + Me.txtFahrzeugtyp.TabIndex = 74 ' - 'MyTextBox2 + 'txtLicensePlate ' - Me.MyTextBox2._DateTimeOnly = False - Me.MyTextBox2._numbersOnly = False - Me.MyTextBox2._numbersOnlyKommastellen = "" - Me.MyTextBox2._numbersOnlyTrennzeichen = False - Me.MyTextBox2._Prozent = False - Me.MyTextBox2._ShortDateNew = False - Me.MyTextBox2._ShortDateOnly = False - Me.MyTextBox2._TimeOnly = False - Me.MyTextBox2._TimeOnly_Seconds = False - Me.MyTextBox2._value = "" - Me.MyTextBox2._Waehrung = False - Me.MyTextBox2._WaehrungZeichen = False - Me.MyTextBox2.ForeColor = System.Drawing.Color.Black - Me.MyTextBox2.Location = New System.Drawing.Point(621, 261) - Me.MyTextBox2.MaxLineLength = -1 - Me.MyTextBox2.MaxLines_Warning = "" - Me.MyTextBox2.MaxLines_Warning_Label = Nothing - Me.MyTextBox2.Name = "MyTextBox2" - Me.MyTextBox2.Size = New System.Drawing.Size(67, 20) - Me.MyTextBox2.TabIndex = 73 + Me.txtLicensePlate._DateTimeOnly = False + Me.txtLicensePlate._numbersOnly = False + Me.txtLicensePlate._numbersOnlyKommastellen = "" + Me.txtLicensePlate._numbersOnlyTrennzeichen = False + Me.txtLicensePlate._Prozent = False + Me.txtLicensePlate._ShortDateNew = False + Me.txtLicensePlate._ShortDateOnly = False + Me.txtLicensePlate._TimeOnly = False + Me.txtLicensePlate._TimeOnly_Seconds = False + Me.txtLicensePlate._value = "" + Me.txtLicensePlate._Waehrung = False + Me.txtLicensePlate._WaehrungZeichen = False + Me.txtLicensePlate.ForeColor = System.Drawing.Color.Black + Me.txtLicensePlate.Location = New System.Drawing.Point(621, 261) + Me.txtLicensePlate.MaxLineLength = -1 + Me.txtLicensePlate.MaxLines_Warning = "" + Me.txtLicensePlate.MaxLines_Warning_Label = Nothing + Me.txtLicensePlate.Name = "txtLicensePlate" + Me.txtLicensePlate.Size = New System.Drawing.Size(67, 20) + Me.txtLicensePlate.TabIndex = 73 ' 'Label20 ' @@ -332,7 +351,7 @@ Partial Class frmGoMautBoxen_Bestellung 'cbxKK ' Me.cbxKK._allowedValuesFreiText = Nothing - Me.cbxKK._allowFreiText = False + Me.cbxKK._allowFreiText = True Me.cbxKK._value = "" Me.cbxKK.BackColor = System.Drawing.Color.FromArgb(CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer), CType(CType(224, Byte), Integer)) Me.cbxKK.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList @@ -364,14 +383,14 @@ Partial Class frmGoMautBoxen_Bestellung Me.Label16.TabIndex = 62 Me.Label16.Text = "Title:" ' - 'TextBox1 + 'txtTitle ' - Me.TextBox1.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.TextBox1.Location = New System.Drawing.Point(621, 30) - Me.TextBox1.MaxLength = 4 - Me.TextBox1.Name = "TextBox1" - Me.TextBox1.Size = New System.Drawing.Size(96, 20) - Me.TextBox1.TabIndex = 61 + Me.txtTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.txtTitle.Location = New System.Drawing.Point(621, 30) + Me.txtTitle.MaxLength = 4 + Me.txtTitle.Name = "txtTitle" + Me.txtTitle.Size = New System.Drawing.Size(96, 20) + Me.txtTitle.TabIndex = 61 ' 'Label15 ' @@ -576,14 +595,14 @@ Partial Class frmGoMautBoxen_Bestellung Me.Label13.TabIndex = 31 Me.Label13.Text = "Salutation:" ' - 'txtAnsprechpartner + 'txtAnsprechpartner_VN ' - Me.txtAnsprechpartner.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.txtAnsprechpartner.Location = New System.Drawing.Point(621, 53) - Me.txtAnsprechpartner.MaxLength = 40 - Me.txtAnsprechpartner.Name = "txtAnsprechpartner" - Me.txtAnsprechpartner.Size = New System.Drawing.Size(194, 20) - Me.txtAnsprechpartner.TabIndex = 33 + Me.txtAnsprechpartner_VN.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.txtAnsprechpartner_VN.Location = New System.Drawing.Point(621, 53) + Me.txtAnsprechpartner_VN.MaxLength = 40 + Me.txtAnsprechpartner_VN.Name = "txtAnsprechpartner_VN" + Me.txtAnsprechpartner_VN.Size = New System.Drawing.Size(194, 20) + Me.txtAnsprechpartner_VN.TabIndex = 33 ' 'cbxLandKz ' @@ -737,34 +756,15 @@ Partial Class frmGoMautBoxen_Bestellung Me.btnAbbrechen.Text = "Abbrechen" Me.btnAbbrechen.UseVisualStyleBackColor = True ' - 'btnOK + 'btnNew ' - Me.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnOK.Location = New System.Drawing.Point(654, 401) - Me.btnOK.Name = "btnOK" - Me.btnOK.Size = New System.Drawing.Size(160, 34) - Me.btnOK.TabIndex = 6 - Me.btnOK.Text = "OK" - Me.btnOK.UseVisualStyleBackColor = True - ' - 'TextBox2 - ' - Me.TextBox2.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.TextBox2.Location = New System.Drawing.Point(621, 80) - Me.TextBox2.MaxLength = 40 - Me.TextBox2.Name = "TextBox2" - Me.TextBox2.Size = New System.Drawing.Size(194, 20) - Me.TextBox2.TabIndex = 79 - ' - 'Label24 - ' - Me.Label24.AutoSize = True - Me.Label24.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) - Me.Label24.Location = New System.Drawing.Point(509, 83) - Me.Label24.Name = "Label24" - Me.Label24.Size = New System.Drawing.Size(56, 13) - Me.Label24.TabIndex = 80 - Me.Label24.Text = "Lastname:" + Me.btnNew.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnNew.Location = New System.Drawing.Point(654, 401) + Me.btnNew.Name = "btnNew" + Me.btnNew.Size = New System.Drawing.Size(160, 34) + Me.btnNew.TabIndex = 6 + Me.btnNew.Text = "Neu" + Me.btnNew.UseVisualStyleBackColor = True ' 'frmGoMautBoxen_Bestellung ' @@ -784,7 +784,7 @@ Partial Class frmGoMautBoxen_Bestellung End Sub Friend WithEvents pnl As System.Windows.Forms.Panel Friend WithEvents btnAbbrechen As System.Windows.Forms.Button - Friend WithEvents btnOK As System.Windows.Forms.Button + Friend WithEvents btnNew As System.Windows.Forms.Button Friend WithEvents Label5 As System.Windows.Forms.Label Friend WithEvents KdSearchBox1 As VERAG_PROG_ALLGEMEIN.KdSearchBox Friend WithEvents cbxLandKz As VERAG_PROG_ALLGEMEIN.MyComboBox @@ -799,7 +799,7 @@ Partial Class frmGoMautBoxen_Bestellung Friend WithEvents Label11 As Label Friend WithEvents txtAnsprechpartnerAnrede As TextBox Friend WithEvents Label13 As Label - Friend WithEvents txtAnsprechpartner As TextBox + Friend WithEvents txtAnsprechpartner_VN As TextBox Friend WithEvents lblSachbearb As Label Friend WithEvents lblAenderung As Label Friend WithEvents Label1 As Label @@ -818,12 +818,12 @@ Partial Class frmGoMautBoxen_Bestellung Friend WithEvents Label7 As Label Friend WithEvents Label6 As Label Friend WithEvents Label16 As Label - Friend WithEvents TextBox1 As TextBox + Friend WithEvents txtTitle As TextBox Friend WithEvents Label15 As Label Friend WithEvents MyComboBox3 As VERAG_PROG_ALLGEMEIN.MyComboBox Friend WithEvents Label22 As Label - Friend WithEvents MyTextBox1 As VERAG_PROG_ALLGEMEIN.MyTextBox - Friend WithEvents MyTextBox2 As VERAG_PROG_ALLGEMEIN.MyTextBox + Friend WithEvents txtFahrzeugtyp As VERAG_PROG_ALLGEMEIN.MyTextBox + Friend WithEvents txtLicensePlate As VERAG_PROG_ALLGEMEIN.MyTextBox Friend WithEvents Label20 As Label Friend WithEvents Label21 As Label Friend WithEvents txtJahr As VERAG_PROG_ALLGEMEIN.MyTextBox @@ -835,5 +835,5 @@ Partial Class frmGoMautBoxen_Bestellung Friend WithEvents txtAxles As VERAG_PROG_ALLGEMEIN.MyTextBox Friend WithEvents Label23 As Label Friend WithEvents Label24 As Label - Friend WithEvents TextBox2 As TextBox + Friend WithEvents txtAnsprechpartner_NN As TextBox End Class diff --git a/SDL/kunden/frmGoMautBoxen_Bestellung.vb b/SDL/kunden/frmGoMautBoxen_Bestellung.vb index 5ff0d6b4..6d286254 100644 --- a/SDL/kunden/frmGoMautBoxen_Bestellung.vb +++ b/SDL/kunden/frmGoMautBoxen_Bestellung.vb @@ -1,5 +1,4 @@ -Imports System.DirectoryServices.ActiveDirectory -Imports com.sun.tools.corba.se.idl.constExpr + Imports VERAG_PROG_ALLGEMEIN Public Class frmGoMautBoxen_Bestellung @@ -9,11 +8,9 @@ Public Class frmGoMautBoxen_Bestellung Dim adresse As cAdressen Dim kundeErw As cKundenErweitert Dim SQL As New VERAG_PROG_ALLGEMEIN.SQL - Dim dt As New DataTable Public addnew = False - Public WithEvents s As New cBinding("SDL") 'fürs Binding Dim changed As Boolean = False Dim ready As Boolean = False @@ -42,7 +39,7 @@ Public Class frmGoMautBoxen_Bestellung End Sub - Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click + Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnNew.Click lblWarning.Text = "" @@ -57,25 +54,72 @@ Public Class frmGoMautBoxen_Bestellung Exit Sub End If + Dim licensePlate As String = txtLicensePlate.Text - btnOK.DialogResult = DialogResult.OK + If Not String.IsNullOrEmpty(licensePlate) Then + For i As Integer = 0 To licensePlate.Length - 1 + Dim ch As Char = licensePlate(i) + If Not (Char.IsDigit(ch) OrElse (ch >= "A"c AndAlso ch <= "Z"c) OrElse ch = " "c OrElse ch = "-"c) Then + MessageBox.Show("Ungültiges Zeichen: " & ch, "Eingabeprüfung", MessageBoxButtons.OK, MessageBoxIcon.Information) + btnNew.DialogResult = DialogResult.None + Exit Sub + Exit For + End If + Next + End If + + Dim cardNum As String = cbxKK.SelectedValue + + If Not String.IsNullOrEmpty(cardNum) Then + Dim mainPart As String = cardNum.Substring(0, cardNum.Length - 1) + Dim checkDigit As Char = cardNum(cardNum.Length - 1) + + If checkDigit <> fktMod10(mainPart) Then + MessageBox.Show("CardNum ungültig. Prüfziffernfehler!", "Eingabeprüfung", MessageBoxButtons.OK, MessageBoxIcon.Error) + btnNew.DialogResult = DialogResult.None + Exit Sub + End If + End If + + + btnNew.DialogResult = DialogResult.OK + + txtLicensePlate.Text = txtLicensePlate.Text.ToUpper.Trim + Dim LicenseNat As String = setLand(MyComboBox3._value) - 'txtKennzeichen.Text = txtKennzeichen.Text.ToUpper.Trim - 'txtNationalitaet.Text = txtNationalitaet.Text.ToUpper 'Label5.ForeColor = Color.Black 'lblErfassung.ForeColor = Color.Black 'If KdSearchBox1.KdNr < 0 Then Label5.ForeColor = Color.Red : Me.DialogResult = Windows.Forms.DialogResult.None : Exit Sub 'If txtKennzeichen.Text = "" Then lblErfassung.ForeColor = Color.Red : Me.DialogResult = Windows.Forms.DialogResult.None : Exit Sub + Dim LandBez As String = cbxLandKz.SelectedItem.ToString + + If LandBez <> "" Then + LandBez = LandBez.Replace(cbxLandKz._value, "") + LandBez = LandBez.Replace("-", "") + LandBez = LandBez.Trim() + End If + + + + If Not SQL.doSQL("INSERT INTO VERAG.dbo.tblGOBOXBestellungen (gb_adressNr,gb_transactionTyp,gb_company1,gb_company2,gb_companyStreet,gb_companyStreetNr,gb_companyPostalcode,gb_companyCity,gb_companyCountryISO,gb_companyCountry,gb_companyTel,gb_companyFax,gb_salutation,gb_title,gb_firstname,gb_lastname,gb_email,gb_personLanguage,gb_licensePlate,gb_licensePlateNat,gb_vehicleTyp,gb_Axles,gb_CardNum,gb_CardValidMonth,gb_CardValidYear) + VALUES (" & kunde.KundenNr & ",'" & MyComboBox1._value & "','" & txtName.Text & "','" & txtName2.Text & "','" & txtStrasse.Text & "','" & txtStasseNr.Text & "','" & txtPlz.Text & "','" & txtOrt.Text & "','" & setLand(cbxLandKz._value) & "','" & LandBez & "','" & txtTel.Text & "','" & txtFax.Text & "','" & txtAnsprechpartnerAnrede.Text & "','" & txtTitle.Text & "','" & txtAnsprechpartner_VN.Text & "','" & txtAnsprechpartner_NN.Text & "','" & txtEmail.Text & "','','" & txtLicensePlate.Text & "','" & LicenseNat & "','" & txtFahrzeugtyp.Text & "','" & txtAxles.Text & "','" & cardNum & "','" & txtMonat.Text & "','" & txtJahr.Text & "')", "FMZOLL") Then + MsgBox("Fehler beim Anlegen!") + Else + MsgBox("Bestellung wurde angelegt!") + Me.Close() + End If + + 'If s.updateBinding Then ' Dim SQL As New SQL - ' If oldkfz <> txtKennzeichen.Text Then - ' VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.REMANE_FOLDER_KDNR(New VERAG_PROG_ALLGEMEIN.cDatenserver_Change_Value("DOKUMENTE", "MDM", kundenNr, oldkfz, Nothing, Nothing), - ' New VERAG_PROG_ALLGEMEIN.cDatenserver_Change_Value("DOKUMENTE", "MDM", kundenNr, txtKennzeichen.Text, Nothing, Nothing)) - ' SQL.doSQL("UPDATE SDL SET KfzKennzeichen= '" & txtKennzeichen.Text & "' WHERE KundenNr='" & kundenNr & "' AND KfzKennzeichen='" & oldkfz & "'", "SDL", True) - ' SQL.doSQL("UPDATE [Kartenpool] SET KfzKennzeichen= '" & txtKennzeichen.Text & "' WHERE KundenNr='" & kundenNr & "' AND KfzKennzeichen='" & oldkfz & "'", "SDL", True) - ' End If - ' Me.Close() + 'If oldkfz <> txtLicensePlate.Text Then + ' ' VERAG_PROG_ALLGEMEIN.DATENVERVER_OPTIONS.REMANE_FOLDER_KDNR(New VERAG_PROG_ALLGEMEIN.cDatenserver_Change_Value("DOKUMENTE", "MDM", kundenNr, oldkfz, Nothing, Nothing), + ' ' New VERAG_PROG_ALLGEMEIN.cDatenserver_Change_Value("DOKUMENTE", "MDM", kundenNr, txtKennzeichen.Text, Nothing, Nothing)) + ' SQL.doSQL("UPDATE SDL SET KfzKennzeichen= '" & txtLicensePlate.Text & "' WHERE KundenNr='" & kundenNr & "' AND KfzKennzeichen='" & oldkfz & "'", "SDL", True) + ' SQL.doSQL("UPDATE [Kartenpool] SET KfzKennzeichen= '" & txtLicensePlate.Text & "' WHERE KundenNr='" & kundenNr & "' AND KfzKennzeichen='" & oldkfz & "'", "SDL", True) + 'End If + Me.Close() 'End If End Sub @@ -102,6 +146,10 @@ Public Class frmGoMautBoxen_Bestellung cbxKK.DisplayMember = "KartenNr" cbxKK.ValueMember = "KartenNr" cbxKK.changeItem(dv.Item(0).Row.Item(0)) + + txtMonat.Text = dt.Rows(0).Item("Kartenablaufmonat").ToString + txtJahr.Text = dt.Rows(0).Item("Kartenablaufjahr").ToString + End If @@ -109,24 +157,8 @@ Public Class frmGoMautBoxen_Bestellung VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name) End Try - - If addnew Then newEntry() 'NEUER EINTRAG! - ready = True End Sub - Public Sub newEntry() - ' s.updateBinding() - Dim row = s.bindingdataTable.NewRow() - row.Item("KundenNr") = kundenNr - row.Item("KfzKennzeichen") = "" - s.bindingdataTable.Rows.Add(row) - - s.bindingSource.MoveLast() - 'If save Then updateBinding() - lblAenderung.Text = Now.ToString("dd.MM.yyyy HH:mm") - lblSachbearb.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME - If kundenNr < 0 Then KdSearchBox1.Enabled = True - End Sub Sub BindingTableColumnChanged(sender As Object, e As System.Data.DataColumnChangeEventArgs) If ready Then @@ -136,11 +168,32 @@ Public Class frmGoMautBoxen_Bestellung End If End Sub + Private Function fktMod10(ByVal number As String) As Char + Dim sum As Integer = 0 + Dim doubleDigit As Boolean = True + + ' Durchlaufen von rechts nach links + For i As Integer = number.Length - 1 To 0 Step -1 + Dim digit As Integer = CInt(number(i).ToString()) + + If doubleDigit Then + digit *= 2 + If digit > 9 Then digit -= 9 + End If + + sum += digit + doubleDigit = Not doubleDigit + Next + + Dim check As Integer = (10 - (sum Mod 10)) Mod 10 + Return check.ToString()(0) + End Function + Private Sub btnAbbrechen_Click(sender As Object, e As EventArgs) Handles btnAbbrechen.Click ', Me.FormClosing If changed Then Select Case MsgBox("Änderungen speichern", vbYesNoCancel) - Case vbYes : Me.DialogResult = Windows.Forms.DialogResult.None : btnOK.PerformClick() + Case vbYes : Me.DialogResult = Windows.Forms.DialogResult.None : btnNew.PerformClick() Case vbNo : Me.Close() Case vbCancel : Me.DialogResult = Windows.Forms.DialogResult.None End Select @@ -151,12 +204,13 @@ Public Class frmGoMautBoxen_Bestellung Private Sub frmLKWDetails_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown If e.KeyCode = Keys.Return Then - btnOK.PerformClick() + btnNew.PerformClick() End If End Sub Private Sub frmLKWDetails_Load(sender As Object, e As EventArgs) Handles Me.Load + 'TODO: wieder aktivierten!!! 'If Not VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("MAUTBOXEN_bearbeiten", Me) Then ' MsgBox("Keine Berechtigung!") ' Me.Close() @@ -164,13 +218,21 @@ Public Class frmGoMautBoxen_Bestellung KdSearchBox1.initKdBox(Me) + MyComboBox1.Items.Add(New MyListItem("N", "N")) + MyComboBox1.changeItem("N") If kundenNr > 0 Then Me.KdSearchBox1.KdNr = kundenNr KdSearchBox1.Enabled = False End If - cbxLandKz.fillWithSQL(" select distinct landkz, Währungstabelle.Land from Währungstabelle where landkz is not null order by LandKz", , "FMZOLL", True) + cbxLandKz.fillWithSQL(" select distinct landkz, Währungstabelle.Land from Währungstabelle where landkz is not null order by LandKz", , "FMZOLL", True) + + If cbxLandKz.Items.Count > 0 Then + MyComboBox2.Items.AddRange(cbxLandKz.Items.Cast(Of VERAG_PROG_ALLGEMEIN.MyListItem).ToArray()) + MyComboBox3.Items.AddRange(cbxLandKz.Items.Cast(Of VERAG_PROG_ALLGEMEIN.MyListItem).ToArray()) + End If + initKunde() @@ -188,13 +250,16 @@ Public Class frmGoMautBoxen_Bestellung If adresse IsNot Nothing Then - txtName.Text = If(adresse.Name_1, "") & If(adresse.Name_2, "") - txtStrasse.Text = If(adresse.Straße, "") + txtName.Text = If(adresse.Name_1, "") + txtName2.Text = If(adresse.Name_2, "") + + StrasseNrAufteilen(adresse.Straße, txtStrasse.Text, txtStasseNr.Text) + txtOrt.Text = If(adresse.Ort, "") txtPlz.Text = If(adresse.PLZ, "") cbxLandKz.changeItem(If(adresse.LandKz, "")) txtAnsprechpartnerAnrede.Text = adresse.Anrede - txtAnsprechpartner.Text = adresse.Ansprechpartner + txtAnsprechpartner_VN.Text = adresse.Ansprechpartner txtFax.Text = adresse.Telefax txtEmail.Text = adresse.E_Mail @@ -211,19 +276,60 @@ Public Class frmGoMautBoxen_Bestellung Dim KD = KdSearchBox1.KdData_KUNDE Dim KDERW = KdSearchBox1.KdData_KUNDE_ERW - txtName.Text = If(AD.Name_1, "") & If(AD.Name_2, "") - txtStrasse.Text = If(AD.Straße, "") + txtName.Text = If(AD.Name_1, "") + txtName2.Text = If(AD.Name_2, "") + + StrasseNrAufteilen(AD.Straße, txtStrasse.Text, txtStasseNr.Text) + txtOrt.Text = If(AD.Ort, "") txtPlz.Text = If(AD.PLZ, "") cbxLandKz.changeItem(If(AD.LandKz, "")) txtAnsprechpartnerAnrede.Text = AD.Anrede - txtAnsprechpartner.Text = AD.Ansprechpartner + txtAnsprechpartner_VN.Text = AD.Ansprechpartner initdgv() End If End If + If cbxLandKz.SelectedValue <> "" Then setLand(cbxLandKz.SelectedValue) + + + + + End Sub + + Private Function setLand(landkz As String) As String + + Dim LandISO2 + If landkz.Length = 2 Then + LandISO2 = landkz + ElseIf landkz.Length = 3 Then + LandISO2 = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromISO3Land(landkz) + ElseIf landkz.Length = 1 Then + LandISO2 = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromISO1Land(landkz) + End If + + Return LandISO2 + + 'MyComboBox3.changeItem(LandISO2) 'License plate Nationality + 'MyComboBox2.changeItem(LandISO2) 'CompanyCountryAbbr + + End Function + + Private Sub checkAndSetKKNr(adressenNr As String) + + + Dim strCardNum As String + + '' Take the last 6 digits of AdressenNr, padded with leading zeros + 'strCardNum = "990001" & Right(adressenNr.PadLeft(6, "0"c), 6) & "0001" + + '' Append the Mod10 check digit + 'strCardNum &= fktMod10(strCardNum) + + '' Assign to CardNum TextBox + 'txtCardNum.Text = strCardNum End Sub @@ -242,15 +348,37 @@ Public Class frmGoMautBoxen_Bestellung End Sub + Private Sub StrasseNrAufteilen(Strasse_input As String, ByRef companyStreet_output As String, ByRef companyNumber_output As String) + + Dim companyStreet As String = "-" + Dim companyNumber As String = "" + + For i As Integer = 0 To Strasse_input.Length - 1 + If Char.IsDigit(Strasse_input(i)) Then + companyStreet = Strasse_input.Substring(0, i).Trim() + companyNumber = Strasse_input.Substring(i).Trim() + Exit For + End If + Next + + If String.IsNullOrWhiteSpace(companyStreet) Then companyStreet = "-" + + companyStreet_output = companyStreet + companyNumber_output = companyNumber + + End Sub + + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + ' frm_GOX_BOX_Bestellung (FMZOLL) + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + '------------------------------------------------------------------------------------------------------------------------------------------------------------- - - ' Select Case tbl_GO_BOX_Bestellung.* - 'From tbl_GO_BOX_Bestellung - 'Where (((tbl_GO_BOX_Bestellung.Bestelldatum) Is Null) And ((tbl_GO_BOX_Bestellung.Bestellnummer) Is Null)) - 'Order By tbl_GO_BOX_Bestellung.ID; - - + 'Option Compare Database + 'Option Explicit On ' Private Sub AdressenNr_AfterUpdate() @@ -350,9 +478,13 @@ Public Class frmGoMautBoxen_Bestellung ' End Sub - - - '-------------------------------------------------------BESTELLVORGANG + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + ' frm_GO_BOX_Bestellvorgang (FMZOLL) + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + '------------------------------------------------------------------------------------------------------------------------------------------------------------- + '------------------------------------------------------------------------------------------------------------------------------------------------------------- ' Option Compare Database 'Option Explicit On @@ -642,4 +774,8 @@ Public Class frmGoMautBoxen_Bestellung '2000 Cancel = BerechtigungsprüfungForm(Me) '2010 If Cancel Then Exit Sub ' End Sub + + + + End Class \ No newline at end of file diff --git a/SDL/kunden/frmKundenblatt.Designer.vb b/SDL/kunden/frmKundenblatt.Designer.vb index 403b3928..a1ce2e52 100644 --- a/SDL/kunden/frmKundenblatt.Designer.vb +++ b/SDL/kunden/frmKundenblatt.Designer.vb @@ -119,6 +119,7 @@ Partial Class frmKundenblatt Me.PictureBox6 = New System.Windows.Forms.PictureBox() Me.Button5 = New System.Windows.Forms.Button() Me.Panel5 = New System.Windows.Forms.Panel() + Me.btnBestelldateiErzeugen = New System.Windows.Forms.Button() Me.Button7 = New System.Windows.Forms.Button() Me.Label35 = New System.Windows.Forms.Label() Me.flpSDLDok = New System.Windows.Forms.FlowLayoutPanel() @@ -333,7 +334,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(1644, 1458) + Me.tbFirmendaten.Size = New System.Drawing.Size(1644, 1492) Me.tbFirmendaten.TabIndex = 3 Me.tbFirmendaten.Text = "Firmendaten" ' @@ -343,7 +344,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(1638, 1452) + Me.Panel4.Size = New System.Drawing.Size(1638, 1486) Me.Panel4.TabIndex = 0 ' 'UsrcntlKundeBearbeitenFull1 @@ -353,7 +354,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(1638, 1452) + Me.UsrcntlKundeBearbeitenFull1.Size = New System.Drawing.Size(1638, 1486) Me.UsrcntlKundeBearbeitenFull1.TabIndex = 0 ' 'tbcntrMain @@ -373,7 +374,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(1652, 1487) + Me.tbcntrMain.Size = New System.Drawing.Size(1652, 1521) Me.tbcntrMain.TabIndex = 3 ' 'tbAllgemein @@ -414,7 +415,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(1644, 1458) + Me.tbAllgemein.Size = New System.Drawing.Size(1644, 1509) Me.tbAllgemein.TabIndex = 0 Me.tbAllgemein.Text = "Allgemein" ' @@ -495,7 +496,7 @@ Partial Class frmKundenblatt Me.TabControl1.Location = New System.Drawing.Point(8, 582) Me.TabControl1.Name = "TabControl1" Me.TabControl1.SelectedIndex = 0 - Me.TabControl1.Size = New System.Drawing.Size(718, 870) + Me.TabControl1.Size = New System.Drawing.Size(718, 921) Me.TabControl1.TabIndex = 186 ' 'TabPage1 @@ -507,7 +508,7 @@ Partial Class frmKundenblatt Me.TabPage1.Location = New System.Drawing.Point(4, 22) Me.TabPage1.Name = "TabPage1" Me.TabPage1.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage1.Size = New System.Drawing.Size(710, 844) + Me.TabPage1.Size = New System.Drawing.Size(710, 895) Me.TabPage1.TabIndex = 0 Me.TabPage1.Text = "Offene Posten" Me.TabPage1.UseVisualStyleBackColor = True @@ -566,7 +567,7 @@ Partial Class frmKundenblatt Me.dgvOffenePosten.RowHeadersDefaultCellStyle = DataGridViewCellStyle4 Me.dgvOffenePosten.RowHeadersVisible = False Me.dgvOffenePosten.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvOffenePosten.Size = New System.Drawing.Size(707, 809) + Me.dgvOffenePosten.Size = New System.Drawing.Size(707, 860) Me.dgvOffenePosten.TabIndex = 175 ' 'Label10 @@ -599,7 +600,7 @@ Partial Class frmKundenblatt Me.TabPage2.Location = New System.Drawing.Point(4, 22) Me.TabPage2.Name = "TabPage2" Me.TabPage2.Padding = New System.Windows.Forms.Padding(3) - Me.TabPage2.Size = New System.Drawing.Size(710, 844) + Me.TabPage2.Size = New System.Drawing.Size(710, 878) Me.TabPage2.TabIndex = 1 Me.TabPage2.Text = "Umsatzbericht" Me.TabPage2.UseVisualStyleBackColor = True @@ -644,7 +645,7 @@ Partial Class frmKundenblatt Me.dgvUmsaetze.RowHeadersDefaultCellStyle = DataGridViewCellStyle8 Me.dgvUmsaetze.RowHeadersVisible = False Me.dgvUmsaetze.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvUmsaetze.Size = New System.Drawing.Size(707, 816) + Me.dgvUmsaetze.Size = New System.Drawing.Size(707, 850) Me.dgvUmsaetze.TabIndex = 182 ' 'Label13 @@ -692,7 +693,7 @@ Partial Class frmKundenblatt Me.TabPage3.Controls.Add(Me.dgvUmsatzNachLeistngsNr) Me.TabPage3.Location = New System.Drawing.Point(4, 22) Me.TabPage3.Name = "TabPage3" - Me.TabPage3.Size = New System.Drawing.Size(710, 844) + Me.TabPage3.Size = New System.Drawing.Size(710, 878) Me.TabPage3.TabIndex = 2 Me.TabPage3.Text = "Umsatz nach LeistungsNr" Me.TabPage3.UseVisualStyleBackColor = True @@ -748,7 +749,7 @@ Partial Class frmKundenblatt Me.dgvUmsatzNachLeistngsNr.RowHeadersDefaultCellStyle = DataGridViewCellStyle12 Me.dgvUmsatzNachLeistngsNr.RowHeadersVisible = False Me.dgvUmsatzNachLeistngsNr.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvUmsatzNachLeistngsNr.Size = New System.Drawing.Size(705, 855) + Me.dgvUmsatzNachLeistngsNr.Size = New System.Drawing.Size(705, 889) Me.dgvUmsatzNachLeistngsNr.TabIndex = 183 ' 'lblAdressenzusatz @@ -1109,7 +1110,7 @@ Partial Class frmKundenblatt Me.dgvSperrliste.Name = "dgvSperrliste" Me.dgvSperrliste.ReadOnly = True Me.dgvSperrliste.RowHeadersDefaultCellStyle = DataGridViewCellStyle15 - Me.dgvSperrliste.Size = New System.Drawing.Size(446, 1414) + Me.dgvSperrliste.Size = New System.Drawing.Size(446, 1465) Me.dgvSperrliste.TabIndex = 23 ' 'PictureBox2 @@ -1163,7 +1164,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(1644, 1458) + Me.tbZoll.Size = New System.Drawing.Size(1644, 1492) Me.tbZoll.TabIndex = 9 Me.tbZoll.Text = "ZOLL" Me.tbZoll.UseVisualStyleBackColor = True @@ -1175,7 +1176,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(1638, 1452) + Me.tbcntrZOLL.Size = New System.Drawing.Size(1638, 1486) Me.tbcntrZOLL.TabIndex = 0 ' 'tabZoll_Artikel @@ -1183,7 +1184,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(1630, 1426) + Me.tabZoll_Artikel.Size = New System.Drawing.Size(1630, 1460) Me.tabZoll_Artikel.TabIndex = 1 Me.tabZoll_Artikel.Text = "Artikel" Me.tabZoll_Artikel.UseVisualStyleBackColor = True @@ -1194,7 +1195,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(1644, 1458) + Me.tbMdm.Size = New System.Drawing.Size(1644, 1492) Me.tbMdm.TabIndex = 10 Me.tbMdm.Text = "MDM" Me.tbMdm.UseVisualStyleBackColor = True @@ -1213,7 +1214,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(1638, 1452) + Me.tbcntrMDM.Size = New System.Drawing.Size(1638, 1486) Me.tbcntrMDM.TabIndex = 0 ' 'tbSDL @@ -1225,7 +1226,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(1630, 1426) + Me.tbSDL.Size = New System.Drawing.Size(1630, 1460) Me.tbSDL.TabIndex = 5 Me.tbSDL.Text = "SDL-Leistungen" Me.tbSDL.UseVisualStyleBackColor = True @@ -1267,7 +1268,7 @@ Partial Class frmKundenblatt DataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.[True] Me.dgvSDLLeistungenFull.RowHeadersDefaultCellStyle = DataGridViewCellStyle21 Me.dgvSDLLeistungenFull.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvSDLLeistungenFull.Size = New System.Drawing.Size(1624, 1230) + Me.dgvSDLLeistungenFull.Size = New System.Drawing.Size(1624, 1264) Me.dgvSDLLeistungenFull.TabIndex = 5 ' 'Panel6 @@ -1356,6 +1357,7 @@ Partial Class frmKundenblatt ' 'Panel5 ' + Me.Panel5.Controls.Add(Me.btnBestelldateiErzeugen) Me.Panel5.Controls.Add(Me.Button7) Me.Panel5.Controls.Add(Me.Label35) Me.Panel5.Controls.Add(Me.flpSDLDok) @@ -1372,11 +1374,21 @@ 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, 1280) + Me.Panel5.Location = New System.Drawing.Point(3, 1314) Me.Panel5.Name = "Panel5" Me.Panel5.Size = New System.Drawing.Size(1624, 143) Me.Panel5.TabIndex = 177 ' + 'btnBestelldateiErzeugen + ' + Me.btnBestelldateiErzeugen.Location = New System.Drawing.Point(1169, 46) + Me.btnBestelldateiErzeugen.Name = "btnBestelldateiErzeugen" + Me.btnBestelldateiErzeugen.Size = New System.Drawing.Size(155, 32) + Me.btnBestelldateiErzeugen.TabIndex = 179 + Me.btnBestelldateiErzeugen.Text = "Bestelldaten erzeugen" + Me.btnBestelldateiErzeugen.UseVisualStyleBackColor = True + Me.btnBestelldateiErzeugen.Visible = False + ' 'Button7 ' Me.Button7.Location = New System.Drawing.Point(1169, 20) @@ -2258,7 +2270,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(1644, 1458) + Me.tbOfferte.Size = New System.Drawing.Size(1644, 1492) Me.tbOfferte.TabIndex = 11 Me.tbOfferte.Text = "Offerte" Me.tbOfferte.UseVisualStyleBackColor = True @@ -2270,7 +2282,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(1644, 1458) + Me.UsrCntlOfferte1.Size = New System.Drawing.Size(1644, 1492) Me.UsrCntlOfferte1.TabIndex = 0 ' 'tbUSTV @@ -2278,7 +2290,7 @@ Partial Class frmKundenblatt Me.tbUSTV.Controls.Add(Me.tbcntrUSTV) Me.tbUSTV.Location = New System.Drawing.Point(4, 25) Me.tbUSTV.Name = "tbUSTV" - Me.tbUSTV.Size = New System.Drawing.Size(1644, 1458) + Me.tbUSTV.Size = New System.Drawing.Size(1644, 1492) Me.tbUSTV.TabIndex = 12 Me.tbUSTV.Text = "USTV" Me.tbUSTV.UseVisualStyleBackColor = True @@ -2292,7 +2304,7 @@ Partial Class frmKundenblatt Me.tbcntrUSTV.Margin = New System.Windows.Forms.Padding(0) Me.tbcntrUSTV.Name = "tbcntrUSTV" Me.tbcntrUSTV.SelectedIndex = 0 - Me.tbcntrUSTV.Size = New System.Drawing.Size(1644, 1458) + Me.tbcntrUSTV.Size = New System.Drawing.Size(1644, 1492) Me.tbcntrUSTV.TabIndex = 1 ' 'tbUSTVDokumente @@ -2305,7 +2317,7 @@ Partial Class frmKundenblatt Me.tbUSTVDokumente.Controls.Add(Me.scanUSTVVollmachten) Me.tbUSTVDokumente.Location = New System.Drawing.Point(4, 22) Me.tbUSTVDokumente.Name = "tbUSTVDokumente" - Me.tbUSTVDokumente.Size = New System.Drawing.Size(1636, 1432) + Me.tbUSTVDokumente.Size = New System.Drawing.Size(1636, 1466) Me.tbUSTVDokumente.TabIndex = 8 Me.tbUSTVDokumente.Text = "Dokumente" Me.tbUSTVDokumente.UseVisualStyleBackColor = True @@ -2436,7 +2448,7 @@ Partial Class frmKundenblatt Me.tbFIBU.Controls.Add(Me.txtFIBUKuerzel) Me.tbFIBU.Location = New System.Drawing.Point(4, 25) Me.tbFIBU.Name = "tbFIBU" - Me.tbFIBU.Size = New System.Drawing.Size(1644, 1458) + Me.tbFIBU.Size = New System.Drawing.Size(1644, 1492) Me.tbFIBU.TabIndex = 13 Me.tbFIBU.Text = "FIBU" Me.tbFIBU.UseVisualStyleBackColor = True @@ -2550,7 +2562,7 @@ Partial Class frmKundenblatt ' Me.btnFirmendatenFormularSpeichern.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnFirmendatenFormularSpeichern.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnFirmendatenFormularSpeichern.Location = New System.Drawing.Point(1482, 3) + Me.btnFirmendatenFormularSpeichern.Location = New System.Drawing.Point(-1422, 3) Me.btnFirmendatenFormularSpeichern.Name = "btnFirmendatenFormularSpeichern" Me.btnFirmendatenFormularSpeichern.Size = New System.Drawing.Size(71, 52) Me.btnFirmendatenFormularSpeichern.TabIndex = 17 @@ -2582,7 +2594,7 @@ Partial Class frmKundenblatt Me.tbRechnungen.Controls.Add(Me.MyPanel1) Me.tbRechnungen.Location = New System.Drawing.Point(4, 25) Me.tbRechnungen.Name = "tbRechnungen" - Me.tbRechnungen.Size = New System.Drawing.Size(1644, 1458) + Me.tbRechnungen.Size = New System.Drawing.Size(1644, 1492) Me.tbRechnungen.TabIndex = 14 Me.tbRechnungen.Text = "Rechnungen" Me.tbRechnungen.UseVisualStyleBackColor = True @@ -2601,7 +2613,7 @@ Partial Class frmKundenblatt Me.dgvRg.ReadOnly = True Me.dgvRg.RowHeadersVisible = False Me.dgvRg.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect - Me.dgvRg.Size = New System.Drawing.Size(1644, 1398) + Me.dgvRg.Size = New System.Drawing.Size(1644, 1432) Me.dgvRg.TabIndex = 3 ' 'MyPanel1 @@ -2996,7 +3008,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(1651, 1616) + Me.ClientSize = New System.Drawing.Size(1651, 1650) Me.Controls.Add(Me.lblAbfVerb) Me.Controls.Add(Me.btnAbfVerb) Me.Controls.Add(Me.tbcntrMain) @@ -3285,4 +3297,5 @@ Partial Class frmKundenblatt Friend WithEvents Label18 As Label Friend WithEvents Label16 As Label Friend WithEvents dgvZinsnachberechnung As VERAG_PROG_ALLGEMEIN.MyDatagridview + Friend WithEvents btnBestelldateiErzeugen As Button End Class diff --git a/SDL/kunden/frmKundenblatt.vb b/SDL/kunden/frmKundenblatt.vb index ac3924ca..bf93e619 100644 --- a/SDL/kunden/frmKundenblatt.vb +++ b/SDL/kunden/frmKundenblatt.vb @@ -4,6 +4,11 @@ Imports System.Reflection Imports javax.xml.bind.annotation Imports VERAG_PROG_ALLGEMEIN Imports System.Globalization +Imports System.Data.OleDb +Imports System.IO +Imports System.Web.UI.WebControls.Expressions +Imports System.DirectoryServices.ActiveDirectory +Imports Microsoft.Office.Interop Public Class frmKundenblatt @@ -1322,6 +1327,7 @@ Public Class frmKundenblatt scanErstbestellung.Visible = False scanMWSTAgreement.Visible = False Button7.Visible = False + btnBestelldateiErzeugen.Visible = False If dgvSDLLeistungenFull.SelectedRows.Count > 0 Then Panel2.Visible = True @@ -1335,7 +1341,7 @@ Public Class frmKundenblatt Select Case tmpSDLNr Case 100 : txtPartnerKdNr.Text = PartnerKdNrFromFMZOLL.IDSKundenNr 'IDS - Case 200 : txtPartnerKdNr.Text = PartnerKdNrFromFMZOLL.ATKundenNr : Button7.Visible = True 'AT + Case 200 : txtPartnerKdNr.Text = PartnerKdNrFromFMZOLL.ATKundenNr : Button7.Visible = True : btnBestelldateiErzeugen.Visible = True Case 212 : txtPartnerKdNr.Text = PartnerKdNrFromFMZOLL.UTAKundenNr 'UTA Case 101 : txtPartnerKdNr.Text = PartnerKdNrFromFMZOLL.WölflKundenNr 'WÖLFL Case 202 : txtPartnerKdNr.Text = PartnerKdNrFromFMZOLL.TELEPASS_Kd_Nr 'TELEPASS @@ -2489,5 +2495,136 @@ Public Class frmKundenblatt End Sub + Private Sub btnBestelldateiErzeugen_Click(sender As Object, e As EventArgs) Handles btnBestelldateiErzeugen.Click + Dim dateBestelldatum As Date = Date.Now + Dim intBestellnummer As Integer + Dim lngBestellanzahl As Long + Dim strDateiname As String + + Try + ' Kreditkarten prüfen/eintragen + + Dim dt_offeneBestellungen As New DataTable + dt_offeneBestellungen = SQL.loadDgvBySql("SELECT gb_bestelldatum, gb_bestellNr, gb_adressNr, gb_CardNum, gb_CardValidMonth, gb_CardValidYear, gb_licensePlate, gb_licensePlateNat, gb_Axles FROM [tblGOBOXBestellungen] WHERE gb_bestelldatum Is Null AND gb_bestellNr Is Null", "FMZOLL") + + If dt_offeneBestellungen IsNot Nothing Then + + lngBestellanzahl = dt_offeneBestellungen.Rows.Count + + For Each r As DataRow In dt_offeneBestellungen.Rows + + If Not IsDBNull(r.Item("gb_adressNr")) AndAlso Not IsDBNull(r.Item("gb_CardNum")) AndAlso Not IsDBNull(r.Item("gb_CardValidMonth")) AndAlso Not IsDBNull(r.Item("gb_CardValidYear")) Then + + Dim countKK = SQL.getValueTxtBySql("SELECT COUNT(*) FROM Kreditkarten WHERE AdressenNr = " & r.Item("gb_adressNr") & " AND KartenNr =" & r.Item("gb_CardNum"), "FMZOLL") + + If countKK = "0" Then + + If SQL.doSQL("INSERT INTO Kreditkarten (AdressenNr, KartenNr, Kartenfreischaltungsdatum, Kartenablaufmonat, Kartenablaufjahr, Kartensperre, Zeitstempel, Sachbearbeiter) + VALUES ('" & r.Item("gb_adressNr") & "','" & r.Item("gb_CardNum") & "','" & Date.Now & "','" & r.Item("gb_CardValidMonth") & "','" & r.Item("gb_CardValidYear") & "','0','" & Now() & "','" & VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME & "')", "FMZOLL") Then + + + End If + + + End If + + + End If + + Next + + + + End If + + ' 4️ Bestelldaten lesen + Dim dtBestellungen As DataTable = SQL.loadDgvBySql("SELECT gb_ID,gb_bestelldatum, gb_bestellNr, gb_adressNr, gb_CardNum, gb_CardValidMonth, gb_CardValidYear, gb_licensePlate, gb_licensePlateNat, gb_Axles FROM [tblGOBOXBestellungen] WHERE gb_bestelldatum Is Null AND gb_bestellNr Is Null", "FMZOLL") + If dtBestellungen.Rows.Count = 0 Then + MessageBox.Show("Keine Bestelldaten vorhanden.", "Bestelldatei erzeugen", MessageBoxButtons.OK, MessageBoxIcon.Information) + Exit Sub + End If + + '5 Neue Bestellnummer bestimmen + Dim bestellNr As String = SQL.getValueTxtBySql("SELECT Top(1) gb_bestellNr FROM [tblGOBOXBestellnummern] ORDER BY gb_bestelldatum DESC", "FMZOLL") + If bestellNr <> "" AndAlso IsNumeric(bestellNr) Then + intBestellnummer = CInt(bestellNr) + End If + + + ' 6️ Datensätze aktualisieren + Dim ID_bestellungen As String = "" + If dtBestellungen.Columns.Contains("gb_ID") Then + Dim dtNew As DataTable = dtBestellungen.Rows.Cast(Of DataRow)().Where(Function(row) Not row.ItemArray.All(Function(field) field Is DBNull.Value Or field.Equals(""))).CopyToDataTable() + If dtNew.Rows.Count > 0 Then + Dim counter = 0 + For Each r As DataRow In dtNew.Rows + ID_bestellungen &= r.Item(0) + counter = counter + 1 + If (dtNew.Rows.Count <> 0 And counter <> dtNew.Rows.Count) Then + ID_bestellungen &= "," + End If + Next + End If + End If + If ID_bestellungen <> "" Then + SQL.doSQL("UPDATE tblGOBOXBestellungen SET gb_bestelldatum = '" & dateBestelldatum.ToShortDateString & "', gb_bestellNr = " & intBestellnummer & " WHERE gb_ID in (" & ID_bestellungen & ")", "FMZOLL") + End If + + ' 7 Bestellnummer speichern + If IsDate(dateBestelldatum) AndAlso IsNumeric(intBestellnummer) AndAlso IsNumeric(lngBestellanzahl) Then + + SQL.doSQL("INSERT INTO tblGOBOXBestellnummern (gb_bestelldatum, gb_bestellNr, gb_bestellAnzahl) VALUES ('" & dateBestelldatum.ToShortDateString & "', " & intBestellnummer & ", " & lngBestellanzahl & ")", "FMZOLL") + + End If + + 'CSV erzeugen: + Dim SQL_String As String = "Select Top(1) 'S' As [Transaction Type], ''As Company1, ' ' As Company2, ' ' As CompanyStreet, ' ' As CompanyNumber, ' ' As CompanyCode, ' ' As CompanyCity, ' ' As CompanyCountry, ' ' As CompanyCountryAbbr, ' ' As CompanyTelephone, ' ' As CompanyTelefax, ' ' As Salutation, ' ' As Title, ' ' As FirstName, ' ' As LastName, ' ' As Email, ' ' As PersonLanguage, ' ' As [License plate], ' ' As [License plate Nationality], ' ' As VehicleType, ' ' As Axles, ' ' As [Stammnummer For Tripon Orders only], ' ' As CardNum, ' ' As CardValidMonth, ' ' As CardValidYear FROM [tblGOBOXBestellungen] + UNION ALL + Select gb_transactionTyp, gb_company1, gb_company2, gb_companyStreet, gb_adressNr, gb_companyPostalcode, gb_companyCountry, gb_companyCountryISO, gb_companyCountryISO, gb_companyTel, gb_companyFax, gb_salutation, gb_title, gb_firstname, gb_lastname, gb_email, gb_personLanguage, gb_licensePlate, gb_licensePlateNat, gb_vehicleTyp, gb_Axles, '', gb_CardNum,RIGHT('00' + CAST(gb_CardValidMonth AS VARCHAR(2)), 2) , RIGHT('00' + CAST(gb_CardValidYear AS VARCHAR(2)), 2) + From [tblGOBOXBestellungen] where gb_bestellNr = " & intBestellnummer & " and gb_transactionTyp = 'N' + UNION SELECT TOP (1) 'E', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' FROM [tblGOBOXBestellungen]" + + Dim dt_export As DataTable = SQL.loadDgvBySql(SQL_String, "FMZOLL") + + Dim outl As New Outlook.Application + Dim Mail As Microsoft.Office.Interop.Outlook.MailItem + Mail = outl.CreateItem(0) + + Mail.Subject = "GO-BOX Bestellung Nr. " & intBestellnummer & " vom " & dateBestelldatum.ToShortDateString + + strDateiname = "PO_VG_" & Format(intBestellnummer, "0000") & "_" & Format(dateBestelldatum, "ddmmyy") & ".csv" + + Dim Path As String = VERAG_PROG_ALLGEMEIN.cProgramFunctions.genCSVFromDT(dt_export,,, strDateiname) + + 'muss genauer Bezeichnung haben!! + '"PO_VG_" & Format(Forms!frm_GO_BOX_Bestellvorgang!Bestellnummer, "0000") & "_" & Format(Forms!frm_GO_BOX_Bestellvorgang!Bestelldatum, "ddmmyy") & ".csv" + + + Mail.Body = "Als Anhang senden wir Ihnen die Datei """ & strDateiname & """ mit den GO-BOX-Bestellungen." & + vbCrLf & vbCrLf & "Mit freundlichen Grüssen" & + vbCrLf & "VERAG Spedition AG" & + vbCrLf & "ASFINAG-Mautabteilung" & + vbCrLf & "______________________" & + vbCrLf & "Tel. +43 7711 2777 - 14 o. 17 o. 47" & + vbCrLf & "Fax +43 7711 3386" & + vbCrLf & "email: maut.asfinag@verag.ag" & + vbCrLf & "www.verag.ag" + + + Mail.Attachments.Add(Path, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue,, strDateiname) + + Mail.Display() + Me.Cursor = Cursors.Default + + + + + Catch ex As Exception + MessageBox.Show("Fehler beim Erzeugen der Bestelldatei: " & ex.Message, "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error) + End Try + End Sub + + + End Class diff --git a/SDL/kunden/usrCntlOfferte.Designer.vb b/SDL/kunden/usrCntlOfferte.Designer.vb index f6d44139..af950f35 100644 --- a/SDL/kunden/usrCntlOfferte.Designer.vb +++ b/SDL/kunden/usrCntlOfferte.Designer.vb @@ -22,8 +22,9 @@ Partial Class usrCntlOfferte 'Das Bearbeiten mit dem Code-Editor ist nicht möglich. Private Sub InitializeComponent() - Dim DataGridViewCellStyle11 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() - Dim DataGridViewCellStyle12 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Me.components = New System.ComponentModel.Container() + Dim DataGridViewCellStyle7 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() + Dim DataGridViewCellStyle8 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.lblBesonderheiten = New System.Windows.Forms.Label() Me.rtbBesonderheiten = New System.Windows.Forms.RichTextBox() Me.lblOffert = New System.Windows.Forms.TextBox() @@ -36,7 +37,7 @@ Partial Class usrCntlOfferte Me.Label67 = New System.Windows.Forms.Label() Me.btnDeleteLeistung = New System.Windows.Forms.Button() Me.btnAddLeistung = New System.Windows.Forms.Button() - Me.cntxtAddSdl = New System.Windows.Forms.ContextMenuStrip() + Me.cntxtAddSdl = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.DToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem() Me.btnOfferteSpeichern = New System.Windows.Forms.Button() Me.btnHinzufuegen = New System.Windows.Forms.Button() @@ -62,9 +63,10 @@ Partial Class usrCntlOfferte Me.lblArchivierteOfferten = New System.Windows.Forms.Label() Me.lblEditMode = New System.Windows.Forms.Label() Me.btnOffertbearbeiten = New System.Windows.Forms.Button() - Me.dgvOfferteNew = New VERAG_PROG_ALLGEMEIN.MyDatagridview() + Me.dgvOfferteNew = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components) Me.Button2 = New System.Windows.Forms.Button() Me.Panel1 = New System.Windows.Forms.Panel() + Me.btnSaveBes = New System.Windows.Forms.Button() CType(Me.dgvOfferteDetails, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgvOfferte, System.ComponentModel.ISupportInitialize).BeginInit() Me.cntxtAddSdl.SuspendLayout() @@ -123,8 +125,8 @@ Partial Class usrCntlOfferte Me.dgvOfferteDetails.AllowUserToDeleteRows = False Me.dgvOfferteDetails.AllowUserToOrderColumns = True Me.dgvOfferteDetails.AllowUserToResizeRows = False - DataGridViewCellStyle11.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) - Me.dgvOfferteDetails.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle11 + DataGridViewCellStyle7.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.dgvOfferteDetails.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle7 Me.dgvOfferteDetails.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left) _ Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) @@ -143,8 +145,8 @@ Partial Class usrCntlOfferte Me.dgvOfferte.AllowUserToAddRows = False Me.dgvOfferte.AllowUserToDeleteRows = False Me.dgvOfferte.AllowUserToResizeRows = False - DataGridViewCellStyle12.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) - Me.dgvOfferte.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle12 + DataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) + Me.dgvOfferte.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle8 Me.dgvOfferte.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.dgvOfferte.BackgroundColor = System.Drawing.Color.White @@ -646,11 +648,25 @@ Partial Class usrCntlOfferte Me.Panel1.Size = New System.Drawing.Size(139, 51) Me.Panel1.TabIndex = 34 ' + 'btnSaveBes + ' + Me.btnSaveBes.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnSaveBes.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnSaveBes.ForeColor = System.Drawing.Color.Black + Me.btnSaveBes.Image = Global.SDL.My.Resources.Resources.save + Me.btnSaveBes.Location = New System.Drawing.Point(1000, 545) + Me.btnSaveBes.Name = "btnSaveBes" + Me.btnSaveBes.Size = New System.Drawing.Size(30, 27) + Me.btnSaveBes.TabIndex = 34 + Me.btnSaveBes.Tag = "" + Me.btnSaveBes.UseVisualStyleBackColor = True + ' 'usrCntlOfferte ' 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.btnSaveBes) Me.Controls.Add(Me.dgvOfferteNew) Me.Controls.Add(Me.btnOffertbearbeiten) Me.Controls.Add(Me.lblEditMode) @@ -731,4 +747,5 @@ Partial Class usrCntlOfferte Friend WithEvents Button1 As Button Friend WithEvents Button2 As Button Friend WithEvents Panel1 As Panel + Friend WithEvents btnSaveBes As Button End Class diff --git a/SDL/kunden/usrCntlOfferte.vb b/SDL/kunden/usrCntlOfferte.vb index 8382af61..3feb0dfc 100644 --- a/SDL/kunden/usrCntlOfferte.vb +++ b/SDL/kunden/usrCntlOfferte.vb @@ -198,6 +198,7 @@ Public Class usrCntlOfferte rtbBesonderheiten.Text = "" End If + btnSaveBes.Visible = False If dgvOfferteNew.SelectedRows.Count > 0 Then initDGVOfferteDetails(dgvOfferteNew.SelectedRows(0).Cells("OffertenNr").Value) @@ -1012,4 +1013,31 @@ Public Class usrCntlOfferte End Function + Private Sub rtbBesonderheiten_TextChanged(sender As Object, e As EventArgs) Handles rtbBesonderheiten.TextChanged + btnSaveBes.Visible = true + End Sub + + Private Sub btnSaveBes_Click(sender As Object, e As EventArgs) Handles btnSaveBes.Click + + Dim OfferenNr = -1 + If dgvOfferteNew.RowCount > 0 Then + If dgvOfferteNew.SelectedRows.Count > 0 Then + + OfferenNr = cSqlDb.checkNullStr(dgvOfferteNew.SelectedRows(0).Cells("OffertenNr").Value) + + Else + OfferenNr = cSqlDb.checkNullStr(dgvOfferteNew.Rows(0).Cells("OffertenNr").Value) + End If + + If OfferenNr > 0 AndAlso kdNr > 0 Then + If SQL.doSQL("update [Offerten] set [Besonderheiten] = '" & rtbBesonderheiten.Text & "' where KundenNr = " & kdNr & " and OffertenNr = " & OfferenNr, "FMZOLL") Then + initDGVOfferte() + End If + End If + + End If + + + + End Sub End Class diff --git a/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb b/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb index 1a69fd31..cc5e8c4a 100644 --- a/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb +++ b/SDL/kunden/usrcntlKundeBearbeitenFull.Designer.vb @@ -243,6 +243,7 @@ Partial Class usrcntlKundeBearbeitenFull Me.tbBank = New System.Windows.Forms.TabPage() Me.Label21 = New System.Windows.Forms.Label() Me.GroupBox4 = New System.Windows.Forms.GroupBox() + Me.btnKKSave = New System.Windows.Forms.Button() Me.Button10 = New System.Windows.Forms.Button() Me.Button9 = New System.Windows.Forms.Button() Me.bntGOBOXUmstellung = New System.Windows.Forms.Button() @@ -271,7 +272,6 @@ Partial Class usrcntlKundeBearbeitenFull Me.txtUSt_GVAusgestelltAm = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.txtUSt_GVAngefordertAm = New VERAG_PROG_ALLGEMEIN.MyTextBox() Me.tbSonstiges = New System.Windows.Forms.TabPage() - Me.cbxCS_Added = New System.Windows.Forms.CheckBox() Me.cbxCSInsolvent = New System.Windows.Forms.CheckBox() Me.cbxCS_Added = New System.Windows.Forms.CheckBox() Me.Label113 = New System.Windows.Forms.Label() @@ -320,6 +320,7 @@ Partial Class usrcntlKundeBearbeitenFull Me.Label102 = New System.Windows.Forms.Label() Me.rtb_Zahlungsinfo = New System.Windows.Forms.RichTextBox() Me.tbBankverbindungen = New System.Windows.Forms.TabPage() + Me.btnBnkExcel = New System.Windows.Forms.Button() Me.dgvBankverbindungen = New System.Windows.Forms.DataGridView() Me.cbxAlleBVanzeigen = New System.Windows.Forms.CheckBox() Me.Label108 = New System.Windows.Forms.Label() @@ -414,7 +415,6 @@ Partial Class usrcntlKundeBearbeitenFull Me.cboFirma = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.cboAuswahl = New VERAG_PROG_ALLGEMEIN.MyComboBox() Me.DataGridViewTextBoxColumn2 = New System.Windows.Forms.DataGridViewTextBoxColumn() - Me.btnBnkExcel = New System.Windows.Forms.Button() Me.tbcntrDetails.SuspendLayout() Me.tbAbfertigung.SuspendLayout() Me.tbcntrAbf.SuspendLayout() @@ -1278,7 +1278,7 @@ Partial Class usrcntlKundeBearbeitenFull Me.kdProvDLProzentGSAn._UseFIRMA = "" Me.kdProvDLProzentGSAn._ValueKdAndName = True Me.kdProvDLProzentGSAn.dgvpos = "LEFT" - Me.kdProvDLProzentGSAn.KdName = Nothing + Me.kdProvDLProzentGSAn.KdName = "" Me.kdProvDLProzentGSAn.KdNr = "-1" Me.kdProvDLProzentGSAn.kdNrField = Nothing Me.kdProvDLProzentGSAn.KdNrNullInt = Nothing @@ -3407,6 +3407,7 @@ Partial Class usrcntlKundeBearbeitenFull ' 'GroupBox4 ' + Me.GroupBox4.Controls.Add(Me.btnKKSave) Me.GroupBox4.Controls.Add(Me.Button10) Me.GroupBox4.Controls.Add(Me.Button9) Me.GroupBox4.Controls.Add(Me.bntGOBOXUmstellung) @@ -3415,18 +3416,31 @@ Partial Class usrcntlKundeBearbeitenFull Me.GroupBox4.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.GroupBox4.Location = New System.Drawing.Point(9, 69) Me.GroupBox4.Name = "GroupBox4" - Me.GroupBox4.Size = New System.Drawing.Size(657, 383) + Me.GroupBox4.Size = New System.Drawing.Size(657, 404) Me.GroupBox4.TabIndex = 4 Me.GroupBox4.TabStop = False Me.GroupBox4.Text = "Kreditkarten" ' + 'btnKKSave + ' + Me.btnKKSave.Enabled = False + Me.btnKKSave.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnKKSave.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) + Me.btnKKSave.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft + Me.btnKKSave.Location = New System.Drawing.Point(488, 334) + Me.btnKKSave.Name = "btnKKSave" + Me.btnKKSave.Size = New System.Drawing.Size(163, 22) + Me.btnKKSave.TabIndex = 5 + Me.btnKKSave.Text = "speichern" + Me.btnKKSave.UseVisualStyleBackColor = True + ' 'Button10 ' Me.Button10.Enabled = False Me.Button10.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button10.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button10.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button10.Location = New System.Drawing.Point(488, 338) + Me.Button10.Location = New System.Drawing.Point(488, 360) Me.Button10.Name = "Button10" Me.Button10.Size = New System.Drawing.Size(163, 38) Me.Button10.TabIndex = 4 @@ -3439,7 +3453,7 @@ Partial Class usrcntlKundeBearbeitenFull Me.Button9.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.Button9.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.Button9.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.Button9.Location = New System.Drawing.Point(351, 338) + Me.Button9.Location = New System.Drawing.Point(351, 360) Me.Button9.Name = "Button9" Me.Button9.Size = New System.Drawing.Size(131, 38) Me.Button9.TabIndex = 3 @@ -3452,7 +3466,7 @@ Partial Class usrcntlKundeBearbeitenFull Me.bntGOBOXUmstellung.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.bntGOBOXUmstellung.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.bntGOBOXUmstellung.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.bntGOBOXUmstellung.Location = New System.Drawing.Point(193, 338) + Me.bntGOBOXUmstellung.Location = New System.Drawing.Point(193, 360) Me.bntGOBOXUmstellung.Name = "bntGOBOXUmstellung" Me.bntGOBOXUmstellung.Size = New System.Drawing.Size(152, 38) Me.bntGOBOXUmstellung.TabIndex = 2 @@ -3467,7 +3481,7 @@ Partial Class usrcntlKundeBearbeitenFull Me.btnKKhinzufuegen.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnKKhinzufuegen.Image = Global.SDL.My.Resources.Resources.plus Me.btnKKhinzufuegen.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft - Me.btnKKhinzufuegen.Location = New System.Drawing.Point(9, 338) + Me.btnKKhinzufuegen.Location = New System.Drawing.Point(9, 360) Me.btnKKhinzufuegen.Name = "btnKKhinzufuegen" Me.btnKKhinzufuegen.Size = New System.Drawing.Size(178, 38) Me.btnKKhinzufuegen.TabIndex = 1 @@ -3504,7 +3518,6 @@ Partial Class usrcntlKundeBearbeitenFull Me.dgvKreditkarten.Location = New System.Drawing.Point(9, 20) Me.dgvKreditkarten.MultiSelect = False Me.dgvKreditkarten.Name = "dgvKreditkarten" - Me.dgvKreditkarten.ReadOnly = True DataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft DataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control DataGridViewCellStyle6.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) @@ -4507,6 +4520,18 @@ Partial Class usrcntlKundeBearbeitenFull Me.tbBankverbindungen.Text = "Bankverbindung" Me.tbBankverbindungen.UseVisualStyleBackColor = True ' + 'btnBnkExcel + ' + Me.btnBnkExcel.BackgroundImage = Global.SDL.My.Resources.Resources.Excel_logo + Me.btnBnkExcel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom + Me.btnBnkExcel.FlatAppearance.BorderSize = 0 + Me.btnBnkExcel.FlatStyle = System.Windows.Forms.FlatStyle.Flat + Me.btnBnkExcel.Location = New System.Drawing.Point(15, 290) + Me.btnBnkExcel.Name = "btnBnkExcel" + Me.btnBnkExcel.Size = New System.Drawing.Size(25, 20) + Me.btnBnkExcel.TabIndex = 137 + Me.btnBnkExcel.UseVisualStyleBackColor = True + ' 'dgvBankverbindungen ' Me.dgvBankverbindungen.AllowUserToDeleteRows = False @@ -5659,18 +5684,6 @@ Partial Class usrcntlKundeBearbeitenFull Me.DataGridViewTextBoxColumn2.HeaderText = "E-Mail" Me.DataGridViewTextBoxColumn2.Name = "DataGridViewTextBoxColumn2" ' - 'btnBnkExcel - ' - Me.btnBnkExcel.BackgroundImage = Global.SDL.My.Resources.Resources.Excel_logo - Me.btnBnkExcel.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom - Me.btnBnkExcel.FlatAppearance.BorderSize = 0 - Me.btnBnkExcel.FlatStyle = System.Windows.Forms.FlatStyle.Flat - Me.btnBnkExcel.Location = New System.Drawing.Point(15, 290) - Me.btnBnkExcel.Name = "btnBnkExcel" - Me.btnBnkExcel.Size = New System.Drawing.Size(25, 20) - Me.btnBnkExcel.TabIndex = 137 - Me.btnBnkExcel.UseVisualStyleBackColor = True - ' 'usrcntlKundeBearbeitenFull ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -6140,4 +6153,5 @@ Partial Class usrcntlKundeBearbeitenFull Friend WithEvents kdProvDLProzentGSAn As VERAG_PROG_ALLGEMEIN.KdSearchBox Friend WithEvents cbxProvDL As CheckBox Friend WithEvents Label115 As Label + Friend WithEvents btnKKSave As Button End Class diff --git a/SDL/kunden/usrcntlKundeBearbeitenFull.vb b/SDL/kunden/usrcntlKundeBearbeitenFull.vb index fd08be14..9934253a 100644 --- a/SDL/kunden/usrcntlKundeBearbeitenFull.vb +++ b/SDL/kunden/usrcntlKundeBearbeitenFull.vb @@ -12,6 +12,7 @@ Public Class usrcntlKundeBearbeitenFull Dim sql As New SQL Dim WunschKdNr As Integer = -1 Public Filiale As Integer = -1 + Dim dgvKKLoaded As Boolean = False ' Dim kdnr = -1 Public Event KD_SAVED(kdnr) @@ -1018,6 +1019,7 @@ Public Class usrcntlKundeBearbeitenFull Dim cBinding_dgvSonst_IDSKunden As New cBinding("FMZOLL") Dim cBinding_dgvBankverbindungen As New cBinding("FMZOLL") Dim cBinding_dgvMWST As New cBinding("FMZOLL") + Dim cBinding_dgvKreditkaten As New cBinding("FMZOLL") @@ -1787,10 +1789,16 @@ Public Class usrcntlKundeBearbeitenFull Sub initdgvKreditkarten() + dgvKKLoaded = False + With dgvKreditkarten - .DataSource = sql.loadDgvBySql("SELECT [AdressenNr],KartenNr,Kartenfreischaltungsdatum as [Freisch.Dat.],CAST(Kartenablaufmonat AS varchar(2)) + '/' + CAST(Kartenablaufjahr AS varchar(2))as [Ablauf-Dat.],Kartensperre as Sperre,Kartensperrdatum as [Sperrdat.],NeueKartenNr,NeueKartenNrGemeldet as Gemeldet" & + + cBinding_dgvKreditkaten.initBinding("SELECT [AdressenNr],KartenNr,Kartenfreischaltungsdatum as [Freisch.Dat.],CAST(Kartenablaufmonat AS varchar(2)) + '/' + CAST(Kartenablaufjahr AS varchar(2))as [Ablauf-Dat.],Kartensperre as Sperre,Kartensperrdatum as [Sperrdat.],NeueKartenNr,NeueKartenNrGemeldet as Gemeldet" & " FROM [Kreditkarten] " & " WHERE [AdressenNr]='" & KUNDE.KundenNr & "' ORDER BY Kartensperre, Kartenablaufjahr DESC,Kartenablaufmonat DESC", "FMZOLL") + + .DataSource = cBinding_dgvKreditkaten.bindingdataTable + '.DataSource = sql.loadDgvBySql() .Columns(0).Visible = False .Columns(1).MinimumWidth = 120 @@ -1807,6 +1815,32 @@ Public Class usrcntlKundeBearbeitenFull .Columns(5).DefaultCellStyle.Alignment = DataGridViewContentAlignment.TopCenter .Columns(6).Width = 160 .Columns(7).Width = 70 + + .Columns(1).ReadOnly = True + .Columns(2).ReadOnly = True + .Columns(3).ReadOnly = True + .Columns(5).ReadOnly = True + .Columns(6).ReadOnly = True + .Columns(7).ReadOnly = True + + FUNC.dgvCellToCbo(dgvKreditkarten, 4, "Kartensperre", "Sperre", "select distinct(Kartensperre) as Kartensperre, case when Kartensperre = 0 then 'ensperren' else 'Stopped for Post-Pay' end as Grund from Kreditkarten ", "FMZOLL", 150) + + + + AddHandler btnKKSave.Click, + Sub(send As Object, evnt As EventArgs) + If cBinding_dgvKreditkaten.updateBinding() Then + send.Enabled = False + initdgvKreditkarten() + End If + End Sub + + AddHandler cBinding_dgvKreditkaten.bindingdataTable.ColumnChanged, + Sub(send As Object, evnt As EventArgs) + btnKKSave.Enabled = True + End Sub + + End With End Sub @@ -2390,4 +2424,5 @@ Public Class usrcntlKundeBearbeitenFull VERAG_PROG_ALLGEMEIN.cProgramFunctions.genExcelFromDT_NEW(dt_Bank,,,,,,,, True) End Sub + End Class diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cMDMZinsberechnung.vb b/VERAG_PROG_ALLGEMEIN/Classes/cMDMZinsberechnung.vb index 3a0e1af0..3569b0f0 100644 --- a/VERAG_PROG_ALLGEMEIN/Classes/cMDMZinsberechnung.vb +++ b/VERAG_PROG_ALLGEMEIN/Classes/cMDMZinsberechnung.vb @@ -17,6 +17,8 @@ Public Class cMDMZinsberechnung Property belegDatum As Object = Nothing Property zahlungDatum As Object = Nothing Property zahlungsBetrag As Object = Nothing + Property zahlungsperiode_start As Object = Nothing + Property zahlungsperiode_ende As Object = Nothing Public hasEntry = False @@ -49,6 +51,8 @@ Public Class cMDMZinsberechnung list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("belegDatum", belegDatum)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("zahlungDatum", zahlungDatum)) list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("zahlungsBetrag", zahlungsBetrag)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("zahlungsperiode_start", zahlungsperiode_start)) + list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("zahlungsperiode_ende", zahlungsperiode_ende)) Return list