chat, essenebstellungen, vollmachten (gültig bis), bugfix laden bei sendungsdetails kunden (fehlermeldung), sprache bei verzollungsunterlagen BAR, Rechung an Atilla

This commit is contained in:
2024-07-29 09:35:57 +02:00
parent f84d9184ab
commit df27c0c389
15 changed files with 1131 additions and 113 deletions

View File

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

View File

@@ -522,7 +522,13 @@ Public Class frmAbrechnungsMaske
End Select End Select
Mail.HTMLBody = "<div style=""font-family:Calibri, Arial"">" & Mail.HTMLBody & "</div>" Mail.HTMLBody = "<div style=""font-family:Calibri, Arial"">" & Mail.HTMLBody & "</div>"
Dim KdNrTmp = getSelectionKdNr() 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() Mail.Display()

View File

@@ -152,11 +152,28 @@ Public Class frmFaktEmail
If AD.E_Mail IsNot Nothing AndAlso AD.E_Mail <> "" Then lkl.Text = """" & AD.E_Mail & """ anfügen" : lkl.Tag = AD.E_Mail 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 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) 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) 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) If EMAILTMPBCC <> "" Then dgvEmailBCC.Rows.Add(EMAILTMPBCC)
initDGVAnhaenge() initDGVAnhaenge()

View File

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

View File

@@ -374,7 +374,7 @@ Public Class usrCntlFaktAbrechnung
Sub setControlsEnabled(pnl As Panel, pnlEnabled As Boolean) Sub setControlsEnabled(pnl As Panel, pnlEnabled As Boolean)
For Each c In pnl.Controls 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 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 End If
Next Next
End Sub End Sub

View File

@@ -69,6 +69,7 @@
txtAdresse1.Text = (If(ADRESSE.LandKz, "") & " " & If(ADRESSE.PLZ, "") & " " & If(ADRESSE.Ort, "")).ToString.Trim txtAdresse1.Text = (If(ADRESSE.LandKz, "") & " " & If(ADRESSE.PLZ, "") & " " & If(ADRESSE.Ort, "")).ToString.Trim
End If End If
End If End If
RaiseEvent KDNR_CHANGED(KdNR) RaiseEvent KDNR_CHANGED(KdNR)
End Sub End Sub
initControlsHandler() initControlsHandler()
@@ -93,6 +94,17 @@
cboRechnungAn.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("4 - Avisierer", "4")) 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 loaded = True
End Sub End Sub
@@ -108,6 +120,7 @@
cboSprache.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Englisch", "EN")) cboSprache.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Englisch", "EN"))
'cboSprache.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Französisch", "FR")) ?? 'cboSprache.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("Französisch", "FR")) ??
cboSprache.changeItem("DE") cboSprache.changeItem("DE")
End If End If
End Sub End Sub

View File

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

View File

@@ -1,5 +1,7 @@
 
