diff --git a/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVorauskasse.vb b/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVorauskasse.vb index dd75f051..aafc8382 100644 --- a/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVorauskasse.vb +++ b/SDL/Formulare/KDFormulare/FormulareBaukasten/usrcntlVorauskasse.vb @@ -225,6 +225,7 @@ Public Class usrcntlVorauskasse txtEustProzent.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("0%", "0")) txtEustProzent.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("7%", "0,07")) txtEustProzent.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("10%", "0,10")) + txtEustProzent.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("13%", "0,13")) txtEustProzent.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("19%", "0,19")) txtEustProzent.Items.Add(New VERAG_PROG_ALLGEMEIN.MyListItem("20%", "0,20")) ' txtEustProzent.changeItem("0,19") diff --git a/VERAG_PROG_ALLGEMEIN/Schnittstellen/ATEZ/RELAYHUB/cRelayHub.vb b/VERAG_PROG_ALLGEMEIN/Schnittstellen/ATEZ/RELAYHUB/cRelayHub.vb index 1a006ddb..4451a20b 100644 --- a/VERAG_PROG_ALLGEMEIN/Schnittstellen/ATEZ/RELAYHUB/cRelayHub.vb +++ b/VERAG_PROG_ALLGEMEIN/Schnittstellen/ATEZ/RELAYHUB/cRelayHub.vb @@ -81,6 +81,10 @@ Public Class cRelayHub Public Property declaration As List(Of cRelayHubDeclaration) End Class + Public Class cRelayHubAdditionalSettings + Public Property combineOptions As List(Of String) + End Class + Public Class cRelayHubJobOrderRequest Public Property referenceNo As String Public Property dispatchCountry As String @@ -89,6 +93,7 @@ Public Class cRelayHub ' Entfernt: customer (vom Schema abgelehnt) Public Property documents As List(Of cRelayHubDocument) Public Property additionalData As cRelayHubAdditionalData + Public Property additionalSettings As cRelayHubAdditionalSettings ' Neu: Pflichtfeld lt. Fehlermeldung Public Property outputApplication As String ' "test" | "dakosy/sftp/vera" | "evrim/excel" | "sec/import/integration" @@ -225,15 +230,60 @@ Public Class cRelayHub End Try End Function + 'Private Shared Function Sanitize(req As cRelayHub.cRelayHubJobOrderRequest) As cRelayHub.cRelayHubJobOrderRequest + ' req.outputApplication = If(req.outputApplication, "").Trim() + ' req.dispatchCountry = If(req.dispatchCountry, "").Trim().ToUpperInvariant() + ' req.destinationCountry = If(req.destinationCountry, "").Trim().ToUpperInvariant() + + ' ' lokale Fail-fast Checks + ' If req.dispatchCountry.Length <> 2 Then Throw New ApplicationException("dispatchCountry ISO-2 erforderlich.") + ' If req.destinationCountry.Length <> 2 Then Throw New ApplicationException("destinationCountry ISO-2 erforderlich.") + + + ' Return req + 'End Function + Public Shared Function getRelayHub_AnhDesc(anh_Art) As String + Dim fileType = "other" + If anh_Art IsNot Nothing AndAlso anh_Art IsNot DBNull.Value Then + Select Case anh_Art + Case "eFatura", "INVOICE" : fileType = "invoice" + Case "Rechnung", "Konsi-Rechnung", "INVOICE" : fileType = "commercial_invoice" + Case "CMR" : fileType = "cmr" + Case "Ausfuhr", "EXPORT" : fileType = "tr_export_declaration" + Case "ATR", "A.TR", "ATR-EUR1", "EUR1" : fileType = "atr" + Case "Vorpapier", "T1" : fileType = "transit_declaration" + Case "Ursprungszeugnis", "CoO" : fileType = "origin" + Case "Lieferschein" : fileType = "delivery_note" + Case "Packliste" : fileType = "packaging_list" + Case Else : fileType = "other" + + End Select + End If + Return fileType + End Function Private Shared Function Sanitize(req As cRelayHub.cRelayHubJobOrderRequest) As cRelayHub.cRelayHubJobOrderRequest req.outputApplication = If(req.outputApplication, "").Trim() req.dispatchCountry = If(req.dispatchCountry, "").Trim().ToUpperInvariant() req.destinationCountry = If(req.destinationCountry, "").Trim().ToUpperInvariant() - ' lokale Fail-fast Checks If req.dispatchCountry.Length <> 2 Then Throw New ApplicationException("dispatchCountry ISO-2 erforderlich.") If req.destinationCountry.Length <> 2 Then Throw New ApplicationException("destinationCountry ISO-2 erforderlich.") + ' AdditionalSettings -> combineOptions: nur erlaubte Keys, distinct, lower-case + Dim allowed As New HashSet(Of String)(StringComparer.OrdinalIgnoreCase) From { + "description", "commodity_code", "country_of_origin", "unit_type" + } + + If req.additionalSettings IsNot Nothing AndAlso req.additionalSettings.combineOptions IsNot Nothing Then + Dim cleaned = req.additionalSettings.combineOptions. + Where(Function(o) Not String.IsNullOrWhiteSpace(o)). + Select(Function(o) o.Trim().ToLowerInvariant()). + Where(Function(o) allowed.Contains(o)). + Distinct(). + ToList() + + req.additionalSettings.combineOptions = cleaned + End If Return req End Function @@ -289,6 +339,14 @@ Public Class cRelayHub } } } + }, + .additionalSettings = New cRelayHubAdditionalSettings With { + .combineOptions = New List(Of String) From { + "description", + "commodity_code", + "country_of_origin", + "unit_type" + } } } Return req