only mark fields with missing account as error if required, re-add selected field for checkboxes in file list, make automatic price calculation configurable

This commit is contained in:
Jonathan Jenne
2022-04-20 14:03:04 +02:00
parent 17d5f5ca1b
commit 1c3d5dd543
4 changed files with 31 additions and 12 deletions

View File

@@ -15,6 +15,7 @@ Namespace Documents
Private ReadOnly Winline As WinlineData
Private ReadOnly MappingConfig As MappingConfig
Private ReadOnly TemplateConfig As TemplateConfig
Private ReadOnly ApplicationConfig As Config
Public Property Files As New List(Of Document)
@@ -44,11 +45,12 @@ Namespace Documents
End Sub
End Class
Public Sub New(pLogConfig As LogConfig, pWinline As WinlineData, pMappingConfig As MappingConfig, pTemplateConfig As TemplateConfig)
Public Sub New(pLogConfig As LogConfig, pWinline As WinlineData, pMappingConfig As MappingConfig, pTemplateConfig As TemplateConfig, pApplicationConfig As Config)
MyBase.New(pLogConfig)
Winline = pWinline
MappingConfig = pMappingConfig
TemplateConfig = pTemplateConfig
ApplicationConfig = pApplicationConfig
End Sub
Public Async Function LoadFiles(pTemplate As Template, pMandator As Mandator) As Task(Of Boolean)
@@ -273,8 +275,10 @@ Namespace Documents
.RunningFunction = "Preis-Funktionen"
})
' These functions will only be applied if the document does not have errors
pDocument = Await MaybeApplyPriceFunctions(pDocument, oMandator, pTemplate)
If ApplicationConfig.AutomaticPriceCalculation = True Then
' These functions will only be applied if the document does not have errors
pDocument = Await MaybeApplyPriceFunctions(pDocument, oMandator, pTemplate)
End If
RaiseEvent FileLoadProgress(Me, New FileLoadProgressInfo(FilesTotal, FilesLoaded) With {
.RunningFunction = "Feld-Funktionen"
@@ -567,7 +571,11 @@ Namespace Documents
'})
End If
Else
oNumberItem.Error = FieldError.AccountNotFound
' If no account was found and the field is required,
' mark it as error. Otherwise, do nothing.
If oNumberItem.IsRequired Then
oNumberItem.Error = FieldError.AccountNotFound
End If
End If
End Sub