Merge branch 'newMaster2024' of https://dev.azure.com/VeragAG/_git/SDL into newMaster2024

This commit is contained in:
2025-08-11 16:55:04 +02:00
2 changed files with 72 additions and 37 deletions

View File

@@ -1,6 +1,7 @@

Imports System.Data.SqlClient
Imports System.Reflection
Imports jdk.nashorn.internal.ir
Public Class cOfferteList
Property KundenNr As Object = Nothing
@@ -270,21 +271,8 @@ Public Class cOfferte
'P.PreisänderungProzent = XXXXXXXXX
'P.PreisAlt = XXXXXXXXX
Dim LandISO As String = ""
Select Case P.OffertenNr
Case 31, 15, 14
If (P.LeistungsNr = 124 Or P.LeistungsNr = 125 Or P.LeistungsNr = 126) Then
LandISO = P.LeistungsBez.ToString.Substring(P.LeistungsBez.ToString.Length - 2, 2)
End If
End Select
If LandISO <> "" AndAlso LandISO.All(Function(c) Char.IsUpper(c)) Then
P.Land = LandISO
End If
P.Land = setLand(P.OffertenNr, P.LeistungsNr, P.LeistungsBez)
P.VZ = setVZ(P.OffertenNr, P.LeistungsNr, P.LeistungsBez)
If Not P.INSERT() Then
Return False
@@ -307,10 +295,8 @@ Public Class cOfferte
Dim P As New cOffertPosition()
Dim Leistung As New cLeistungen(r("LeistungsNr"))
P.KundenNr = Me.KundenNr
P.OffertenNr = Me.OffertenNr
P.LeistungsNr = r("LeistungsNr")
Dim leistBez As String = ""
@@ -346,18 +332,8 @@ Public Class cOfferte
'P.PreisänderungProzent = XXXXXXXXX
'P.PreisAlt = XXXXXXXXX
Dim LandISO As String = ""
Select Case P.OffertenNr
Case 31, 15, 14
LandISO = P.LeistungsBez.ToString.Substring(P.LeistungsBez.ToString.Length - 2, 2)
End Select
If LandISO <> "" AndAlso LandISO.All(Function(c) Char.IsUpper(c)) Then
P.Land = LandISO
End If
P.Land = setLand(P.OffertenNr, P.LeistungsNr, P.LeistungsBez)
P.VZ = setVZ(P.OffertenNr, P.LeistungsNr, P.LeistungsBez)
If Not P.INSERT() Then
Return False
@@ -370,6 +346,63 @@ Public Class cOfferte
End If
End Function
Private Function setLand(OffertenNr As Integer, LeistungsNr As Integer, LeistungsBez As String) As String
Dim LandISO As String = ""
Select Case OffertenNr
Case 31, 15, 14
If (LeistungsNr = 124 Or LeistungsNr = 125 Or LeistungsNr = 126) Then
LandISO = LeistungsBez.ToString.Substring(LeistungsBez.ToString.Length - 2, 2)
End If
If (LeistungsNr = 117 Or LeistungsNr = 118 Or LeistungsNr = 119) Then
LandISO = LeistungsBez.ToString.Substring(LeistungsBez.ToString.Length - 2, 2)
End If
End Select
If LandISO <> "" AndAlso LandISO.All(Function(c) Char.IsUpper(c)) Then
If LandISO <> "EU" And LandISO <> "RG" Then
Return LandISO
Else
Return LandISO
End If
End If
Return LandISO
End Function
Private Function setVZ(OffertenNr As Integer, LeistungsNr As Integer, LeistungsBez As String) As Boolean
Select Case OffertenNr
Case 31, 15, 14
If (LeistungsNr = 117 Or LeistungsNr = 118 Or LeistungsNr = 119) Then
If LeistungsBez.ToString.Contains("ZV") Then
Return True
Else
Return False
End If
End If
If (LeistungsNr = 124 Or LeistungsNr = 125 Or LeistungsNr = 126) Then
If LeistungsBez.ToString.Contains("ZV") Then
Return True
Else
Return False
End If
End If
End Select
End Function
End Class