GoBoxen_validiuerungpruef., Mahnlauf, Zugferd DLL Update

This commit is contained in:
2025-10-15 14:02:02 +02:00
parent 0de64a837c
commit 9d19f3b4bd
9 changed files with 354 additions and 188 deletions

View File

@@ -1,4 +1,5 @@

Imports javax.xml.bind.annotation
Imports VERAG_PROG_ALLGEMEIN
Public Class frmGoMautBoxen_Bestellung
@@ -13,6 +14,7 @@ Public Class frmGoMautBoxen_Bestellung
Public addnew = False
Dim changed As Boolean = False
Dim ready As Boolean = False
Dim Land2ISOcode As String = ""
Sub New(kundenNr)
@@ -43,49 +45,17 @@ Public Class frmGoMautBoxen_Bestellung
lblWarning.Text = ""
If kunde Is Nothing And kundenNr < 0 Then
lblWarning.Text = "Bitte Kunden-Nr eingeben."
If Not checkValues() Then
btnNew.DialogResult = DialogResult.None
Exit Sub
End If
If cbxKK.SelectedValue = "" Then
lblWarning.Text = "Bitte Kreditkarten-Nr eingeben."
Exit Sub
End If
Dim licensePlate As String = txtLicensePlate.Text
If Not String.IsNullOrEmpty(licensePlate) Then
For i As Integer = 0 To licensePlate.Length - 1
Dim ch As Char = licensePlate(i)
If Not (Char.IsDigit(ch) OrElse (ch >= "A"c AndAlso ch <= "Z"c) OrElse ch = " "c OrElse ch = "-"c) Then
MessageBox.Show("Ungültiges Zeichen: " & ch, "Eingabeprüfung", MessageBoxButtons.OK, MessageBoxIcon.Information)
btnNew.DialogResult = DialogResult.None
Exit Sub
Exit For
End If
Next
Else
btnNew.DialogResult = DialogResult.OK
End If
Dim cardNum As String = cbxKK.SelectedValue
If Not String.IsNullOrEmpty(cardNum) Then
Dim mainPart As String = cardNum.Substring(0, cardNum.Length - 1)
Dim checkDigit As Char = cardNum(cardNum.Length - 1)
If checkDigit <> fktMod10(mainPart) Then
MessageBox.Show("CardNum ungültig. Prüfziffernfehler!", "Eingabeprüfung", MessageBoxButtons.OK, MessageBoxIcon.Error)
btnNew.DialogResult = DialogResult.None
Exit Sub
End If
End If
btnNew.DialogResult = DialogResult.OK
txtLicensePlate.Text = txtLicensePlate.Text.ToUpper.Trim
Dim LicenseNat As String = setLand(MyComboBox3._value)
Dim LicenseNat As String = getLand(MyComboBox3._value)
'Label5.ForeColor = Color.Black
'lblErfassung.ForeColor = Color.Black
@@ -100,10 +70,8 @@ Public Class frmGoMautBoxen_Bestellung
LandBez = LandBez.Trim()
End If
If Not SQL.doSQL("INSERT INTO VERAG.dbo.tblGOBOXBestellungen (gb_adressNr,gb_transactionTyp,gb_company1,gb_company2,gb_companyStreet,gb_companyStreetNr,gb_companyPostalcode,gb_companyCity,gb_companyCountryISO,gb_companyCountry,gb_companyTel,gb_companyFax,gb_salutation,gb_title,gb_firstname,gb_lastname,gb_email,gb_personLanguage,gb_licensePlate,gb_licensePlateNat,gb_vehicleTyp,gb_Axles,gb_CardNum,gb_CardValidMonth,gb_CardValidYear)
VALUES (" & kunde.KundenNr & ",'" & MyComboBox1._value & "','" & txtName.Text & "','" & txtName2.Text & "','" & txtStrasse.Text & "','" & txtStasseNr.Text & "','" & txtPlz.Text & "','" & txtOrt.Text & "','" & setLand(cbxLandKz._value) & "','" & LandBez & "','" & txtTel.Text & "','" & txtFax.Text & "','" & txtAnsprechpartnerAnrede.Text & "','" & txtTitle.Text & "','" & txtAnsprechpartner_VN.Text & "','" & txtAnsprechpartner_NN.Text & "','" & txtEmail.Text & "','','" & txtLicensePlate.Text & "','" & LicenseNat & "','" & txtFahrzeugtyp.Text & "','" & txtAxles.Text & "','" & cardNum & "','" & txtMonat.Text & "','" & txtJahr.Text & "')", "FMZOLL") Then
VALUES (" & kunde.KundenNr & ",'" & MyComboBox1._value & "','" & txtName.Text & "','" & txtName2.Text & "','" & txtStrasse.Text & "','" & txtStasseNr.Text & "','" & txtPlz.Text & "','" & txtOrt.Text & "','" & getLand(cbxLandKz._value) & "','" & LandBez & "','" & txtTel.Text & "','" & txtFax.Text & "','" & txtAnsprechpartnerAnrede.Text & "','" & txtTitle.Text & "','" & txtAnsprechpartner_VN.Text & "','" & txtAnsprechpartner_NN.Text & "','" & txtEmail.Text & "','','" & txtLicensePlate.Text & "','" & LicenseNat & "','" & txtFahrzeugtyp.Text & "','" & txtAxles.Text & "','" & cardNum & "','" & txtMonat.Text & "','" & txtJahr.Text & "')", "FMZOLL") Then
MsgBox("Fehler beim Anlegen!")
Else
MsgBox("Bestellung wurde angelegt!")
@@ -159,15 +127,6 @@ Public Class frmGoMautBoxen_Bestellung
End Sub
Sub BindingTableColumnChanged(sender As Object, e As System.Data.DataColumnChangeEventArgs)
If ready Then
lblSachbearb.Text = VERAG_PROG_ALLGEMEIN.cAllgemein.USRKURZNAME
lblAenderung.Text = Now.ToString("dd.MM.yyyy HH:mm")
changed = True
End If
End Sub
Private Function fktMod10(ByVal number As String) As Char
Dim sum As Integer = 0
Dim doubleDigit As Boolean = True
@@ -210,17 +169,25 @@ Public Class frmGoMautBoxen_Bestellung
Private Sub frmLKWDetails_Load(sender As Object, e As EventArgs) Handles Me.Load
'TODO: wieder aktivierten!!!
'If Not VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("MAUTBOXEN_bearbeiten", Me) Then
' MsgBox("Keine Berechtigung!")
' Me.Close()
'End If
If Not VERAG_PROG_ALLGEMEIN.cBerechtignunen.CHECK_BERECHTIGUNG_bool("MDM_MAUTBOXEN_bearbeiten", Me) Then
MsgBox("Keine Berechtigung!")
Me.Close()
End If
KdSearchBox1.initKdBox(Me)
MyComboBox1.Items.Add(New MyListItem("N", "N"))
MyComboBox1.Items.Add(New MyListItem("N", "N")) '"N" -> Neue Bestellung
MyComboBox1.changeItem("N")
cbxSprache.Items.Add(New MyListItem("", ""))
cbxSprache.Items.Add(New MyListItem("deutsch", "DE"))
cbxSprache.Items.Add(New MyListItem("englisch", "EN"))
cbxSprache.Items.Add(New MyListItem("italienisch", "IT"))
cbxSprache.Items.Add(New MyListItem("kroatisch", "HR"))
cbxSprache.Items.Add(New MyListItem("tschechisch", "CZ"))
cbxSprache.Items.Add(New MyListItem("ungarisch", "HU"))
MyComboBox1.changeItem("")
If kundenNr > 0 Then
Me.KdSearchBox1.KdNr = kundenNr
KdSearchBox1.Enabled = False
@@ -242,6 +209,132 @@ Public Class frmGoMautBoxen_Bestellung
initKunde()
End Sub
Private Sub setDefaultValues()
'Anzahl der Achsen des Zugfahrzeuges. Fahrzeuge mit mehr als 4 Achsen sind mit 4 zu deklarieren.
If txtAxles.Text = "" Then
txtAxles.Text = "2"
End If
'Fahrzeugtyp (Busse und Wohnmobile sind als "Bus", alle anderen mautpflichtigen Fahrzeuge als "LKW" zu deklarieren).
If txtFahrzeugtyp.Text = "" Then
txtFahrzeugtyp.Text = "LKW"
End If
'Firmenadresse: Strasse; Sollte es keine Strasseninformation geben, so ist dieses Feld mit einem "-" zu füllen.
If txtStrasse.Text = "" Then
txtStrasse.Text = "-"
End If
'Firmenadresse: Hausnummer; Sollte es keine Hausnummer geben, so ist dieses Feld mit einem "-" zu füllen.
If txtStasseNr.Text = "" Then
txtStasseNr.Text = "-"
End If
End Sub
Private Function checkValues() As Boolean
If kunde Is Nothing And kundenNr < 0 Then
lblWarning.Text = "Bitte Kunden-Nr eingeben."
Return False
End If
If cbxKK.SelectedValue = "" Then
lblWarning.Text = "Bitte Kreditkarten-Nr eingeben."
Return False
End If
Dim PLZRegel As Integer = 0
Select Case Land2ISOcode
Case "BE" : PLZRegel = 2
Case "DZ", "DK", "DE", "FI", "FR", "GR", "IR", "IS", "IT", "HR", "KW", "LI", "LU", "MC", "NO", "AT", "RU", "CH", "RS", "SI", "ES", "TN", "TR", "UA", "HU", "CY" : PLZRegel = 4
Case "GB" : PLZRegel = 5
Case "NL", "PL", "PT", "SE", "SK", "CZ" : PLZRegel = 9
End Select
'PLZ-Regel PLZ-RegelBeschreibung
'1 Maximale Länge; keine Leerzeichen
'2 Numerisch; Maximale Länge; keine Leerzeichen
'3 Exakte Länge; keine Leerzeichen
'4 Numerisch; exakte Länge; keine Leerzeichen
'5 Maximale Länge
'6 Numerisch; maximale Länge
'7 Exakte Länge
'8 Numerisch; exakte Länge
'9 Länder-spezifisch (siehe PostleitzahlFormat)
Dim laengePLZ As Integer = 0
Select Case Land2ISOcode
Case "IS" : laengePLZ = 3
Case "BE", "DK", "LI", "LU", "NO", "AT", "CH", "SI", "TN", "HU", "CY" : laengePLZ = 4
Case "DZ", "DE", "FI", "FR", "GR", "IR", "IL", "IT", "HR", "KW", "MC", "RS", "ES", "TR", "UA" : laengePLZ = 5
Case "NL", "PL", "RU", "SE", "SK", "CZ" : laengePLZ = 6
Case "PT" : laengePLZ = 8
Case "GB" : laengePLZ = 9
End Select
Dim PLZFormat As String = ""
If PLZRegel = 9 Then
Select Case Land2ISOcode
Case "NL" : PLZFormat = "NNNN AA"
Case "PL" : PLZFormat = "NN-NNN"
Case "PT" : PLZFormat = "NNNN NNN oder NNNN"
Case "SE", "SK", "CZ" : PLZFormat = "NNN NN"
End Select
ElseIf PLZRegel = 2 Then
lblPLZRegel.Text = "Numerisch; keine LZ Max. Länge: " & laengePLZ
ElseIf PLZRegel = 4 Then
lblPLZRegel.Text = " Numerisch; keine LZ, genaue Länge: " & laengePLZ
ElseIf PLZRegel = 5 Then
lblPLZRegel.Text = "Max. Länge: " & laengePLZ
End If
If PLZFormat <> "" Then lblPLZRegel.Text &= PLZFormat
If txtPlz.Text <> "" AndAlso txtPlz.Text <> "-" Then
If laengePLZ > 0 AndAlso (txtPlz.Text.Length <> laengePLZ AndAlso PLZRegel = 4) OrElse (txtPlz.Text.Length > laengePLZ AndAlso (PLZRegel = 2 OrElse PLZRegel = 5)) Then
lblWarning.Text = "Die PLZ für " & Land2ISOcode & IIf(PLZRegel = 2 Or PLZRegel = 5, " darf max. ", " muss genau ") & laengePLZ & " Stellen besitzen!"
Return False
End If
End If
Dim licensePlate As String = txtLicensePlate.Text
If Not String.IsNullOrEmpty(licensePlate) Then
For i As Integer = 0 To licensePlate.Length - 1
Dim ch As Char = licensePlate(i)
If Not (Char.IsDigit(ch) OrElse (ch >= "A"c AndAlso ch <= "Z"c) OrElse ch = " "c OrElse ch = "-"c) Then
MessageBox.Show("Ungültiges Zeichen: " & ch, "Eingabeprüfung", MessageBoxButtons.OK, MessageBoxIcon.Information)
Return False
Exit For
End If
Next
End If
Dim cardNum As String = cbxKK.SelectedValue
If Not String.IsNullOrEmpty(cardNum) Then
Dim mainPart As String = cardNum.Substring(0, cardNum.Length - 1)
Dim checkDigit As Char = cardNum(cardNum.Length - 1)
If checkDigit <> fktMod10(mainPart) Then
MessageBox.Show("CardNum ungültig. Prüfziffernfehler!", "Eingabeprüfung", MessageBoxButtons.OK, MessageBoxIcon.Error)
Return False
End If
End If
Return True
End Function
Private Sub initKunde()
@@ -292,16 +385,16 @@ Public Class frmGoMautBoxen_Bestellung
End If
End If
If cbxLandKz.SelectedValue <> "" Then setLand(cbxLandKz.SelectedValue)
If cbxLandKz._value <> "" Then getLand(cbxLandKz._value, True)
setDefaultValues()
End Sub
Private Function setLand(landkz As String) As String
Private Function getLand(landkz As String, Optional setISO2Global As Boolean = False) As String
Dim LandISO2
Dim LandISO2 As String = ""
If landkz.Length = 2 Then
LandISO2 = landkz
ElseIf landkz.Length = 3 Then
@@ -310,6 +403,11 @@ Public Class frmGoMautBoxen_Bestellung
LandISO2 = VERAG_PROG_ALLGEMEIN.cProgramFunctions.getISO2LandFromISO1Land(landkz)
End If
If setISO2Global Then
Land2ISOcode = LandISO2
End If
Return LandISO2
'MyComboBox3.changeItem(LandISO2) 'License plate Nationality
@@ -368,6 +466,11 @@ Public Class frmGoMautBoxen_Bestellung
End Sub
Private Sub cbxLandKz_SelectedValueChanged(sender As Object, e As EventArgs) Handles cbxLandKz.SelectedValueChanged
If cbxLandKz._value <> "" Then getLand(cbxLandKz._value, True)
lblPLZRegel.Text = ""
End Sub
'-------------------------------------------------------------------------------------------------------------------------------------------------------------
'-------------------------------------------------------------------------------------------------------------------------------------------------------------
'-------------------------------------------------------------------------------------------------------------------------------------------------------------