Imports System.Data.SqlTypes Imports System.Data.SqlTypes
Imports System.Windows.Documents
Imports io.konik.zugferd.unqualified
Imports VERAG_PROG_ALLGEMEIN Imports VERAG_PROG_ALLGEMEIN
Public Class UsrCntlessensbestellungen Public Class UsrCntlessensbestellungen
@@ -78,41 +80,53 @@ Public Class UsrCntlessensbestellungen
cbxAbteilung.Enabled = False cbxAbteilung.Enabled = False
txtAnmerkung.Text = If(essen.eb_anmerkung IsNot Nothing, essen.eb_anmerkung.ToString, "") txtAnmerkung.Text = If(essen.eb_anmerkung IsNot Nothing, essen.eb_anmerkung.ToString, "")
End Sub 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 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 If rbMenuAlt_montag.Checked Then
txtAlt_montag.Visible = True 'txtAlt_montag.Visible = True
cbxAlt_montag.Visible = True
Else Else
txtAlt_montag.Visible = False cbxAlt_montag.Visible = False
'txtAlt_montag.Visible = False
End If End If
If rbMenuAlt_dienstag.Checked Then If rbMenuAlt_dienstag.Checked Then
txtAlt_dienstag.Visible = True cbxAlt_dienstag.Visible = True
'txtAlt_dienstag.Visible = True
Else Else
txtAlt_dienstag.Visible = False cbxAlt_dienstag.Visible = False
'txtAlt_dienstag.Visible = False
End If End If
If rbMenuAlt_mittwoch.Checked Then If rbMenuAlt_mittwoch.Checked Then
txtAlt_mittwoch.Visible = True cbxAlt_mittwoch.Visible = True
'txtAlt_mittwoch.Visible = True
Else Else
txtAlt_mittwoch.Visible = False cbxAlt_mittwoch.Visible = False
'txtAlt_mittwoch.Visible = False
End If End If
If rbMenuAlt_donnerstag.Checked Then If rbMenuAlt_donnerstag.Checked Then
txtAlt_donnerstag.Visible = True cbxAlt_donnerstag.Visible = True
'txtAlt_donnerstag.Visible = True
Else Else
txtAlt_donnerstag.Visible = False cbxAlt_donnerstag.Visible = False
'txtAlt_donnerstag.Visible = False
End If End If
If rbMenuAlt_freitag.Checked Then If rbMenuAlt_freitag.Checked Then
txtAlt_freitag.Visible = True cbxAlt_freitag.Visible = True
'txtAlt_freitag.Visible = True
Else Else
txtAlt_freitag.Visible = False cbxAlt_freitag.Visible = False
'txtAlt_freitag.Visible = False
End If End If
countChecks() countChecks()
End Sub End Sub
@@ -242,6 +256,9 @@ Public Class UsrCntlessensbestellungen
txtAnzahlLaCart.Text = countlaCarte.ToString txtAnzahlLaCart.Text = countlaCarte.ToString
txtAnzahlKeb.Text = countKebab.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 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 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) essen = New cEssensbestellung(cbxMenu._value, cbxMitarbeiter._value, cbxGebäude._value, cbxAbteilung._value, cbxMitarbeiter.Text, txtAnmerkung.Text)
If cb_montag.Checked Then If cb_montag.Checked Then
If rbMenu_montag.Checked Then If rbMenu_montag.Checked Then
essen.eb_montag = menu essen.eb_montag = menu
@@ -546,13 +567,17 @@ Public Class UsrCntlessensbestellungen
Private Sub initPanelFields() Private Sub initPanelFields()
If essen.eb_montag IsNot Nothing Then If essen.eb_montag IsNot Nothing Then
cb_montag.Checked = True cb_montag.Checked = True
If essen.eb_montag.ToString = menu Then If essen.eb_montag.ToString = menu Then
rbMenu_montag.Checked = True rbMenu_montag.Checked = True
Else Else
rbMenuAlt_montag.Checked = True 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 End If
Else Else
cb_montag.Checked = False cb_montag.Checked = False
@@ -564,7 +589,10 @@ Public Class UsrCntlessensbestellungen
rbMenu_dienstag.Checked = True rbMenu_dienstag.Checked = True
Else Else
rbMenuAlt_dienstag.Checked = True 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 End If
Else Else
cb_dienstag.Checked = False cb_dienstag.Checked = False
@@ -577,7 +605,10 @@ Public Class UsrCntlessensbestellungen
rbMenu_mittwoch.Checked = True rbMenu_mittwoch.Checked = True
Else Else
rbMenuAlt_mittwoch.Checked = True 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 End If
Else Else
cb_mittwoch.Checked = False cb_mittwoch.Checked = False
@@ -589,7 +620,10 @@ Public Class UsrCntlessensbestellungen
rbMenu_donnerstag.Checked = True rbMenu_donnerstag.Checked = True
Else Else
rbMenuAlt_donnerstag.Checked = True 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 End If
Else Else
cbdonnerstag.Checked = False cbdonnerstag.Checked = False
@@ -602,7 +636,10 @@ Public Class UsrCntlessensbestellungen
rbMenu__freitag.Checked = True rbMenu__freitag.Checked = True
Else Else
rbMenuAlt_freitag.Checked = True 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 End If
Else Else
cb_freitag.Checked = False 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("Maut", "Maut"))
cbxGebäude.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("", "")) 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 Sub
End Class End Class

