Compare commits

...

2 Commits

Author SHA1 Message Date
1b31bae783 Sammelrechnung, etc. 2026-05-05 17:07:03 +02:00
1d137b969c Offerte Kostenkalkulation 2026-05-05 16:52:19 +02:00
4 changed files with 107 additions and 39 deletions

View File

@@ -188,7 +188,7 @@ Public Class frmAbrechnungsMaske
If cbx.Checked Then If cbx.Checked Then
reNrSQL = " isnull(Rechnungsausgang.RechnungsNr,'-') as ReNr,cast(isnull(Automailversand_sent, 0) as bit) as AUTO_sent, " reNrSQL = " isnull(Rechnungsausgang.RechnungsNr,'-') as ReNr,cast(isnull(Automailversand_sent, 0) as bit) as AUTO_sent, "
Else Else
reNrSQL = " cast(isnull(Automailversand_sent, 0) as bit) as AUTO_sent, " reNrSQL = " isnull(Rechnungsausgang.RechnungsNr,'-') as ReNr, cast(isnull(Automailversand_sent, 0) as bit) as AUTO_sent, "
End If End If
@@ -987,7 +987,7 @@ Public Class frmAbrechnungsMaske
Dim ListOfRK_ID As New List(Of Integer) Dim ListOfRK_ID As New List(Of Integer)
Dim noRE_DATE = dgvRechnungen.SelectedRows.Cast(Of DataGridViewRow)().Any(Function(r) r.Cells("RENR").Value Is Nothing OrElse IsDBNull(r.Cells("RENR").Value)) Dim noRE_DATE = dgvRechnungen.SelectedRows.Cast(Of DataGridViewRow)().Any(Function(r) r.Cells("RENR").Value Is Nothing OrElse IsDBNull(r.Cells("RENR").Value) OrElse (r.Cells("RENR").Value) <> "-")
If noRE_DATE Then MsgBox("ACHTUNG, Rechnungsdatum wurde nicht gesetzt." & vbNewLine & "Vorgang wird abgebrochen!") : Exit Sub If noRE_DATE Then MsgBox("ACHTUNG, Rechnungsdatum wurde nicht gesetzt." & vbNewLine & "Vorgang wird abgebrochen!") : Exit Sub

View File

@@ -669,12 +669,13 @@ Public Class frmFaktSammelRgDrucken
Me.Enabled = True Me.Enabled = True
Me.Cursor = Cursors.Default Me.Cursor = Cursors.Default
Else
End If End If
End If End If
Else
MsgBox("Es wurde keine RE-Nr vergeben !") : Exit Sub
End If End If
setMailversand_ALL(True, Firma, Sammelrechung) setMailversand_ALL(True, Firma, Sammelrechung)

View File

