Reload after export, Show and filter by Document Kind, Fix crash when reloading settings, change filename pattern for export files
This commit is contained in:
@@ -45,7 +45,7 @@ Namespace Winline
|
||||
|
||||
Public Class GetDocumentArgs
|
||||
Public Property Account As Account
|
||||
Public Property Kind As DocumentKind
|
||||
Public Property Kinds As List(Of DocumentKind)
|
||||
Public Property DateFrom As Date
|
||||
Public Property DateTo As Date
|
||||
Public Property DocNumberFrom As String
|
||||
@@ -543,18 +543,21 @@ Namespace Winline
|
||||
End If
|
||||
|
||||
Dim oKindConstraint = ""
|
||||
If pOptions.Kind IsNot Nothing Then
|
||||
oKindConstraint = $"T.c035 = {pOptions.Kind.Id} AND "
|
||||
If pOptions.Kinds IsNot Nothing AndAlso pOptions.Kinds.Count > 0 Then
|
||||
Dim oKindIdList = pOptions.Kinds.Select(Function(kind) kind.Id)
|
||||
Dim oKindIdString = String.Join(",", oKindIdList)
|
||||
|
||||
oKindConstraint = $"T.c035 IN ({oKindIdString}) AND "
|
||||
End If
|
||||
|
||||
Dim oDateFromConstraint = ""
|
||||
If pOptions.DateFrom <> Date.MinValue Then
|
||||
oDateFromConstraint = $"T2.DATE >= CAST('{pOptions.DateFrom.ToString("yyyy-MM-dd")}' as date) AND "
|
||||
oDateFromConstraint = $"T2.DATE >= CAST('{pOptions.DateFrom:yyyy-MM-dd}' as date) AND "
|
||||
End If
|
||||
|
||||
Dim oDateToConstraint = ""
|
||||
If pOptions.DateTo <> Date.MinValue Then
|
||||
oDateToConstraint = $"T2.DATE <= CAST('{pOptions.DateTo.ToString("yyyy-MM-dd")}' as date) AND "
|
||||
oDateToConstraint = $"T2.DATE <= CAST('{pOptions.DateTo:yyyy-MM-dd}' as date) AND "
|
||||
End If
|
||||
|
||||
Dim oDocNumberConstraint = ""
|
||||
@@ -641,7 +644,7 @@ Namespace Winline
|
||||
|
||||
Public Async Function ExecuteFinalSQL(pDocument As ExportDocument, pTemplate As Template, pMandator As Mandator) As Task(Of Boolean)
|
||||
Try
|
||||
Dim oSql As String = Patterns.ReplaceForExport(pTemplate, pDocument, pMandator, pTemplate.FinalSQL)
|
||||
Dim oSql As String = Patterns.ReplaceForExport(pDocument, pMandator, pTemplate.FinalSQL)
|
||||
Return Await Database.ExecuteNonQueryAsync(oSql)
|
||||
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user