View File

@@ -534,7 +534,7 @@ Class DAKOSY_Interface_SEND
If u.ezaWP_AHStatWert IsNot Nothing AndAlso IsNumeric(u.ezaWP_AHStatWert) Then WP.AHStatWert = CInt(u.ezaWP_AHStatWert) If u.ezaWP_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_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_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_PackstueckArt IsNot Nothing Then WP.PackstueckArt = u.ezaWP_PackstueckArt
If u.ezaWP_PackstueckZeichen IsNot Nothing Then WP.PackstueckZeichen = u.ezaWP_PackstueckZeichen If u.ezaWP_PackstueckZeichen IsNot Nothing Then WP.PackstueckZeichen = u.ezaWP_PackstueckZeichen

View File

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

View File

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

View File

@@ -941,6 +941,8 @@ Public Class usrCntlKundenuebersicht
r.DefaultCellStyle.ForeColor = Color.Gray 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 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 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 End If
If True Then If True Then

View File

@@ -56,11 +56,11 @@ Public Class cMessenger
Public Shared Function GET_NewMSG_COUNT_ART(maId, chat_art) As Integer Public Shared Function GET_NewMSG_COUNT_ART(maId, chat_art) As Integer
If maId < 0 Then maId = VERAG_PROG_ALLGEMEIN.cAllgemein.USRID 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 End Function
Public Shared Function GET_NewMSG_COUNT_ART_INAKTIV(maId, chat_art) As Integer Public Shared Function GET_NewMSG_COUNT_ART_INAKTIV(maId, chat_art) As Integer
If maId < 0 Then maId = VERAG_PROG_ALLGEMEIN.cAllgemein.USRID 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 End Function
Public Shared Function GET_NewMSG_COUNT_AVISOID(AvisoId As Integer) As Integer Public Shared Function GET_NewMSG_COUNT_AVISOID(AvisoId As Integer) As Integer

View File

@@ -1428,11 +1428,16 @@ Public Class cFormularManager
If doc IsNot Nothing Then If doc IsNot Nothing Then
doc.PageSettings.Size = Spire.Pdf.PdfPageSize.A4 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 If openFileAfterDownload Then
End If
End If End If
End If
End Using End Using
End Using End Using

View File

