This commit is contained in:
2024-08-02 16:36:48 +02:00
18 changed files with 2802 additions and 259 deletions

View File

@@ -1644,7 +1644,11 @@ Public Class cFakturierung
Mail.HTMLBody &= "<br><br><br>Best regards<br><br>" & getSignature(RECHNUNG)
End Select
Mail.HTMLBody = "<div style=""font-family:Calibri, Arial"">" & Mail.HTMLBody & "</div>"
Mail.To = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(RECHNUNG.RechnungsKundenNr, "Rechnung an")
Dim emai_receipt As String = ""
If RECHNUNG.FilialenNr = "4801" Or RECHNUNG.FilialenNr = "4802" Then emai_receipt = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(RECHNUNG.RechnungsKundenNr, "Rechnung an (ATILLA)")
Mail.To = IIf(emai_receipt = "", VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(RECHNUNG.RechnungsKundenNr, "Rechnung an"), emai_receipt)
Mail.Attachments.Add(tmpPath, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, , "Rechnung.pdf")
Mail.Display()

View File

@@ -522,7 +522,13 @@ Public Class frmAbrechnungsMaske
End Select
Mail.HTMLBody = "<div style=""font-family:Calibri, Arial"">" & Mail.HTMLBody & "</div>"
Dim KdNrTmp = getSelectionKdNr()
Mail.To = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(If(IsNumeric(KdNrTmp), KdNrTmp, -1), "Rechnung an")
Dim emai_receipt As String = ""
If getSelection("FilialenNr") = "4801" Or getSelection("FilialenNr") = "4802" Then emai_receipt = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(If(IsNumeric(KdNrTmp), KdNrTmp, -1), "Rechnung an (ATILLA)")
Mail.To = IIf(emai_receipt = "", VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(If(IsNumeric(KdNrTmp), KdNrTmp, -1), "Rechnung an"), emai_receipt)
Mail.Display()

View File

@@ -152,11 +152,28 @@ Public Class frmFaktEmail
If AD.E_Mail IsNot Nothing AndAlso AD.E_Mail <> "" Then lkl.Text = """" & AD.E_Mail & """ anfügen" : lkl.Tag = AD.E_Mail
lblKunde.Text = AD.AdressenNr & " - " & AD.Ordnungsbegriff
Dim EMAILTMP = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(AD.AdressenNr, "Rechnung an")
Dim email_receipt As String = ""
If SR Then
Dim allAtilla = IIf(Firma_ID = 7, True, False)
If SR_DT IsNot Nothing AndAlso SR_DT.Rows.Count > 0 Then
For Each r In SR_DT.Rows
If "4801" <> r("FilialenNr") And "4802" <> r("FilialenNr") Then
allAtilla = False
Exit For
End If
Next
End If
email_receipt = IIf(allAtilla, VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(AD.AdressenNr, "Rechnung an (ATILLA)"), "")
Else
If RECHNUNG.FilialenNr = "4801" Or RECHNUNG.FilialenNr = "4802" Then email_receipt = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(AD.AdressenNr, "Rechnung an (ATILLA)")
End If
Dim EMAILTMP = IIf(email_receipt = "", VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(AD.AdressenNr, "Rechnung an"), email_receipt) 'VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(AD.AdressenNr, "Rechnung an")
If EMAILTMP <> "" Then dgvEmail.Rows.Add(EMAILTMP)
Dim EMAILTMPCC = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdressCC(AD.AdressenNr, "Rechnung an")
Dim EMAILTMPCC = IIf(email_receipt = "", VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdressCC(AD.AdressenNr, "Rechnung an"), VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdressCC(AD.AdressenNr, "Rechnung an (ATILLA)"))
If EMAILTMPCC <> "" Then dgvEmailCC.Rows.Add(EMAILTMPCC)
Dim EMAILTMPBCC = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdressBCC(AD.AdressenNr, "Rechnung an")
Dim EMAILTMPBCC = IIf(email_receipt = "", VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdressBCC(AD.AdressenNr, "Rechnung an"), VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdressBCC(AD.AdressenNr, "Rechnung an (ATILLA)"))
If EMAILTMPBCC <> "" Then dgvEmailBCC.Rows.Add(EMAILTMPBCC)
initDGVAnhaenge()

View File

@@ -288,7 +288,14 @@ Public Class frmFaktSammelRgDrucken
Mail = outl.CreateItem(0)
Mail.Subject = "VERAG Sammel-Rechnung"
Mail.HTMLBody = getSammelRgTExt(getSelectionLandKz)
If IsNumeric(getSelectionKdNr) Then Mail.To = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(CInt(getSelectionKdNr()), "Rechnung an")
If IsNumeric(getSelectionKdNr) Then
Dim email_receipt As String = ""
If cboFirma._value = "7" Then email_receipt = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(CInt(getSelectionKdNr()), "Rechnung an (ATILLA)")
Mail.To = IIf(email_receipt = "", VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(CInt(getSelectionKdNr()), "Rechnung an"), email_receipt)
End If
For Each pdf In listPDFs
Mail.Attachments.Add(pdf, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue)
Next
@@ -320,7 +327,13 @@ Public Class frmFaktSammelRgDrucken
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem
Mail = outl.CreateItem(0)
Mail.Subject = "VERAG Sammel-Rechnung"
If IsNumeric(getSelectionKdNr) Then Mail.To = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(CInt(getSelectionKdNr()), "Rechnung an")
If IsNumeric(getSelectionKdNr) Then
Dim email_receipt As String = ""
If cboFirma._value = "7" Then email_receipt = VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(CInt(getSelectionKdNr()), "Rechnung an (ATILLA)")
Mail.To = IIf(email_receipt = "", VERAG_PROG_ALLGEMEIN.cKundenKontakte.getMailAdress(CInt(getSelectionKdNr()), "Rechnung an"), email_receipt)
End If
Mail.HTMLBody = getSammelRgTExt(getSelectionLandKz) ' Sehr geehrte Damen und Herren,<br><br>anbei erhalten Sie Ihre Sammel-Rechnung."
Mail.Attachments.Add(pdf, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue)
Mail.Display()

View File

@@ -374,7 +374,7 @@ Public Class usrCntlFaktAbrechnung
Sub setControlsEnabled(pnl As Panel, pnlEnabled As Boolean)
For Each c In pnl.Controls
If c.GetType Is GetType(VERAG_PROG_ALLGEMEIN.MyTextBox) Or c.GetType Is GetType(VERAG_PROG_ALLGEMEIN.KdSearchBox) Then
c.Enabled = pnlEnabled
c.Enabled = IIf(cboFiliale._value = "5701" AndAlso VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("AMBAR_ALLE_RECHNUNGSEMPFÄNGER", "SDL"), True, pnlEnabled)
End If
Next
End Sub
@@ -4105,8 +4105,8 @@ Nächste_Textzeile_lesen:
If check >= 0 Then
If IsNumeric(cboSteuerschlüssel._value) AndAlso CInt(cboSteuerschlüssel._value) <> check Then
Dim text = SQL.getValueTxtBySql("select AuswahlSteuerbezeichnung from Steuertabelle where Steuerschlüssel =" & check, "FMZOLL")
Dim hintUIDPruef As String = IIf((RECHNUNG.RechnungsUstIdGeprüft IsNot Nothing AndAlso CDate(RECHNUNG.RechnungsUstIdGeprüft) < Today.AddDays(-30)), " UID-Prüfung ist älter als 30 Tage!", "")
If Not vbYes = MsgBox("Falscher Steuertyp!" & vbNewLine & " Steuerschlüssel " & text & " sollte hinterlegt werden." & vbNewLine & IIf(hintUIDPruef <> "", hintUIDPruef & vbNewLine, "") & "Trotzdem speichern?", vbYesNo) Then
Dim hintUIDPruef As String = IIf((RECHNUNG.RechnungsUstIdGeprüft IsNot Nothing AndAlso CDate(RECHNUNG.RechnungsUstIdGeprüft) < Today.AddDays(-31)), "UID-Prüfung ist älter als 31 Tage!", "")
If Not vbYes = MsgBox("Falscher Steuertyp!" & vbNewLine & "Steuerschlüssel " & text & " sollte hinterlegt werden." & vbNewLine & IIf(hintUIDPruef <> "", hintUIDPruef & vbNewLine, "") & "Trotzdem speichern?", vbYesNo) Then
Return False
End If
End If

View File

@@ -69,6 +69,7 @@
txtAdresse1.Text = (If(ADRESSE.LandKz, "") & " " & If(ADRESSE.PLZ, "") & " " & If(ADRESSE.Ort, "")).ToString.Trim
End If
End If
RaiseEvent KDNR_CHANGED(KdNR)
End Sub
initControlsHandler()
@@ -93,6 +94,17 @@
cboRechnungAn.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("4 - Avisierer", "4"))
If Not cboTEXT._value = "DE_FISKAL" Then
If txtFirma.KdNr_value > 0 AndAlso txtFirma.KdData_ADRESSEN IsNot Nothing Then
If txtFirma.KdData_ADRESSEN.LandKz = "DE" Or txtFirma.KdData_ADRESSEN.LandKz = "AT" Then
cboSprache.changeItem("DE")
Else
cboSprache.changeItem("EN")
End If
End If
End If
loaded = True
End Sub
@@ -108,6 +120,7 @@
cboSprache.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Englisch", "EN"))
'cboSprache.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Französisch", "FR")) ??
cboSprache.changeItem("DE")
End If
End Sub

View File