@@ -22,8 +22,9 @@ Partial Class usrCntlOfferte
'Das Bearbeiten mit dem Code-Editor ist nicht möglich. 'Das Bearbeiten mit dem Code-Editor ist nicht möglich.
<System.Diagnostics.DebuggerStepThrough()> <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Dim DataGridViewCellStyle1 As System.Windows.Forms.DataGridViewCellStyle = New System.Windows.Forms.DataGridViewCellStyle() Me.components = New System.ComponentModel.Container()
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()
Me.lblBesonderheiten = New System.Windows.Forms.Label() Me.lblBesonderheiten = New System.Windows.Forms.Label()
Me.rtbBesonderheiten = New System.Windows.Forms.RichTextBox() Me.rtbBesonderheiten = New System.Windows.Forms.RichTextBox()
Me.lblOffert = New System.Windows.Forms.TextBox() Me.lblOffert = New System.Windows.Forms.TextBox()
@@ -36,7 +37,7 @@ Partial Class usrCntlOfferte
Me.Label67 = New System.Windows.Forms.Label() Me.Label67 = New System.Windows.Forms.Label()
Me.btnDeleteLeistung = New System.Windows.Forms.Button() Me.btnDeleteLeistung = New System.Windows.Forms.Button()
Me.btnAddLeistung = 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.DToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.btnOfferteSpeichern = New System.Windows.Forms.Button() Me.btnOfferteSpeichern = New System.Windows.Forms.Button()
Me.btnHinzufuegen = New System.Windows.Forms.Button() Me.btnHinzufuegen = New System.Windows.Forms.Button()
@@ -63,10 +64,12 @@ Partial Class usrCntlOfferte
Me.lblArchivierteOfferten = New System.Windows.Forms.Label() Me.lblArchivierteOfferten = New System.Windows.Forms.Label()
Me.lblEditMode = New System.Windows.Forms.Label() Me.lblEditMode = New System.Windows.Forms.Label()
Me.btnOffertbearbeiten = New System.Windows.Forms.Button() 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.btnKK = New System.Windows.Forms.Button()
Me.pnlKostenkalkulation = New System.Windows.Forms.Panel() Me.pnlKostenkalkulation = New System.Windows.Forms.Panel()
Me.btnKK_Mail = New System.Windows.Forms.Button()
Me.btnSaveBes = New System.Windows.Forms.Button() Me.btnSaveBes = New System.Windows.Forms.Button()
Me.Label4 = New System.Windows.Forms.Label()
CType(Me.dgvOfferteDetails, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgvOfferteDetails, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.dgvOfferte, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgvOfferte, System.ComponentModel.ISupportInitialize).BeginInit()
Me.cntxtAddSdl.SuspendLayout() Me.cntxtAddSdl.SuspendLayout()
@@ -125,8 +128,8 @@ Partial Class usrCntlOfferte
Me.dgvOfferteDetails.AllowUserToDeleteRows = False Me.dgvOfferteDetails.AllowUserToDeleteRows = False
Me.dgvOfferteDetails.AllowUserToOrderColumns = True Me.dgvOfferteDetails.AllowUserToOrderColumns = True
Me.dgvOfferteDetails.AllowUserToResizeRows = False Me.dgvOfferteDetails.AllowUserToResizeRows = False
DataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) DataGridViewCellStyle3.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
Me.dgvOfferteDetails.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle1 Me.dgvOfferteDetails.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle3
Me.dgvOfferteDetails.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ 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.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -145,8 +148,8 @@ Partial Class usrCntlOfferte
Me.dgvOfferte.AllowUserToAddRows = False Me.dgvOfferte.AllowUserToAddRows = False
Me.dgvOfferte.AllowUserToDeleteRows = False Me.dgvOfferte.AllowUserToDeleteRows = False
Me.dgvOfferte.AllowUserToResizeRows = False Me.dgvOfferte.AllowUserToResizeRows = False
DataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer)) DataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(CType(CType(240, Byte), Integer), CType(CType(245, Byte), Integer), CType(CType(255, Byte), Integer))
Me.dgvOfferte.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle2 Me.dgvOfferte.AlternatingRowsDefaultCellStyle = DataGridViewCellStyle4
Me.dgvOfferte.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _ 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) Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.dgvOfferte.BackgroundColor = System.Drawing.Color.White Me.dgvOfferte.BackgroundColor = System.Drawing.Color.White
@@ -640,31 +643,46 @@ Partial Class usrCntlOfferte
Me.dgvOfferteNew.Size = New System.Drawing.Size(228, 347) Me.dgvOfferteNew.Size = New System.Drawing.Size(228, 347)
Me.dgvOfferteNew.TabIndex = 30 Me.dgvOfferteNew.TabIndex = 30
' '
'Button2 'btnKK
' '
Me.Button2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnKK.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.Button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat Me.btnKK.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.Button2.ForeColor = System.Drawing.Color.Black Me.btnKK.ForeColor = System.Drawing.Color.Black
Me.Button2.Image = Global.SDL.My.Resources.Resources.Excel_logo Me.btnKK.Image = Global.SDL.My.Resources.Resources.Excel_logo
Me.Button2.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft Me.btnKK.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.Button2.Location = New System.Drawing.Point(0, 7) Me.btnKK.Location = New System.Drawing.Point(11, 26)
Me.Button2.Name = "Button2" Me.btnKK.Name = "btnKK"
Me.Button2.Size = New System.Drawing.Size(131, 36) Me.btnKK.Size = New System.Drawing.Size(44, 36)
Me.Button2.TabIndex = 34 Me.btnKK.TabIndex = 34
Me.Button2.Text = "Kostenkalkulation" Me.btnKK.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.Button2.TextAlign = System.Drawing.ContentAlignment.MiddleRight Me.btnKK.UseVisualStyleBackColor = True
Me.Button2.UseVisualStyleBackColor = True
' '
'pnlKostenkalkulation 'pnlKostenkalkulation
' '
Me.pnlKostenkalkulation.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.pnlKostenkalkulation.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.pnlKostenkalkulation.Controls.Add(Me.Button2) Me.pnlKostenkalkulation.Controls.Add(Me.Label4)
Me.pnlKostenkalkulation.Controls.Add(Me.btnKK_Mail)
Me.pnlKostenkalkulation.Controls.Add(Me.btnKK)
Me.pnlKostenkalkulation.Location = New System.Drawing.Point(3, 385) Me.pnlKostenkalkulation.Location = New System.Drawing.Point(3, 385)
Me.pnlKostenkalkulation.Name = "pnlKostenkalkulation" Me.pnlKostenkalkulation.Name = "pnlKostenkalkulation"
Me.pnlKostenkalkulation.Size = New System.Drawing.Size(139, 51) Me.pnlKostenkalkulation.Size = New System.Drawing.Size(119, 65)
Me.pnlKostenkalkulation.TabIndex = 34 Me.pnlKostenkalkulation.TabIndex = 34
Me.pnlKostenkalkulation.Visible = False Me.pnlKostenkalkulation.Visible = False
' '
'btnKK_Mail
'
Me.btnKK_Mail.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnKK_Mail.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btnKK_Mail.ForeColor = System.Drawing.Color.Black
Me.btnKK_Mail.Image = Global.SDL.My.Resources.Resources.email_big1
Me.btnKK_Mail.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.btnKK_Mail.Location = New System.Drawing.Point(62, 26)
Me.btnKK_Mail.Name = "btnKK_Mail"
Me.btnKK_Mail.Size = New System.Drawing.Size(44, 36)
Me.btnKK_Mail.TabIndex = 35
Me.btnKK_Mail.TextAlign = System.Drawing.ContentAlignment.MiddleRight
Me.btnKK_Mail.UseVisualStyleBackColor = True
'
'btnSaveBes 'btnSaveBes
' '
Me.btnSaveBes.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnSaveBes.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -678,6 +696,16 @@ Partial Class usrCntlOfferte
Me.btnSaveBes.Tag = "" Me.btnSaveBes.Tag = ""
Me.btnSaveBes.UseVisualStyleBackColor = True Me.btnSaveBes.UseVisualStyleBackColor = True
' '
'Label4
'
Me.Label4.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(5, 4)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(94, 13)
Me.Label4.TabIndex = 35
Me.Label4.Text = "Kostenkalkulation:"
'
'usrCntlOfferte 'usrCntlOfferte
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -718,6 +746,7 @@ Partial Class usrCntlOfferte
Me.pnlEdit.PerformLayout() Me.pnlEdit.PerformLayout()
CType(Me.dgvOfferteNew, System.ComponentModel.ISupportInitialize).EndInit() CType(Me.dgvOfferteNew, System.ComponentModel.ISupportInitialize).EndInit()
Me.pnlKostenkalkulation.ResumeLayout(False) Me.pnlKostenkalkulation.ResumeLayout(False)
Me.pnlKostenkalkulation.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
@@ -762,8 +791,10 @@ Partial Class usrCntlOfferte
Friend WithEvents btnOffertbearbeiten As Button Friend WithEvents btnOffertbearbeiten As Button
Friend WithEvents dgvOfferteNew As VERAG_PROG_ALLGEMEIN.MyDatagridview Friend WithEvents dgvOfferteNew As VERAG_PROG_ALLGEMEIN.MyDatagridview
Friend WithEvents Button1 As Button Friend WithEvents Button1 As Button
Friend WithEvents Button2 As Button Friend WithEvents btnKK As Button
Friend WithEvents pnlKostenkalkulation As Panel Friend WithEvents pnlKostenkalkulation As Panel
Friend WithEvents btnSaveBes As Button Friend WithEvents btnSaveBes As Button
Friend WithEvents btnOffertPreisliste As Button Friend WithEvents btnOffertPreisliste As Button
Friend WithEvents btnKK_Mail As Button
Friend WithEvents Label4 As Label
End Class End Class

