fix Mandator being set after applying functions that rely on it

This commit is contained in:
Jonathan Jenne
2022-03-16 15:18:55 +01:00
parent 6526eb29b1
commit b941416de4

View File

@@ -246,6 +246,9 @@ Namespace Documents
If oMandator Is Nothing Then
Logger.Warn("Mandator not found for File [{0}]", pDocument.File.Name)
Else
' Set mandator befor applying any functions that depend on a valid mandator
pDocument.Mandator = oMandator
pDocument = ApplyDefinedItemFunctionsForImport(pDocument, oMandator, pTemplate)
pDocument = ApplyDynamicItemFunctionsForImport(pDocument, oMandator)
@@ -253,7 +256,6 @@ Namespace Documents
pDocument = Await MaybeApplyPriceFunctions(pDocument, oMandator, pTemplate)
End If
pDocument.Mandator = oMandator
Return pDocument
End Function
@@ -312,11 +314,11 @@ Namespace Documents
Dim oFunctionParams = oColumn.Config.FunctionParams
Dim oParamsDict = ParseFunctionParamsAsDict(oFunctionParams)
If oFunctionName = "GLN" Then
If oFunctionName = Constants.FUNCTION_GLN Then
SetAccountByGLN(oRow, pMandator, oField.Key, Nothing, oParamsDict)
End If
If oFunctionName = "EAN" Then
If oFunctionName = Constants.FUNCTION_EAN Then
SetArticleByEAN(oRow, pMandator, oField.Key)
End If