@@ -24,6 +24,8 @@ Partial Class UsrCntlessensbestellungen
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.MyPanel1 = New VERAG_PROG_ALLGEMEIN.MyPanel(Me.components)
Me.txtAnzahlKeb = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.lblWarning = New System.Windows.Forms.Label()
Me.txtPreis = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
@@ -76,8 +78,11 @@ Partial Class UsrCntlessensbestellungen
Me.cbxMenu = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cbxAbteilung = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.Label5 = New System.Windows.Forms.Label()
Me.txtAnzahlKeb = New System.Windows.Forms.Label()
Me.Label6 = New System.Windows.Forms.Label()
Me.cbxAlt_montag = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cbxAlt_dienstag = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cbxAlt_mittwoch = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cbxAlt_donnerstag = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.cbxAlt_freitag = New VERAG_PROG_ALLGEMEIN.MyComboBox()
Me.MyPanel1.SuspendLayout()
Me.GroupBoxDienstag.SuspendLayout()
Me.GroupBoxMontag.SuspendLayout()
@@ -107,6 +112,24 @@ Partial Class UsrCntlessensbestellungen
Me.MyPanel1.Size = New System.Drawing.Size(667, 266)
Me.MyPanel1.TabIndex = 19
'
'txtAnzahlKeb
'
Me.txtAnzahlKeb.AutoSize = True
Me.txtAnzahlKeb.Location = New System.Drawing.Point(580, 154)
Me.txtAnzahlKeb.Name = "txtAnzahlKeb"
Me.txtAnzahlKeb.Size = New System.Drawing.Size(13, 13)
Me.txtAnzahlKeb.TabIndex = 35
Me.txtAnzahlKeb.Text = "0"
'
'Label6
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(463, 154)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(112, 13)
Me.Label6.TabIndex = 34
Me.Label6.Text = "Anzahl Kebap/Dürüm:"
'
'lblWarning
'
Me.lblWarning.AutoSize = True
@@ -137,6 +160,7 @@ Partial Class UsrCntlessensbestellungen
'GroupBoxDienstag
'
Me.GroupBoxDienstag.Controls.Add(Me.txtMenu_dienstag)
Me.GroupBoxDienstag.Controls.Add(Me.cbxAlt_dienstag)
Me.GroupBoxDienstag.Controls.Add(Me.cb_dienstag)
Me.GroupBoxDienstag.Controls.Add(Me.txtAlt_dienstag)
Me.GroupBoxDienstag.Controls.Add(Me.rbMenuAlt_dienstag)
@@ -181,12 +205,12 @@ Partial Class UsrCntlessensbestellungen
Me.txtAlt_dienstag._Waehrung = False
Me.txtAlt_dienstag._WaehrungZeichen = True
Me.txtAlt_dienstag.ForeColor = System.Drawing.Color.Black
Me.txtAlt_dienstag.Location = New System.Drawing.Point(3, 93)
Me.txtAlt_dienstag.Location = New System.Drawing.Point(130, 94)
Me.txtAlt_dienstag.MaxLineLength = -1
Me.txtAlt_dienstag.MaxLines_Warning = ""
Me.txtAlt_dienstag.MaxLines_Warning_Label = Nothing
Me.txtAlt_dienstag.Name = "txtAlt_dienstag"
Me.txtAlt_dienstag.Size = New System.Drawing.Size(177, 20)
Me.txtAlt_dienstag.Size = New System.Drawing.Size(61, 20)
Me.txtAlt_dienstag.TabIndex = 2
Me.txtAlt_dienstag.Visible = False
'
@@ -225,6 +249,7 @@ Partial Class UsrCntlessensbestellungen
'
'GroupBoxMontag
'
Me.GroupBoxMontag.Controls.Add(Me.cbxAlt_montag)
Me.GroupBoxMontag.Controls.Add(Me.txtMenu_montag)
Me.GroupBoxMontag.Controls.Add(Me.cb_montag)
Me.GroupBoxMontag.Controls.Add(Me.txtAlt_montag)
@@ -270,12 +295,12 @@ Partial Class UsrCntlessensbestellungen
Me.txtAlt_montag._Waehrung = False
Me.txtAlt_montag._WaehrungZeichen = True
Me.txtAlt_montag.ForeColor = System.Drawing.Color.Black
Me.txtAlt_montag.Location = New System.Drawing.Point(3, 92)
Me.txtAlt_montag.Location = New System.Drawing.Point(124, 94)
Me.txtAlt_montag.MaxLineLength = -1
Me.txtAlt_montag.MaxLines_Warning = ""
Me.txtAlt_montag.MaxLines_Warning_Label = Nothing
Me.txtAlt_montag.Name = "txtAlt_montag"
Me.txtAlt_montag.Size = New System.Drawing.Size(177, 20)
Me.txtAlt_montag.Size = New System.Drawing.Size(67, 20)
Me.txtAlt_montag.TabIndex = 2
Me.txtAlt_montag.Visible = False
'
@@ -309,6 +334,7 @@ Partial Class UsrCntlessensbestellungen
Me.GroupBoxFreitag.Controls.Add(Me.cb_freitag)
Me.GroupBoxFreitag.Controls.Add(Me.txtAlt_freitag)
Me.GroupBoxFreitag.Controls.Add(Me.rbMenuAlt_freitag)
Me.GroupBoxFreitag.Controls.Add(Me.cbxAlt_freitag)
Me.GroupBoxFreitag.Controls.Add(Me.rbMenu__freitag)
Me.GroupBoxFreitag.Location = New System.Drawing.Point(219, 135)
Me.GroupBoxFreitag.Name = "GroupBoxFreitag"
@@ -350,12 +376,12 @@ Partial Class UsrCntlessensbestellungen
Me.txtAlt_freitag._Waehrung = False
Me.txtAlt_freitag._WaehrungZeichen = True
Me.txtAlt_freitag.ForeColor = System.Drawing.Color.Black
Me.txtAlt_freitag.Location = New System.Drawing.Point(3, 97)
Me.txtAlt_freitag.Location = New System.Drawing.Point(136, 95)
Me.txtAlt_freitag.MaxLineLength = -1
Me.txtAlt_freitag.MaxLines_Warning = ""
Me.txtAlt_freitag.MaxLines_Warning_Label = Nothing
Me.txtAlt_freitag.Name = "txtAlt_freitag"
Me.txtAlt_freitag.Size = New System.Drawing.Size(177, 20)
Me.txtAlt_freitag.Size = New System.Drawing.Size(61, 20)
Me.txtAlt_freitag.TabIndex = 2
Me.txtAlt_freitag.Visible = False
'
@@ -405,6 +431,7 @@ Partial Class UsrCntlessensbestellungen
'
Me.Mittwoch.Controls.Add(Me.txtMenu_mittwoch)
Me.Mittwoch.Controls.Add(Me.cb_mittwoch)
Me.Mittwoch.Controls.Add(Me.cbxAlt_mittwoch)
Me.Mittwoch.Controls.Add(Me.txtAlt_mittwoch)
Me.Mittwoch.Controls.Add(Me.rbMenuAlt_mittwoch)
Me.Mittwoch.Controls.Add(Me.rbMenu_mittwoch)
@@ -448,12 +475,12 @@ Partial Class UsrCntlessensbestellungen
Me.txtAlt_mittwoch._Waehrung = False
Me.txtAlt_mittwoch._WaehrungZeichen = True
Me.txtAlt_mittwoch.ForeColor = System.Drawing.Color.Black
Me.txtAlt_mittwoch.Location = New System.Drawing.Point(3, 93)
Me.txtAlt_mittwoch.Location = New System.Drawing.Point(126, 92)
Me.txtAlt_mittwoch.MaxLineLength = -1
Me.txtAlt_mittwoch.MaxLines_Warning = ""
Me.txtAlt_mittwoch.MaxLines_Warning_Label = Nothing
Me.txtAlt_mittwoch.Name = "txtAlt_mittwoch"
Me.txtAlt_mittwoch.Size = New System.Drawing.Size(177, 20)
Me.txtAlt_mittwoch.Size = New System.Drawing.Size(65, 20)
Me.txtAlt_mittwoch.TabIndex = 2
Me.txtAlt_mittwoch.Visible = False
'
@@ -486,6 +513,7 @@ Partial Class UsrCntlessensbestellungen
Me.GroupBoxDonnerstag.Controls.Add(Me.txtMenu_donnerstag)
Me.GroupBoxDonnerstag.Controls.Add(Me.cbdonnerstag)
Me.GroupBoxDonnerstag.Controls.Add(Me.txtAlt_donnerstag)
Me.GroupBoxDonnerstag.Controls.Add(Me.cbxAlt_donnerstag)
Me.GroupBoxDonnerstag.Controls.Add(Me.rbMenuAlt_donnerstag)
Me.GroupBoxDonnerstag.Controls.Add(Me.rbMenu_donnerstag)
Me.GroupBoxDonnerstag.Location = New System.Drawing.Point(3, 135)
@@ -528,12 +556,12 @@ Partial Class UsrCntlessensbestellungen
Me.txtAlt_donnerstag._Waehrung = False
Me.txtAlt_donnerstag._WaehrungZeichen = True
Me.txtAlt_donnerstag.ForeColor = System.Drawing.Color.Black
Me.txtAlt_donnerstag.Location = New System.Drawing.Point(3, 97)
Me.txtAlt_donnerstag.Location = New System.Drawing.Point(127, 95)
Me.txtAlt_donnerstag.MaxLineLength = -1
Me.txtAlt_donnerstag.MaxLines_Warning = ""
Me.txtAlt_donnerstag.MaxLines_Warning_Label = Nothing
Me.txtAlt_donnerstag.Name = "txtAlt_donnerstag"
Me.txtAlt_donnerstag.Size = New System.Drawing.Size(177, 20)
Me.txtAlt_donnerstag.Size = New System.Drawing.Size(64, 20)
Me.txtAlt_donnerstag.TabIndex = 2
Me.txtAlt_donnerstag.Visible = False
'
@@ -723,23 +751,70 @@ Partial Class UsrCntlessensbestellungen
Me.Label5.TabIndex = 39
Me.Label5.Text = "Abteilung:"
'
'txtAnzahlKeb
'cbxAlt_montag
'
Me.txtAnzahlKeb.AutoSize = True
Me.txtAnzahlKeb.Location = New System.Drawing.Point(580, 154)
Me.txtAnzahlKeb.Name = "txtAnzahlKeb"
Me.txtAnzahlKeb.Size = New System.Drawing.Size(13, 13)
Me.txtAnzahlKeb.TabIndex = 35
Me.txtAnzahlKeb.Text = "0"
Me.cbxAlt_montag._allowedValuesFreiText = Nothing
Me.cbxAlt_montag._allowFreiText = True
Me.cbxAlt_montag._value = ""
Me.cbxAlt_montag.DropDownWidth = 120
Me.cbxAlt_montag.FormattingEnabled = True
Me.cbxAlt_montag.Location = New System.Drawing.Point(0, 94)
Me.cbxAlt_montag.Name = "cbxAlt_montag"
Me.cbxAlt_montag.Size = New System.Drawing.Size(100, 21)
Me.cbxAlt_montag.TabIndex = 41
Me.cbxAlt_montag.Visible = False
'
'Label6
'cbxAlt_dienstag
'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(463, 154)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(112, 13)
Me.Label6.TabIndex = 34
Me.Label6.Text = "Anzahl Kebap/Dürüm:"
Me.cbxAlt_dienstag._allowedValuesFreiText = Nothing
Me.cbxAlt_dienstag._allowFreiText = True
Me.cbxAlt_dienstag._value = ""
Me.cbxAlt_dienstag.DropDownWidth = 120
Me.cbxAlt_dienstag.FormattingEnabled = True
Me.cbxAlt_dienstag.Location = New System.Drawing.Point(0, 93)
Me.cbxAlt_dienstag.Name = "cbxAlt_dienstag"
Me.cbxAlt_dienstag.Size = New System.Drawing.Size(100, 21)
Me.cbxAlt_dienstag.TabIndex = 42
Me.cbxAlt_dienstag.Visible = False
'
'cbxAlt_mittwoch
'
Me.cbxAlt_mittwoch._allowedValuesFreiText = Nothing
Me.cbxAlt_mittwoch._allowFreiText = True
Me.cbxAlt_mittwoch._value = ""
Me.cbxAlt_mittwoch.DropDownWidth = 120
Me.cbxAlt_mittwoch.FormattingEnabled = True
Me.cbxAlt_mittwoch.Location = New System.Drawing.Point(0, 92)
Me.cbxAlt_mittwoch.Name = "cbxAlt_mittwoch"
Me.cbxAlt_mittwoch.Size = New System.Drawing.Size(100, 21)
Me.cbxAlt_mittwoch.TabIndex = 43
Me.cbxAlt_mittwoch.Visible = False
'
'cbxAlt_donnerstag
'
Me.cbxAlt_donnerstag._allowedValuesFreiText = Nothing
Me.cbxAlt_donnerstag._allowFreiText = True
Me.cbxAlt_donnerstag._value = ""
Me.cbxAlt_donnerstag.DropDownWidth = 120
Me.cbxAlt_donnerstag.FormattingEnabled = True
Me.cbxAlt_donnerstag.Location = New System.Drawing.Point(3, 97)
Me.cbxAlt_donnerstag.Name = "cbxAlt_donnerstag"
Me.cbxAlt_donnerstag.Size = New System.Drawing.Size(100, 21)
Me.cbxAlt_donnerstag.TabIndex = 44
Me.cbxAlt_donnerstag.Visible = False
'
'cbxAlt_freitag
'
Me.cbxAlt_freitag._allowedValuesFreiText = Nothing
Me.cbxAlt_freitag._allowFreiText = True
Me.cbxAlt_freitag._value = ""
Me.cbxAlt_freitag.DropDownWidth = 120
Me.cbxAlt_freitag.FormattingEnabled = True
Me.cbxAlt_freitag.Location = New System.Drawing.Point(0, 97)
Me.cbxAlt_freitag.Name = "cbxAlt_freitag"
Me.cbxAlt_freitag.Size = New System.Drawing.Size(100, 21)
Me.cbxAlt_freitag.TabIndex = 45
Me.cbxAlt_freitag.Visible = False
'
'UsrCntlessensbestellungen
'
@@ -834,4 +909,9 @@ Partial Class UsrCntlessensbestellungen
Friend WithEvents Label5 As Label
Friend WithEvents txtAnzahlKeb As Label
Friend WithEvents Label6 As Label
Friend WithEvents cbxAlt_dienstag As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents cbxAlt_montag As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents cbxAlt_freitag As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents cbxAlt_mittwoch As VERAG_PROG_ALLGEMEIN.MyComboBox
Friend WithEvents cbxAlt_donnerstag As VERAG_PROG_ALLGEMEIN.MyComboBox
End Class

View File

@@ -1,5 +1,7 @@