View File

@@ -1,4 +1,6 @@
Public Class usrCntlOfferte Imports Microsoft.Office.Interop
Public Class usrCntlOfferte
Dim FUNC As New cProgramFunctions Dim FUNC As New cProgramFunctions
Public kdNr As Integer = -1 Public kdNr As Integer = -1
@@ -877,7 +879,7 @@
End Function End Function
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click Private Sub Button2_Click(sender As Object, e As EventArgs) Handles btnKK.Click, btnKK_Mail.Click
Me.Cursor = Cursors.WaitCursor Me.Cursor = Cursors.WaitCursor
Try Try
@@ -888,6 +890,7 @@
Dim KD As New VERAG_PROG_ALLGEMEIN.cKunde(kdNr) Dim KD As New VERAG_PROG_ALLGEMEIN.cKunde(kdNr)
Dim ADR As New VERAG_PROG_ALLGEMEIN.cAdressen(kdNr) Dim ADR As New VERAG_PROG_ALLGEMEIN.cAdressen(kdNr)
Dim FIRMA_TMP = VERAG_PROG_ALLGEMEIN.cAllgemein.getFirmaFromFiliale(KD.FilialenNr) Dim FIRMA_TMP = VERAG_PROG_ALLGEMEIN.cAllgemein.getFirmaFromFiliale(KD.FilialenNr)
Dim FirmaID As Integer = -1
If dgvOfferteDetails.Rows.Count = 0 Then Exit Sub If dgvOfferteDetails.Rows.Count = 0 Then Exit Sub
@@ -916,10 +919,10 @@
If (offertenNr = 26 Or offertenNr = 38) AndAlso FIRMA_TMP <> "UNISPED" Then FIRMA_TMP = "CS" If (offertenNr = 26 Or offertenNr = 38) AndAlso FIRMA_TMP <> "UNISPED" Then FIRMA_TMP = "CS"
Select Case FIRMA_TMP Select Case FIRMA_TMP
Case "IMEX" : ExcelBez &= "_IMEX " Case "IMEX" : ExcelBez &= "_IMEX_" : FirmaID = 20
Case "VERAG" : ExcelBez &= "_AG " Case "VERAG" : ExcelBez &= "_AG_" : FirmaID = 1
Case "UNISPED" : ExcelBez &= "_UNI " Case "UNISPED" : ExcelBez &= "_UNISPED_" : FirmaID = 21
Case "CS" : ExcelBez &= "_CS " Case "CS" : ExcelBez &= "_CS " : FirmaID = 11
Case Else : ExcelBez &= " " Case Else : ExcelBez &= " "
End Select End Select
@@ -1010,9 +1013,41 @@
currentRow = currentRow + 1 currentRow = currentRow + 1
Next Next
Datei.Save Datei.Save
.Visible = True
Select Case sender.name
Case "btnKK_Mail"
Dim outl As New Outlook.Application
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
Mail = outl.CreateItem(0)
Mail.To = ADR.E_Mail
Dim TextHTML = ""
TextHTML &= "_CHANGEME_"
TextHTML &= "<br>"
TextHTML &= "<br>"
TextHTML &= "Mit freundlichen Grüßen<br>"
TextHTML &= VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME & "<br>"
TextHTML &= "<br>"
TextHTML &= cFakturierung.getSignature("DE", FirmaID, True, True)
Mail.HTMLBody = "<div style=""font-family:Calibri, Arial"">" & TextHTML & "</div>"
Mail.Subject = "Preiserhöhung " & Today().Year
Mail.Attachments.Add(Path)
Mail.Display()
Case Else
.Visible = True
End Select
End With End With
@@ -1066,4 +1101,5 @@
MsgBox("Noch nicht implementiert!") MsgBox("Noch nicht implementiert!")
End Sub End Sub
End Class End Class