diff --git a/SDL/Fakturierung/cFakturierung.vb b/SDL/Fakturierung/cFakturierung.vb
index 617ef24d..77d47fdf 100644
--- a/SDL/Fakturierung/cFakturierung.vb
+++ b/SDL/Fakturierung/cFakturierung.vb
@@ -1644,7 +1644,11 @@ Public Class cFakturierung
Mail.HTMLBody &= "
Best regards
" & getSignature(RECHNUNG)
End Select
Mail.HTMLBody = "
" & Mail.HTMLBody & "
"
- 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()
diff --git a/SDL/Fakturierung/frmAbrechnungsMaske.vb b/SDL/Fakturierung/frmAbrechnungsMaske.vb
index c5dc2db9..5965adc0 100644
--- a/SDL/Fakturierung/frmAbrechnungsMaske.vb
+++ b/SDL/Fakturierung/frmAbrechnungsMaske.vb
@@ -522,7 +522,13 @@ Public Class frmAbrechnungsMaske
End Select
Mail.HTMLBody = "" & Mail.HTMLBody & "
"
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()
diff --git a/SDL/Fakturierung/frmFaktEmail.vb b/SDL/Fakturierung/frmFaktEmail.vb
index c35a450f..b33066b3 100644
--- a/SDL/Fakturierung/frmFaktEmail.vb
+++ b/SDL/Fakturierung/frmFaktEmail.vb
@@ -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()
diff --git a/SDL/Fakturierung/frmFaktSammelRgDrucken.vb b/SDL/Fakturierung/frmFaktSammelRgDrucken.vb
index 551be32d..86ed9321 100644
--- a/SDL/Fakturierung/frmFaktSammelRgDrucken.vb
+++ b/SDL/Fakturierung/frmFaktSammelRgDrucken.vb
@@ -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,
anbei erhalten Sie Ihre Sammel-Rechnung."
Mail.Attachments.Add(pdf, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue)
Mail.Display()
diff --git a/SDL/Fakturierung/usrCntlFaktAbrechnung.vb b/SDL/Fakturierung/usrCntlFaktAbrechnung.vb
index 3b2efa31..f7855093 100644
--- a/SDL/Fakturierung/usrCntlFaktAbrechnung.vb
+++ b/SDL/Fakturierung/usrCntlFaktAbrechnung.vb
@@ -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
diff --git a/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVerzollungsunterlagen_BAR.vb b/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVerzollungsunterlagen_BAR.vb
index 8415196d..a336336c 100644
--- a/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVerzollungsunterlagen_BAR.vb
+++ b/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVerzollungsunterlagen_BAR.vb
@@ -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
diff --git a/SDL/UsrCntlEssensbestellungen.Designer.vb b/SDL/UsrCntlEssensbestellungen.Designer.vb
index e13fd6eb..245ebbde 100644
--- a/SDL/UsrCntlEssensbestellungen.Designer.vb
+++ b/SDL/UsrCntlEssensbestellungen.Designer.vb
@@ -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
diff --git a/SDL/UsrCntlEssensbestellungen.vb b/SDL/UsrCntlEssensbestellungen.vb
index a0866451..74277ff9 100644
--- a/SDL/UsrCntlEssensbestellungen.vb
+++ b/SDL/UsrCntlEssensbestellungen.vb
@@ -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
diff --git a/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/cDakosyInterface_Send.vb b/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/cDakosyInterface_Send.vb
index 289753ff..286ac7a4 100644
--- a/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/cDakosyInterface_Send.vb
+++ b/SDL/ZOLLSYSTEM/DAKOSY/ATLAS/cDakosyInterface_Send.vb
@@ -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
diff --git a/SDL/buchhaltung/frmBU_Mahnlauf.vb b/SDL/buchhaltung/frmBU_Mahnlauf.vb
index 81051c11..3cbc75ad 100644
--- a/SDL/buchhaltung/frmBU_Mahnlauf.vb
+++ b/SDL/buchhaltung/frmBU_Mahnlauf.vb
@@ -487,10 +487,9 @@ Public Class frmBU_Mahnlauf
to which future reminders should be sent.
In the meantime, we ask you to forward them to the responsible persons in your company."
Mail_HTMLBody &= "
" & 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,
im Anhang finden Sie ihre Mahnung, mit der Bitte um Bearbeitung. "
Mail_HTMLBody &= "
"
@@ -500,6 +499,7 @@ Public Class frmBU_Mahnlauf
Mail_HTMLBody &= "
Mit freundlichen Grüßen
" & cFakturierung.getSignature(AD.LandKz, FIRMA.Firma_ID)
Case Else
+
Mail_Subject = "PAYMENT REMINDER" & IIf(KdNr > 0, " - Cust.: " & KdNr, "")
Mail_HTMLBody = "Dear Sear or Madam,
attached we send you the invoice reminder."
Mail_HTMLBody &= "
"
@@ -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
diff --git a/SDL/frmEssensbestellungenAdministration.vb b/SDL/frmEssensbestellungenAdministration.vb
index e319dad7..4fdcc90f 100644
--- a/SDL/frmEssensbestellungenAdministration.vb
+++ b/SDL/frmEssensbestellungenAdministration.vb
@@ -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
diff --git a/SDL/kunden/usrCntlKundenBesonderheiten.vb b/SDL/kunden/usrCntlKundenBesonderheiten.vb
index ada9f52e..90a2e723 100644
--- a/SDL/kunden/usrCntlKundenBesonderheiten.vb
+++ b/SDL/kunden/usrCntlKundenBesonderheiten.vb
@@ -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()
diff --git a/SDL/kunden/usrCntlKundenuebersicht.vb b/SDL/kunden/usrCntlKundenuebersicht.vb
index 65ec5ce0..ac6e2885 100644
--- a/SDL/kunden/usrCntlKundenuebersicht.vb
+++ b/SDL/kunden/usrCntlKundenuebersicht.vb
@@ -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
diff --git a/SDL/mdm/frmMDMDatenverarbetiung.Designer.vb b/SDL/mdm/frmMDMDatenverarbetiung.Designer.vb
index 0542e296..3055b1ce 100644
--- a/SDL/mdm/frmMDMDatenverarbetiung.Designer.vb
+++ b/SDL/mdm/frmMDMDatenverarbetiung.Designer.vb
@@ -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
diff --git a/SDL/mdm/frmMDMDatenverarbetiung.vb b/SDL/mdm/frmMDMDatenverarbetiung.vb
index e6a65710..b6eb0d2e 100644
--- a/SDL/mdm/frmMDMDatenverarbetiung.vb
+++ b/SDL/mdm/frmMDMDatenverarbetiung.vb
@@ -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
diff --git a/VERAG_PROG_ALLGEMEIN/Classes/cMessenger.vb b/VERAG_PROG_ALLGEMEIN/Classes/cMessenger.vb
index 4661aa3f..a19af3c3 100644
--- a/VERAG_PROG_ALLGEMEIN/Classes/cMessenger.vb
+++ b/VERAG_PROG_ALLGEMEIN/Classes/cMessenger.vb
@@ -56,11 +56,11 @@ Public Class cMessenger
Public Shared Function GET_NewMSG_COUNT_ART(maId, chat_art) As Integer
If maId < 0 Then maId = VERAG_PROG_ALLGEMEIN.cAllgemein.USRID
- Return SQL.getValueTxtBySql("SELECT isnull(COUNT(*),0) FROM tblMessenger_ChatMessages INNER JOIN tblMessenger_Chat on chat_id=chatMg_chatId INNER JOIN tblMessenger_ChatMessageStatus ON chatMgSt_chatMsgId=chatMg_id WHERE chatMgSt_MaId=" & maId & " AND chatMgSt_gelesen=0 AND chat_art='" & chat_art & "'", "ADMIN",,, 0)
+ Return SQL.getValueTxtBySql("SELECT isnull(COUNT(*),0) FROM tblMessenger_ChatMessages INNER JOIN tblMessenger_Chat on chat_id=chatMg_chatId INNER JOIN tblMessenger_ChatMessageStatus ON chatMgSt_chatMsgId=chatMg_id WHERE chatMgSt_MaId=" & maId & " AND chatMgSt_gelesen=0 AND chat_art='" & chat_art & "' AND (SELECT COUNT(*) FROM tblMessenger_ChatMembers WHERE chatMB_chatId=chat_id AND chatMB_maId=" & maId & ")>0", "ADMIN",,, 0)
End Function
Public Shared Function GET_NewMSG_COUNT_ART_INAKTIV(maId, chat_art) As Integer
If maId < 0 Then maId = VERAG_PROG_ALLGEMEIN.cAllgemein.USRID
- Return SQL.getValueTxtBySql("SELECT isnull(COUNT(*),0) FROM tblMessenger_ChatMessages INNER JOIN tblMessenger_Chat on chat_id=chatMg_chatId INNER JOIN tblMessenger_ChatMessageStatus ON chatMgSt_chatMsgId=chatMg_id WHERE chatMgSt_MaId=" & maId & " AND chatMgSt_gelesen=0 AND chat_aktiv=0 AND chat_art='" & chat_art & "'", "ADMIN",,, 0)
+ Return SQL.getValueTxtBySql("SELECT isnull(COUNT(*),0) FROM tblMessenger_ChatMessages INNER JOIN tblMessenger_Chat on chat_id=chatMg_chatId INNER JOIN tblMessenger_ChatMessageStatus ON chatMgSt_chatMsgId=chatMg_id WHERE chatMgSt_MaId=" & maId & " AND chatMgSt_gelesen=0 AND chat_aktiv=0 AND chat_art='" & chat_art & "' AND (SELECT COUNT(*) FROM tblMessenger_ChatMembers WHERE chatMB_chatId=chat_id AND chatMB_maId=" & maId & ")>0", "ADMIN",,, 0)
End Function
Public Shared Function GET_NewMSG_COUNT_AVISOID(AvisoId As Integer) As Integer
diff --git a/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb b/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb
index 1d0d06da..66034b25 100644
--- a/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb
+++ b/VERAG_PROG_ALLGEMEIN/DATENSERVER/cDATENSERVER.vb
@@ -1428,11 +1428,16 @@ Public Class cFormularManager
If doc IsNot Nothing Then
doc.PageSettings.Size = Spire.Pdf.PdfPageSize.A4
- doc.SaveToFile(targetPath)
+ If targetPath.EndsWith(".pdf") Then
+ doc.SaveToFile(targetPath)
+ Else
+ doc.SaveToFile(targetPath & "\" & filename)
+ End If
+
If openFileAfterDownload Then
+ End If
End If
- End If
End Using
End Using
diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb
index b8121586..620a9003 100644
--- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb
+++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/MSE/cMSEAPI.vb
@@ -1,4 +1,6 @@
-Imports System.Net
+Imports System.Data.SqlClient
+Imports System.Net
+Imports System.Reflection
Public Class cMSEAPI
@@ -7,6 +9,7 @@ Public Class cMSEAPI
Dim rest As New Chilkat.Rest
Dim SQL As New SQL
Dim apiSettingsloaded As Boolean = False
+ Dim test As Boolean = False
Sub New(program As String)
@@ -32,6 +35,7 @@ Public Class cMSEAPI
' Now build the JWT claims (also known as the payload)
Dim claims As New Chilkat.JsonObject
+ If API.Rows.Count = 0 Then Return "keine gültigen Zugangsdaten gefunden!"
success = claims.AppendString("iss", API.Rows(0).Item("api_user"))
Dim curDateTime As Integer = jwt.GenNumericDate(0)
@@ -52,13 +56,15 @@ Public Class cMSEAPI
End Function
- Public Function getNewestTransactions(jwt As String, dt As DataTable) As String
+ Public Function getNewestTransactions(jwt As String, dt As DataTable, ByRef batchNr As Integer, ByRef totalPages As Integer, ByRef currentPage As Integer) As String
Try
Dim returnText As String = ""
Dim failureText As String = ""
Dim success As Boolean
+ rest.DebugMode = test
+
rest.VerboseLogging = True
Dim bTls As Boolean = True
Dim port As Integer = 443
@@ -82,22 +88,25 @@ Public Class cMSEAPI
rest.AddHeader("X-API-Key", jwt)
- rest.IdleTimeoutMs = 500000
+ rest.IdleTimeoutMs = 1000000
Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/transactions/new")
If (rest.LastMethodSuccess <> True) Then
Debug.WriteLine(rest.LastErrorText)
rest.IdleTimeoutMs = 30000 'defualt
- Return "rest.LastErrorText"
+ Return rest.LastErrorText
End If
- If (rest.ResponseStatusCode <> 200) Then
+ If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
Debug.WriteLine(rest.ResponseHeader)
- Return "rest.LastErrorText"
+ Return rest.LastErrorText
End If
Debug.WriteLine(responseJson)
+ If test Then
+ responseJson = "{""sender"":""MSTS"",""receiver"":""10738"",""datetime"":""2024-06-28 10:56:39"",""code"":""OK"",""message"":""OK"",""batch_seq_nr"":""2"",""customer_currency"":""EUR"",""total_pages"":100,""total_count"":99998,""total_amount"":291133.02,""page_nr"":1,""page_count"":999,""page_amount"":26238.88,""transactions"":[{""transaction_id"":1001723285,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-20 14:02:34"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-20 14:02:34"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723286,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-26 05:34:49"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-26 05:34:49"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723289,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-03 09:57:14"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-03 09:57:14"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723290,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-04 14:47:25"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-04 14:47:25"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""}]}"
+ End If
Dim json As New Chilkat.JsonObject
success = json.Load(responseJson)
@@ -107,78 +116,789 @@ Public Class cMSEAPI
Debug.WriteLine(json)
+ batchNr = json.StringOf("batch_seq_nr")
+ totalPages = json.IntOf("total_pages")
+ currentPage = json.IntOf("page_nr")
- Dim jsonArray As New Chilkat.JsonArray
- success = jsonArray.Load(responseJson)
- If (success <> True) Then
- Return jsonArray.LastErrorText
+ If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
+
+ Dim transactions As New Chilkat.JsonArray
+ transactions = json.ArrayOf("transactions")
+ If (json.LastMethodSuccess = False) Then
+ Debug.WriteLine("transactions member not found.")
End If
- Dim num As Integer = jsonArray.Size
+ Dim num As Integer = transactions.Size
If num = -1 Then
- Return "FEHLER"
+ Return "FEHLER im TransaktionArray"
+ End If
+
+ If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"))
+
+
+ Catch ex As WebException
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+
+ End Function
+
+ Public Function getCustomers(jwt As String, dt As DataTable) As String
+ Try
+ Dim returnText As String = ""
+ Dim failureText As String = ""
+
+ Dim success As Boolean
+
+ rest.DebugMode = test
+
+ rest.VerboseLogging = True
+ Dim bTls As Boolean = True
+ Dim port As Integer = 443
+ Dim bAutoReconnect As Boolean = True
+ success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
+ If (success <> True) Then
+ Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ If (success <> True) Then
+ Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ rest.ClearAllQueryParams()
+
+ rest.AddHeader("X-API-Key", jwt)
+
+ rest.IdleTimeoutMs = 1000000
+
+ Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/customers")
+ If (rest.LastMethodSuccess <> True) Then
+ Debug.WriteLine(rest.LastErrorText)
+ rest.IdleTimeoutMs = 30000 'defualt
+ Return rest.LastErrorText
+ End If
+
+ If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
+ Debug.WriteLine(rest.ResponseHeader)
+ Return rest.LastErrorText
+ End If
+
+ Debug.WriteLine(responseJson)
+
+ If test Then
+ responseJson = "[{""customer_id"":13579,""partner_customer_number"":""203102"",""customer_name"":""NEGRO GROUP SRL"",""vat_number"":""RO17587350""},{""customer_id"":13566,""partner_customer_number"":""203104"",""customer_name"":""DANEMA SPECIAL TRANSPORT S.R.L."",""vat_number"":""RO27454467""},{""customer_id"":10746,""coc_number"":""11111"",""partner_customer_number"":""401386"",""customer_name"":""Teoma Transport"",""vat_number"":""SR100427963""},{""customer_id"":27765,""partner_customer_number"":""402810"",""customer_name"":""EMS TRANSPORTI DOO"",""vat_number"":""BA219169270003""}]"
+ End If
+
+ Dim customers As New Chilkat.JsonArray
+ success = customers.Load(responseJson)
+ If (success <> True) Then
+ Return customers.LastErrorText
+
+ End If
+
+ Dim num As Integer = customers.Size
+ If num = -1 Then
+ Return "FEHLER im Customer Array"
+ End If
+
+ saveCustomers(num, dt, customers)
+
+
+ Catch ex As WebException
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+
+ End Function
+
+ Public Function getTransactionsFromToDate(jwt As String, dt As DataTable, start_date As Date, end_date As Date, ByRef batchNr As Integer, ByRef totalPages As Integer, ByRef currentPage As Integer) As String
+ Try
+ Dim returnText As String = ""
+ Dim failureText As String = ""
+
+ Dim success As Boolean
+
+ rest.DebugMode = test
+
+ rest.VerboseLogging = True
+ Dim bTls As Boolean = True
+ Dim port As Integer = 443
+ Dim bAutoReconnect As Boolean = True
+ success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
+ If (success <> True) Then
+ Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ If (success <> True) Then
+ Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ rest.ClearAllQueryParams()
+ rest.AddHeader("X-API-Key", jwt)
+ rest.AddQueryParam("start_date", start_date.ToString("yyyy-MM-dd"))
+ rest.AddQueryParam("end_date", end_date.ToString("yyyy-MM-dd"))
+
+ rest.IdleTimeoutMs = 1000000
+
+ Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/transactions")
+ If (rest.LastMethodSuccess <> True) Then
+ Debug.WriteLine(rest.LastErrorText)
+ rest.IdleTimeoutMs = 30000 'defualt
+ Return rest.LastErrorText
+ End If
+
+ If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
+ Debug.WriteLine(rest.ResponseHeader)
+ Return rest.LastErrorText
+ End If
+
+ Debug.WriteLine(responseJson)
+
+ If test Then
+ responseJson = "{""sender"":""MSTS"",""receiver"":""10738"",""datetime"":""2024-06-28 10:56:39"",""code"":""OK"",""message"":""OK"",""batch_seq_nr"":""2"",""customer_currency"":""EUR"",""total_pages"":100,""total_count"":99998,""total_amount"":291133.02,""page_nr"":1,""page_count"":999,""page_amount"":26238.88,""transactions"":[{""transaction_id"":1001723285,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-07-20 14:02:34"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-10 14:02:34"",""exit_point_name"":null,""exit_datetime"":""2024-04-11 14:02:34"",""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":-2549.2400000000002,""original_gross_amount"":-2549.2400000000002,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723286,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-26 05:34:49"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-26 05:34:49"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723289,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-03 09:57:14"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-03 09:57:14"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723290,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-04 14:47:25"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-04 14:47:25"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""}]}"
+ End If
+
+ Dim json As New Chilkat.JsonObject
+ success = json.Load(responseJson)
+ If (success <> True) Then
+ Debug.WriteLine(json.LastErrorText)
+ End If
+
+ Debug.WriteLine(json)
+
+ If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
+
+ batchNr = json.StringOf("batch_seq_nr")
+ totalPages = json.IntOf("total_pages")
+ currentPage = json.IntOf("page_nr")
+
+
+ Dim transactions As New Chilkat.JsonArray
+ transactions = json.ArrayOf("transactions")
+ If (json.LastMethodSuccess = False) Then
+ Debug.WriteLine("transactions member not found.")
+ End If
+
+
+ Dim num As Integer = transactions.Size
+ If num = -1 Then
+ Return "FEHLER Array Transaktions ist leer"
+ End If
+
+
+ If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"))
+
+
+ Catch ex As WebException
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+
+ End Function
+
+ Public Function getTransactionsFromTransactionID(jwt As String, dt As DataTable, ByRef transactionID As DataTable) As String
+ Try
+ Dim returnText As String = ""
+ Dim failureText As String = ""
+
+ Dim success As Boolean
+
+ rest.DebugMode = test
+
+ rest.VerboseLogging = True
+ Dim bTls As Boolean = True
+ Dim port As Integer = 443
+ Dim bAutoReconnect As Boolean = True
+ success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
+ If (success <> True) Then
+ Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ If (success <> True) Then
+ Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ rest.ClearAllQueryParams()
+ rest.AddHeader("X-API-Key", jwt)
+
+
+ rest.IdleTimeoutMs = 1000000
+
+
+
+ 'transactionID.Columns.Add("transaction_id", GetType(String))
+
+
+ If transactionID IsNot Nothing And transactionID.Columns.Contains("transaction_id") And transactionID.Rows.Count > 0 Then
+ For Each row As DataRow In transactionID.Rows
+
+
+ Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/transactions/" & row("transaction_id"))
+ If (rest.LastMethodSuccess <> True) Then
+ Debug.WriteLine(rest.LastErrorText)
+ rest.IdleTimeoutMs = 30000 'defualt
+ Return rest.LastErrorText
+ End If
+
+ If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
+ Debug.WriteLine(rest.ResponseHeader)
+ Return rest.LastErrorText
+ End If
+
+ Debug.WriteLine(responseJson)
+
+ If test Then
+ responseJson = "{""sender"":""MSTS"",""receiver"":""10738"",""datetime"":""2024-06-28 10:56:39"",""code"":""OK"",""message"":""OK"",""batch_seq_nr"":""2"",""customer_currency"":""EUR"",""total_pages"":100,""total_count"":99998,""total_amount"":291133.02,""page_nr"":1,""page_count"":999,""page_amount"":26238.88,""transactions"":[{""transaction_id"":1001723285,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-07-20 14:02:34"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-10 14:02:34"",""exit_point_name"":null,""exit_datetime"":""2024-04-11 14:02:34"",""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":-2549.2400000000002,""original_gross_amount"":-2549.2400000000002,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723286,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-26 05:34:49"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-26 05:34:49"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723289,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-03 09:57:14"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-03 09:57:14"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723290,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-04 14:47:25"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-04 14:47:25"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""}]}"
+ End If
+
+ Dim json As New Chilkat.JsonObject
+ success = json.Load(responseJson)
+ If (success <> True) Then
+ Debug.WriteLine(json.LastErrorText)
+ End If
+
+ Debug.WriteLine(json)
+
+ If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
+
+ Dim transactions As New Chilkat.JsonArray
+ transactions = json.ArrayOf("transactions")
+ If (json.LastMethodSuccess = False) Then
+ Debug.WriteLine("transactions member not found.")
+ End If
+
+
+ Dim num As Integer = transactions.Size
+ If num = -1 Then
+ Return "FEHLER Array Transaktions ist leer"
+ End If
+
+
+ 'If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"))
+ saveTransactions(num, dt, transactions, json.StringOf("receiver"), True) ' wenn ID explizit aufgerufen keine Prüfung auf receivcer und purchaseDate
+
+
+ Next row
+
+
+ End If
+
+
+
+
+
+ Catch ex As WebException
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+
+ End Function
+
+
+ Public Function getTransactionsFromBatchNrAndPage(jwt As String, dt As DataTable, ByRef batchNr As Integer, ByRef totalPages As Integer, ByRef currentPage As Integer) As String
+ Try
+ Dim returnText As String = ""
+ Dim failureText As String = ""
+
+ Dim success As Boolean
+
+
+ rest.DebugMode = test
+
+ rest.VerboseLogging = True
+ Dim bTls As Boolean = True
+ Dim port As Integer = 443
+ Dim bAutoReconnect As Boolean = True
+ success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
+ If (success <> True) Then
+ Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ Return rest.LastErrorText
+
+ End If
+
+ If (success <> True) Then
+ Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ Return rest.LastErrorText
+
+ End If
+
+ rest.ClearAllQueryParams()
+ rest.AddHeader("X-API-Key", jwt)
+ rest.AddQueryParam("batch_seq_nr", batchNr)
+ If currentPage > 0 Then rest.AddQueryParam("page_nr", currentPage)
+
+ rest.IdleTimeoutMs = 1000000
+
+ Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/transactions")
+ If (rest.LastMethodSuccess <> True) Then
+ Debug.WriteLine(rest.LastErrorText)
+ rest.IdleTimeoutMs = 30000 'defualt
+ Return rest.LastErrorText
+ End If
+
+ If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
+ Debug.WriteLine(rest.ResponseHeader)
+ Return rest.LastErrorText
+ End If
+
+ Debug.WriteLine(responseJson)
+
+ If test Then
+ responseJson = "{""sender"":""MSTS"",""receiver"":""10738"",""datetime"":""2024-06-28 10:56:39"",""code"":""OK"",""message"":""OK"",""batch_seq_nr"":""2"",""customer_currency"":""EUR"",""total_pages"":100,""total_count"":99998,""total_amount"":291133.02,""page_nr"":1,""page_count"":999,""page_amount"":26238.88,""transactions"":[{""transaction_id"":1001723285,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-20 14:02:34"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-20 14:02:34"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723286,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-26 05:34:49"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-26 05:34:49"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723289,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-03 09:57:14"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-03 09:57:14"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723290,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-04 14:47:25"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-04 14:47:25"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""}]}"
+ End If
+
+ Dim json As New Chilkat.JsonObject
+ success = json.Load(responseJson)
+ If (success <> True) Then
+ Debug.WriteLine(json.LastErrorText)
+ Return json.LastErrorText
+ End If
+
+ Debug.WriteLine(json)
+
+ If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
+
+ batchNr = json.StringOf("batch_seq_nr")
+ totalPages = json.IntOf("total_pages")
+ currentPage = json.IntOf("page_nr")
+
+
+ Dim transactions As New Chilkat.JsonArray
+ transactions = json.ArrayOf("transactions")
+ If (json.LastMethodSuccess = False) Then
+ Return "transactions member not found."
+ End If
+
+
+ Dim num As Integer = transactions.Size
+ If num < 1 Then
+ Return "FEHLER Array Transaktions ist leer"
+ End If
+
+ If json.StringOf("receiver") = "10738" Then saveTransactions(num, dt, transactions, json.StringOf("receiver"))
+
+
+ Catch ex As WebException
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+
+ End Function
+
+
+ Public Function getSettlementsFromInvoiceID(jwt As String, dt As DataTable, invoiceID As String, ByRef batchNr As Integer, ByRef totalPages As Integer, ByRef currentPage As Integer) As String
+ Try
+ Dim returnText As String = ""
+ Dim failureText As String = ""
+
+ Dim success As Boolean
+
+ rest.DebugMode = test
+
+ rest.VerboseLogging = True
+ Dim bTls As Boolean = True
+ Dim port As Integer = 443
+ Dim bAutoReconnect As Boolean = True
+ success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
+ If (success <> True) Then
+ Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ Return rest.LastErrorText
+
+ End If
+
+ If (success <> True) Then
+ Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ Return rest.LastErrorText
+
+ End If
+
+ rest.ClearAllQueryParams()
+
+
+ rest.AddQueryParam("invoice_id", invoiceID)
+
+ rest.AddHeader("X-API-Key", jwt)
+
+ rest.IdleTimeoutMs = 1000000
+
+
+ Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/settlements")
+ If (rest.LastMethodSuccess <> True) Then
+ Debug.WriteLine(rest.LastErrorText)
+ rest.IdleTimeoutMs = 30000 'defualt
+ Return rest.LastErrorText
+ End If
+
+ If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
+ Debug.WriteLine(rest.ResponseHeader)
+ Return rest.LastErrorText
+ End If
+
+ Debug.WriteLine(responseJson)
+
+ If test Then
+ responseJson = "{""sender"":""MSTS"",""receiver"":""10738"",""datetime"":""2024-07-25 14:17:45"",""code"":""OK"",""message"":""OK"",""customer_currency"":""EUR"",""total_pages"":1,""total_count"":56351,""total_amount"":164386.34,""page_nr"":1,""page_count"":56351,""page_amount"":164386.34,""settlements"":[{""transaction_id"":1001723285,""purchase_datetime"":""2024-06-25 21:29:16"",""partner_haulier_id"":""401058"",""transaction_net_amount"":9.08,""transaction_gross_amount"":10.9,""msts_fee_amount"":0.11,""msts_vat_amount"":0,""total_gross_amount"":11.01,""invoice_number"":""1753066"",""invoice_date"":""2024-07-15"",""specification_page_id"":197,""specification_page_name"":""French toll roads - TISPL"",""transaction_debit_or_credit"":""Debit"",""original_transaction_id"":null,""original_invoice_number"":null,""original_invoice_date"":null,""credit_comment"":null,""batch_seq_nr"":""1""},{""transaction_id"":1001723286,""purchase_datetime"":""2024-06-26 11:17:48"",""partner_haulier_id"":""401267"",""transaction_net_amount"":10.42,""transaction_gross_amount"":12.5,""msts_fee_amount"":0.13,""msts_vat_amount"":0,""total_gross_amount"":12.63,""invoice_number"":""1753066"",""invoice_date"":""2024-07-15"",""specification_page_id"":197,""specification_page_name"":""French toll roads - TISPL"",""transaction_debit_or_credit"":""Debit"",""original_transaction_id"":null,""original_invoice_number"":null,""original_invoice_date"":null,""credit_comment"":null,""batch_seq_nr"":""1""}]}"
+ End If
+
+ Dim json As New Chilkat.JsonObject
+ success = json.Load(responseJson)
+ If (success <> True) Then
+ Return json.LastErrorText
+ End If
+
+ Debug.WriteLine(json)
+
+ If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
+
+ batchNr = json.StringOf("batch_seq_nr")
+ totalPages = json.IntOf("total_pages")
+ currentPage = json.IntOf("page_nr")
+
+
+ Dim transactions As New Chilkat.JsonArray
+ transactions = json.ArrayOf("settlements")
+ If (json.LastMethodSuccess = False) Then
+ Return "transactions member not found."
+ End If
+
+
+
+ Dim num As Integer = transactions.Size
+ If num = -1 Then
+ Return "FEHLER Array Transaktions ist leer"
+ End If
+
+
+ If json.StringOf("receiver") = "10738" Then saveSettlements(num, dt, transactions, json.StringOf("receiver"))
+
+ Catch ex As WebException
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+
+ End Function
+
+
+ Public Function getSettlementsFromBatchNrAndPage(jwt As String, dt As DataTable, ByRef batchNr As Integer, ByRef totalPages As Integer, ByRef currentPage As Integer) As String
+ Try
+ Dim returnText As String = ""
+ Dim failureText As String = ""
+
+ Dim success As Boolean
+
+
+ rest.DebugMode = test
+
+ rest.VerboseLogging = True
+ Dim bTls As Boolean = True
+ Dim port As Integer = 443
+ Dim bAutoReconnect As Boolean = True
+ success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
+ If (success <> True) Then
+ Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ If (success <> True) Then
+ Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ rest.ClearAllQueryParams()
+ rest.AddHeader("X-API-Key", jwt)
+ rest.AddQueryParam("batch_seq_nr", batchNr)
+ If currentPage > 0 Then rest.AddQueryParam("page_nr", currentPage)
+
+ rest.IdleTimeoutMs = 1000000
+
+ Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/settlements")
+ If (rest.LastMethodSuccess <> True) Then
+ Debug.WriteLine(rest.LastErrorText)
+ rest.IdleTimeoutMs = 30000 'defualt
+ Return rest.LastErrorText
+ End If
+
+ If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
+ Debug.WriteLine(rest.ResponseHeader)
+ Return rest.LastErrorText
+ End If
+
+ Debug.WriteLine(responseJson)
+
+ If test Then
+ responseJson = "{""sender"":""MSTS"",""receiver"":""23771"",""datetime"":""2024-06-28 10:56:39"",""code"":""OK"",""message"":""OK"",""batch_seq_nr"":""2"",""customer_currency"":""EUR"",""total_pages"":100,""total_count"":99998,""total_amount"":291133.02,""page_nr"":1,""page_count"":999,""page_amount"":26238.88,""transactions"":[{""transaction_id"":1001723285,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-20 14:02:34"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-20 14:02:34"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723286,""partner_haulier_id"":""401052"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-26 05:34:49"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-26 05:34:49"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005108291"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""BG1000FG"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723289,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-03 09:57:14"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-03 09:57:14"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""},{""transaction_id"":1001723290,""partner_haulier_id"":""401370"",""supplier_name"":""TUNNEL ALPIN DU FREJUS"",""transaction_country"":""FR"",""transaction_domain"":""Frejus tunnel"",""purchase_datetime"":""2024-04-04 14:47:25"",""entry_point_name"":""FREJUS TUNNEL"",""entry_datetime"":""2024-04-04 14:47:25"",""exit_point_name"":null,""exit_datetime"":null,""device_product_type"":""Frejus"",""device_product_number"":""3081184009005114273"",""transaction_product_id"":140,""transaction_product_name"":""Toll "",""license_plate_number"":""RU042IS"",""vehicle_country"":""RS"",""original_currency"":""EUR"",""original_net_amount"":258.38,""original_gross_amount"":310.05,""original_vat_percentage"":20,""transaction_net_amount"":258.38,""transaction_gross_amount"":310.05,""exempt_amount"":0,""msts_fee_amount"":4.65,""msts_vat_amount"":0,""msts_vat_percentage"":0,""total_gross_amount"":314.7,""transaction_status"":""Billed"",""original_transaction_id"":null,""credit_comment"":null,""loading_date"":""2024-05-14"",""batch_seq_nr"":""2""}]}"
+ End If
+
+ Dim json As New Chilkat.JsonObject
+ success = json.Load(responseJson)
+ If (success <> True) Then
+ Debug.WriteLine(json.LastErrorText)
+ End If
+
+ Debug.WriteLine(json)
+
+ If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
+
+ batchNr = json.StringOf("batch_seq_nr")
+ totalPages = json.IntOf("total_pages")
+ currentPage = json.IntOf("page_nr")
+
+
+ Dim transactions As New Chilkat.JsonArray
+ transactions = json.ArrayOf("transactions")
+ If (json.LastMethodSuccess = False) Then
+ Debug.WriteLine("transactions member not found.")
+ End If
+
+
+ Dim num As Integer = transactions.Size
+ If num = -1 Then
+ Return "FEHLER Array Transaktions ist leer"
+ End If
+
+ If json.StringOf("receiver") = "10738" Then saveSettlements(num, dt, transactions, json.StringOf("receiver"))
+
+
+ Catch ex As WebException
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+
+ End Function
+
+
+ Public Function checkNullStr(ByVal o As Object) As String
+ If o IsNot Nothing AndAlso o IsNot DBNull.Value AndAlso Not o = "null" Then Return CStr(o)
+ Return ""
+ End Function
+ Public Function checkNullInteger(ByVal o As Object) As Integer
+ If o IsNot Nothing AndAlso o IsNot DBNull.Value Then
+ If IsNumeric(o) Then
+ Return CInt(o)
+ Else
+ Return -1
+ End If
+ Else
+ Return -1
+ End If
+
+ End Function
+ Public Function checkNullReturnValue(ByVal o As Object, ByVal returnValue As Object) As Object
+ If o IsNot Nothing And o IsNot DBNull.Value And Not o = "null" Then Return (o)
+ Return returnValue
+ End Function
+
+ Public Function checkNullIntegerZero(ByVal o As Object) As Integer
+ If o IsNot Nothing And o IsNot DBNull.Value And Not o = "null" Then Return CInt(o)
+ Return 0
+ End Function
+ Public Function checkNulDbl(ByVal o As Object) As Double
+ If o IsNot Nothing And o IsNot DBNull.Value Then
+ If IsNumeric(o) Then
+ Return Math.Round(CDbl(o), 2)
+ Else
+ Return -1
+ End If
+ Else
+ Return -1
+ End If
+ End Function
+
+ Public Function checkNullBool(ByVal o As Object) As Boolean
+ If o Is Nothing Or o Is DBNull.Value Or o = "null" Then Return 0
+ Try
+ Return CBool(o)
+ Catch ex As Exception
+ End Try
+ Return 0
+ End Function
+
+ Public Function checkNullDateNothing(ByVal o As Object) As Object
+ If o Is DBNull.Value Or Not IsDate(o) Then
+ Return Nothing
+ Else
+ Return CDate(o)
+ End If
+ End Function
+ Public Function getInvoices(jwt As String, dt As DataTable, startDate As Date, end_date As Date) As String
+ Try
+ Dim returnText As String = ""
+ Dim failureText As String = ""
+
+ Dim success As Boolean
+
+ rest.DebugMode = test
+
+ rest.VerboseLogging = True
+ Dim bTls As Boolean = True
+ Dim port As Integer = 443
+ Dim bAutoReconnect As Boolean = True
+ success = rest.Connect(API_STRING, port, bTls, bAutoReconnect)
+ If (success <> True) Then
+ Debug.WriteLine("ConnectFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ If (success <> True) Then
+ Debug.WriteLine("BAFailReason: " & rest.ConnectFailReason)
+ Debug.WriteLine(rest.LastErrorText)
+ failureText = rest.LastErrorText
+ Return False
+ End If
+
+ rest.ClearAllQueryParams()
+
+
+ rest.AddQueryParam("start_date", startDate.ToString("yyyy-MM-dd"))
+ rest.AddQueryParam("end_date", end_date.ToString("yyyy-MM-dd"))
+
+ rest.AddHeader("X-API-Key", jwt)
+
+ rest.IdleTimeoutMs = 1000000
+
+ Dim responseJson As String = rest.FullRequestNoBody("GET", "/v1/invoices")
+ If (rest.LastMethodSuccess <> True) Then
+ Debug.WriteLine(rest.LastErrorText)
+ rest.IdleTimeoutMs = 30000 'defualt
+ Return rest.LastErrorText
+ End If
+
+ If (rest.ResponseStatusCode <> IIf(rest.DebugMode = True, 201, 200) And rest.ResponseStatusCode <> 404) Then
+ Debug.WriteLine(rest.ResponseHeader)
+ Return rest.LastErrorText
+ End If
+
+ Debug.WriteLine(responseJson)
+
+ If test Then
+ responseJson = "{""sender"":""MSTS"",""receiver"":""10738"",""datetime"":""2024-07-24 11:07:08"",""code"":""OK"",""message"":""OK"",""pdf_invoices"":[{""name"":""20240715_11024_ES_VAT.pdf"",""url"":"""",""total_amount_euro"":-2549.2400000000004,""total_vat_amount_euro"":-2549.2400000000002,""msts_vat_number"":""N0034998E"",""invoice_id"":1753066,""invoice_date"":""2024-07-15""},{""name"":""20240715_11024_FR_VAT.pdf"",""url"":"""",""total_amount_euro"":326.90000000000006,""total_vat_amount_euro"":54.49,""msts_vat_number"":""FR39491257770"",""invoice_id"":1753066,""invoice_date"":""2024-07-15""},{""name"":""20240715_11070_FR_VAT.pdf"",""url"":"""",""total_amount_euro"":0.00,""total_vat_amount_euro"":0.00,""msts_vat_number"":""FR39491257770"",""invoice_id"":1753066,""invoice_date"":""2024-07-15""}]}"
+ End If
+
+
+ Dim json As New Chilkat.JsonObject
+ success = json.Load(responseJson)
+ If (success <> True) Then
+ Debug.WriteLine(json.LastErrorText)
+ End If
+
+ If json.StringOf("message") <> "" AndAlso json.StringOf("message") <> "OK" Then Return json.StringOf("message")
+
+ Debug.WriteLine(json)
+
+
+ Dim invoices As New Chilkat.JsonArray
+ invoices = json.ArrayOf("pdf_invoices")
+ If (json.LastMethodSuccess = False) Then
+ Debug.WriteLine("pdf_invoices member not found.")
+ End If
+
+
+ Dim num As Integer = invoices.Size
+ If num = -1 Then
+ Return "FEHLER Array Invoices ist leer"
End If
Dim j As Integer = 0
- If dt IsNot Nothing And Not dt.Columns.Contains("transaction_id") Then
-
- dt.Columns.Add("transaction_id", GetType(String))
- dt.Columns.Add("partner_haulier_id", GetType(Integer))
- dt.Columns.Add("supplier_name", GetType(String))
- dt.Columns.Add("transaction_country", GetType(String))
- dt.Columns.Add("transaction_domain", GetType(String))
-
- dt.Columns.Add("purchase_datetime", GetType(DateTime))
- dt.Columns.Add("entry_point_name", GetType(String))
- dt.Columns.Add("entry_datetime", GetType(DateTime))
- dt.Columns.Add("exit_point_name", GetType(String))
- dt.Columns.Add("exit_datetime", GetType(DateTime))
-
- dt.Columns.Add("device_product_type", GetType(String))
- dt.Columns.Add("device_product_number", GetType(String))
- dt.Columns.Add("transaction_product_id", GetType(Integer))
- dt.Columns.Add("transaction_product_name", GetType(String))
- dt.Columns.Add("license_plate_number", GetType(String))
-
- dt.Columns.Add("vehicle_country", GetType(Integer))
- dt.Columns.Add("original_currency", GetType(String))
- dt.Columns.Add("original_net_amount", GetType(String))
- dt.Columns.Add("original_gross_amount", GetType(String))
- dt.Columns.Add("original_vat_percentage", GetType(Boolean))
-
- dt.Columns.Add("transaction_net_amount", GetType(Integer))
- dt.Columns.Add("transaction_gross_amount", GetType(String))
- dt.Columns.Add("exempt_amount", GetType(String))
- dt.Columns.Add("msts_fee_amount", GetType(String))
- dt.Columns.Add("msts_vat_amount", GetType(Boolean))
-
- dt.Columns.Add("msts_vat_percentage", GetType(Integer))
- dt.Columns.Add("total_gross_amount", GetType(String))
- dt.Columns.Add("transaction_status", GetType(String))
- dt.Columns.Add("original_transaction_id", GetType(String))
- dt.Columns.Add("credit_comment", GetType(Boolean))
- dt.Columns.Add("loading_date", GetType(Date))
- dt.Columns.Add("batch_seq_nr", GetType(Integer))
+ If dt IsNot Nothing And Not dt.Columns.Contains("name") Then
+ dt.Columns.Add("name", GetType(String))
+ dt.Columns.Add("url", GetType(String))
+ dt.Columns.Add("total_amount_euro", GetType(Double))
+ dt.Columns.Add("total_vat_amount_euro", GetType(Double))
+ dt.Columns.Add("msts_vat_number", GetType(String))
+ dt.Columns.Add("invoice_id", GetType(String))
+ dt.Columns.Add("invoice_date", GetType(String))
While j < num
- Dim transaction As Chilkat.JsonObject = jsonArray.ObjectAt(j)
+ Dim invoice As Chilkat.JsonObject = invoices.ObjectAt(j)
Dim R As DataRow = dt.NewRow
- 'R("id") = groups.IntOf("id")
- 'R("name") = groups.StringOf("name")
- 'R("groupType") = groups.StringOf("groupType")
- 'R("info") = groups.StringOf("info")
+ R("name") = checkNullStr(invoice.StringOf("name"))
+ R("url") = checkNullStr(invoice.StringOf("url"))
+ R("total_amount_euro") = CDbl(IIf(invoice.StringOf("total_amount_euro") = "null", "0", invoice.StringOf("total_amount_euro").Replace(".", ",")))
+ R("total_vat_amount_euro") = CDbl(IIf(invoice.StringOf("total_vat_amount_euro") = "null", "0", invoice.StringOf("total_vat_amount_euro").Replace(".", ",")))
+ R("msts_vat_number") = checkNullStr(invoice.StringOf("msts_vat_number"))
+ R("invoice_id") = checkNullInteger(invoice.StringOf("invoice_id"))
+ R("invoice_date") = checkNullStr(invoice.StringOf("invoice_date"))
+ Dim invoice_date_string As String = invoice.StringOf("invoice_date")
+
+ Try
+ If invoice_date_string <> "" AndAlso invoice_date_string <> "null" Then R("invoice_date") = CDate(invoice_date_string)
+
+ Catch ex As Exception
+ 'VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
dt.Rows.Add(R)
+
+ If R("total_amount_euro") <> 0 And R("total_vat_amount_euro") <> 0 Then
+ Dim inv As New cMSEInvoices()
+ Dim nameString = checkNullStr(R("name"))
+ inv.name = nameString
+ inv.total_amount_euro = Math.Round(R("total_amount_euro"), 2)
+ inv.total_vat_amount_euro = Math.Round(R("total_vat_amount_euro"), 2)
+ inv.msts_vat_number = checkNullStr(R("msts_vat_number"))
+ inv.invoice_id = checkNullInteger(R("invoice_id"))
+ inv.invoice_date = checkNullDateNothing(R("invoice_date"))
+
+ If nameString.Length > 13 AndAlso nameString.Contains("_") Then
+ inv.customer_number = nameString.Substring(nameString.IndexOf("_") + 1, 5)
+ End If
+
+ If nameString.Length > 16 AndAlso nameString.Contains("_") Then
+ Dim indexOfFirst_ = nameString.IndexOf("_")
+ If nameString.Length > indexOfFirst_ + 2 Then
+ Dim countryString = nameString.Substring(nameString.IndexOf("_", indexOfFirst_ + 1) + 1, 2)
+ inv.country = countryString
+ End If
+
+ End If
+
+ inv.SAVE()
+ End If
+
+
+
j = j + 1
End While
+ For Each r As DataRow In dt.Rows
+
+ '\\fmzoll\f\FMZoll\MSE\TESTRECHNUNGEN
+ '\\datenarchiv\Datenarchiv\MDM_SCHNITTSTELLEN\ECHTSYSTEM\Nachrichtendaten_ZIEL\MSE
+
+ If r("url") <> "" AndAlso r("name") <> "" AndAlso r("name").contains("VAT") Then 'only VAT-Invoices
+ VERAG_PROG_ALLGEMEIN.cFormularManager.getPDFViaSpirePDF_FromURLStream(r("url"), r("name"), "\\fmzoll\f\FMZoll\MSE\TESTRECHNUNGEN", False)
+ End If
+
+ Next
+
dt = dt.DefaultView.ToTable()
End If
@@ -192,4 +912,857 @@ Public Class cMSEAPI
End Function
+
+
+ Public Sub saveTransactions(num As Integer, dt As DataTable, transactions As Chilkat.JsonArray, receiver As Integer, Optional ignorePurchaseDate As Boolean = False)
+
+ Dim j As Integer = 0
+
+ If dt IsNot Nothing And Not dt.Columns.Contains("transaction_id") Then
+
+ dt.Columns.Add("transaction_id", GetType(String))
+ dt.Columns.Add("partner_haulier_id", GetType(Integer))
+ dt.Columns.Add("supplier_name", GetType(String))
+ dt.Columns.Add("transaction_country", GetType(String))
+ dt.Columns.Add("transaction_domain", GetType(String))
+ dt.Columns.Add("purchase_datetime", GetType(DateTime))
+ dt.Columns.Add("entry_point_name", GetType(String))
+ dt.Columns.Add("entry_datetime", GetType(DateTime))
+ dt.Columns.Add("exit_point_name", GetType(String))
+ dt.Columns.Add("exit_datetime", GetType(DateTime))
+ dt.Columns.Add("device_product_type", GetType(String))
+ dt.Columns.Add("device_product_number", GetType(String))
+ dt.Columns.Add("transaction_product_id", GetType(Integer))
+ dt.Columns.Add("transaction_product_name", GetType(String))
+ dt.Columns.Add("license_plate_number", GetType(String))
+ dt.Columns.Add("vehicle_country", GetType(String))
+ dt.Columns.Add("original_currency", GetType(String))
+ dt.Columns.Add("original_net_amount", GetType(Double))
+ dt.Columns.Add("original_gross_amount", GetType(Double))
+ dt.Columns.Add("original_vat_amount", GetType(Double))
+ dt.Columns.Add("original_vat_percentage", GetType(Double))
+ dt.Columns.Add("customer_currency", GetType(String))
+ dt.Columns.Add("transaction_net_amount", GetType(Double))
+ dt.Columns.Add("transaction_gross_amount", GetType(Double))
+ dt.Columns.Add("exempt_amount", GetType(Double))
+ dt.Columns.Add("msts_fee_amount", GetType(Double))
+ dt.Columns.Add("msts_vat_amount", GetType(Double))
+ dt.Columns.Add("msts_vat_percentage", GetType(Double))
+ dt.Columns.Add("total_gross_amount", GetType(Double))
+ dt.Columns.Add("transaction_status", GetType(String))
+ dt.Columns.Add("original_transaction_id", GetType(String))
+ dt.Columns.Add("loading_date", GetType(Date))
+ dt.Columns.Add("batch_seq_nr", GetType(Integer))
+ dt.Columns.Add("distance_km", GetType(Double))
+ dt.Columns.Add("USteuer_EUR", GetType(Double))
+ End If
+ While j < num
+
+ Dim transaction As Chilkat.JsonObject = transactions.ObjectAt(j)
+
+ Dim purchaseDate As New Chilkat.CkDateTime
+ Dim entryDate As New Chilkat.CkDateTime
+ Dim exitDate As New Chilkat.CkDateTime
+ Dim loadingDate As New Chilkat.CkDateTime
+ Dim getAsLocal As Boolean = False
+ Dim USteuer_EUR As Double = 0
+
+ Dim R As DataRow = dt.NewRow
+ R("transaction_id") = transaction.StringOf("transaction_id")
+ R("partner_haulier_id") = transaction.IntOf("partner_haulier_id")
+ R("supplier_name") = transaction.StringOf("supplier_name")
+ R("transaction_country") = transaction.StringOf("transaction_country")
+ R("transaction_domain") = transaction.StringOf("transaction_domain")
+ R("entry_point_name") = transaction.StringOf("entry_point_name")
+ R("exit_point_name") = transaction.StringOf("exit_point_name")
+ R("device_product_type") = transaction.StringOf("device_product_type")
+
+ If ((transaction.StringOf("device_product_type") = "" Or transaction.StringOf("device_product_type") = "null") And CDbl(transaction.StringOf("msts_fee_amount").Replace(".", ",")) <> 0) Then
+ R("device_product_type") = transaction.StringOf("transaction_product_name")
+ End If
+
+ If ((transaction.StringOf("device_product_type") = "" Or transaction.StringOf("device_product_type") = "null") And transaction.StringOf("transaction_product_name") = "Charge - HU-GO SIM card fee") Then
+ R("device_product_type") = transaction.StringOf("transaction_product_name")
+ End If
+
+ R("device_product_number") = transaction.StringOf("device_product_number")
+ R("transaction_product_id") = transaction.IntOf("transaction_product_id")
+ R("transaction_product_name") = transaction.StringOf("transaction_product_name")
+ R("license_plate_number") = transaction.StringOf("license_plate_number")
+ R("vehicle_country") = transaction.StringOf("vehicle_country")
+ R("original_currency") = transaction.StringOf("original_currency")
+ R("original_net_amount") = CDbl(transaction.StringOf("original_net_amount").Replace(".", ","))
+ R("original_gross_amount") = CDbl(transaction.StringOf("original_gross_amount").Replace(".", ","))
+ R("original_vat_percentage") = CDbl(IIf(transaction.StringOf("original_vat_percentage") = "null", 0, transaction.StringOf("original_vat_percentage").Replace(".", ",")))
+ R("transaction_net_amount") = CDbl(transaction.StringOf("transaction_net_amount").Replace(".", ","))
+ R("transaction_gross_amount") = CDbl(transaction.StringOf("transaction_gross_amount").Replace(".", ","))
+ R("exempt_amount") = CDbl(transaction.StringOf("exempt_amount").Replace(".", ","))
+ R("msts_fee_amount") = CDbl(transaction.StringOf("msts_fee_amount").Replace(".", ","))
+ R("msts_vat_amount") = CDbl(transaction.StringOf("msts_vat_amount").Replace(".", ","))
+ R("msts_vat_percentage") = CDbl(transaction.StringOf("msts_vat_percentage").Replace(".", ","))
+ R("total_gross_amount") = CDbl(transaction.StringOf("total_gross_amount").Replace(".", ","))
+ R("transaction_status") = transaction.StringOf("transaction_status")
+ R("batch_seq_nr") = transaction.StringOf("batch_seq_nr")
+ R("original_vat_amount") = CDbl(R("original_gross_amount") - R("original_net_amount"))
+
+ If (transaction.StringOf("original_currency") = "EUR" Or R("original_vat_amount") = 0) Then
+ USteuer_EUR = R("original_vat_amount")
+ Else
+ If transaction.StringOf("transaction_country") = "HU" Then
+ Dim curBruttobetragEUR = R("msts_fee_amount") + R("transaction_gross_amount")
+ Dim steuersatz = SQL.DLookup("1+[Steuersatz]", "[Länderverzeichnis für die Außenhandelsstatistik]", "[LandNr]=64", "FMZOLL")
+ Dim curNettobetragEUR = CInt(curBruttobetragEUR / steuersatz * 100 + 0.5) / 100
+ USteuer_EUR = Math.Round(curBruttobetragEUR - curNettobetragEUR, 2)
+ End If
+ End If
+
+ R("USteuer_EUR") = USteuer_EUR
+ 'R("distance_km") = transaction.StringOf("distance_km")
+
+
+ Dim purchase_datetime_string As String = transaction.StringOf("purchase_datetime")
+ Dim entry_datetime_string As String = transaction.StringOf("entry_datetime")
+ Dim exit_datetime_string As String = transaction.StringOf("exit_datetime")
+ Dim loading_date_string As String = transaction.StringOf("loading_date")
+
+ Try
+ If purchase_datetime_string <> "" AndAlso purchase_datetime_string <> "null" Then R("purchase_datetime") = CDate(purchase_datetime_string)
+ If entry_datetime_string <> "" AndAlso entry_datetime_string <> "null" Then R("entry_datetime") = CDate(entry_datetime_string)
+ If exit_datetime_string <> "" AndAlso exit_datetime_string <> "null" Then R("exit_datetime") = CDate(exit_datetime_string)
+ If loading_date_string <> "" AndAlso loading_date_string <> "null" Then R("loading_date") = CDate(loading_date_string)
+ Catch ex As Exception
+ 'VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ dt.Rows.Add(R)
+
+
+ If IIf(ignorePurchaseDate, True, CDate(R("purchase_datetime")) >= "30.05.2024") Then
+
+ Dim trans As New cMSETransactions()
+ trans.transaction_id = checkNullStr(R("transaction_id"))
+ trans.controller_id = receiver
+ trans.partner_haulier_id = checkNullInteger(R("partner_haulier_id"))
+ trans.supplier_name = checkNullStr(R("supplier_name"))
+ trans.transaction_country = checkNullStr(R("transaction_country"))
+ trans.transaction_domain = checkNullStr(R("transaction_domain"))
+ trans.purchase_datetime = checkNullDateNothing(R("purchase_datetime"))
+ trans.entry_point_name = checkNullStr(R("entry_point_name"))
+ trans.entry_datetime = checkNullDateNothing(R("entry_datetime"))
+ trans.exit_point_name = checkNullStr(R("exit_point_name"))
+ trans.exit_datetime = checkNullDateNothing(R("exit_datetime"))
+ trans.device_product_type = checkNullStr(R("device_product_type"))
+ trans.device_product_number = checkNullStr(R("device_product_number"))
+ trans.transaction_product_id = checkNullInteger(R("transaction_product_id"))
+ trans.transaction_product_name = checkNullStr(R("transaction_product_name"))
+ trans.license_plate_number = checkNullStr(R("license_plate_number"))
+ trans.vehicle_country = checkNullStr(R("vehicle_country"))
+ trans.original_currency = checkNullStr(R("original_currency"))
+ trans.original_net_amount = checkNulDbl(R("original_net_amount"))
+ trans.original_gross_amount = checkNulDbl(R("original_gross_amount"))
+ trans.original_vat_amount = checkNulDbl(R("original_vat_amount"))
+ trans.original_vat_percentage = checkNulDbl(R("original_vat_percentage"))
+ trans.transaction_net_amount = checkNulDbl(R("transaction_net_amount"))
+ trans.transaction_gross_amount = checkNulDbl(R("transaction_gross_amount"))
+ trans.msts_fee_amount = checkNulDbl(R("msts_fee_amount"))
+ trans.msts_vat_amount = checkNulDbl(R("msts_vat_amount"))
+ trans.total_gross_amount = checkNulDbl(R("total_gross_amount"))
+ trans.transaction_status = checkNullStr(R("transaction_status"))
+ trans.loading_date = checkNullDateNothing(R("loading_date"))
+ trans.batch_seq_nr = checkNullInteger(R("batch_seq_nr"))
+ trans.tstmp = Now()
+ trans.USteuer_EUR = checkNulDbl(R("USteuer_EUR"))
+ 'trans.distance_km = CDbl(R("distance_km"))
+ trans.SAVE()
+
+ End If
+
+
+
+ j = j + 1
+ End While
+
+
+ dt = dt.DefaultView.ToTable()
+
+
+
+ End Sub
+
+ Public Sub saveSettlements(num As Integer, dt As DataTable, transactions As Chilkat.JsonArray, receiver As Integer)
+
+
+ Dim j As Integer = 0
+
+ If dt IsNot Nothing And Not dt.Columns.Contains("transaction_id") Then
+
+ dt.Columns.Add("transaction_id", GetType(String))
+ dt.Columns.Add("invoice_number", GetType(String))
+ dt.Columns.Add("invoice_date", GetType(String))
+ dt.Columns.Add("specification_page_id", GetType(String))
+ dt.Columns.Add("specification_page_name", GetType(String))
+ dt.Columns.Add("transaction_debit_or_credit", GetType(String))
+ dt.Columns.Add("original_transaction_id", GetType(String))
+ dt.Columns.Add("original_invoice_number", GetType(Integer))
+ dt.Columns.Add("original_invoice_date", GetType(String))
+ dt.Columns.Add("credit_comment", GetType(String))
+ End If
+
+ While j < num
+
+ Dim transaction As Chilkat.JsonObject = transactions.ObjectAt(j)
+
+ Dim R As DataRow = dt.NewRow
+ R("transaction_id") = checkNullStr(transaction.StringOf("transaction_id"))
+ R("invoice_number") = checkNullStr(transaction.StringOf("invoice_number"))
+ R("specification_page_id") = checkNullStr(transaction.StringOf("specification_page_id"))
+ R("specification_page_name") = checkNullStr(transaction.StringOf("specification_page_name"))
+ R("transaction_debit_or_credit") = checkNullStr(transaction.StringOf("transaction_debit_or_credit"))
+ R("original_transaction_id") = checkNullStr(transaction.StringOf("original_transaction_id"))
+ R("original_invoice_number") = checkNullInteger(transaction.StringOf("original_invoice_number"))
+ R("credit_comment") = checkNullStr(transaction.StringOf("credit_comment"))
+
+
+ Dim invoice_date_string As String = transaction.StringOf("invoice_date")
+ Dim original_invoice_date_string As String = transaction.StringOf("original_invoice_date")
+
+
+ Try
+ If invoice_date_string <> "" AndAlso invoice_date_string <> "null" Then R("invoice_date") = CDate(invoice_date_string)
+ If original_invoice_date_string <> "" AndAlso original_invoice_date_string <> "null" Then R("original_invoice_date") = CDate(original_invoice_date_string)
+
+ Catch ex As Exception
+ 'VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ dt.Rows.Add(R)
+
+ Dim trans = New cMSESettlements(R("transaction_id"))
+ trans.invoice_number = checkNullStr(R("invoice_number"))
+ trans.invoice_date = checkNullDateNothing(R("invoice_date"))
+ trans.specification_page_id = checkNullStr(R("specification_page_id"))
+ trans.specification_page_name = checkNullStr(R("specification_page_name"))
+ trans.transaction_debit_or_credit = checkNullStr(R("transaction_debit_or_credit"))
+ trans.original_transaction_id = checkNullStr(R("original_transaction_id"))
+ trans.original_invoice_number = checkNullInteger(R("original_invoice_number"))
+ trans.original_invoice_date = checkNullDateNothing(R("original_invoice_date"))
+ trans.credit_comment = checkNullStr(R("credit_comment"))
+ trans.SAVE()
+
+
+ j = j + 1
+
+ End While
+
+
+ dt = dt.DefaultView.ToTable()
+
+
+ End Sub
+
+ Public Sub saveCustomers(num As Integer, dt As DataTable, customers As Chilkat.JsonArray)
+
+ Dim j As Integer = 0
+
+ If dt IsNot Nothing And Not dt.Columns.Contains("customer_id") Then
+ dt.Columns.Add("customer_id", GetType(Integer))
+ dt.Columns.Add("partner_customer_number", GetType(String))
+ dt.Columns.Add("customer_name", GetType(String))
+ dt.Columns.Add("vat_number", GetType(String))
+ dt.Columns.Add("alternative_vat_number", GetType(String))
+ dt.Columns.Add("coc_number", GetType(String))
+ dt.Columns.Add("partner_fleet_card_number", GetType(String))
+ End If
+
+ While j < num
+
+ Dim custom As Chilkat.JsonObject = customers.ObjectAt(j)
+
+
+
+ Dim R As DataRow = dt.NewRow
+ R("customer_id") = custom.IntOf("customer_id")
+ R("partner_customer_number") = custom.StringOf("partner_customer_number")
+ R("customer_name") = custom.StringOf("customer_name")
+ R("vat_number") = custom.StringOf("vat_number")
+ R("alternative_vat_number") = custom.StringOf("alternative_vat_number")
+ R("coc_number") = custom.StringOf("coc_number")
+ R("partner_fleet_card_number") = custom.StringOf("partner_fleet_card_number")
+
+ dt.Rows.Add(R)
+
+
+
+ Dim cust As New cMSECustomers(R("customer_id"))
+ cust.partner_customer_number = checkNullStr(R("partner_customer_number"))
+ cust.customer_name = checkNullStr(R("customer_name"))
+ cust.vat_number = checkNullStr(R("vat_number"))
+ cust.alternative_vat_number = checkNullStr(R("alternative_vat_number"))
+ cust.coc_number = checkNullStr(R("coc_number"))
+ cust.partner_fleet_card_number = checkNullStr(R("partner_fleet_card_number"))
+ cust.SAVE()
+
+ j = j + 1
+ End While
+
+
+ dt = dt.DefaultView.ToTable()
+
+
+
+ End Sub
+
+
+End Class
+
+Public Class cMSEInvoices
+ Property id As Integer
+ Property name As Object = Nothing
+ Property total_amount_euro As Object = Nothing
+ Property total_vat_amount_euro As Object = Nothing
+ Property msts_vat_number As Object = Nothing
+ Property invoice_id As Object = Nothing
+ Property invoice_date As Object = Nothing
+ Property customer_number As Object = Nothing
+ Property country As Object = Nothing
+
+ Public hasEntry = False
+
+ Dim SQL As New SQL
+
+ Sub New()
+
+ End Sub
+
+ Sub New(name, invoice_id)
+ Me.name = name
+ Me.invoice_id = invoice_id
+ LOAD()
+ End Sub
+ Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
+ Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("name", name))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("total_amount_euro", total_amount_euro))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("total_vat_amount_euro", total_vat_amount_euro))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("msts_vat_number", msts_vat_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("invoice_id", invoice_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("invoice_date", invoice_date))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("customer_number", customer_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("country", country))
+
+ Return list
+ End Function
+
+
+
+ Public Function SAVE() As Boolean
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+
+ Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblMSEInvoices WHERE name=@name AND invoice_id = @invoice_id) " &
+ " BEGIN " & getUpdateCmd() & " END " &
+ " Else " &
+ " BEGIN " & getInsertCmd() & " END " &
+ " commit tran "
+
+ Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
+ End Function
+
+ Public Sub LOAD()
+ Try
+ hasEntry = False
+ Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
+ Using cmd As New SqlCommand("SELECT * FROM tblMSEInvoices WHERE name=@name AND invoice_id = @invoice_id", conn)
+ cmd.Parameters.AddWithValue("@name", name)
+ cmd.Parameters.AddWithValue("@invoice_id", invoice_id)
+ Dim dr = cmd.ExecuteReader()
+ If dr.Read Then
+ For Each li In getParameterList()
+ Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
+
+ If dr.Item(li.Text) Is DBNull.Value Then
+ propInfo.SetValue(Me, Nothing)
+ Else
+ propInfo.SetValue(Me, dr.Item(li.Text))
+ End If
+
+ Next
+ hasEntry = True
+ End If
+ dr.Close()
+ End Using
+ End Using
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ End Sub
+
+
+
+ Public Function getUpdateCmd() As String
+ Try
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+
+ Dim str As String = ""
+ For Each i In list
+ If Not i.isPrimaryParam Then
+ str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
+ End If
+ Next
+ str = str.Substring(0, str.Length - 1) 'wg. ','
+ Return (" UPDATE tblMSEInvoices SET " & str & " WHERE name=@name AND invoice_id = @invoice_id ")
+
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ Return ""
+ End Function
+
+
+ Public Function getInsertCmd() As String
+ Try
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+ Dim str As String = ""
+ Dim values As String = ""
+ For Each i In list
+ If Not i.isPrimaryParam Then
+ str &= "[" & i.Text & "],"
+ values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
+ End If
+ Next
+ str = str.Substring(0, str.Length - 1) 'wg. ','
+ values = values.Substring(0, values.Length - 1) 'wg. ','
+ Return (" INSERT INTO tblMSEInvoices (" & str & ") VALUES(" & values & ") ")
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ Return ""
+ End Function
+End Class
+
+Public Class cMSETransactions
+
+ Property transaction_id As Object = Nothing
+ Property controller_id As Integer
+ Property partner_haulier_id As Object = Nothing
+ Property supplier_name As Object = Nothing
+ Property transaction_country As Object = Nothing
+ Property transaction_domain As Object = Nothing
+ Property purchase_datetime As Object = Nothing
+ Property entry_point_name As Object = Nothing
+ Property entry_datetime As Object = Nothing
+ Property exit_point_name As Object = Nothing
+ Property exit_datetime As Object = Nothing
+ Property device_product_type As Object = Nothing
+ Property device_product_number As Object = Nothing
+ Property transaction_product_id As Object = Nothing
+ Property transaction_product_name As Object = Nothing
+ Property license_plate_number As Object = Nothing
+ Property vehicle_country As Object = Nothing
+ Property original_currency As Object = Nothing
+ Property original_net_amount As Object = Nothing
+ Property original_gross_amount As Object = Nothing
+ Property original_vat_amount As Object = Nothing
+ Property original_vat_percentage As Object = Nothing
+ Property customer_currency As Object = Nothing
+ Property transaction_net_amount As Object = Nothing
+ Property transaction_gross_amount As Object = Nothing
+ Property exempt_amount As Object = Nothing
+ Property msts_fee_amount As Object = Nothing
+ Property msts_vat_amount As Object = Nothing
+ Property msts_vat_percentage As Object = Nothing
+ Property total_gross_amount As Object = Nothing
+ Property transaction_status As Object = Nothing
+ Property loading_date As Object = Nothing
+ Property batch_seq_nr As Object = Nothing
+ Property distance_km As Object = Nothing
+ Property tstmp As Object = Nothing
+ Property USteuer_EUR As Object = Nothing
+ Property charged As Boolean = False
+ Property chargedDatetime As Object = Nothing
+
+ Public hasEntry = False
+
+ Dim SQL As New SQL
+
+ Sub New()
+ End Sub
+
+ Sub New(transaction_id)
+ Me.transaction_id = transaction_id
+ LOAD()
+ End Sub
+ Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
+ Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
+
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_id", transaction_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("controller_id", controller_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("partner_haulier_id", partner_haulier_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("supplier_name", supplier_name))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_country", transaction_country))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_domain", transaction_domain))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("purchase_datetime", purchase_datetime))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("entry_point_name", entry_point_name))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("entry_datetime", entry_datetime))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("exit_point_name", exit_point_name))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("exit_datetime", exit_datetime))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("device_product_type", device_product_type))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("device_product_number", device_product_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_product_id", transaction_product_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_product_name", transaction_product_name))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("license_plate_number", license_plate_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("vehicle_country", vehicle_country))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("original_currency", original_currency))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("original_net_amount", original_net_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("original_gross_amount", original_gross_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("original_vat_amount", original_vat_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("original_vat_percentage", original_vat_percentage))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("customer_currency", customer_currency))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_net_amount", transaction_net_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_gross_amount", transaction_gross_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("exempt_amount", exempt_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("msts_fee_amount", msts_fee_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("msts_vat_amount", msts_vat_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("msts_vat_percentage", msts_vat_percentage))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("total_gross_amount", total_gross_amount))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_status", transaction_status))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("loading_date", loading_date))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("batch_seq_nr", batch_seq_nr))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("distance_km", distance_km))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("tstmp", tstmp))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("USteuer_EUR", USteuer_EUR))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("charged", charged))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("chargedDatetime", chargedDatetime))
+
+
+ Return list
+ End Function
+
+
+
+ Public Function SAVE() As Boolean
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+
+ Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblMSETransactions WHERE transaction_id=@transaction_id) " &
+ " BEGIN " & getUpdateCmd() & " END " &
+ " Else " &
+ " BEGIN " & getInsertCmd() & " END " &
+ " commit tran "
+
+ Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
+ End Function
+
+ Public Sub LOAD()
+ Try
+ hasEntry = False
+ Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
+ Using cmd As New SqlCommand("SELECT * FROM tblMSETransactions WHERE transaction_id=@transaction_id", conn)
+ cmd.Parameters.AddWithValue("@transaction_id", transaction_id)
+ Dim dr = cmd.ExecuteReader()
+ If dr.Read Then
+ For Each li In getParameterList()
+ Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
+
+ If dr.Item(li.Text) Is DBNull.Value Then
+ propInfo.SetValue(Me, Nothing)
+ Else
+ propInfo.SetValue(Me, dr.Item(li.Text))
+ End If
+
+ Next
+ hasEntry = True
+ End If
+ dr.Close()
+ End Using
+ End Using
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ End Sub
+
+
+
+ Public Function getUpdateCmd() As String
+ Try
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+
+ Dim str As String = ""
+ For Each i In list
+ If Not i.isPrimaryParam Then
+ str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
+ End If
+ Next
+ str = str.Substring(0, str.Length - 1) 'wg. ','
+ Return (" UPDATE tblMSETransactions SET " & str & " WHERE transaction_id=@transaction_id and charged <> 1")
+
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ Return ""
+ End Function
+
+
+ Public Function getInsertCmd() As String
+ Try
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+ Dim str As String = ""
+ Dim values As String = ""
+ For Each i In list
+ If Not i.isPrimaryParam Then
+ str &= "[" & i.Text & "],"
+ values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
+ End If
+ Next
+ str = str.Substring(0, str.Length - 1) 'wg. ','
+ values = values.Substring(0, values.Length - 1) 'wg. ','
+ Return (" INSERT INTO tblMSETransactions (" & str & ") VALUES(" & values & ") ")
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ Return ""
+ End Function
+End Class
+
+Public Class cMSESettlements
+
+ Property transaction_id As Object = Nothing
+ Property invoice_number As Object = Nothing
+ Property invoice_date As Object = Nothing
+ Property specification_page_id As Object = Nothing
+ Property specification_page_name As Object = Nothing
+ Property transaction_debit_or_credit As Object = Nothing
+ Property original_transaction_id As Object = Nothing
+ Property original_invoice_number As Object = Nothing
+ Property original_invoice_date As Object = Nothing
+ Property credit_comment As Object = Nothing
+
+
+ Public hasEntry = False
+
+ Dim SQL As New SQL
+
+ Sub New()
+ End Sub
+
+ Sub New(transaction_id)
+ Me.transaction_id = transaction_id
+ LOAD()
+ End Sub
+ Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
+ Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
+
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_id", transaction_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("invoice_number", invoice_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("invoice_date", invoice_date))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("specification_page_id", specification_page_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("specification_page_name", specification_page_name))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("transaction_debit_or_credit", transaction_debit_or_credit))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("original_transaction_id", original_transaction_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("original_invoice_number", original_invoice_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("original_invoice_date", original_invoice_date))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("credit_comment", credit_comment))
+
+ Return list
+ End Function
+
+
+
+ Public Function SAVE() As Boolean
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+
+ Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblMSESettlements WHERE transaction_id=@transaction_id) " &
+ " BEGIN " & getUpdateCmd() & " END " &
+ " Else " &
+ " BEGIN " & getInsertCmd() & " END " &
+ " commit tran "
+
+ Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
+ End Function
+
+ Public Sub LOAD()
+ Try
+ hasEntry = False
+ Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
+ Using cmd As New SqlCommand("SELECT * FROM tblMSESettlements WHERE transaction_id=@transaction_id", conn)
+ cmd.Parameters.AddWithValue("@transaction_id", transaction_id)
+ Dim dr = cmd.ExecuteReader()
+ If dr.Read Then
+ For Each li In getParameterList()
+ Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
+
+ If dr.Item(li.Text) Is DBNull.Value Then
+ propInfo.SetValue(Me, Nothing)
+ Else
+ propInfo.SetValue(Me, dr.Item(li.Text))
+ End If
+
+ Next
+ hasEntry = True
+ End If
+ dr.Close()
+ End Using
+ End Using
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ End Sub
+
+
+
+ Public Function getUpdateCmd() As String
+ Try
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+
+ Dim str As String = ""
+ For Each i In list
+ If Not i.isPrimaryParam Then
+ str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
+ End If
+ Next
+ str = str.Substring(0, str.Length - 1) 'wg. ','
+ Return (" UPDATE tblMSESettlements SET " & str & " WHERE transaction_id=@transaction_id")
+
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ Return ""
+ End Function
+
+
+ Public Function getInsertCmd() As String
+ Try
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+ Dim str As String = ""
+ Dim values As String = ""
+ For Each i In list
+ If Not i.isPrimaryParam Then
+ str &= "[" & i.Text & "],"
+ values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
+ End If
+ Next
+ str = str.Substring(0, str.Length - 1) 'wg. ','
+ values = values.Substring(0, values.Length - 1) 'wg. ','
+ Return (" INSERT INTO tblMSESettlements (" & str & ") VALUES(" & values & ") ")
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ Return ""
+ End Function
+End Class
+
+Public Class cMSECustomers
+
+ Property customer_id As Object = Nothing
+ Property partner_customer_number As Object = Nothing
+ Property customer_name As Object = Nothing
+ Property vat_number As Object = Nothing
+ Property alternative_vat_number As Object = Nothing
+ Property coc_number As Object = Nothing
+ Property partner_fleet_card_number As Object = Nothing
+
+ Public hasEntry = False
+
+ Dim SQL As New SQL
+
+ Sub New()
+ End Sub
+
+ Sub New(customer_id)
+ Me.customer_id = customer_id
+ LOAD()
+ End Sub
+ Function getParameterList() As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
+ Dim list As New List(Of VERAG_PROG_ALLGEMEIN.SQLVariable)
+
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("customer_id", customer_id))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("partner_customer_number", partner_customer_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("customer_name", customer_name))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("vat_number", vat_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("alternative_vat_number", alternative_vat_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("coc_number", coc_number))
+ list.Add(New VERAG_PROG_ALLGEMEIN.SQLVariable("partner_fleet_card_number", partner_fleet_card_number))
+
+ Return list
+ End Function
+
+
+
+ Public Function SAVE() As Boolean
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+
+ Dim sqlstr = " BEGIN TRAN IF EXISTS(SELECT * FROM tblMSECustomers WHERE customer_id=@customer_id) " &
+ " BEGIN " & getUpdateCmd() & " END " &
+ " Else " &
+ " BEGIN " & getInsertCmd() & " END " &
+ " commit tran "
+
+ Return SQL.doSQLVarList(sqlstr, "FMZOLL", , list)
+ End Function
+
+ Public Sub LOAD()
+ Try
+ hasEntry = False
+ Using conn As SqlConnection = SQL.GetNewOpenConnectionFMZOLL()
+ Using cmd As New SqlCommand("SELECT * FROM tblMSECustomers WHERE customer_id=@customer_id", conn)
+ cmd.Parameters.AddWithValue("@customer_id", customer_id)
+ Dim dr = cmd.ExecuteReader()
+ If dr.Read Then
+ For Each li In getParameterList()
+ Dim propInfo As PropertyInfo = Me.GetType.GetProperty(li.Scalarvariable)
+
+ If dr.Item(li.Text) Is DBNull.Value Then
+ propInfo.SetValue(Me, Nothing)
+ Else
+ propInfo.SetValue(Me, dr.Item(li.Text))
+ End If
+
+ Next
+ hasEntry = True
+ End If
+ dr.Close()
+ End Using
+ End Using
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ End Sub
+
+
+
+ Public Function getUpdateCmd() As String
+ Try
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+
+ Dim str As String = ""
+ For Each i In list
+ If Not i.isPrimaryParam Then
+ str &= "[" & i.Text & "] = @" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
+ End If
+ Next
+ str = str.Substring(0, str.Length - 1) 'wg. ','
+ Return (" UPDATE tblMSECustomers SET " & str & " WHERE customer_id=@customer_id")
+
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ Return ""
+ End Function
+
+
+ Public Function getInsertCmd() As String
+ Try
+ Dim list As List(Of VERAG_PROG_ALLGEMEIN.SQLVariable) = getParameterList()
+ Dim str As String = ""
+ Dim values As String = ""
+ For Each i In list
+ If Not i.isPrimaryParam Then
+ str &= "[" & i.Text & "],"
+ values &= "@" & i.Scalarvariable & "," '.Replace("-", "").Replace(" ", "") & ","
+ End If
+ Next
+ str = str.Substring(0, str.Length - 1) 'wg. ','
+ values = values.Substring(0, values.Length - 1) 'wg. ','
+ Return (" INSERT INTO tblMSECustomers (" & str & ") VALUES(" & values & ") ")
+ Catch ex As Exception
+ VERAG_PROG_ALLGEMEIN.cErrorHandler.ERR(ex.Message, ex.StackTrace, System.Reflection.MethodInfo.GetCurrentMethod.Name)
+ End Try
+ Return ""
+ End Function
End Class
\ No newline at end of file