@@ -1,4 +1,6 @@
Imports System.Net Imports System.Data.SqlClient
Imports System.Net
Imports System.Reflection
Public Class cMSEAPI Public Class cMSEAPI
@@ -32,6 +34,7 @@ Public Class cMSEAPI
' Now build the JWT claims (also known as the payload) ' Now build the JWT claims (also known as the payload)
Dim claims As New Chilkat.JsonObject 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")) success = claims.AppendString("iss", API.Rows(0).Item("api_user"))
Dim curDateTime As Integer = jwt.GenNumericDate(0) Dim curDateTime As Integer = jwt.GenNumericDate(0)
@@ -59,6 +62,8 @@ Public Class cMSEAPI
Dim success As Boolean Dim success As Boolean
'rest.DebugMode = True
rest.VerboseLogging = True rest.VerboseLogging = True
Dim bTls As Boolean = True Dim bTls As Boolean = True
Dim port As Integer = 443 Dim port As Integer = 443
@@ -98,6 +103,7 @@ Public Class cMSEAPI
Debug.WriteLine(responseJson) Debug.WriteLine(responseJson)
'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""}]}"
Dim json As New Chilkat.JsonObject Dim json As New Chilkat.JsonObject
success = json.Load(responseJson) success = json.Load(responseJson)
@@ -108,14 +114,181 @@ Public Class cMSEAPI
Debug.WriteLine(json) Debug.WriteLine(json)
Dim jsonArray As New Chilkat.JsonArray Dim transactions As New Chilkat.JsonArray
success = jsonArray.Load(responseJson) transactions = json.ArrayOf("transactions")
If (success <> True) Then If (json.LastMethodSuccess = False) Then
Return jsonArray.LastErrorText Debug.WriteLine("transactions member not found.")
End If End If
Dim num As Integer = jsonArray.Size Dim num As Integer = transactions.Size
If num = -1 Then
Return "FEHLER"
End If
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 getTransactionsFromToDate(jwt As String, dt As DataTable, start_date As Date, end_date As Date) As String
Try
Dim returnText As String = ""
Dim failureText As String = ""
Dim success As Boolean
'rest.DebugMode = True
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 = 500000
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 <> 200) Then
Debug.WriteLine(rest.ResponseHeader)
Return rest.LastErrorText
End If
Debug.WriteLine(responseJson)
'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""}]}"
Dim json As New Chilkat.JsonObject
success = json.Load(responseJson)
If (success <> True) Then
Debug.WriteLine(json.LastErrorText)
End If
Debug.WriteLine(json)
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"
End If
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 getBilledTransactionsFromInvoiceID(jwt As String, dt As DataTable, invoiceID As String) As String
Try
Dim returnText As String = ""
Dim failureText As String = ""
Dim success As Boolean
'rest.DebugMode = True
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("invoice_id", invoiceID)
rest.AddHeader("X-API-Key", jwt)
rest.IdleTimeoutMs = 500000
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 <> 200) Then
Debug.WriteLine(rest.ResponseHeader)
Return "rest.LastErrorText"
End If
Debug.WriteLine(responseJson)
'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""}]}"
Dim json As New Chilkat.JsonObject
success = json.Load(responseJson)
If (success <> True) Then
Debug.WriteLine(json.LastErrorText)
End If
Debug.WriteLine(json)
Dim transactions As New Chilkat.JsonArray
transactions = json.ArrayOf("settlements")
If (json.LastMethodSuccess = False) Then
Debug.WriteLine("transactions member not found.")
End If
Dim num As Integer = transactions.Size
If num = -1 Then If num = -1 Then
Return "FEHLER" Return "FEHLER"
End If End If
@@ -123,61 +296,258 @@ Public Class cMSEAPI
Dim j As Integer = 0 Dim j As Integer = 0
dt.Columns.Clear()
If dt IsNot Nothing And Not dt.Columns.Contains("transaction_id") Then If dt IsNot Nothing And Not dt.Columns.Contains("transaction_id") Then
dt.Columns.Add("transaction_id", GetType(String)) dt.Columns.Add("transaction_id", GetType(String))
dt.Columns.Add("partner_haulier_id", GetType(Integer)) 'dt.Columns.Add("purchase_datetime", GetType(DateTime))
dt.Columns.Add("supplier_name", GetType(String)) 'dt.Columns.Add("partner_haulier_id", GetType(Integer))
dt.Columns.Add("transaction_country", GetType(String)) 'dt.Columns.Add("transaction_net_amount", GetType(String))
dt.Columns.Add("transaction_domain", GetType(String)) 'dt.Columns.Add("transaction_gross_amount", GetType(String))
'dt.Columns.Add("msts_fee_amount", GetType(String))
dt.Columns.Add("purchase_datetime", GetType(DateTime)) 'dt.Columns.Add("msts_vat_amount", GetType(String))
dt.Columns.Add("entry_point_name", GetType(String)) 'dt.Columns.Add("total_gross_amount", GetType(String))
dt.Columns.Add("entry_datetime", GetType(DateTime)) dt.Columns.Add("invoice_number", GetType(String))
dt.Columns.Add("exit_point_name", GetType(String)) dt.Columns.Add("invoice_date", GetType(String))
dt.Columns.Add("exit_datetime", GetType(DateTime)) dt.Columns.Add("specification_page_id", GetType(String))
dt.Columns.Add("specification_page_name", GetType(String))
dt.Columns.Add("device_product_type", GetType(String)) dt.Columns.Add("transaction_debit_or_credit", 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("original_transaction_id", GetType(String))
dt.Columns.Add("credit_comment", GetType(Boolean)) dt.Columns.Add("original_invoice_number", GetType(Integer))
dt.Columns.Add("loading_date", GetType(Date)) dt.Columns.Add("original_invoice_date", GetType(String))
dt.Columns.Add("batch_seq_nr", GetType(Integer)) dt.Columns.Add("credit_comment", GetType(String))
While j < num While j < num
Dim transaction As Chilkat.JsonObject = jsonArray.ObjectAt(j) Dim transaction As Chilkat.JsonObject = transactions.ObjectAt(j)
Dim R As DataRow = dt.NewRow Dim R As DataRow = dt.NewRow
'R("id") = groups.IntOf("id") R("transaction_id") = transaction.StringOf("transaction_id")
'R("name") = groups.StringOf("name") 'R("purchase_datetime") = transaction.StringOf("purchase_datetime")
'R("groupType") = groups.StringOf("groupType") 'R("partner_haulier_id") = transaction.IntOf("partner_haulier_id")
'R("info") = groups.StringOf("info") 'R("transaction_net_amount") = transaction.IntOf("transaction_net_amount")
'R("transaction_gross_amount") = transaction.StringOf("transaction_gross_amount")
'R("msts_fee_amount") = transaction.StringOf("msts_fee_amount")
'R("msts_vat_amount") = transaction.StringOf("msts_vat_amount")
'R("total_gross_amount") = transaction.StringOf("total_gross_amount")
R("invoice_number") = transaction.StringOf("invoice_number")
R("invoice_date") = transaction.StringOf("invoice_date")
R("specification_page_id") = transaction.StringOf("specification_page_id")
R("specification_page_name") = transaction.StringOf("specification_page_name")
R("transaction_debit_or_credit") = transaction.StringOf("transaction_debit_or_credit")
R("original_transaction_id") = IIf(transaction.StringOf("original_transaction_id") <> "null", transaction.StringOf("original_transaction_id"), "")
R("original_invoice_number") = IIf(transaction.StringOf("original_invoice_number") <> "null", transaction.StringOf("original_invoice_number"), DBNull.Value)
R("original_invoice_date") = IIf(transaction.StringOf("original_invoice_date") <> "null", transaction.StringOf("original_invoice_date"), "")
R("credit_comment") = IIf(transaction.StringOf("credit_comment") <> "null", transaction.StringOf("credit_comment"), "")
Dim trans = New cMSETransactions(R("transaction_id"))
trans.invoice_number = R("invoice_number")
'trans.invoice_date = CDate(R("invoice_date"))
'trans.specification_page_id = R("specification_page_id")
'trans.specification_page_name = R("specification_page_name")
'trans.transaction_debit_or_credit = R("transaction_debit_or_credit")
'trans.original_transaction_id = IIf(R("original_transaction_id") <> "", R("original_transaction_id"), "")
'trans.original_invoice_number = IIf(Not IsDBNull(R("original_invoice_number")), R("original_invoice_number"), "")
'trans.credit_comment = IIf(R("credit_comment") <> "", R("credit_comment"), "")
'trans.partner_haulier_id = R("partner_haulier_id")
'trans.purchase_datetime = R("purchase_datetime")
'trans.transaction_net_amount = CDbl(R("transaction_net_amount"))
'trans.transaction_gross_amount = CDbl(R("transaction_gross_amount"))
'trans.msts_fee_amount = CDbl(R("msts_fee_amount"))
'trans.msts_vat_amount = CDbl(R("msts_vat_amount"))
'trans.total_gross_amount = CDbl(R("total_gross_amount"))
trans.invoice_number = R("invoice_number")
trans.invoice_date = CDate(R("invoice_date"))
trans.specification_page_id = R("specification_page_id")
trans.specification_page_name = R("specification_page_name")
trans.transaction_debit_or_credit = R("transaction_debit_or_credit")
trans.original_transaction_id = IIf(R("original_transaction_id") <> "", R("original_transaction_id"), "")
trans.original_invoice_number = IIf(Not IsDBNull(R("original_invoice_number")), R("original_invoice_number"), "")
If (R("original_invoice_date") <> "" AndAlso IsDate(R("original_invoice_date"))) Then
trans.original_invoice_date = CDate(R("original_invoice_date"))
Else
trans.original_invoice_date = DBNull.Value
End If
trans.credit_comment = IIf(R("credit_comment") <> "", R("credit_comment"), "")
trans.SAVE()
'Property msts_fee_amount As Object = Nothing
'Property msts_vat_amount As Object = Nothing
'Property total_gross_amount 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
'Property batch_seq_nr As Object = Nothing
'R("entry_point_name") = transaction.StringOf("entry_point_name")
'R("entry_datetime") = transaction.DateOf("entry_datetime", New Chilkat.CkDateTime)
'R("exit_point_name") = transaction.StringOf("exit_point_name")
'R("exit_datetime") = transaction.DateOf("exit_datetime", New Chilkat.CkDateTime)
'R("device_product_type") = transaction.StringOf("device_product_type")
'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.IntOf("vehicle_country")
'R("original_currency") = transaction.StringOf("original_currency")
'R("original_net_amount") = transaction.StringOf("original_net_amount")
'R("original_gross_amount") = transaction.IntOf("original_gross_amount")
'R("original_currency") = transaction.StringOf("original_currency")
'R("original_vat_percentage") = transaction.BoolOf("original_vat_percentage")
'R("exempt_amount") = transaction.StringOf("exempt_amount")
dt.Rows.Add(R) dt.Rows.Add(R)
j = j + 1 j = j + 1
End While End While
dt = dt.DefaultView.ToTable()
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 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.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 = 500000
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 <> 200) Then
Debug.WriteLine(rest.ResponseHeader)
Return "rest.LastErrorText"
End If
Debug.WriteLine(responseJson)
Dim json As New Chilkat.JsonObject
success = json.Load(responseJson)
If (success <> True) Then
Debug.WriteLine(json.LastErrorText)
End If
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"
End If
Dim j As Integer = 0
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(String))
dt.Columns.Add("total_vat_amount_euro", GetType(String))
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 invoice As Chilkat.JsonObject = invoices.ObjectAt(j)
Dim R As DataRow = dt.NewRow
R("name") = invoice.StringOf("name")
R("url") = invoice.StringOf("url")
R("total_amount_euro") = invoice.StringOf("total_amount_euro")
R("total_vat_amount_euro") = invoice.StringOf("total_vat_amount_euro")
R("msts_vat_number") = invoice.StringOf("msts_vat_number")
R("invoice_id") = invoice.StringOf("invoice_id")
R("invoice_date") = invoice.StringOf("invoice_date")
Dim inv As New cMSEInvoices()
inv.name = R("name")
inv.total_amount_euro = IIf(R("total_amount_euro") = "null", 0, R("total_amount_euro"))
inv.total_vat_amount_euro = IIf(R("total_vat_amount_euro") = "null", 0, R("total_vat_amount_euro"))
inv.msts_vat_number = IIf(R("msts_vat_number") = "null", "", R("msts_vat_number"))
inv.invoice_id = R("invoice_id")
inv.invoice_date = CDate(R("invoice_date"))
inv.SAVE()
dt.Rows.Add(R)
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() dt = dt.DefaultView.ToTable()
@@ -192,4 +562,457 @@ Public Class cMSEAPI
End Function End Function
End Class
Public Sub saveTransactions(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("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_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))
While j < num
Dim transaction As Chilkat.JsonObject = transactions.ObjectAt(j)
Dim purchaseDate, entryDate, exitDate, loadingDate As New Chilkat.CkDateTime
Dim getAsLocal As Boolean = False
Dim dateTime As New Chilkat.CkDateTime
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")
transaction.DateOf("purchase_datetime", purchaseDate)
R("purchase_datetime") = purchaseDate.GetAsTimestamp(getAsLocal)
R("entry_point_name") = transaction.StringOf("entry_point_name")
transaction.DateOf("entry_datetime", entryDate)
R("entry_datetime") = entryDate.GetAsTimestamp(getAsLocal)
R("exit_point_name") = transaction.StringOf("exit_point_name")
transaction.DateOf("exit_datetime", exitDate)
R("exit_datetime") = exitDate.GetAsTimestamp(getAsLocal)
R("device_product_type") = transaction.StringOf("device_product_type")
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") = IIf(transaction.StringOf("vehicle_country") = "null", "", transaction.StringOf("vehicle_country"))
R("original_currency") = transaction.StringOf("original_currency")
R("original_net_amount") = CDbl(transaction.StringOf("original_net_amount"))
R("original_gross_amount") = CDbl(transaction.StringOf("original_gross_amount"))
R("original_vat_percentage") = CDbl(IIf(transaction.StringOf("original_vat_percentage") = "null", 0, transaction.StringOf("original_vat_percentage")))
R("transaction_net_amount") = CDbl(transaction.StringOf("transaction_net_amount"))
R("transaction_gross_amount") = CDbl(transaction.StringOf("transaction_gross_amount"))
R("exempt_amount") = CDbl(transaction.StringOf("exempt_amount"))
R("msts_fee_amount") = CDbl(transaction.StringOf("msts_fee_amount"))
R("msts_vat_amount") = CDbl(transaction.StringOf("msts_vat_amount"))
R("msts_vat_percentage") = CDbl(transaction.StringOf("msts_vat_percentage"))
R("total_gross_amount") = CDbl(transaction.StringOf("total_gross_amount"))
R("transaction_status") = transaction.StringOf("transaction_status")
transaction.DateOf("loading_date", loadingDate)
R("loading_date") = CDate(loadingDate.GetAsTimestamp(getAsLocal))
R("batch_seq_nr") = transaction.StringOf("batch_seq_nr")
'R("distance_km") = transaction.StringOf("distance_km")
If CDate(R("purchase_datetime")) >= "01.07.2024" Then
Dim trans As New cMSETransactions()
trans.transaction_id = R("transaction_id")
trans.controller_id = receiver
trans.partner_haulier_id = R("partner_haulier_id")
trans.supplier_name = R("supplier_name")
trans.transaction_country = R("transaction_country")
trans.transaction_domain = R("transaction_domain")
trans.purchase_datetime = purchaseDate.GetAsDateTime(getAsLocal)
trans.entry_point_name = R("entry_point_name")
trans.entry_datetime = entryDate.GetAsDateTime(getAsLocal)
trans.exit_point_name = R("exit_point_name")
trans.exit_datetime = exitDate.GetAsDateTime(getAsLocal)
trans.device_product_type = R("device_product_type")
trans.device_product_number = R("device_product_number")
trans.transaction_product_id = R("transaction_product_id")
trans.transaction_product_name = R("transaction_product_name")
trans.license_plate_number = R("license_plate_number")
trans.vehicle_country = R("vehicle_country")
trans.original_currency = R("original_currency")
trans.original_net_amount = R("original_net_amount")
trans.original_gross_amount = R("original_gross_amount")
trans.original_vat_percentage = R("original_vat_percentage")
trans.transaction_net_amount = CDbl(R("transaction_net_amount"))
trans.transaction_gross_amount = CDbl(R("transaction_gross_amount"))
trans.msts_fee_amount = CDbl(R("msts_fee_amount"))
trans.msts_vat_amount = CDbl(R("msts_vat_amount"))
trans.total_gross_amount = CDbl(R("total_gross_amount"))
trans.transaction_status = R("transaction_status")
trans.loading_date = CDate(loadingDate.GetAsDateTime(getAsLocal))
trans.batch_seq_nr = R("batch_seq_nr")
'trans.distance_km = CDbl(R("distance_km"))
trans.SAVE()
End If
dt.Rows.Add(R)
j = j + 1
End While
dt = dt.DefaultView.ToTable()
End If
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
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("rmc_id", rmc_id))
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))
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_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 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("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_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("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 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")
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