Imports System.Data.SqlTypes
Imports System.Windows.Documents
Imports io.konik.zugferd.unqualified
Imports VERAG_PROG_ALLGEMEIN
Public Class UsrCntlessensbestellungen
@@ -78,41 +80,53 @@ Public Class UsrCntlessensbestellungen
cbxAbteilung.Enabled = False
txtAnmerkung.Text = If(essen.eb_anmerkung IsNot Nothing, essen.eb_anmerkung.ToString, "")
End Sub
Private Sub rbaLaCarte_CheckedChanged(sender As Object, e As EventArgs) Handles rbMenuAlt_montag.CheckedChanged, rbMenuAlt_dienstag.CheckedChanged, rbMenuAlt_donnerstag.CheckedChanged, rbMenuAlt_mittwoch.CheckedChanged, rbMenuAlt_freitag.CheckedChanged
If rbMenuAlt_montag.Checked Then
txtAlt_montag.Visible = True
'txtAlt_montag.Visible = True
cbxAlt_montag.Visible = True
Else
txtAlt_montag.Visible = False
cbxAlt_montag.Visible = False
'txtAlt_montag.Visible = False
End If
If rbMenuAlt_dienstag.Checked Then
txtAlt_dienstag.Visible = True
cbxAlt_dienstag.Visible = True
'txtAlt_dienstag.Visible = True
Else
txtAlt_dienstag.Visible = False
cbxAlt_dienstag.Visible = False
'txtAlt_dienstag.Visible = False
End If
If rbMenuAlt_mittwoch.Checked Then
txtAlt_mittwoch.Visible = True
cbxAlt_mittwoch.Visible = True
'txtAlt_mittwoch.Visible = True
Else
txtAlt_mittwoch.Visible = False
cbxAlt_mittwoch.Visible = False
'txtAlt_mittwoch.Visible = False
End If
If rbMenuAlt_donnerstag.Checked Then
txtAlt_donnerstag.Visible = True
cbxAlt_donnerstag.Visible = True
'txtAlt_donnerstag.Visible = True
Else
txtAlt_donnerstag.Visible = False
cbxAlt_donnerstag.Visible = False
'txtAlt_donnerstag.Visible = False
End If
If rbMenuAlt_freitag.Checked Then
txtAlt_freitag.Visible = True
cbxAlt_freitag.Visible = True
'txtAlt_freitag.Visible = True
Else
txtAlt_freitag.Visible = False
cbxAlt_freitag.Visible = False
'txtAlt_freitag.Visible = False
End If
countChecks()
End Sub
@@ -242,6 +256,9 @@ Public Class UsrCntlessensbestellungen
txtAnzahlLaCart.Text = countlaCarte.ToString
txtAnzahlKeb.Text = countKebab.ToString
If dt.Rows.Count < 1 Then Exit Sub
If CDate(dt.Rows(0).Item("MenuDateVon")).ToString("dd.MM.yyyy") >= DateTime.Parse("01/06/2024") Then
txtPreis.Text = (CDbl(countKebab) + CDbl(countMenus)) * 3 + CDbl(countlaCarte) * 5
@@ -289,6 +306,10 @@ Public Class UsrCntlessensbestellungen
essen = New cEssensbestellung(cbxMenu._value, cbxMitarbeiter._value, cbxGebäude._value, cbxAbteilung._value, cbxMitarbeiter.Text, txtAnmerkung.Text)
If cb_montag.Checked Then
If rbMenu_montag.Checked Then
essen.eb_montag = menu
@@ -546,13 +567,17 @@ Public Class UsrCntlessensbestellungen
Private Sub initPanelFields()
If essen.eb_montag IsNot Nothing Then
cb_montag.Checked = True
If essen.eb_montag.ToString = menu Then
rbMenu_montag.Checked = True
Else
rbMenuAlt_montag.Checked = True
If essen.eb_montag IsNot Nothing Then txtAlt_montag.Text = essen.eb_montag.ToString
If essen.eb_montag IsNot Nothing Then cbxAlt_montag.changeItem(essen.eb_montag)
If cbxAlt_montag.SelectedValue = Nothing Then
cbxAlt_montag.Text = essen.eb_montag.ToString
End If
End If
Else
cb_montag.Checked = False
@@ -564,7 +589,10 @@ Public Class UsrCntlessensbestellungen
rbMenu_dienstag.Checked = True
Else
rbMenuAlt_dienstag.Checked = True
If essen.eb_dienstag IsNot Nothing Then txtAlt_dienstag.Text = essen.eb_dienstag.ToString
If essen.eb_dienstag IsNot Nothing Then cbxAlt_dienstag.changeItem(essen.eb_dienstag)
If cbxAlt_dienstag.SelectedValue = Nothing Then
cbxAlt_dienstag.Text = essen.eb_dienstag.ToString
End If
End If
Else
cb_dienstag.Checked = False
@@ -577,7 +605,10 @@ Public Class UsrCntlessensbestellungen
rbMenu_mittwoch.Checked = True
Else
rbMenuAlt_mittwoch.Checked = True
If essen.eb_mittwoch IsNot Nothing Then txtAlt_mittwoch.Text = essen.eb_mittwoch.ToString
If essen.eb_mittwoch IsNot Nothing Then cbxAlt_mittwoch.changeItem(essen.eb_mittwoch)
If cbxAlt_mittwoch.SelectedValue = Nothing Then
cbxAlt_mittwoch.Text = essen.eb_mittwoch.ToString
End If
End If
Else
cb_mittwoch.Checked = False
@@ -589,7 +620,10 @@ Public Class UsrCntlessensbestellungen
rbMenu_donnerstag.Checked = True
Else
rbMenuAlt_donnerstag.Checked = True
If essen.eb_donnerstag IsNot Nothing Then txtAlt_donnerstag.Text = essen.eb_donnerstag.ToString
If essen.eb_donnerstag IsNot Nothing Then cbxAlt_donnerstag.changeItem(essen.eb_donnerstag)
If cbxAlt_donnerstag.SelectedValue = Nothing Then
cbxAlt_donnerstag.Text = essen.eb_donnerstag.ToString
End If
End If
Else
cbdonnerstag.Checked = False
@@ -602,7 +636,10 @@ Public Class UsrCntlessensbestellungen
rbMenu__freitag.Checked = True
Else
rbMenuAlt_freitag.Checked = True
If essen.eb_freitag IsNot Nothing Then txtAlt_freitag.Text = essen.eb_freitag.ToString
If essen.eb_freitag IsNot Nothing Then cbxAlt_freitag.changeItem(essen.eb_freitag)
If cbxAlt_freitag.SelectedValue = Nothing Then
cbxAlt_freitag.Text = essen.eb_freitag.ToString
End If
End If
Else
cb_freitag.Checked = False
@@ -643,6 +680,22 @@ Public Class UsrCntlessensbestellungen
cbxGebäude.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Maut", "Maut"))
cbxGebäude.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", ""))
Dim list As New List(Of MyListItem)
list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Kebap", "Kebap"))
list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Dürüm", "Dürüm"))
'list.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", ""))
cbxAlt_montag.Items.AddRange(list.ToArray())
cbxAlt_dienstag.Items.AddRange(list.ToArray())
cbxAlt_mittwoch.Items.AddRange(list.ToArray())
cbxAlt_donnerstag.Items.AddRange(list.ToArray())
cbxAlt_freitag.Items.AddRange(list.ToArray())
End Sub
Private Sub cbxAlt_montag_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbxAlt_montag.SelectedValueChanged, cbxAlt_dienstag.SelectedValueChanged, cbxAlt_mittwoch.SelectedValueChanged, cbxAlt_donnerstag.SelectedValueChanged, cbxAlt_freitag.SelectedValueChanged, cbxAlt_montag.TextChanged, cbxAlt_dienstag.TextChanged, cbxAlt_mittwoch.TextChanged, cbxAlt_donnerstag.TextChanged, cbxAlt_freitag.TextChanged
countChecks()
End Sub
End Class

View File

@@ -534,7 +534,7 @@ Class DAKOSY_Interface_SEND
If u.ezaWP_AHStatWert IsNot Nothing AndAlso IsNumeric(u.ezaWP_AHStatWert) Then WP.AHStatWert = CInt(u.ezaWP_AHStatWert)
If u.ezaWP_AHStatWertManuellKZ IsNot Nothing Then WP.AHStatWertManuellKZ = CInt(Int(u.ezaWP_AHStatWertManuellKZ))
If u.ezaWP_KostenEUSt IsNot Nothing Then WP.KostenEUSt = u.ezaWP_KostenEUSt
If u.ezaWP_PackstueckAnzahl IsNot Nothing Then WP.PackstueckAnzahl = u.ezaWP_PackstueckAnzahl.ToString.Replace(".", "")
If u.ezaWP_PackstueckAnzahl IsNot Nothing Then WP.PackstueckAnzahl = u.ezaWP_PackstueckAnzahl.ToString.Replace(".", "").Replace(" ", "")
If u.ezaWP_PackstueckArt IsNot Nothing Then WP.PackstueckArt = u.ezaWP_PackstueckArt
If u.ezaWP_PackstueckZeichen IsNot Nothing Then WP.PackstueckZeichen = u.ezaWP_PackstueckZeichen

View File

@@ -487,10 +487,9 @@ Public Class frmBU_Mahnlauf
to which future reminders should be sent.<br>
In the meantime, we ask you to forward them to the responsible persons in your company.</i>"
Mail_HTMLBody &= "<br><br><br>" & cFakturierung.getSignature(AD.LandKz, FIRMA.Firma_ID)
Case "A", "AT", "D", "DE", "CH"
Mail_Subject = MAHNTEXT & IIf(KdNr > 0, " - KdNr.: " & KdNr, "")
Mail_HTMLBody = "Sehr geehrte Damen und Herren,<br><br>im Anhang finden Sie ihre Mahnung, mit der Bitte um Bearbeitung. "
Mail_HTMLBody &= "<br><br><br>"
@@ -500,6 +499,7 @@ Public Class frmBU_Mahnlauf
Mail_HTMLBody &= "<br><br><br>Mit freundlichen Grüßen<br><br>" & cFakturierung.getSignature(AD.LandKz, FIRMA.Firma_ID)
Case Else
Mail_Subject = "PAYMENT REMINDER" & IIf(KdNr > 0, " - Cust.: " & KdNr, "")
Mail_HTMLBody = "Dear Sear or Madam,<br><br>attached we send you the invoice reminder."
Mail_HTMLBody &= "<br><br><br>"
@@ -527,7 +527,6 @@ Public Class frmBU_Mahnlauf
VERAG_PROG_ALLGEMEIN.cProgramFunctions.sendMail(Mail_To, Mail_Subject, Mail_HTMLBody, IIf(FIRMA.Firma_E_Mail_Mahnungen <> "", FIRMA.Firma_E_Mail_Mahnungen, "buchhaltung@verag.ag"), False, False, Mail_CC, Mail_BCC, list)
Case Else
Dim outl As New Outlook.Application
Dim Mail As Microsoft.Office.Interop.Outlook.MailItem

View File

@@ -450,9 +450,13 @@ Public Class frmEssensbestellungenAdministration
Next
dgvBestellungen.GetOrder()
dgvBestellungen.LOAD()
dgvBestellungen.SetOrder()
If dgvBestellungen.RowCount > 0 Then
dgvBestellungen.GetOrder()
dgvBestellungen.LOAD()
dgvBestellungen.SetOrder()
End If
End Sub

View File

@@ -84,14 +84,15 @@ Public Class usrCntlKundenBesonderheiten
End Try
End Sub
Private Sub initDGV(Optional kdnrTmp = -1, Optional simpleView = False, Optional preferedKategorie = "", Optional preferedKategorieOtherIN = "")
'If dgvBesonderheiten IsNot Nothing Then Exit Sub
'If dgvBesonderheiten i Nothing Then Exit Sub
If dgvBesonderheiten.Columns IsNot Nothing AndAlso dgvBesonderheiten.Columns.Count > 0 Then
Try
dgvBesonderheiten.Columns.Clear()
Catch
End Try
End If
'If dgvBesonderheiten.ColumnCount > 0 Then
' Try
' dgvBesonderheiten.Columns.Clear()
' Catch ex As Exception
' VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
' End Try
'End If
If kdnrTmp > 0 Then Me.kdNr = kdnrTmp
If kdNr <= 0 Then Exit Sub
@@ -172,7 +173,9 @@ Public Class usrCntlKundenBesonderheiten
colm.Name = "clmnRufzeichen"
colm.DefaultCellStyle.ForeColor = Color.Red
colm.DefaultCellStyle.Font = New Font(.DefaultCellStyle.Font.FontFamily, .DefaultCellStyle.Font.Size, FontStyle.Bold)
.Columns.Insert(2, colm)
If Not .Columns.Contains(colm.Name) Then
.Columns.Insert(2, colm)
End If
' .GetOrder()
initDGV_CLMN()

View File

@@ -941,6 +941,8 @@ Public Class usrCntlKundenuebersicht
r.DefaultCellStyle.ForeColor = Color.Gray
ElseIf IsDate(r.Cells("kdvm_erhalten_Datum").Value) AndAlso CDate(r.Cells("kdvm_erhalten_Datum").Value) < Now.AddYears(-2) Then
r.DefaultCellStyle.ForeColor = Color.Red
ElseIf IsDate(r.Cells("kdvm_gueltig_bis").Value) AndAlso (CDate(r.Cells("kdvm_gueltig_bis").Value) < Today) Then
r.DefaultCellStyle.ForeColor = Color.Red
End If
If True Then

View File

@@ -45,7 +45,6 @@ Partial Class frmMDMDatenverarbetiung
Me.lbl = New System.Windows.Forms.Label()
Me.Panel1 = New System.Windows.Forms.Panel()
Me.lblTTRSum = New System.Windows.Forms.Label()
Me.txtTTRSum = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.lblProzPruef = New System.Windows.Forms.Label()
Me.PictureBox1 = New System.Windows.Forms.PictureBox()
Me.pic = New System.Windows.Forms.PictureBox()
@@ -58,7 +57,6 @@ Partial Class frmMDMDatenverarbetiung
Me.Button1 = New System.Windows.Forms.Button()
Me.btnKunde = New System.Windows.Forms.Button()
Me.Label4 = New System.Windows.Forms.Label()
Me.txtPruefsummeBrutto = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.cbx = New System.Windows.Forms.CheckBox()
Me.Panel2 = New System.Windows.Forms.Panel()
Me.Label43 = New System.Windows.Forms.Label()
@@ -69,12 +67,17 @@ Partial Class frmMDMDatenverarbetiung
Me.pbPloseAnh_Proz = New System.Windows.Forms.ProgressBar()
Me.lblPloseAnh_Proz = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.txtPruefsummeNetto = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Label2 = New System.Windows.Forms.Label()
Me.txtAnzahl = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button2 = New System.Windows.Forms.Button()
Me.MyDatagridview1 = New VERAG_PROG_ALLGEMEIN.MyDatagridview(Me.components)
Me.txtTTRSum = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtPruefsummeBrutto = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtPruefsummeNetto = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.txtAnzahl = New VERAG_PROG_ALLGEMEIN.MyTextBox()
Me.Panel5 = New System.Windows.Forms.Panel()
Me.Label5 = New System.Windows.Forms.Label()
Me.DateTimePicker2 = New System.Windows.Forms.DateTimePicker()
Me.pnl.SuspendLayout()
CType(Me.PictureBox5, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel4.SuspendLayout()
@@ -86,10 +89,12 @@ Partial Class frmMDMDatenverarbetiung
Me.Panel3.SuspendLayout()
Me.Panel2.SuspendLayout()
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.Panel5.SuspendLayout()
Me.SuspendLayout()
'
'pnl
'
Me.pnl.Controls.Add(Me.Panel5)
Me.pnl.Controls.Add(Me.PictureBox5)
Me.pnl.Controls.Add(Me.cbxBelegeerstellt)
Me.pnl.Controls.Add(Me.cbxASFINAGAbgerechnet)
@@ -338,32 +343,6 @@ Partial Class frmMDMDatenverarbetiung
Me.lblTTRSum.Text = "Prüfsumme TTR:"
Me.lblTTRSum.Visible = False
'
'txtTTRSum
'
Me.txtTTRSum._DateTimeOnly = False
Me.txtTTRSum._numbersOnly = False
Me.txtTTRSum._numbersOnlyKommastellen = ""
Me.txtTTRSum._numbersOnlyTrennzeichen = True
Me.txtTTRSum._Prozent = False
Me.txtTTRSum._ShortDateNew = False
Me.txtTTRSum._ShortDateOnly = False
Me.txtTTRSum._TimeOnly = False
Me.txtTTRSum._TimeOnly_Seconds = False
Me.txtTTRSum._value = ""
Me.txtTTRSum._Waehrung = False
Me.txtTTRSum._WaehrungZeichen = True
Me.txtTTRSum.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtTTRSum.ForeColor = System.Drawing.Color.Black
Me.txtTTRSum.Location = New System.Drawing.Point(1051, 92)
Me.txtTTRSum.MaxLineLength = -1
Me.txtTTRSum.MaxLines_Warning = ""
Me.txtTTRSum.MaxLines_Warning_Label = Nothing
Me.txtTTRSum.Name = "txtTTRSum"
Me.txtTTRSum.Size = New System.Drawing.Size(100, 20)
Me.txtTTRSum.TabIndex = 51
Me.txtTTRSum.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
Me.txtTTRSum.Visible = False
'
'lblProzPruef
'
Me.lblProzPruef.Location = New System.Drawing.Point(63, 92)
@@ -489,31 +468,6 @@ Partial Class frmMDMDatenverarbetiung
Me.Label4.TabIndex = 44
Me.Label4.Text = "Prüfsumme brutto:"
'
'txtPruefsummeBrutto
'
Me.txtPruefsummeBrutto._DateTimeOnly = False
Me.txtPruefsummeBrutto._numbersOnly = False
Me.txtPruefsummeBrutto._numbersOnlyKommastellen = ""
Me.txtPruefsummeBrutto._numbersOnlyTrennzeichen = True
Me.txtPruefsummeBrutto._Prozent = False
Me.txtPruefsummeBrutto._ShortDateNew = False
Me.txtPruefsummeBrutto._ShortDateOnly = False
Me.txtPruefsummeBrutto._TimeOnly = False
Me.txtPruefsummeBrutto._TimeOnly_Seconds = False
Me.txtPruefsummeBrutto._value = ""
Me.txtPruefsummeBrutto._Waehrung = False
Me.txtPruefsummeBrutto._WaehrungZeichen = True
Me.txtPruefsummeBrutto.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtPruefsummeBrutto.ForeColor = System.Drawing.Color.Black
Me.txtPruefsummeBrutto.Location = New System.Drawing.Point(1051, 69)
Me.txtPruefsummeBrutto.MaxLineLength = -1
Me.txtPruefsummeBrutto.MaxLines_Warning = ""
Me.txtPruefsummeBrutto.MaxLines_Warning_Label = Nothing
Me.txtPruefsummeBrutto.Name = "txtPruefsummeBrutto"
Me.txtPruefsummeBrutto.Size = New System.Drawing.Size(100, 20)
Me.txtPruefsummeBrutto.TabIndex = 43
Me.txtPruefsummeBrutto.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'cbx
'
Me.cbx.AutoSize = True
@@ -610,31 +564,6 @@ Partial Class frmMDMDatenverarbetiung
Me.Label3.TabIndex = 38
Me.Label3.Text = "Prüfsumme netto:"
'
'txtPruefsummeNetto
'
Me.txtPruefsummeNetto._DateTimeOnly = False
Me.txtPruefsummeNetto._numbersOnly = False
Me.txtPruefsummeNetto._numbersOnlyKommastellen = ""
Me.txtPruefsummeNetto._numbersOnlyTrennzeichen = True
Me.txtPruefsummeNetto._Prozent = False
Me.txtPruefsummeNetto._ShortDateNew = False
Me.txtPruefsummeNetto._ShortDateOnly = False
Me.txtPruefsummeNetto._TimeOnly = False
Me.txtPruefsummeNetto._TimeOnly_Seconds = False
Me.txtPruefsummeNetto._value = ""
Me.txtPruefsummeNetto._Waehrung = False
Me.txtPruefsummeNetto._WaehrungZeichen = True
Me.txtPruefsummeNetto.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtPruefsummeNetto.ForeColor = System.Drawing.Color.Black
Me.txtPruefsummeNetto.Location = New System.Drawing.Point(1051, 43)
Me.txtPruefsummeNetto.MaxLineLength = -1
Me.txtPruefsummeNetto.MaxLines_Warning = ""
Me.txtPruefsummeNetto.MaxLines_Warning_Label = Nothing
Me.txtPruefsummeNetto.Name = "txtPruefsummeNetto"
Me.txtPruefsummeNetto.Size = New System.Drawing.Size(100, 20)
Me.txtPruefsummeNetto.TabIndex = 37
Me.txtPruefsummeNetto.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'Label2
'
Me.Label2.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
@@ -645,31 +574,6 @@ Partial Class frmMDMDatenverarbetiung
Me.Label2.TabIndex = 36
Me.Label2.Text = "Anzahl:"
'
'txtAnzahl
'
Me.txtAnzahl._DateTimeOnly = False
Me.txtAnzahl._numbersOnly = False
Me.txtAnzahl._numbersOnlyKommastellen = ""
Me.txtAnzahl._numbersOnlyTrennzeichen = True
Me.txtAnzahl._Prozent = False
Me.txtAnzahl._ShortDateNew = False
Me.txtAnzahl._ShortDateOnly = False
Me.txtAnzahl._TimeOnly = False
Me.txtAnzahl._TimeOnly_Seconds = False
Me.txtAnzahl._value = ""
Me.txtAnzahl._Waehrung = False
Me.txtAnzahl._WaehrungZeichen = True
Me.txtAnzahl.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtAnzahl.ForeColor = System.Drawing.Color.Black
Me.txtAnzahl.Location = New System.Drawing.Point(1051, 16)
Me.txtAnzahl.MaxLineLength = -1
Me.txtAnzahl.MaxLines_Warning = ""
Me.txtAnzahl.MaxLines_Warning_Label = Nothing
Me.txtAnzahl.Name = "txtAnzahl"
Me.txtAnzahl.Size = New System.Drawing.Size(100, 20)
Me.txtAnzahl.TabIndex = 35
Me.txtAnzahl.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'Button3
'
Me.Button3.FlatStyle = System.Windows.Forms.FlatStyle.Flat
@@ -707,6 +611,134 @@ Partial Class frmMDMDatenverarbetiung
Me.MyDatagridview1.Size = New System.Drawing.Size(1163, 577)
Me.MyDatagridview1.TabIndex = 0
'
'txtTTRSum
'
Me.txtTTRSum._DateTimeOnly = False
Me.txtTTRSum._numbersOnly = False
Me.txtTTRSum._numbersOnlyKommastellen = ""
Me.txtTTRSum._numbersOnlyTrennzeichen = True
Me.txtTTRSum._Prozent = False
Me.txtTTRSum._ShortDateNew = False
Me.txtTTRSum._ShortDateOnly = False
Me.txtTTRSum._TimeOnly = False
Me.txtTTRSum._TimeOnly_Seconds = False
Me.txtTTRSum._value = ""
Me.txtTTRSum._Waehrung = False
Me.txtTTRSum._WaehrungZeichen = True
Me.txtTTRSum.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtTTRSum.ForeColor = System.Drawing.Color.Black
Me.txtTTRSum.Location = New System.Drawing.Point(1051, 92)
Me.txtTTRSum.MaxLineLength = -1
Me.txtTTRSum.MaxLines_Warning = ""
Me.txtTTRSum.MaxLines_Warning_Label = Nothing
Me.txtTTRSum.Name = "txtTTRSum"
Me.txtTTRSum.Size = New System.Drawing.Size(100, 20)
Me.txtTTRSum.TabIndex = 51
Me.txtTTRSum.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
Me.txtTTRSum.Visible = False
'
'txtPruefsummeBrutto
'
Me.txtPruefsummeBrutto._DateTimeOnly = False
Me.txtPruefsummeBrutto._numbersOnly = False
Me.txtPruefsummeBrutto._numbersOnlyKommastellen = ""
Me.txtPruefsummeBrutto._numbersOnlyTrennzeichen = True
Me.txtPruefsummeBrutto._Prozent = False
Me.txtPruefsummeBrutto._ShortDateNew = False
Me.txtPruefsummeBrutto._ShortDateOnly = False
Me.txtPruefsummeBrutto._TimeOnly = False
Me.txtPruefsummeBrutto._TimeOnly_Seconds = False
Me.txtPruefsummeBrutto._value = ""
Me.txtPruefsummeBrutto._Waehrung = False
Me.txtPruefsummeBrutto._WaehrungZeichen = True
Me.txtPruefsummeBrutto.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtPruefsummeBrutto.ForeColor = System.Drawing.Color.Black
Me.txtPruefsummeBrutto.Location = New System.Drawing.Point(1051, 69)
Me.txtPruefsummeBrutto.MaxLineLength = -1
Me.txtPruefsummeBrutto.MaxLines_Warning = ""
Me.txtPruefsummeBrutto.MaxLines_Warning_Label = Nothing
Me.txtPruefsummeBrutto.Name = "txtPruefsummeBrutto"
Me.txtPruefsummeBrutto.Size = New System.Drawing.Size(100, 20)
Me.txtPruefsummeBrutto.TabIndex = 43
Me.txtPruefsummeBrutto.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'txtPruefsummeNetto
'
Me.txtPruefsummeNetto._DateTimeOnly = False
Me.txtPruefsummeNetto._numbersOnly = False
Me.txtPruefsummeNetto._numbersOnlyKommastellen = ""
Me.txtPruefsummeNetto._numbersOnlyTrennzeichen = True
Me.txtPruefsummeNetto._Prozent = False
Me.txtPruefsummeNetto._ShortDateNew = False
Me.txtPruefsummeNetto._ShortDateOnly = False
Me.txtPruefsummeNetto._TimeOnly = False
Me.txtPruefsummeNetto._TimeOnly_Seconds = False
Me.txtPruefsummeNetto._value = ""
Me.txtPruefsummeNetto._Waehrung = False
Me.txtPruefsummeNetto._WaehrungZeichen = True
Me.txtPruefsummeNetto.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtPruefsummeNetto.ForeColor = System.Drawing.Color.Black
Me.txtPruefsummeNetto.Location = New System.Drawing.Point(1051, 43)
Me.txtPruefsummeNetto.MaxLineLength = -1
Me.txtPruefsummeNetto.MaxLines_Warning = ""
Me.txtPruefsummeNetto.MaxLines_Warning_Label = Nothing
Me.txtPruefsummeNetto.Name = "txtPruefsummeNetto"
Me.txtPruefsummeNetto.Size = New System.Drawing.Size(100, 20)
Me.txtPruefsummeNetto.TabIndex = 37
Me.txtPruefsummeNetto.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'txtAnzahl
'
Me.txtAnzahl._DateTimeOnly = False
Me.txtAnzahl._numbersOnly = False
Me.txtAnzahl._numbersOnlyKommastellen = ""
Me.txtAnzahl._numbersOnlyTrennzeichen = True
Me.txtAnzahl._Prozent = False
Me.txtAnzahl._ShortDateNew = False
Me.txtAnzahl._ShortDateOnly = False
Me.txtAnzahl._TimeOnly = False
Me.txtAnzahl._TimeOnly_Seconds = False
Me.txtAnzahl._value = ""
Me.txtAnzahl._Waehrung = False
Me.txtAnzahl._WaehrungZeichen = True
Me.txtAnzahl.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtAnzahl.ForeColor = System.Drawing.Color.Black
Me.txtAnzahl.Location = New System.Drawing.Point(1051, 16)
Me.txtAnzahl.MaxLineLength = -1
Me.txtAnzahl.MaxLines_Warning = ""
Me.txtAnzahl.MaxLines_Warning_Label = Nothing
Me.txtAnzahl.Name = "txtAnzahl"
Me.txtAnzahl.Size = New System.Drawing.Size(100, 20)
Me.txtAnzahl.TabIndex = 35
Me.txtAnzahl.TextAlign = System.Windows.Forms.HorizontalAlignment.Right
'
'Panel5
'
Me.Panel5.Controls.Add(Me.Label5)
Me.Panel5.Controls.Add(Me.DateTimePicker2)
Me.Panel5.Location = New System.Drawing.Point(3, 67)
Me.Panel5.Name = "Panel5"
Me.Panel5.Size = New System.Drawing.Size(264, 33)
Me.Panel5.TabIndex = 29
Me.Panel5.Visible = False
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(11, 12)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(113, 13)
Me.Label5.TabIndex = 23
Me.Label5.Text = "Rechnungsdaten von:"
'
'DateTimePicker2
'
Me.DateTimePicker2.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.DateTimePicker2.Location = New System.Drawing.Point(143, 6)
Me.DateTimePicker2.Name = "DateTimePicker2"
Me.DateTimePicker2.Size = New System.Drawing.Size(103, 20)
Me.DateTimePicker2.TabIndex = 22
'
'frmMDMDatenverarbetiung
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -735,6 +767,8 @@ Partial Class frmMDMDatenverarbetiung
Me.Panel2.ResumeLayout(False)
Me.Panel2.PerformLayout()
CType(Me.MyDatagridview1, System.ComponentModel.ISupportInitialize).EndInit()
Me.Panel5.ResumeLayout(False)
Me.Panel5.PerformLayout()
Me.ResumeLayout(False)
End Sub
@@ -790,4 +824,7 @@ Partial Class frmMDMDatenverarbetiung
Friend WithEvents PictureBox5 As PictureBox
Friend WithEvents Button4 As Button
Friend WithEvents Button9 As Button
Friend WithEvents Panel5 As Panel
Friend WithEvents Label5 As Label
Friend WithEvents DateTimePicker2 As DateTimePicker
End Class

View File

@@ -1,6 +1,7 @@
Imports System.Data.OleDb
Imports System.DirectoryServices.ActiveDirectory
Imports System.IO
Imports Chilkat
Imports com.sun.jdi
Imports com.sun.net.httpserver.Authenticator
Imports DAKOSY_Worker.NichtAbschliessendeFestsetzung
@@ -35,7 +36,7 @@ Public Class frmMDMDatenverarbetiung
Case "ASFINAG" : genSummenbericht_ASFINAG()
Case "UTA" : genSummenbericht_UTA()
Case "IDS" : MsgBox("Nicht verfügbar!") : Exit Sub
Case "MSE" : MsgBox("Nicht verfügbar!") : Exit Sub
Case "MSE" : genSummenbericht_MSE()
Case Else : MsgBox("Nicht verfügbar!")
End Select
End Sub
@@ -53,7 +54,7 @@ Public Class frmMDMDatenverarbetiung
Case "ASFINAG" : pruef = pruefData_ASFINAG()
Case "UTA" : pruef = pruefData_UTA()
Case "IDS" : MsgBox("Nicht verfügbar!") : Exit Sub
Case "MSE" : MsgBox("Nicht verfügbar!") : Exit Sub
Case "MSE" : pruef = pruefData_MSE()
Case Else : MsgBox("Nicht verfügbar!") : Exit Sub
End Select
@@ -86,7 +87,7 @@ Public Class frmMDMDatenverarbetiung
btnDatenLaden.Text = "Daten laden"
Case "IDS" : MsgBox("Nicht verfügbar!")
btnDatenLaden.Text = "Daten laden"
Case "MSE" : MsgBox("Nicht verfügbar!")
Case "MSE" : initDgv_MSE()
btnDatenLaden.Text = "Daten laden"
End Select
End Sub
@@ -97,20 +98,24 @@ Public Class frmMDMDatenverarbetiung
Case "PLOSE"
If genRGAtt_PLOSE() Then
If MautD_Befuellen() Then
setFakturiertPLOSE()
setFakturiert(LIEFERANT)
End If
End If
Case "UTA"
If genRGAtt_UTA() Then
If MautD_Befuellen() Then
'setFakturiertUTA()
setFakturiert(LIEFERANT)
End If
End If
Case "IDS"
MsgBox("Nicht verfügbar!")
Case "MSE"
MsgBox("Nicht verfügbar!")
If genRGAtt_MSE() Then
If MautD_Befuellen() Then
setFakturiert(LIEFERANT)
End If
End If
Case "ASFINAG"
Dim abrechnungsDatum As DateTime = Now()
@@ -439,6 +444,97 @@ Public Class frmMDMDatenverarbetiung
print.Show()
End Sub
Sub genSummenbericht_MSE()
Dim displayFilter = False
Dim sqlstr As String = ""
sqlstr &= " SELECT Adressen.AdressenNr, Adressen.[Name 1], trans.transaction_country AS Country,trans.device_product_type AS CardType, Sum(trans.transaction_gross_amount) AS [Transaction Amount], Sum(trans.total_gross_amount) AS [Total Amount]
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] and inv.customer_number = cust.[customer_id] and trans.transaction_country = inv.country
left join adressen ON cust.[customer_id] = Adressen.MSEKundenNr
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.charged <> 1
GROUP BY Adressen.AdressenNr, Adressen.[Name 1], trans.transaction_country, trans.device_product_type order by cust.customer_id"
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
'DataGridView.DataSource = dt
Dim print As New frmPrintLayout
print.Text = "mse"
Dim rpt As New rptASFINAG_TransaktionenSumary
rpt.DataSource = dt
'If cbxProdukt.Checked Then
' rpt.GroupHeader2.DataField = "prod_descr"
'Else
' rpt.GroupHeader2.Visible = False
' rpt.GroupFooter2.Visible = False
'End If
Dim sum = 0
rpt.lblUeberschrift.Text = "MSE Summenbericht " & CDate(Now.ToShortDateString)
rpt.lblSachbearbeiter.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRNAME
rpt.lblBrutto.Text = "Total Amount"
rpt.lblNetto.Text = "Transaction Amount"
'rpt.lblMandantNiederlassung.Text = PERSONAL.Mandant & " / " & PERSONAL.Niederlassung
'Dim cnt As Integer = 0
rpt.lblDat.Text = Now.ToLongDateString
Dim sumNetto As Double = 0
'Dim sumMWST As Double = 0
Dim sumBrutto As Double = 0
Dim sumperKdNrNetto As Double = 0
'Dim sumperKdNrMWST As Double = 0
Dim sumperKdNrBrutto As Double = 0
AddHandler rpt.Detail.Format, Sub()
rpt.lblKundennr.Text = SQL.isDbnullEmpty(rpt.Fields.Item("KundenNr").Value, "")
rpt.lblName1.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Name").Value, "")
rpt.lblKartennr.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Country").Value, "") & " " & SQL.isDbnullEmpty(rpt.Fields.Item("CardType").Value, "")
rpt.lblNetto.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaction Amount").Value, 2, "")
rpt.lblMWST.Text = "" 'SQL.isDbnullEmptyDbl(CDbl(rpt.Fields.Item("SummevonGesamtbetrag_Brutto_in_Darstellwährung").Value) - CDbl(rpt.Fields.Item("SummevonGesamtbetrag_Netto_in_Darstellwährung").Value), 2, "")
rpt.lblBrutto.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Total Amount").Value, 2, "")
rpt.lblSumNet.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaction Amount").Value, 2, "")
rpt.lblSumVat.Text = "" 'SQL.isDbnullEmptyDbl(CDbl(rpt.Fields.Item("SummevonGesamtbetrag_Brutto_in_Darstellwährung").Value) - CDbl(rpt.Fields.Item("SummevonGesamtbetrag_Netto_in_Darstellwährung").Value), 2, "")
rpt.lblSumBrt.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Total Amount").Value, 2, "")
sumNetto += SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaction Amount").Value, 4, 0)
'sumMWST += SQL.isDbnullEmptyDbl(CDbl(rpt.Fields.Item("SummevonGesamtbetrag_Brutto_in_Darstellwährung").Value) - CDbl(rpt.Fields.Item("SummevonGesamtbetrag_Netto_in_Darstellwährung").Value), 4, 0)
sumBrutto += SQL.isDbnullEmptyDbl(rpt.Fields.Item("Total Amount").Value, 4, 0)
End Sub
AddHandler rpt.ReportFooter1.Format, Sub()
rpt.lblSumNetto.Text = sumNetto.ToString("N2")
'rpt.lblSumMwst.Text = sumMWST.ToString("N2")
rpt.lblSumBrutto.Text = sumBrutto.ToString("N2")
End Sub
print.Viewer.LoadDocument(rpt)
print.Viewer.ViewType = GrapeCity.Viewer.Common.Model.ViewType.Continuous
print.Show()
End Sub
Sub initDgv_PLOSE()
@@ -534,7 +630,7 @@ Public Class frmMDMDatenverarbetiung
INNER JOIN (((Adressen INNER JOIN tblUTAImport ON Adressen.UTAKundenNr = tblUTAImport.Kundennummer)
INNER JOIN Offertenpositionen ON Adressen.AdressenNr = Offertenpositionen.KundenNr)
INNER JOIN tblUTALeistungen ON (tblUTALeistungen.VERAG_LeistungsNr = Offertenpositionen.LeistungsNr) AND (tblUTALeistungen.VERAG_OffertenNr = Offertenpositionen.OffertenNr) AND (tblUTAImport.Lieferland = tblUTALeistungen.Lieferland) AND (tblUTAImport.Fakturierwarenart = tblUTALeistungen.Fakturierwarenart)) ON tblUTAFakturierwarenarten.Fakturierwarenart = tblUTALeistungen.Fakturierwarenart
where archiv <> 1
where abgerechnet <> 1
group by Adressen.AdressenNr, Adressen.[Name 1], Adressen.LandKz, Adressen.Ort, Offertenpositionen.OffertenNr, Offertenpositionen.LeistungsNr, Offertenpositionen.LeistungsBez, tblUTAFakturierwarenarten.Warenart,tblUTAImport.Fakturierwarenart ", "FMZOLL")
.LOAD()
'MsgBox(.GET_SQL())
@@ -603,6 +699,89 @@ Public Class frmMDMDatenverarbetiung
End Sub
Sub initDgv_MSE()
With MyDatagridview1
.Columns.Clear()
'Exit Sub
'MsgBox(.sql)
.SET_SQL(" SELECT Adressen.AdressenNr as KundenNr, Adressen.[Name 1] as Name, trans.transaction_country AS Country,trans.device_product_type AS CardType, Sum(trans.transaction_gross_amount) As [Transaktionsbetrag],Sum(trans.USteuer_EUR) As [USt Betrag], Sum(trans.total_gross_amount) As [Gesamtbetrag_Brutto]
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] and inv.customer_number = cust.[customer_id] and trans.transaction_country = inv.country
Left Join adressen ON cust.[customer_id] = Adressen.MSEKundenNr
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.charged <> 1
GROUP BY Adressen.AdressenNr, Adressen.[Name 1], trans.transaction_country, trans.device_product_type", "FMZOLL")
.LOAD()
'MsgBox(.GET_SQL())
If .Columns.Count > 0 Then
'.Columns("AdressenNr").HeaderText = "KdNr"
'.Columns("Name 1").HeaderText = "Kunde"
'.Columns("LandKz").HeaderText = "Land"
'.Columns("Name 1").AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
'.Columns("VERAGLeistungsNr").ReadOnly = False
'.Columns("VERAGKdNr").ReadOnly = False
'For Each r As DataGridViewColumn In .Columns
' If r.Name = "VERAGLeistungsNr" Or r.Name = "VERAGKdNr" Then
' r.ReadOnly = False
' Else
' r.ReadOnly = True
' End If
'Next
'Dim c As New DataGridViewTextBoxColumn
'c.Name = "VERAGKdNr"
'c.HeaderText = "VERAG KdNr"
'c.Width = 100
'.Columns.Insert(1, c)
'c = New DataGridViewTextBoxColumn
'c.Name = "VERAGLeistungsNr"
'c.HeaderText = "VERAG/PLOSE LeistungsNr."
'c.Width = 100
'.Columns.Insert(2, c)
'c = New DataGridViewTextBoxColumn
'c.Name = "KundeOffertenNr"
'c.HeaderText = "Kunde OffertenNr."
'c.Width = 100
'.Columns.Insert(3, c)
'c = New DataGridViewTextBoxColumn
'c.Name = "KundeLeistungsNr"
'c.HeaderText = "Kunde LeistungsNr."
'c.Width = 100
'.Columns.Insert(4, c)
.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.AllCells
End If
Dim sumBto As Double = 0
Dim sumNto As Double = 0
For Each r As DataGridViewRow In .Rows
sumBto += If(IsNumeric(r.Cells("Gesamtbetrag_Brutto").Value), CDbl(r.Cells("Gesamtbetrag_Brutto").Value), 0)
sumNto += If(IsNumeric(r.Cells("Transaktionsbetrag").Value), CDbl(r.Cells("Transaktionsbetrag").Value), 0)
Next
txtAnzahl.Text = .Rows.Count
txtPruefsummeNetto.Text = CDbl(sumNto).ToString("C2")
txtPruefsummeBrutto.Text = CDbl(sumBto).ToString("C2")
.ClearSelection()
End With
End Sub
Sub initDgv_ASFINAG(abgerechnet As Boolean, belegeErstellt As Boolean)
'datum = CDate(SQL.getValueTxtBySql("SELECT Abrechnungsdatum FROM Abrechnungsdatum", "ASFINAG"))
@@ -676,6 +855,7 @@ Public Class frmMDMDatenverarbetiung
cbxTestdaten.Visible = False
pnlAsfinag.Visible = False
Panel4.Visible = False
Panel5.Visible = False
Select Case Me.LIEFERANT
@@ -700,7 +880,10 @@ Public Class frmMDMDatenverarbetiung
MsgBox("Noch nicht verfürbar!")
Case "MSE"
MsgBox("Noch nicht verfürbar!")
Panel5.Visible = True
Dim c As New usrCntlMDMDatenverarbeitungAuswertungen_divers(Me, Me.LIEFERANT)
Panel3.Controls.Add(c)
c.Dock = DockStyle.Fill
End Select
init()
@@ -780,7 +963,7 @@ Public Class frmMDMDatenverarbetiung
INNER JOIN (((Adressen INNER JOIN tblUTAImport ON Adressen.UTAKundenNr = tblUTAImport.Kundennummer)
INNER JOIN Offertenpositionen ON Adressen.AdressenNr = Offertenpositionen.KundenNr)
INNER JOIN tblUTALeistungen ON (tblUTALeistungen.VERAG_LeistungsNr = Offertenpositionen.LeistungsNr) AND (tblUTALeistungen.VERAG_OffertenNr = Offertenpositionen.OffertenNr) AND (tblUTAImport.Lieferland = tblUTALeistungen.Lieferland) AND (tblUTAImport.Fakturierwarenart = tblUTALeistungen.Fakturierwarenart)) ON tblUTAFakturierwarenarten.Fakturierwarenart = tblUTALeistungen.Fakturierwarenart
where archiv <> 1
where abgerechnet <> 1
group by Kundennummer, KundenNr, UTAExportCSV,Rechnungsdruck"
Dim dt_Main As DataTable = SQL.loadDgvBySql_Param(SQLStr, "FMZOLL", 1200)
@@ -842,7 +1025,7 @@ Public Class frmMDMDatenverarbetiung
If verarbOK Then
'UPDATE Fakturiert
SQL.doSQL("UPDATE [tblUTAImport] set archiv=1, archiviertDatum=GETDATE() where Kundennummer = " & UTA("Customer ID"), "FMZOLL")
SQL.doSQL("UPDATE [tblUTAImport] set abgerechnetDatum=GETDATE() where abgerechnetDatum is null and Kundennummer = " & UTA("Customer ID"), "FMZOLL")
End If
@@ -884,6 +1067,135 @@ Public Class frmMDMDatenverarbetiung
Return False
End Function
Function genRGAtt_MSE() As Boolean
Dim top = ""
'top = " TOP 20 "
Dim SQLStr = " SELECT distinct cust.customer_id as [Customer ID], Adressen.AdressenNr AS [Customer Nr], Adressen.MSEExportCSV, Adressen.Rechnungsdruck
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] and inv.customer_number = cust.[customer_id] and trans.transaction_country = inv.country
left join adressen ON cust.[customer_id] = Adressen.MSEKundenNr
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.charged <> 1 and (trans.transaction_gross_amount <> 0 or trans.[msts_fee_amount] <> 0)
order by cust.customer_id"
Dim dt_Main As DataTable = SQL.loadDgvBySql_Param(SQLStr, "FMZOLL", 1200)
If dt_Main Is Nothing OrElse dt_Main.Rows.Count = 0 Then
MsgBox("Keine Daten!")
Return False
End If
Dim cnt = 0
If vbYes = MsgBox("Es wurden Daten von " & dt_Main.Rows.Count & " Kunden gefunden " & vbNewLine & " Möchten Sie die Anhänge erstellen?", vbYesNoCancel) Then
Dim dir = "F:\FMZoll\MSE\Archiv\" & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "Test", "") & Now.ToShortDateString
If Directory.Exists(dir) Then dir &= "_" & Now.ToShortTimeString.Replace(":", "")
Directory.CreateDirectory(dir)
Dim displayView = New DataView(dt_Main, "MSEExportCSV = 1", "Customer ID", DataViewRowState.CurrentRows)
Dim distinctDT_CSV As DataTable = displayView.ToTable(True, "Customer ID", "Customer Nr")
For Each csv As DataRow In distinctDT_CSV.Rows
Dim dt_CSV_selected = SQL.loadDgvBySql_Param("
SELECT controller_id as [Controller ID], 'VERAG 360 GmbH' as [Controller Name] , inv.[invoice_id] as [Invoice ID], inv.invoice_date as [Invoice Date],
cust.customer_id as [Customer ID], cust.partner_customer_number as [Customer No], cust.customer_name as [Customer name], bills.specification_page_name as [Specification Page], bills.specification_page_id as [Specification ID], trans.purchase_datetime as [Transaction date], trans.transaction_id as [Transaction ID],
trans.supplier_name as [Transaction Supplier/Terminal], trans.transaction_country as [Transaction Country], trans.transaction_product_name as [Product description], trans.transaction_product_id as [Product Description ID], trans.device_product_type as [Card Type], trans.device_product_number as [Card number], trans.license_plate_number as [Load File Licence Plate Number],
'' as [Card Licence Plate Number], trans.license_plate_number as [Truck Licence Plate Number], '' as [Truck Fleet Code], '' as [Truck Driver Name], trans.entry_point_name as [Entry Terminal/Direction], trans.entry_datetime as [Start date], trans.entry_datetime as [Start Time], trans.exit_point_name as [Exit Terminal Description], trans.exit_datetime as [End Date], trans.exit_datetime as [End Time],
'' as [Eurovignet K-Number], '' as [LKW-Kostenstelle], trans.original_net_amount as [Original Nett Amount], trans.original_vat_amount as [Original VAT Amount], trans.original_gross_amount as [Original Amount], trans.original_currency as [Original Currency],
trans.transaction_gross_amount as [Transaction Amount ( EUR )], trans.msts_fee_amount as [Admin Fee Amount ( EUR )], '' as [Fees and Costs Amount ( EUR )], trans.msts_vat_amount as [VAT Amount ( EUR )],trans.total_gross_amount as [Total Amount ( EUR )], '' as [Total Dutch VAT ( EUR )], '' as [Total Foreign VAT ( EUR )], trans.[USteuer_EUR] as [USteuer_EUR]
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] and inv.customer_number = cust.[customer_id] and trans.transaction_country = inv.country
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.charged <> 1 and (trans.transaction_gross_amount <> 0 or [msts_fee_amount] <> 0) and cust.[customer_id] = " & csv.Item("Customer ID"), "FMZOLL")
dt_CSV_selected.ParentRelations.Clear()
dt_CSV_selected.ChildRelations.Clear()
dt_CSV_selected.Constraints.Clear()
Dim fn As String = dir & "\" & csv.Item("Customer ID") & "_Maut_MSE.csv"
Dim outFile As System.IO.StreamWriter = My.Computer.FileSystem.OpenTextFileWriter(fn, False)
Dim clmns As String = ""
For i = 0 To dt_CSV_selected.Columns.Count - 1
clmns &= dt_CSV_selected.Columns(i).ColumnName.ToString().Replace(";", ", ") & ";"
Next
outFile.WriteLine(clmns)
For i = 0 To dt_CSV_selected.Rows.Count - 1
clmns = ""
For j = 0 To dt_CSV_selected.Columns.Count - 1
clmns &= dt_CSV_selected.Rows(i)(j).ToString.Replace(";", ", ") & ";"
Next
outFile.WriteLine(clmns)
Next
outFile.Close()
Next
For Each MSE In dt_Main.Rows
Dim SPEDBUCH As VERAG_PROG_ALLGEMEIN.cSpeditionsbuch = Nothing
Dim verarbOK = True
If Not gen_SPEDBUCH_ByKdNr(MSE("Customer Nr"), SPEDBUCH, "MSE") Then verarbOK = False
If Not gen_RECHNUNG_BySPEDBUCH(MSE("Customer Nr"), SPEDBUCH, "MSE") Then verarbOK = False
genMSEAttachmentByKdNr(MSE("Customer Nr"), MSE("Customer ID"), dir, datPloseAnhang.Value)
If verarbOK Then
'Update Fakturiert
SQL.doSQL("UPDATE [tblMSETransactions] Set chargedDatetime = GETDATE()
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.chargedDatetime is null and cust.[customer_id] = " & MSE("Customer ID"), "FMZOLL")
End If
If True Then 'cnt Mod 10 = 0 Then
txtPloseAnh_Einarbeitung.Text = cnt & " / " & dt_Main.Rows.Count
Dim proz As Double = (cnt / dt_Main.Rows.Count) * 100
pbPloseAnh_Proz.Value = proz
lblPloseAnh_Proz.Text = proz.ToString("N2") & " %"
'GroupBox12.Refresh()
My.Application.DoEvents()
End If
cnt += 1
Next
' ANHÄNGE WERDEN NCIHT BENÖTIGT::
'Alle Alangen im foglenden VZ löschen und die aktuellen kopieren
Dim dirAnhang = "F: \FMZoll\MSE\Anlagen\" & IIf(VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM, "Test", "") & Now.ToShortDateString
If Directory.Exists(dirAnhang) Then 'Directory.Delete(dirAnhang, True)
For Each f In Directory.GetFiles(dirAnhang)
File.Delete(f)
Next
End If
If Not Directory.Exists(dirAnhang) Then Directory.CreateDirectory(dirAnhang)
For Each f In Directory.GetFiles(dir)
File.Copy(f, dirAnhang & (New FileInfo(f)).Name)
Next
'IN FMZOLL / DB MautD einfügen --> Mautbericht
'genPLOSEInsertMautD(dat_Sum_Von.Value.ToShortDateString, dat_Sum_Bis.Value.ToShortDateString)
pbPloseAnh_Proz.Value = 100
txtPloseAnh_Einarbeitung.Text = dt_Main.Rows.Count & " / " & dt_Main.Rows.Count
lblPloseAnh_Proz.Text = "100.00 %"
Return True
End If
Return False
End Function
Function genRGAtt_ASFINAG(belegerstellungsdatum As DateTime, abrechnungsdatum As Date, inputKdNr As String) As Boolean
@@ -1245,8 +1557,6 @@ Public Class frmMDMDatenverarbetiung
group by Adressen.AdressenNr, licenceplate,turnoverdate,CardNumber
order by Adressen.AdressenNr"
Dim dtAT As DataTable = SQL.loadDgvBySql_Param(sqlstrAT, "FMZOLL")
@@ -1324,7 +1634,7 @@ Public Class frmMDMDatenverarbetiung
End Function
Function genUTAInsertMautAT(kdNr) As Boolean
Function genUTAInsertMaut(kdNr) As Boolean
Try
pic.Visible = False
Dim displayFilter = False
@@ -1385,7 +1695,7 @@ Public Class frmMDMDatenverarbetiung
Try
'Zeitstempel
Dim SQLQuery = "INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Nett Amount],[VAT Amount],[Total Amount]) VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10) "
Dim SQLQuery = "INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Entry Terminal],[Exit Terminal],[Nett Amount],[VAT Amount],[Total Amount]) VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12) "
' "SELECT * FROM DBParent WHERE P_ID = " & UniqeID & ";"
Using Command As New OleDbCommand(SQLQuery, con)
@@ -1396,9 +1706,100 @@ Public Class frmMDMDatenverarbetiung
Command.Parameters.AddWithValue("@P5", r(4))
Command.Parameters.AddWithValue("@P6", r(5))
Command.Parameters.AddWithValue("@P7", r(6))
Command.Parameters.AddWithValue("@P8", CDbl(r(7)))
Command.Parameters.AddWithValue("@P9", CDbl(r(8)))
Command.Parameters.AddWithValue("@P8", r(7))
Command.Parameters.AddWithValue("@P9", r(8))
Command.Parameters.AddWithValue("@P10", CDbl(r(9)))
Command.Parameters.AddWithValue("@P11", CDbl(r(10)))
Command.Parameters.AddWithValue("@P12", CDbl(r(11)))
Command.ExecuteNonQuery()
Command.Dispose()
End Using
Catch ex2 As System.Exception
MsgBox("err: " & ex2.Message & ex2.StackTrace)
Finally
If reader IsNot Nothing Then reader.Close()
End Try
Next
con.Close()
End If
pic.Visible = True
Return True
Catch ex As System.Exception
MsgBox(ex.Message & ex.StackTrace)
End Try
Return False
End Function
Function genMSEInsertMaut(kdNr) As Boolean
Try
pic.Visible = False
Dim displayFilter = False
Dim sqlstr As String = ""
Dim sqlWhere As String = ""
If kdNr <> "" Then
sqlWhere &= " AND Adressen.AdressenNr=" & kdNr
End If
sqlstr = " Select adressen.AdressenNr As [Customer No],trans.license_plate_number as [Licence Plate Number],cast(trans.[purchase_datetime] as Date) as [Transaction Date], trans.transaction_country As [Transaction Country],trans.device_product_type As [Product description],trans.device_product_number as [Card Number], trans.entry_point_name as [Entry Terminal],trans.exit_point_name as [Exit Terminal], Sum(trans.transaction_gross_amount) As [Nett Amount],Sum(trans.USteuer_EUR) As [VAT Amount], Sum(trans.total_gross_amount) As [Total Amount]
From [VERAG].[dbo].[tblMSESettlements] as bills
inner Join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner Join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner Join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] And inv.customer_number = cust.[customer_id] And trans.transaction_country = inv.country
Left Join adressen ON cust.[customer_id] = Adressen.MSEKundenNr
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.chargedDatetime is null " & sqlWhere &
"GROUP BY Adressen.AdressenNr,trans.license_plate_number,cast(trans.[purchase_datetime] as Date), trans.transaction_country,trans.device_product_type, trans.device_product_number, trans.entry_point_name ,trans.exit_point_name
order by Adressen.AdressenNr "
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
Dim connectionString = ""
If VERAG_PROG_ALLGEMEIN.cAllgemein.TESTSYSTEM Then
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD_Test.accdb"
Else
connectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=\\FMZOLL.verag.ost.dmn\f\FMZoll\MautD.accdb"
End If
Dim con As New OleDbConnection(connectionString)
Dim cmd As New OleDbCommand
Dim var1 As String
Dim adapter As OleDbDataAdapter = New OleDbDataAdapter()
Dim reader As OleDbDataReader = Nothing
If dt IsNot Nothing Then
con.Open()
For Each r In dt.Rows
Try
'Zeitstempel
Dim SQLQuery = "INSERT INTO tblMautbericht (Datenquelle,[Customer No],[Licence Plate Number],[Transaction Date],[Transaction Country],[Product description],[Card Number],[Entry Terminal],[Exit Terminal],[Nett Amount],[VAT Amount],[Total Amount]) VALUES (@P1,@P2,@P3,@P4,@P5,@P6,@P7,@P8,@P9,@P10,@P11,@P12) "
' "SELECT * FROM DBParent WHERE P_ID = " & UniqeID & ";"
Using Command As New OleDbCommand(SQLQuery, con)
Command.Parameters.AddWithValue("@P1", r(0))
Command.Parameters.AddWithValue("@P2", r(1))
Command.Parameters.AddWithValue("@P3", r(2))
Command.Parameters.AddWithValue("@P4", r(3))
Command.Parameters.AddWithValue("@P5", r(4))
Command.Parameters.AddWithValue("@P6", r(5))
Command.Parameters.AddWithValue("@P7", r(6))
Command.Parameters.AddWithValue("@P8", r(7))
Command.Parameters.AddWithValue("@P9", r(8))
Command.Parameters.AddWithValue("@P10", CDbl(r(9)))
Command.Parameters.AddWithValue("@P11", CDbl(r(10)))
Command.Parameters.AddWithValue("@P12", CDbl(r(11)))
Command.ExecuteNonQuery()
Command.Dispose()
@@ -1806,6 +2207,193 @@ Public Class frmMDMDatenverarbetiung
End Function
Function genMSEAttachmentByKdNr(KdNr As String, MSEKdNr As String, dir As String, bis As Date)
Try
Dim displayFilter = False
Dim sqlstr As String = ""
sqlstr &= "Select cust.customer_id as [Customer ID], cust.partner_customer_number as [Customer No], cust.customer_name as [Customer name],
trans.supplier_name as [Transaction Supplier/Terminal], trans.transaction_country as [Transaction Country], trans.transaction_product_name as [Product description], trans.purchase_datetime as [Transaction date],trans.device_product_type as [Card Type], trans.device_product_number as [Card number], trans.license_plate_number as [LicencePlateNumber],
trans.entry_point_name as [Entry Terminal/Direction], trans.entry_datetime as [Start date], trans.entry_datetime as [Start Time], trans.exit_point_name as [Exit Terminal Description], trans.exit_datetime as [End Date], trans.exit_datetime as [End Time],
trans.original_net_amount as [Original Nett Amount], trans.original_vat_amount as [Original VAT Amount], trans.original_gross_amount as [Original Amount], trans.original_currency as [Original Currency],
trans.transaction_gross_amount as [Transaction Amount ( EUR )], trans.msts_fee_amount as [Admin Fee Amount ( EUR )], '' as [Fees and Costs Amount ( EUR )], trans.msts_vat_amount as [VAT Amount ( EUR )],trans.total_gross_amount as [Total Amount ( EUR )], '' as [Total Dutch VAT ( EUR )], '' as [Total Foreign VAT ( EUR )], trans.[USteuer_EUR] as [USteuer_EUR]
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] and inv.customer_number = cust.[customer_id] and trans.transaction_country = inv.country
where bills.invoice_date = '" & DateTimePicker2.Text & "' and (trans.transaction_gross_amount <> 0 or [msts_fee_amount] <> 0) and cust.[customer_id] = " & MSEKdNr
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
If dt Is DBNull.Value Then Return ""
If dt.Rows.Count = 0 Then Return ""
Dim rpt As New rptPLOSE_Anhang
rpt.DataSource = dt
rpt.txtKunde.Text = KdNr & " " & New VERAG_PROG_ALLGEMEIN.cAdressen(KdNr).FullName
rpt.lblRgDatum.Text = datPloseAnhang.Value.ToShortDateString
rpt.GroupHeaderKz.DataField = "LicencePlateNumber" 'Gruppierung
rpt.txtNettoKzSum.Visible = False
rpt.txtNettoGesSum.Visible = False
rpt.txtNetto.Visible = False
rpt.txtNettoKatSum.Visible = False
rpt.lblNetto.Visible = False
rpt.txtMWSTKzSum.Visible = False
rpt.txtMWSTGEsSum.Visible = False
rpt.txtMWST.Visible = False
rpt.txtMWSTKatSum.Visible = False
rpt.lblMWST.Visible = False
rpt.lblBrutto.Text = "Total Amount ( EUR )"
rpt.Label4.Text = bis.ToShortDateString
rpt.Label2.Text = "MSE-KundenNr:"
rpt.TextBox1.Text = MSEKdNr
rpt.Label1.Text = " MSE Fleet Management Service"
rpt.lblSummeKennzeichen.Visible = False
rpt.lblService.Visible = False
'rpt.lblSummeKennzeichen.Location = New PointF(rpt.lblSummeKennzeichen.Location.X + 4.5, rpt.lblSummeKennzeichen.Location.Y)
'rpt.lblSumKategorie.Location = New PointF(rpt.lblSumKategorie.Location.X + 4.5, rpt.lblSumKategorie.Location.Y)
'rpt.lblGessumme.Location = New PointF(rpt.lblGessumme.Location.X + 4.5, rpt.lblGessumme.Location.Y)
Dim sumNetto As Double = 0
Dim sumMWST As Double = 0
Dim sumBrutto As Double = 0
Dim sumNettoKat As Double = 0
Dim sumMWSTKat As Double = 0
Dim sumBruttoKat As Double = 0
Dim sumNettoGes As Double = 0
Dim sumMWSTGes As Double = 0
Dim sumBruttoGes As Double = 0
Dim cntKat = 0
Dim cnt = 0
rpt.GroupFooterKat.Visible = False
AddHandler rpt.Detail.Format, Sub()
' If cnt = 0 Then
rpt.txtKunde.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Customer ID").Value, "")
rpt.txtKunde.Text &= " " & SQL.isDbnullEmpty(rpt.Fields.Item("Customer name").Value, "")
' End If
' rpt.txtProduktBeschreibung.Text = sql.isDbnullEmpty(rpt.Fields.Item("BC_DESCR").Value, "")
Select Case "DE"
Case "DE" : rpt.txtProdukt.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Product description").Value, "") 'sql.isDbnullEmpty(rpt.Fields.Item("plose_ProduktCode").Value, "") & " - " & sql.isDbnullEmpty(rpt.Fields.Item("plose_Produktbeschreibung").Value, "")
Case "IT" : rpt.txtProdukt.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Product description").Value, "") 'sql.isDbnullEmpty(rpt.Fields.Item("plose_ProduktCode").Value, "") & " - " & sql.isDbnullEmpty(rpt.Fields.Item("plose_Produktbeschreibung").Value, "")
Case Else : rpt.txtProdukt.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Product description").Value, "") 'sql.isDbnullEmpty(rpt.Fields.Item("plose_ProduktCode").Value, "") & " - " & sql.isDbnullEmpty(rpt.Fields.Item("plose_Produktbeschreibung").Value, "")
End Select
rpt.txtKartennummer.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Card number").Value, "")
rpt.txtEingang.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Entry Terminal/Direction").Value, "")
rpt.txtAusgang.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Exit Terminal Description").Value, "")
rpt.txtLand.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Transaction Country").Value, "")
rpt.txtDatum.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Transaction Date").Value, "")
rpt.txtEingang.Text = SQL.isDbnullEmpty(rpt.Fields.Item("Card Type").Value, "")
rpt.txtNetto.Text = "" 'SQL.isDbnullEmptyDbl(rpt.Fields.Item("plose_NettobetragWaehrungAbbuchung").Value, 2, "")
rpt.txtMWST.Text = "" 'SQL.isDbnullEmptyDbl(rpt.Fields.Item("plose_MWSTBetragWaehrungAbbuchung").Value, 2, "")
rpt.txtBrutto.Text = SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaction Amount ( EUR )").Value, 2, "")
sumNetto += 0 'SQL.isDbnullEmptyDbl(rpt.Fields.Item("plose_NettobetragWaehrungAbbuchung").Value, 4, 0)
sumMWST += 0 'SQL.isDbnullEmptyDbl(rpt.Fields.Item("plose_MWSTBetragWaehrungAbbuchung").Value, 4, 0)
sumBrutto += SQL.isDbnullEmptyDbl(rpt.Fields.Item("Transaction Amount ( EUR )").Value, 4, 0)
cnt += 1
End Sub
AddHandler rpt.GroupHeaderKz.Format, Sub()
rpt.txtKennzeichen.Text = SQL.isDbnullEmpty(rpt.Fields.Item("LicencePlateNumber").Value, "")
If rpt.txtKennzeichen.Text = "" Then rpt.lblKennzeichen.Visible = False
End Sub
AddHandler rpt.GroupHeaderKat.Format, Sub()
rpt.lblKategorie.Text = "MAUT REPORT"
End Sub
AddHandler rpt.GroupFooterKz.Format, Sub()
rpt.txtNettoKzSum.Text = sumNetto.ToString("N2")
rpt.txtMWSTKzSum.Text = sumMWST.ToString("N2")
rpt.txtBruttoKzSum.Text = sumBrutto.ToString("N2")
sumNettoGes += sumNetto
sumMWSTGes += sumMWST
sumBruttoGes += sumBrutto
sumNetto = 0
sumMWST = 0
sumBrutto = 0
rpt.lblSummeKennzeichen.Text = rpt.lblSummeKennzeichen.Text.Replace("Kennzeichen", SQL.isDbnullEmpty(rpt.Fields.Item("LicencePlateNumber").Value, ""))
End Sub
AddHandler rpt.GroupFooterKat.Format, Sub()
sumNettoKat += sumNetto
sumMWSTKat += sumMWST
sumBruttoKat += sumBrutto
sumNetto = 0
sumMWST = 0
sumBrutto = 0
rpt.txtNettoKatSum.Text = sumNettoKat.ToString("N2")
rpt.txtMWSTKatSum.Text = sumMWSTKat.ToString("N2")
rpt.txtBruttoKatSum.Text = sumBruttoKat.ToString("N2")
cntKat += 1
End Sub
AddHandler rpt.ReportFooter1.Format, Sub()
'sumNettoGes += sumNettoKat
'sumMWSTGes += sumMWSTKat
'sumBruttoGes += sumBruttoKat
sumNettoKat = 0
sumMWSTKat = 0
sumBruttoKat = 0
sumNetto = 0
sumMWST = 0
sumBrutto = 0
rpt.txtNettoGesSum.Text = sumNettoGes.ToString("N2")
rpt.txtMWSTGEsSum.Text = sumMWSTGes.ToString("N2")
rpt.txtBruttoGesSum.Text = sumBruttoGes.ToString("N2")
'If cntKat <= 1 Then
' rpt.GroupFooterKat.Visible = False
'End If
End Sub
'print.Viewer.LoadDocument(rpt)
'print.Viewer.ViewType = GrapeCity.Viewer.Common.Model.ViewType.Continuous
'print.Show()
Dim tmpPath = dir & "\" & KdNr & "_Maut_MSE.pdf"
Dim p As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport
rpt.Run(False)
p.NeverEmbedFonts = ""
p.Export(rpt.Document, tmpPath)
rpt.Dispose()
Return tmpPath
Catch ex As System.Exception
MsgBox(ex.Message & ex.StackTrace)
End Try
Return ""
End Function
Function genASFINAGAttachmentByKdNr(KdNr As Integer, dt As DataTable, tmpPath As String)
Try
@@ -2332,7 +2920,7 @@ Public Class frmMDMDatenverarbetiung
useNettogesamtbetrag = True
sqlstr = "SELECT '135' as LeistungsNr, 'MAUT AT lt. Auslage' as ProductCode, sum([netAmount]) as Netto ,sum([VATamount]) as Vatamount ,sum([totalAmount]) as Brutto FROM Kreditkarten INNER JOIN tblAsfinagMaut ON Kreditkarten.KartenNr = tblAsfinagMaut.cardnumber Where Kreditkarten.AdressenNr= '" & KD.KundenNr & "' and tblAsfinagMaut.VATamount <> 0 group by Kreditkarten.AdressenNr
UNION
SELECT '153' as LeistungsNr, 'MAUT AT lt. Auslage' as ProductCode, sum([netAmount]) as Netto ,sum([VATamount]) as Vatamount ,sum([totalAmount]) as Brutto FROM Kreditkarten INNER JOIN tblAsfinagMaut ON Kreditkarten.KartenNr = tblAsfinagMaut.cardnumber Where Kreditkarten.AdressenNr= '" & KD.KundenNr & "' and tblAsfinagMaut.VATamount = 0 group by Kreditkarten.AdressenNr"
SELECT '153' as LeistungsNr, 'MAUT AT lt. Auslage' as ProductCode, sum([netAmount]) as Netto ,sum([VATamount]) as Vatamount ,sum([totalAmount]) as Brutto FROM Kreditkarten INNER JOIN tblAsfinagMaut ON Kreditkarten.KartenNr = tblAsfinagMaut.cardnumber Where Kreditkarten.AdressenNr= '" & KD.KundenNr & "' and tblAsfinagMaut.VATamount = 0 group by Kreditkarten.AdressenNr"
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
@@ -2379,7 +2967,68 @@ Public Class frmMDMDatenverarbetiung
Case "MSE"
'noch nicht implementiert!
' Case 23 'MSE Maut
'5070 Select Case ![LeistungsNr]
' Case 134 'Frejus - Tunnelmaut (20.01.2011)
'5080 Set rst = OpenParameterQuery("qryReErfSchOpt6BeträgeLNr134", eOpensnapshot, "prmAdressenNr:=" & rstRK![RechnungsKundenNr])
'5090 If Not rst.EOF Then
'5100 ![Anzahl] = 1
'5110 ![Preis] = rst![SummevonTransaction Amount ( EUR )] + rst![SummevonFees And Costs Amount ( EUR )]
'5120 If Not IsNull(![BGebLeistungsNr]) Then
'5130 ![BGebBgl] = ![Preis] - rst![SummevonUSteuer_EUR]
'5140 End If
'5150 End If
'5160 rst.Close
'5170 Set rst = Nothing
'5180 Case 141 'MSC Ressa - alle Länder
'5190 Set rst = OpenParameterQuery("qryReErfSchOpt6BeträgeLNr141", eOpensnapshot, "prmAdressenNr:=" & rstRK![RechnungsKundenNr])
'5200 If Not rst.EOF Then
'5210 ![Anzahl] = 1
'5220 ![Preis] = rst![SummevonTransaction Amount ( EUR )] + rst![SummevonFees And Costs Amount ( EUR )]
'5230 If Not IsNull(![BGebLeistungsNr]) Then
'5240 ![BGebBgl] = ![Preis] - rst![SummevonUSteuer_EUR]
'5250 End If
'5260 End If
'5270 rst.Close
'5280 Set rst = Nothing
'5290 Case Else 'alle anderen MSE Transactions
'5300 Set rst = OpenParameterQuery("qryReErfSchOpt6Beträge", eOpensnapshot, "prmAdressenNr:=" & rstRK![RechnungsKundenNr], "prmLeistungsNr:=" & ![LeistungsNr])
'5310 If Not rst.EOF Then
'5320 ![Anzahl] = 1
'5330 ![Preis] = rst![SummevonTransaction Amount ( EUR )] + rst![SummevonFees And Costs Amount ( EUR )]
'5340 If Not IsNull(![BGebLeistungsNr]) Then
'5350 ![BGebBgl] = ![Preis] - rst![SummevonUSteuer_EUR]
'5360 End If
'5370 End If
'5380 rst.Close
'5390 Set rst = Nothing
'5400 End Select
useNettogesamtbetrag = False
sqlstr = "select cust.[customer_id], trans.device_product_type, Offertenpositionen.LeistungsNr , sum(trans.total_gross_amount) as Brutto, sum(trans.total_gross_amount) - sum(trans.USteuer_EUR) as Netto
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
INNER JOIN tblMSELeistungen ON (tblMSELeistungen.[Card Type] = trans.device_product_type) AND (tblMSELeistungen.[Transaction Country] = trans.transaction_country)
INNER JOIN Offertenpositionen ON cust.partner_customer_number = Offertenpositionen.KundenNr and tblMSELeistungen.LeistungsNr = Offertenpositionen.LeistungsNr and Offertenpositionen.OffertenNr = " & OffertenNr & "
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.charged = 0 and cust.[partner_customer_number] = " & KdNr & "
group by cust.[customer_id], trans.device_product_type, Offertenpositionen.LeistungsNr , Offertenpositionen.LeistungsBez"
Dim dt As DataTable = SQL.loadDgvBySql_Param(sqlstr, "FMZOLL")
For Each r In dt.Rows
Dim NettoBetrag As Double = r("Netto")
Dim BruttoBetrag As Double = r("Brutto")
Dim LeistungsNr As Integer = r("LeistungsNr")
Dim OFFERTE As New VERAG_PROG_ALLGEMEIN.cOfferte(KdNr, OffertenNr, True)
allPos(RG, OFFERTE, LeistungsNr, NettoBetrag, BruttoBetrag)
Next
End Select
@@ -2425,7 +3074,6 @@ Public Class frmMDMDatenverarbetiung
'End If
Dim POS As New VERAG_PROG_ALLGEMEIN.cRechnungsausgangPositionen()
Dim LEISTUNG As New VERAG_PROG_ALLGEMEIN.cLeistungen(o.LeistungsNr)
POS.LeistungsNr = o.LeistungsNr
@@ -2543,7 +3191,7 @@ Public Class frmMDMDatenverarbetiung
End Function
Private Sub dat_Sum_Von_ValueChanged(sender As Object, e As EventArgs) Handles dat_Sum_Von.ValueChanged, dat_Sum_Bis.ValueChanged
Private Sub dat_Sum_Von_ValueChanged(sender As Object, e As EventArgs) Handles dat_Sum_Von.ValueChanged, dat_Sum_Bis.ValueChanged, DateTimePicker2.ValueChanged
init()
End Sub
@@ -2746,6 +3394,70 @@ Public Class frmMDMDatenverarbetiung
End Try
End Function
Function pruefData_MSE() As Boolean
pruefData_MSE = True
Try
Dim dtMSEKundennummern As DataTable = SQL.loadDgvBySql(" SELECT cust.customer_id, cust.customer_name, Adressen.AdressenNr, (SELECT Offerten.OffertenNr FROM Offerten WHERE (((Offerten.KundenNr)=isnull(Adressen.[AdressenNr],0)) AND ((Offerten.OffertenNr)=23))) AS Offerte_23
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] and inv.customer_number = cust.[customer_id] and trans.transaction_country = inv.country
left join adressen ON cust.[customer_id] = Adressen.MSEKundenNr
GROUP BY cust.customer_id, cust.customer_name, Adressen.AdressenNr
HAVING (((cust.customer_id) Is Not Null) AND ((Adressen.AdressenNr) Is Null)) OR (((cust.customer_id) Is Not Null) AND ((Adressen.AdressenNr) Is Not Null) AND (((SELECT Offerten.OffertenNr FROM Offerten WHERE (((Offerten.KundenNr)=isnull(Adressen.[AdressenNr],0)) AND ((Offerten.OffertenNr)=23)))) Is Null));
", "FMZOLL")
If dtMSEKundennummern.Rows.Count > 0 Then
pruefData_MSE = False
'If dtMSEKundennummern.Rows.Count = 1 AndAlso dtMSEKundennummern.Rows(0).Item("Kundennummer").Value = "868070" Then pruefData_MSE = True 'ist VERAG -> OK
End If
Dim dtLeistungsnummern As DataTable = SQL.loadDgvBySql(" SELECT trans.device_product_type, trans.transaction_country,trans.transaction_product_name, trans.transaction_product_id, cust.[customer_id], trans.partner_haulier_id, cust.customer_name,
Sum(trans.transaction_gross_amount) AS [Summe Transaction Amount ( EUR )],
Sum(trans.msts_fee_amount) AS [Summe Admin Fee Amount ( EUR )],
Sum(trans.msts_fee_amount) AS [Summe Fees and Costs Amount ( EUR )],
Sum(trans.msts_vat_amount) AS [Summe VAT Amount ( EUR )],
Sum(trans.transaction_gross_amount) AS [Summe Total Amount ( EUR )]
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
inner join [VERAG].[dbo].[tblMSEInvoices] as inv on inv.[invoice_id] = bills.[invoice_number] and inv.customer_number = cust.[customer_id] and trans.transaction_country = inv.country
LEFT JOIN tblMSELeistungen ON trans.device_product_type = tblMSELeistungen.[Card Type] AND trans.transaction_country = tblMSELeistungen.[Transaction Country]
WHERE ((trans.transaction_gross_amount <> 0) AND tblMSELeistungen.LeistungsNr Is Null)
GROUP BY trans.device_product_type, trans.transaction_country,trans.transaction_product_name, trans.transaction_product_id, cust.[customer_id], trans.partner_haulier_id, cust.customer_name;", "FMZOLL")
If dtLeistungsnummern.Rows.Count > 0 Then
pruefData_MSE = False
End If
Dim fehlendeTransactionen As Integer = 0
fehlendeTransactionen = CInt((New SQL).getValueTxtBySql("select count(*) FROM [VERAG].[dbo].[tblMSESettlements] where [invoice_date] = '" & DateTimePicker2.Text & "' AND [transaction_id] not in (select [transaction_id] from [VERAG].[dbo].[tblMSETransactions]) ", "AVISO"))
If fehlendeTransactionen > 0 Then
pruefData_MSE = False
MsgBox("Es fehlen " & fehlendeTransactionen & " Transaktionen in der Datenbank!" & vbNewLine & "Diese Transaktionen (von Rechnung " & DateTimePicker2.Text & ") müssen nachgeladen werden (bitte an Administrator wenden).")
End If
Catch ex As Exception
MsgBox(ex.Message & ex.StackTrace)
pruefData_MSE = False
End Try
End Function
Function pruefData_PLOSE_old() As Boolean
pruefData_PLOSE_old = True
Try
@@ -2847,25 +3559,47 @@ Public Class frmMDMDatenverarbetiung
Select Case LIEFERANT
Case "PLOSE" : deleteMautD("PLOSE") : Return genPLOSEInsertMautD(dat_Sum_Von.Value.ToShortDateString, dat_Sum_Bis.Value.ToShortDateString)
Case "ASFINAG" : deleteMautD("AT") : Return genASFINAGInsertMautAT(kdNr)
Case "UTA" : deleteMautD("UTA") : Return genUTAInsertMautAT(kdNr)
Case "MSE" : deleteMautD("MSE") 'Return genUTAInsertMautAT(kdNr)
Case "UTA" : deleteMautD("UTA") : Return genUTAInsertMaut(kdNr)
Case "MSE" : deleteMautD("MSE") : Return genMSEInsertMaut(kdNr)
End Select
Return False
End Function
Sub setFakturiertPLOSE()
Sub setFakturiert(Lieferant As String)
PictureBox1.Visible = False
If SQL.doSQL("UPDATE tblPLOSE_Details SET plose_Fakturiert=1 WHERE plose_Fakturiert = 0 AND plose_DatumTransaktion between '" & dat_Sum_Von.Value.ToShortDateString & "' and '" & dat_Sum_Bis.Value.ToShortDateString & "' ", "FMZOLL") Then
PictureBox1.Visible = True
End If
Select Case Lieferant
Case "PLOSE"
If SQL.doSQL("UPDATE tblPLOSE_Details SET plose_Fakturiert=1 WHERE plose_Fakturiert = 0 AND plose_DatumTransaktion between '" & dat_Sum_Von.Value.ToShortDateString & "' and '" & dat_Sum_Bis.Value.ToShortDateString & "' ", "FMZOLL") Then
PictureBox1.Visible = True
End If
Case "UTA"
If SQL.doSQL("UPDATE [tblUTAImport] set abgerechnet=1 where abgerechnetDatum is not null and abgerechnet <> 1", "FMZOLL") Then
PictureBox1.Visible = True
End If
Case "MSE"
If SQL.doSQL("UPDATE [tblMSETransactions] Set charged = 1
FROM [VERAG].[dbo].[tblMSESettlements] as bills
inner join [VERAG].[dbo].[tblMSETransactions] as trans on bills.[transaction_id] = trans.[transaction_id]
inner join [VERAG].[dbo].[tblMSECustomers] as cust on cust.partner_customer_number = trans.partner_haulier_id
where bills.invoice_date = '" & DateTimePicker2.Text & "' and trans.chargedDatetime is not null and charged <> 1 ") Then
PictureBox1.Visible = True
End If
Case Else
MsgBox("Funktion setFaktiuriert für den Lieferant " & Lieferant & " nicht definiert!")
End Select
End Sub
Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
If vbYes = MsgBox("Möchten Sie den Vorgang wirklich manuell ausgeführen (wird bei Rechnungserstellung automatisch ausgeführt)", vbYesNoCancel) Then
Select Case LIEFERANT
Case "PLOSE" : setFakturiertPLOSE()
Case "PLOSE" : setFakturiert(LIEFERANT)
Case "UTA" : setFakturiert(LIEFERANT)
Case "MSE" : setFakturiert(LIEFERANT)
Case "ASFINAG" : setFakturiert_ASFINAG()
End Select
End If
@@ -3000,7 +3734,7 @@ Public Class frmMDMDatenverarbetiung
cbxASFINAGAbgerechnet.Checked = True
cbxASFINAGAbgerechnet.Checked = True
'initDgv_ASFINAG(Not cbxASFINAGNichtAbgerechnet.Checked)
End If